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

This class reads the configuration keys from App.config. More...

Inheritance diagram for Google.Api.Ads.Common.Lib.AppConfigBase:
Google.Api.Ads.Common.Lib.AppConfig Google.Api.Ads.AdManager.Lib.AdManagerAppConfig Google.Api.Ads.AdWords.Lib.AdWordsAppConfig

Public Member Functions

virtual string GetDefaultOAuth2Scope ()
 Gets the default OAuth2 scope. More...
 
virtual string GetUserAgent ()
 Gets the user agent text. More...
 
 AppConfigBase ()
 The default constructor. More...
 
 AppConfigBase (IConfigurationRoot configurationRoot)
 Initializes a new instance of the AppConfigBase class. More...
 
 AppConfigBase (IConfigurationSection configurationSection)
 Initializes a new instance of the AppConfigBase class. More...
 
virtual object Clone ()
 Creates a new object that is a copy of the current instance. More...
 

Protected Member Functions

void LoadFromConfiguration (IConfiguration configuration, string sectionName)
 Initializes a new instance of the AppConfigBase class. More...
 
void LoadFromAppConfigSection (string sectionName)
 Attempts to load the configuration section with the given name. More...
 
virtual void ReadSettings (Dictionary< string, string > settings)
 Read all settings from App.config. More...
 
void ReadSetting (Dictionary< string, string > settings, ConfigSetting settingField)
 Reads a setting from a given dictionary. More...
 
void SetPropertyAndNotify< T > (ConfigSetting< T > field, T newValue, [CallerMemberName] String propertyName="")
 Sets the specified property and notify any listeners. More...
 

Properties

bool MaskCredentials [get, set]
 Gets or sets whether the credentials in the log file should be masked. More...
 
IWebProxy Proxy [get, set]
 Gets or sets the web proxy to be used with the services. More...
 
int Timeout [get, set]
 Gets or sets the timeout for Ads services in milliseconds. More...
 
int RetryCount [get, set]
 Gets or sets the number of times to retry a call if an API call fails and can be retried. More...
 
bool EnableGzipCompression [get, set]
 Gets or sets whether gzip compression should be turned on for SOAP requests and responses. More...
 
string OAuth2ServerUrl [get, set]
 Gets or sets the OAuth2 server URL. More...
 
string OAuth2ClientId [get, set]
 Gets or sets the OAuth2 client ID. More...
 
string OAuth2ClientSecret [get, set]
 Gets or sets the OAuth2 client secret. More...
 
string OAuth2AccessToken [get, set]
 Gets or sets the OAuth2 access token. More...
 
string OAuth2RefreshToken [get, set]
 Gets or sets the OAuth2 refresh token. More...
 
string OAuth2Scope [get, set]
 Gets or sets the OAuth2 scope. More...
 
string OAuth2RedirectUri [get, set]
 Gets or sets the OAuth2 redirect URI. More...
 
OAuth2Flow OAuth2Mode [get, set]
 Gets or sets the OAuth2 mode. More...
 
string OAuth2PrnEmail [get, set]
 Gets or sets the OAuth2 prn email. More...
 
string OAuth2ServiceAccountEmail [get, set]
 Gets the OAuth2 service account email. More...
 
string OAuth2PrivateKey [get, set]
 Gets the OAuth2 private key for service account flow. More...
 
string OAuth2SecretsJsonPath [get, set]
 Gets or sets the OAuth2 secrets JSON file path. More...
 
bool IncludeUtilitiesInUserAgent [get, set]
 Gets or sets whether usage of various client library features should be tracked. More...
 
string Signature [get]
 Gets the signature for this library. More...
 
virtual long UnixTimestamp [get]
 Gets the number of seconds after Jan 1, 1970, 00:00:00 More...
 
- Properties inherited from Google.Api.Ads.Common.Lib.AppConfig
bool MaskCredentials [get]
 Gets whether the credentials in the log file should be masked. More...
 
string OAuth2ServerUrl [get, set]
 Gets or sets the OAuth2 server URL. More...
 
OAuth2Flow OAuth2Mode [get, set]
 Gets or sets the OAuth2 mode. More...
 
string OAuth2AccessToken [get, set]
 Gets or sets the OAuth2 access token. More...
 
string OAuth2ClientId [get, set]
 Gets or sets the OAuth2 client id. More...
 
string OAuth2ClientSecret [get, set]
 Gets or sets the OAuth2 client secret. More...
 
string OAuth2RedirectUri [get, set]
 Gets or sets the OAuth2 redirect URI. More...
 
string OAuth2RefreshToken [get, set]
 OAuth2 refresh token. More...
 
string OAuth2Scope [get, set]
 Gets or sets the OAuth2 scope. More...
 
string OAuth2PrnEmail [get, set]
 Gets or sets the OAuth2 prn email. More...
 
string OAuth2SecretsJsonPath [get, set]
 Gets or sets the OAuth2 secrets JSON file. More...
 
string OAuth2PrivateKey [get]
 Gets the OAuth2 private key for service account flow. More...
 
string OAuth2ServiceAccountEmail [get]
 Gets the OAuth2 service account email. More...
 
bool IncludeUtilitiesInUserAgent [get, set]
 Gets or sets whether usage information of various client library features should be included in the user agent. More...
 
IWebProxy Proxy [get, set]
 Gets the web proxy to be used with the services. More...
 
int RetryCount [get, set]
 Gets or sets the number of times to retry a call if an API call fails and can be retried. More...
 
string Signature [get]
 Gets the signature for this library. More...
 
int Timeout [get, set]
 Gets or sets the timeout for Ads services in milliseconds. More...
 
bool EnableGzipCompression [get, set]
 Gets or sets whether gzip compression should be turned on for SOAP requests and responses. More...
 
long UnixTimestamp [get]
 Gets the number of seconds after Jan 1, 1970, 00:00:00 More...
 

Events

PropertyChangedEventHandler PropertyChanged
 Occurs when a property value changes. More...
 
- Events inherited from Google.Api.Ads.Common.Lib.AppConfig
PropertyChangedEventHandler PropertyChanged
 Occurs when a property is changed. More...
 

Detailed Description

This class reads the configuration keys from App.config.

Constructor & Destructor Documentation

Google.Api.Ads.Common.Lib.AppConfigBase.AppConfigBase ( )
inline

The default constructor.

Google.Api.Ads.Common.Lib.AppConfigBase.AppConfigBase ( IConfigurationRoot  configurationRoot)
inline

Initializes a new instance of the AppConfigBase class.

Parameters
configurationRootThe configuration root.
Google.Api.Ads.Common.Lib.AppConfigBase.AppConfigBase ( IConfigurationSection  configurationSection)
inline

Initializes a new instance of the AppConfigBase class.

Parameters
configurationSectionThe configuration section.

Member Function Documentation

virtual object Google.Api.Ads.Common.Lib.AppConfigBase.Clone ( )
inlinevirtual

Creates a new object that is a copy of the current instance.

Returns
A new object that is a copy of this instance.
virtual string Google.Api.Ads.Common.Lib.AppConfigBase.GetDefaultOAuth2Scope ( )
inlinevirtual
virtual string Google.Api.Ads.Common.Lib.AppConfigBase.GetUserAgent ( )
inlinevirtual

Gets the user agent text.

Returns
The user agent.

Implements Google.Api.Ads.Common.Lib.AppConfig.

Reimplemented in Google.Api.Ads.AdWords.Lib.AdWordsAppConfig, and Google.Api.Ads.AdManager.Lib.AdManagerAppConfig.

void Google.Api.Ads.Common.Lib.AppConfigBase.LoadFromAppConfigSection ( string  sectionName)
inlineprotected

Attempts to load the configuration section with the given name.

Parameters
sectionNameThe name of the configuration section to load.
Returns
The request configuration section, or null if none was found.
void Google.Api.Ads.Common.Lib.AppConfigBase.LoadFromConfiguration ( IConfiguration  configuration,
string  sectionName 
)
inlineprotected

Initializes a new instance of the AppConfigBase class.

Parameters
configurationThe configuration section.
sectionNameThe section name.
void Google.Api.Ads.Common.Lib.AppConfigBase.ReadSetting ( Dictionary< string, string >  settings,
ConfigSetting  settingField 
)
inlineprotected

Reads a setting from a given dictionary.

Parameters
settingsThe settings collection from which the keys are to be read.
settingFieldThe field that holds the setting value.

References Google.Api.Ads.Common.Config.ConfigSetting.Name.

virtual void Google.Api.Ads.Common.Lib.AppConfigBase.ReadSettings ( Dictionary< string, string >  settings)
inlineprotectedvirtual

Read all settings from App.config.

Parameters
settingsThe parsed app.config settings.

Reimplemented in Google.Api.Ads.AdWords.Lib.AdWordsAppConfig, and Google.Api.Ads.AdManager.Lib.AdManagerAppConfig.

void Google.Api.Ads.Common.Lib.AppConfigBase.SetPropertyAndNotify< T > ( ConfigSetting< T >  field,
newValue,
[CallerMemberName] String  propertyName = "" 
)
inlineprotected

Sets the specified property and notify any listeners.

Template Parameters
TType of the property.
Parameters
fieldThe field that store property value.
newValueThe new value to be set.
propertyNameName of the property.

Property Documentation

bool Google.Api.Ads.Common.Lib.AppConfigBase.EnableGzipCompression
getset

Gets or sets whether gzip compression should be turned on for SOAP requests and responses.

bool Google.Api.Ads.Common.Lib.AppConfigBase.IncludeUtilitiesInUserAgent
getset

Gets or sets whether usage of various client library features should be tracked.

The name of the property is kept different to match the setting name for other client libraries.

bool Google.Api.Ads.Common.Lib.AppConfigBase.MaskCredentials
getset

Gets or sets whether the credentials in the log file should be masked.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2AccessToken
getset

Gets or sets the OAuth2 access token.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2ClientId
getset

Gets or sets the OAuth2 client ID.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2ClientSecret
getset

Gets or sets the OAuth2 client secret.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2PrivateKey
getset

Gets the OAuth2 private key for service account flow.

This setting is applicable only when using OAuth2 service accounts. This setting is read directly from the file referred to in OAuth2SecretsJsonPath setting.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2PrnEmail
getset

Gets or sets the OAuth2 prn email.

This setting is applicable only when using OAuth2 service accounts.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2RedirectUri
getset

Gets or sets the OAuth2 redirect URI.

This setting is applicable only when using OAuth2 web flow.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2Scope
getset

Gets or sets the OAuth2 scope.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2SecretsJsonPath
getset

Gets or sets the OAuth2 secrets JSON file path.

This setting is applicable only when using OAuth2 service accounts.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2ServerUrl
getset

Gets or sets the OAuth2 server URL.

This property's setter is primarily used for testing purposes.

string Google.Api.Ads.Common.Lib.AppConfigBase.OAuth2ServiceAccountEmail
getset

Gets the OAuth2 service account email.

This setting is applicable only when using OAuth2 service accounts. This setting is read directly from the file referred to in OAuth2SecretsJsonPath setting.

IWebProxy Google.Api.Ads.Common.Lib.AppConfigBase.Proxy
getset

Gets or sets the web proxy to be used with the services.

int Google.Api.Ads.Common.Lib.AppConfigBase.RetryCount
getset

Gets or sets the number of times to retry a call if an API call fails and can be retried.

string Google.Api.Ads.Common.Lib.AppConfigBase.Signature
get

Gets the signature for this library.

int Google.Api.Ads.Common.Lib.AppConfigBase.Timeout
getset

Gets or sets the timeout for Ads services in milliseconds.

virtual long Google.Api.Ads.Common.Lib.AppConfigBase.UnixTimestamp
get

Gets the number of seconds after Jan 1, 1970, 00:00:00

Event Documentation

PropertyChangedEventHandler Google.Api.Ads.Common.Lib.AppConfigBase.PropertyChanged

Occurs when a property value changes.


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