Skip to content

Commit

Permalink
Commit v18.2.0 to github.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnashOommen committed Aug 1, 2014
1 parent 3fd6fd6 commit 890e373
Show file tree
Hide file tree
Showing 73 changed files with 276 additions and 910 deletions.
26 changes: 5 additions & 21 deletions examples/AdWords/CSharp/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
Web.config for quickly configuring and running a simple application.
However, it is not mandatory to provide your settings in the config file,
you may also set or override these settings at runtime. See
https://code.google.com/p/google-api-adwords-dotnet/wiki/HowToUseAdWordsUser
https://github.com/googleads/googleads-dotnet-lib/wiki/Getting-Started
for details.
You can refer to
https://code.google.com/p/google-api-adwords-dotnet/wiki/UnderstandingAppConfig
https://github.com/googleads/googleads-dotnet-lib/wiki/Understanding-App.config
for detailed explanation of each configuration key.
-->

Expand Down Expand Up @@ -55,10 +55,9 @@
run Common\Util\OAuth2TokenGenerator.cs to generate this section of the
config file.
-->
<add key="AuthorizationMethod" value="OAuth2" />
<!-- Provide the OAuth2 client ID and secret. You can create one from
https://code.google.com/apis/console/. See
https://code.google.com/p/google-api-adwords-dotnet/wiki/UsingOAuth
https://console.developers.google.com. See
https://github.com/googleads/googleads-dotnet-lib/wiki/Using-OAuth2
for more details.
-->
<add key="OAuth2ClientId" value="INSERT_OAUTH2_CLIENT_ID_HERE" />
Expand Down Expand Up @@ -93,7 +92,7 @@
You should comment out all the keys for Web / Installed application
OAuth flow above. See
https://developers.google.com/adwords/api/docs/guides/service-accounts
and https://code.google.com/p/google-api-adwords-dotnet/wiki/UsingOAuth
https://github.com/googleads/googleads-dotnet-lib/wiki/Using-OAuth2
for more details.
-->
<!--
Expand All @@ -106,21 +105,6 @@
<add key="OAuth2JwtCertificatePassword"
value="INSERT_OAUTH2_JWT_CERTIFICATE_PASSWORD_HERE" />
-->

<!-- Settings specific to use ClientLogin as authentication mechanism. -->
<!-- To use ClientLogin as authentication mechanism, uncomment the following
section and comment the OAuth2 section above. Keep in mind that
ClientLogin API is deprecated, and its use is strongly discouraged.
See https://developers.google.com/accounts/docs/AuthForInstalledApps
for details.-->
<!--
<add key="AuthorizationMethod" value="ClientLogin" />
<add key="Email" value="INSERT_YOUR_LOGIN_EMAIL_HERE"/>
<add key="Password" value="INSERT_YOUR_PASSWORD_HERE"/>
-->
<!-- Optional: uncomment this if you want to reuse an authToken multiple
times. -->
<!-- <add key="AuthToken" value="INSERT_YOUR_AUTH_TOKEN_HERE"/> -->
</AdWordsApi>
<system.web>
<webServices>
Expand Down
19 changes: 11 additions & 8 deletions examples/AdWords/CSharp/OAuth/ConsoleExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace Google.Api.Ads.AdWords.Examples.CSharp.OAuth {
/// </list>
/// 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.
/// it as shown in ths project's App.config.
/// 5. Compile and run this example.
/// </summary>
public class ConsoleExample {
Expand All @@ -58,14 +58,17 @@ public class ConsoleExample {
/// <param name="args">Command line arguments.</param>
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 &&

// This code example shows how to run an AdWords API web 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 OAuthTokenGenerator.exe to generate a refresh
// token and use that configuration in your application's App.config.
AdWordsAppConfig config = user.Config as AdWordsAppConfig;
if (user.Config.OAuth2Mode == OAuth2Flow.APPLICATION &&
string.IsNullOrEmpty(config.OAuth2RefreshToken)) {
DoAuth2Authorization(user);
}
} else {
throw new Exception("Authorization mode is not OAuth.");
DoAuth2Authorization(user);
}

Console.Write("Enter the customer id: ");
Expand Down
24 changes: 7 additions & 17 deletions examples/AdWords/CSharp/OAuth/Default.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,12 @@ protected void OnAuthorizeButtonClick(object sender, EventArgs e) {
// 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.
// should run OAuthTokenGenerator.exe to generate a refresh
// token and use that configuration in your website's 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.");
if (user.Config.OAuth2Mode == OAuth2Flow.APPLICATION &&
string.IsNullOrEmpty(config.OAuth2RefreshToken)) {
Response.Redirect("OAuthLogin.aspx");
}
}

Expand Down Expand Up @@ -192,14 +187,9 @@ protected void OnGetCampaignsButtonClick(object sender, EventArgs e) {
/// </summary>
private void ConfigureUserForOAuth() {
AdWordsAppConfig config = (user.Config as AdWordsAppConfig);
if (config.AuthorizationMethod == AdWordsAuthorizationMethod.OAuth2) {
if (config.OAuth2Mode == OAuth2Flow.APPLICATION &&
string.IsNullOrEmpty(config.OAuth2RefreshToken)) {
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.");
}
}

Expand Down
8 changes: 3 additions & 5 deletions examples/AdWords/CSharp/OAuth/OAuthLogin.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ 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);
}
if (config.OAuth2Mode == OAuth2Flow.APPLICATION &&
string.IsNullOrEmpty(config.OAuth2RefreshToken)) {
DoAuth2Configuration(config);
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/AdWords/CSharp/OAuth/Properties/Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
[assembly: AssemblyProduct("AdWords API DotNet Client Library")]
[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")]

[assembly: AssemblyVersion("18.1.0.0")]
[assembly: AssemblyFileVersion("18.1.0.0")]
[assembly: AssemblyVersion("18.2.0.0")]
[assembly: AssemblyFileVersion("18.2.0.0")]
16 changes: 0 additions & 16 deletions examples/AdWords/CSharp/OAuth/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
run Common\Util\OAuth2TokenGenerator.cs to generate this section of the
config file.
-->
<!-- <add key="AuthorizationMethod" value="OAuth2" /> -->
<!-- Provide the OAuth2 client ID and secret. You can create one from
https://code.google.com/apis/console/. See
https://code.google.com/p/google-api-adwords-dotnet/wiki/UsingOAuth
Expand Down Expand Up @@ -108,21 +107,6 @@
<add key="OAuth2JwtCertificatePassword"
value="INSERT_OAUTH2_JWT_CERTIFICATE_PASSWORD_HERE" />
-->

<!-- Settings specific to use ClientLogin as authentication mechanism. -->
<!-- To use ClientLogin as authentication mechanism, uncomment the following
section and comment the OAuth2 section above. Keep in mind that
ClientLogin API is deprecated, and its use is strongly discouraged.
See https://developers.google.com/accounts/docs/AuthForInstalledApps
for details.-->
<!--
<add key="AuthorizationMethod" value="ClientLogin" />
<add key="Email" value="INSERT_YOUR_LOGIN_EMAIL_HERE"/>
<add key="Password" value="INSERT_YOUR_PASSWORD_HERE"/>
-->
<!-- Optional: uncomment this if you want to reuse an authToken multiple
times. -->
<!-- <add key="AuthToken" value="INSERT_YOUR_AUTH_TOKEN_HERE"/> -->
</AdWordsApi>
<system.web>
<webServices>
Expand Down
4 changes: 2 additions & 2 deletions examples/AdWords/CSharp/Properties/Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
[assembly: AssemblyProduct("AdWords API DotNet Client Library")]
[assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")]

[assembly: AssemblyVersion("18.1.0.0")]
[assembly: AssemblyFileVersion("18.1.0.0")]
[assembly: AssemblyVersion("18.2.0.0")]
[assembly: AssemblyFileVersion("18.2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
namespace Google.Api.Ads.AdWords.Examples.CSharp.v201402 {
/// <summary>
/// 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
/// The effective user (ClientCustomerId or OAuth2 header) 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
Expand All @@ -52,8 +52,8 @@ public static void Main(string[] args) {
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 " +
"effective user (ClientCustomerId or OAuth2 header) 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";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
namespace Google.Api.Ads.AdWords.Examples.CSharp.v201406 {
/// <summary>
/// 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
/// The effective user (ClientCustomerId or OAuth2 header) 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
Expand All @@ -52,8 +52,8 @@ public static void Main(string[] args) {
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 " +
"effective user (ClientCustomerId or OAuth2 header) 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";
}
}
Expand Down
2 changes: 0 additions & 2 deletions examples/AdWords/Vb/AdWords.Examples.VB.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
<Compile Include="v201402\ErrorHandling\HandlePartialFailures.vb" />
<Compile Include="v201402\ErrorHandling\HandlePolicyViolationError.vb" />
<Compile Include="v201402\ErrorHandling\HandleRateExceededError.vb" />
<Compile Include="v201402\ErrorHandling\HandleTwoFactorAuthorizationError.vb" />
<Compile Include="v201402\Miscellaneous\GetAllVideosAndImages.vb" />
<Compile Include="v201402\Miscellaneous\UploadImage.vb" />
<Compile Include="v201402\Optimization\EstimateKeywordTraffic.vb" />
Expand Down Expand Up @@ -183,7 +182,6 @@
<Compile Include="v201406\ErrorHandling\HandlePartialFailures.vb" />
<Compile Include="v201406\ErrorHandling\HandlePolicyViolationError.vb" />
<Compile Include="v201406\ErrorHandling\HandleRateExceededError.vb" />
<Compile Include="v201406\ErrorHandling\HandleTwoFactorAuthorizationError.vb" />
<Compile Include="v201406\Miscellaneous\GetAllVideosAndImages.vb" />
<Compile Include="v201406\Miscellaneous\UploadImage.vb" />
<Compile Include="v201406\Optimization\EstimateKeywordTraffic.vb" />
Expand Down
26 changes: 5 additions & 21 deletions examples/AdWords/Vb/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
Web.config for quickly configuring and running a simple application.
However, it is not mandatory to provide your settings in the config file,
you may also set or override these settings at runtime. See
https://code.google.com/p/google-api-adwords-dotnet/wiki/HowToUseAdWordsUser
https://github.com/googleads/googleads-dotnet-lib/wiki/Getting-Started
for details.
You can refer to
https://code.google.com/p/google-api-adwords-dotnet/wiki/UnderstandingAppConfig
https://github.com/googleads/googleads-dotnet-lib/wiki/Understanding-App.config
for detailed explanation of each configuration key.
-->

Expand Down Expand Up @@ -55,10 +55,9 @@
run Common\Util\OAuth2TokenGenerator.cs to generate this section of the
config file.
-->
<add key="AuthorizationMethod" value="OAuth2" />
<!-- Provide the OAuth2 client ID and secret. You can create one from
https://code.google.com/apis/console/. See
https://code.google.com/p/google-api-adwords-dotnet/wiki/UsingOAuth
https://console.developers.google.com. See
https://github.com/googleads/googleads-dotnet-lib/wiki/Using-OAuth2
for more details.
-->
<add key="OAuth2ClientId" value="INSERT_OAUTH2_CLIENT_ID_HERE" />
Expand Down Expand Up @@ -93,7 +92,7 @@
You should comment out all the keys for Web / Installed application
OAuth flow above. See
https://developers.google.com/adwords/api/docs/guides/service-accounts
and https://code.google.com/p/google-api-adwords-dotnet/wiki/UsingOAuth
https://github.com/googleads/googleads-dotnet-lib/wiki/Using-OAuth2
for more details.
-->
<!--
Expand All @@ -106,21 +105,6 @@
<add key="OAuth2JwtCertificatePassword"
value="INSERT_OAUTH2_JWT_CERTIFICATE_PASSWORD_HERE" />
-->

<!-- Settings specific to use ClientLogin as authentication mechanism. -->
<!-- To use ClientLogin as authentication mechanism, uncomment the following
section and comment the OAuth2 section above. Keep in mind that
ClientLogin API is deprecated, and its use is strongly discouraged.
See https://developers.google.com/accounts/docs/AuthForInstalledApps
for details.-->
<!--
<add key="AuthorizationMethod" value="ClientLogin" />
<add key="Email" value="INSERT_YOUR_LOGIN_EMAIL_HERE"/>
<add key="Password" value="INSERT_YOUR_PASSWORD_HERE"/>
-->
<!-- Optional: uncomment this if you want to reuse an authToken multiple
times. -->
<!-- <add key="AuthToken" value="INSERT_YOUR_AUTH_TOKEN_HERE"/> -->
</AdWordsApi>
<system.web>
<webServices>
Expand Down
4 changes: 2 additions & 2 deletions examples/AdWords/Vb/Properties/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyProduct("AdWords API DotNet Client Library")>
<Assembly: AssemblyCopyright("Copyright 2011, Google Inc. All Rights Reserved.")>

<Assembly: AssemblyVersion("18.1.0.0")>
<Assembly: AssemblyFileVersion("18.1.0.0")>
<Assembly: AssemblyVersion("18.2.0.0")>
<Assembly: AssemblyFileVersion("18.2.0.0")>
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Imports System.IO
Namespace Google.Api.Ads.AdWords.Examples.VB.v201402
''' <summary>
''' 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
''' The effective user (ClientCustomerId or OAuth2 header) 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
Expand Down Expand Up @@ -53,7 +53,7 @@ Namespace Google.Api.Ads.AdWords.Examples.VB.v201402
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 " & _
"effective user (ClientCustomerId or OAuth2 header) 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
Expand Down
Loading

0 comments on commit 890e373

Please sign in to comment.