Skip to content

Commit

Permalink
Release for v4.
Browse files Browse the repository at this point in the history
  • Loading branch information
wfansh committed Jul 13, 2020
1 parent 31bf58c commit 6801ce5
Show file tree
Hide file tree
Showing 1,294 changed files with 9,274 additions and 4,506 deletions.
2 changes: 1 addition & 1 deletion Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $build_sc->new(
create_makefile_pl => "traditional",
dist_abstract => "Google Ads API Client Library for Perl",
dist_name => "Google-Ads-GoogleAds-Client",
dist_version => "3.1.0",
dist_version => "4.0.0",
requires => {
"Class::Load" => 0,
"Class::Std::Fast" => 0,
Expand Down
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
4.0.0 - 2020-07-13
- Added support for Google Ads API v4_0.
- Renamed MutateJobService to BatchJobService.
- Added code examples: add_merchant_center_dynamic_remarketing_campaign,
add_sitelinks_using_feeds, parallel_report_download, add_display_upload_ad, etc.

3.1.0 - 2020-05-07
- Added support for Google Ads API v3_1.
- Added code examples: upload_conversion_adjustment, upload_call_conversion,
Expand Down
12 changes: 6 additions & 6 deletions examples/account_management/approve_merchant_center_link.pl
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
use Google::Ads::GoogleAds::Client;
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::Utils::FieldMasks;
use Google::Ads::GoogleAds::V3::Resources::MerchantCenterLink;
use Google::Ads::GoogleAds::V3::Enums::MerchantCenterLinkStatusEnum
use Google::Ads::GoogleAds::V4::Resources::MerchantCenterLink;
use Google::Ads::GoogleAds::V4::Enums::MerchantCenterLinkStatusEnum
qw(ENABLED PENDING);
use
Google::Ads::GoogleAds::V3::Services::MerchantCenterLinkService::MerchantCenterLinkOperation;
Google::Ads::GoogleAds::V4::Services::MerchantCenterLinkService::MerchantCenterLinkOperation;

use Getopt::Long qw(:config auto_help);
use Pod::Usage;
Expand Down Expand Up @@ -100,7 +100,7 @@ sub update_merchant_center_link_status {
# Create an updated MerchantCenterLink object derived from the original, but
# with the specified status.
my $merchant_center_link_to_update =
Google::Ads::GoogleAds::V3::Resources::MerchantCenterLink->new({
Google::Ads::GoogleAds::V4::Resources::MerchantCenterLink->new({
resourceName => $merchant_center_link->{resourceName},
status => $new_merchant_center_link_status
});
Expand All @@ -109,7 +109,7 @@ sub update_merchant_center_link_status {
# FieldMasks utility to derive the update mask. This mask tells the Google Ads
# API which attributes of the Merchant Center link you want to change.
my $merchant_center_link_operation =
Google::Ads::GoogleAds::V3::Services::MerchantCenterLinkService::MerchantCenterLinkOperation
Google::Ads::GoogleAds::V4::Services::MerchantCenterLinkService::MerchantCenterLinkOperation
->new({
update => $merchant_center_link_to_update,
updateMask => all_set_fields_of($merchant_center_link_to_update)});
Expand All @@ -132,7 +132,7 @@ sub update_merchant_center_link_status {
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new({version => "V3"});
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);
Expand Down
6 changes: 3 additions & 3 deletions examples/account_management/create_customer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use lib "$Bin/../../lib";
use Google::Ads::GoogleAds::Client;
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::V3::Resources::Customer;
use Google::Ads::GoogleAds::V4::Resources::Customer;

use Getopt::Long qw(:config auto_help);
use Pod::Usage;
Expand All @@ -50,7 +50,7 @@ sub create_customer {
my ($api_client, $manager_customer_id) = @_;

# Initialize a customer to be created.
my $customer = Google::Ads::GoogleAds::V3::Resources::Customer->new({
my $customer = Google::Ads::GoogleAds::V4::Resources::Customer->new({
descriptiveName => "Account created with CustomerService on #" . uniqid(),

# For a list of valid currency codes and time zones, see this documentation:
Expand Down Expand Up @@ -86,7 +86,7 @@ sub create_customer {
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new({version => "V3"});
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);
Expand Down
8 changes: 4 additions & 4 deletions examples/account_management/get_account_changes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
use Google::Ads::GoogleAds::Client;
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::Utils::SearchGoogleAdsIterator;
use Google::Ads::GoogleAds::V3::Enums::ChangeStatusResourceTypeEnum
use Google::Ads::GoogleAds::V4::Enums::ChangeStatusResourceTypeEnum
qw(AD_GROUP AD_GROUP_AD AD_GROUP_CRITERION CAMPAIGN CAMPAIGN_CRITERION FEED FEED_ITEM AD_GROUP_FEED CAMPAIGN_FEED AD_GROUP_BID_MODIFIER);
use
Google::Ads::GoogleAds::V3::Services::GoogleAdsService::SearchGoogleAdsRequest;
Google::Ads::GoogleAds::V4::Services::GoogleAdsService::SearchGoogleAdsRequest;

use Getopt::Long qw(:config auto_help);
use Pod::Usage;
Expand Down Expand Up @@ -71,7 +71,7 @@ sub get_account_changes {
# Create a search Google Ads request that will retrieve all change statuses using
# pages of the specified page size.
my $search_request =
Google::Ads::GoogleAds::V3::Services::GoogleAdsService::SearchGoogleAdsRequest
Google::Ads::GoogleAds::V4::Services::GoogleAdsService::SearchGoogleAdsRequest
->new({
customerId => $customer_id,
query => $search_query,
Expand Down Expand Up @@ -140,7 +140,7 @@ sub __get_resource_name_for_resource_type {
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new({version => "V3"});
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);
Expand Down
7 changes: 3 additions & 4 deletions examples/account_management/get_account_hierarchy.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::Utils::SearchStreamHandler;
use
Google::Ads::GoogleAds::V3::Services::GoogleAdsService::SearchGoogleAdsStreamRequest;
Google::Ads::GoogleAds::V4::Services::GoogleAdsService::SearchGoogleAdsStreamRequest;

use Getopt::Long qw(:config auto_help);
use Pod::Usage;
Expand Down Expand Up @@ -145,7 +145,6 @@ ()
# https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
# for more information.
my $api_client = Google::Ads::GoogleAds::Client->new({
version => "V3",
login_customer_id => $login_customer_id || $root_customer_id
});

Expand Down Expand Up @@ -178,7 +177,7 @@ ()
Google::Ads::GoogleAds::Utils::SearchStreamHandler->new({
service => $google_ads_service,
request =>
Google::Ads::GoogleAds::V3::Services::GoogleAdsService::SearchGoogleAdsStreamRequest
Google::Ads::GoogleAds::V4::Services::GoogleAdsService::SearchGoogleAdsStreamRequest
->new({
customerId => $customer_id_to_search,
query => $search_query,
Expand Down Expand Up @@ -264,7 +263,7 @@ sub print_account_hierarchy {
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new({version => "V3"});
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);
Expand Down
6 changes: 3 additions & 3 deletions examples/account_management/get_account_information.pl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use lib "$Bin/../../lib";
use Google::Ads::GoogleAds::Client;
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::V3::Utils::ResourceNames;
use Google::Ads::GoogleAds::V4::Utils::ResourceNames;

use Getopt::Long qw(:config auto_help);
use Pod::Usage;
Expand All @@ -45,7 +45,7 @@ sub get_account_information {
my ($api_client, $customer_id) = @_;

my $resource_name =
Google::Ads::GoogleAds::V3::Utils::ResourceNames::customer($customer_id);
Google::Ads::GoogleAds::V4::Utils::ResourceNames::customer($customer_id);

my $customer =
$api_client->CustomerService()->get({resourceName => $resource_name});
Expand All @@ -68,7 +68,7 @@ sub get_account_information {
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new({version => "V3"});
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);
Expand Down
26 changes: 13 additions & 13 deletions examples/account_management/link_manager_to_client.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
use Google::Ads::GoogleAds::Client;
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::Utils::FieldMasks;
use Google::Ads::GoogleAds::V3::Resources::CustomerClientLink;
use Google::Ads::GoogleAds::V3::Resources::CustomerManagerLink;
use Google::Ads::GoogleAds::V3::Enums::ManagerLinkStatusEnum qw(PENDING ACTIVE);
use Google::Ads::GoogleAds::V4::Resources::CustomerClientLink;
use Google::Ads::GoogleAds::V4::Resources::CustomerManagerLink;
use Google::Ads::GoogleAds::V4::Enums::ManagerLinkStatusEnum qw(PENDING ACTIVE);
use
Google::Ads::GoogleAds::V3::Services::CustomerClientLinkService::CustomerClientLinkOperation;
Google::Ads::GoogleAds::V4::Services::CustomerClientLinkService::CustomerClientLinkOperation;
use
Google::Ads::GoogleAds::V3::Services::CustomerManagerLinkService::CustomerManagerLinkOperation;
use Google::Ads::GoogleAds::V3::Utils::ResourceNames;
Google::Ads::GoogleAds::V4::Services::CustomerManagerLinkService::CustomerManagerLinkOperation;
use Google::Ads::GoogleAds::V4::Utils::ResourceNames;

use Getopt::Long qw(:config auto_help);
use Pod::Usage;
Expand Down Expand Up @@ -64,16 +64,16 @@ sub link_manager_to_client {

# Create a customer client link.
my $api_client_link =
Google::Ads::GoogleAds::V3::Resources::CustomerClientLink->new({
Google::Ads::GoogleAds::V4::Resources::CustomerClientLink->new({
clientCustomer =>
Google::Ads::GoogleAds::V3::Utils::ResourceNames::customer(
Google::Ads::GoogleAds::V4::Utils::ResourceNames::customer(
$api_client_customer_id),
status => PENDING
});

# Create a customer client link operation.
my $api_client_link_operation =
Google::Ads::GoogleAds::V3::Services::CustomerClientLinkService::CustomerClientLinkOperation
Google::Ads::GoogleAds::V4::Services::CustomerClientLinkService::CustomerClientLinkOperation
->new({
create => $api_client_link
});
Expand Down Expand Up @@ -108,7 +108,7 @@ sub link_manager_to_client {
$search_response->{results}[0]{customerClientLink}{managerLinkId};

my $manager_link_resource_name =
Google::Ads::GoogleAds::V3::Utils::ResourceNames::customer_manager_link(
Google::Ads::GoogleAds::V4::Utils::ResourceNames::customer_manager_link(
$api_client_customer_id, $manager_customer_id, $manager_link_id);

# Step 3: Accept the manager customer's link invitation while authenticating
Expand All @@ -117,14 +117,14 @@ sub link_manager_to_client {

# Create a customer manager link.
my $manager_link =
Google::Ads::GoogleAds::V3::Resources::CustomerManagerLink->new({
Google::Ads::GoogleAds::V4::Resources::CustomerManagerLink->new({
resourceName => $manager_link_resource_name,
status => ACTIVE
});

# Create a customer manager link operation.
my $manager_link_operation =
Google::Ads::GoogleAds::V3::Services::CustomerManagerLinkService::CustomerManagerLinkOperation
Google::Ads::GoogleAds::V4::Services::CustomerManagerLinkService::CustomerManagerLinkOperation
->new({
update => $manager_link,
updateMask => all_set_fields_of($manager_link)});
Expand All @@ -149,7 +149,7 @@ sub link_manager_to_client {
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new({version => "V3"});
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);
Expand Down
2 changes: 1 addition & 1 deletion examples/account_management/list_accessible_customers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub list_accessible_customers {
}

# Get Google Ads Client, credentials will be read from ~/googleads.properties.
my $api_client = Google::Ads::GoogleAds::Client->new({version => "V3"});
my $api_client = Google::Ads::GoogleAds::Client->new();

# By default examples are set to die on any server returned fault.
$api_client->set_die_on_faults(1);
Expand Down
Loading

0 comments on commit 6801ce5

Please sign in to comment.