Ads API .NET library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Google.Api.Ads.Common.Lib.AdsUser Class Referenceabstract

Represents an Ads API user. More...

Inheritance diagram for Google.Api.Ads.Common.Lib.AdsUser:
Google.Api.Ads.Common.Lib.Configurable Google.Api.Ads.AdManager.Lib.AdManagerUser Google.Api.Ads.AdWords.Lib.AdWordsUser

Public Member Functions

abstract Type[] GetServiceTypes ()
 Gets all the service types to be registered against this user. More...
 
abstract SoapListener[] GetDefaultListeners ()
 Gets the default listeners. More...
 
void RegisterService (string serviceId, ServiceFactory serviceFactory)
 Register a service with AdsUser. More...
 
ServiceFactory GetServiceFactory (string serviceId)
 Gets the service factory for a service. More...
 
AdsClient GetService (ServiceSignature serviceSignature)
 Creates an object of the requested type of service. More...
 
AdsClient GetService (ServiceSignature serviceSignature, string serverUrl)
 Creates an object of the requested type of service. More...
 
AdsClient GetService (ServiceSignature serviceSignature, Uri serverUrl)
 Creates an object of the requested type of service. More...
 

Protected Member Functions

 AdsUser (AppConfigBase config)
 Protected constructor. Use this version from a derived class if you want the library to use all settings from App.config. More...
 
 AdsUser (AppConfigBase config, Dictionary< string, string > headers)
 Protected constructor. Use this version from a derived class if you want the library to use all settings from App.config. More...
 
void RegisterServices (Type[] servicesFamilies)
 Registers a family of services against this user. More...
 
void SetHeadersFromConfig ()
 Set the user headers from App.config. More...
 

Properties

AdsOAuthProvider OAuthProvider [get, set]
 Gets or sets the OAuth provider. More...
 
AppConfig Config [get]
 Gets or sets the application configuration for this user. More...
 
List< SoapListenerListeners [get]
 Gets the listeners. More...
 
- Properties inherited from Google.Api.Ads.Common.Lib.Configurable
AppConfig Config [get]
 Gets the application configuration class for this object. More...
 

Detailed Description

Represents an Ads API user.

Constructor & Destructor Documentation

Google.Api.Ads.Common.Lib.AdsUser.AdsUser ( AppConfigBase  config)
inlineprotected

Protected constructor. Use this version from a derived class if you want the library to use all settings from App.config.

Google.Api.Ads.Common.Lib.AdsUser.AdsUser ( AppConfigBase  config,
Dictionary< string, string >  headers 
)
inlineprotected

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.

Member Function Documentation

abstract SoapListener [] Google.Api.Ads.Common.Lib.AdsUser.GetDefaultListeners ( )
pure virtual

Gets the default listeners.

Returns
A list of default listeners

Implemented in Google.Api.Ads.AdWords.Lib.AdWordsUser, and Google.Api.Ads.AdManager.Lib.AdManagerUser.

AdsClient Google.Api.Ads.Common.Lib.AdsUser.GetService ( ServiceSignature  serviceSignature)
inline

Creates an object of the requested type of service.

Parameters
serviceSignatureSignature of the service being requested.
Returns
An object of the requested type of service. The caller should cast this object to the desired type.

Referenced by Google.Api.Ads.AdWords.Examples.CSharp.v201809.CreateAndAttachSharedKeywordSet.AddKeywordsToSharedSet(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.CreateAndAttachSharedKeywordSet.AttachSharedSetToCampaign(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GraduateTrial.CreateBudget(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.CreateAndAttachSharedKeywordSet.CreateSharedKeywordSet(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.ParallelReportDownload.GetDescendantAdvertiserAccounts(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.LookupLocation.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.EstimateKeywordTraffic.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UploadMediaBundle.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetReportFields.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddProductPartitionTree.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.HandlePartialFailures.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAllImageAssets.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddAudience.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddConversionTrackers.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetTargetableLanguagesAndCarriers.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetCampaigns.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UploadImageAsset.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAllDisapprovedAds.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetKeywordIdeas.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddCustomerNegativeCriteria.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UploadImage.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAllVideosAndImages.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.CreateAccount.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UpdateCampaign.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.RemoveCampaign.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UpdateExpandedTextAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddProductScope.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAdGroupBidModifiers.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAccountChanges.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddUniversalAppCampaign.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddHtml5Ad.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AcceptServiceLink.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddAdGroupDemographicCriteria.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddResponsiveSearchAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAdGroups.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetCampaignsWithAwql.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetKeywords.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAdGroupBidSimulations.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.RemoveAdGroup.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAccountHierarchy.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddCampaigns.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetCampaignsByLabel.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddCampaignLabels.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetExpandedTextAds.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.PauseAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetCampaignCriterionBidModifierSimulations.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.RemoveKeyword.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UpdateKeyword.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetCampaignTargetingCriteria.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GraduateTrial.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddClickToDownloadAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.ValidateTextAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetResponsiveSearchAds.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddExpandedTextAdWithUpgradedUrls.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.RemoveAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddMultiAssetResponsiveDisplayAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetAllDisapprovedAdsWithAwql.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddAdGroupBidModifier.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddResponsiveDisplayAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddGmailAd.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddSitelinks.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.SetAdParameters.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddDraft.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddPrices.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetKeywordBidSimulations.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddRuleBasedRemarketingList.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddExpandedTextAds.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.SetBidModifier.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddAdGroups.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UpdateAdGroup.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddKeywords.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UploadOfflineConversionAdjustments.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddCampaignTargetingCriteria.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddKeywordsUsingIncrementalBatchJob.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UploadOfflineConversions.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddTrial.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.UploadOfflineCallConversions.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddCrmBasedUserList.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.GetProductCategoryTaxonomy.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddCompleteCampaignsUsingBatchJob.Run(), Google.Api.Ads.AdWords.Examples.CSharp.v201809.AddCompleteCampaignsUsingStreamingBatchJob.Run(), and Google.Api.Ads.AdWords.Examples.CSharp.v201809.UploadOfflineData.Run().

AdsClient Google.Api.Ads.Common.Lib.AdsUser.GetService ( ServiceSignature  serviceSignature,
string  serverUrl 
)
inline

Creates an object of the requested type of service.

Parameters
serviceSignatureSignature of the service being requested.
serverUrlThe server url for Ads service.
Returns
An object of the requested type of service. The caller should cast this object to the desired type.
AdsClient Google.Api.Ads.Common.Lib.AdsUser.GetService ( ServiceSignature  serviceSignature,
Uri  serverUrl 
)
inline

Creates an object of the requested type of service.

Parameters
serviceSignatureSignature of the service being requested.
serverUrlThe server url for Ads service.
Returns
An object of the requested type of service. The caller should cast this object to the desired type.

References Google.Api.Ads.Common.Lib.ServiceSignature.Id, and Google.Api.Ads.Common.Lib.ServiceSignature.ServiceName.

ServiceFactory Google.Api.Ads.Common.Lib.AdsUser.GetServiceFactory ( string  serviceId)
inline

Gets the service factory for a service.

Parameters
serviceIdThe service id.
Returns
The service factory instance, or null if the service is not yet registered.
abstract Type [] Google.Api.Ads.Common.Lib.AdsUser.GetServiceTypes ( )
pure virtual

Gets all the service types to be registered against this user.

Returns
The type of all service classes to be registered.

Implemented in Google.Api.Ads.AdWords.Lib.AdWordsUser, and Google.Api.Ads.AdManager.Lib.AdManagerUser.

void Google.Api.Ads.Common.Lib.AdsUser.RegisterService ( string  serviceId,
ServiceFactory  serviceFactory 
)
inline

Register a service with AdsUser.

Parameters
serviceIdA unique id for the service being registered.
serviceFactoryThe factory that will create this service.
void Google.Api.Ads.Common.Lib.AdsUser.RegisterServices ( Type[]  servicesFamilies)
inlineprotected

Registers a family of services against this user.

Parameters
servicesFamiliesThe 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 {
public Type factoryType = typeof(SomeServiceVxFactory);
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.

References Google.Api.Ads.Common.Lib.ServiceSignature.Id.

void Google.Api.Ads.Common.Lib.AdsUser.SetHeadersFromConfig ( )
inlineprotected

Set the user headers from App.config.

Property Documentation

AppConfig Google.Api.Ads.Common.Lib.AdsUser.Config
get

Gets or sets the application configuration for this user.

Referenced by Google.Api.Ads.AdWords.Examples.CSharp.v201809.ParallelReportDownload.Run().

List<SoapListener> Google.Api.Ads.Common.Lib.AdsUser.Listeners
get

Gets the listeners.

AdsOAuthProvider Google.Api.Ads.Common.Lib.AdsUser.OAuthProvider
getset

Gets or sets the OAuth provider.


The documentation for this class was generated from the following file: