Skip to content

Commit

Permalink
Пакет переведён на работу с Google Ads API v16.
Browse files Browse the repository at this point in the history
  • Loading branch information
selesnow committed May 14, 2024
1 parent 7d4b17c commit bca86ad
Show file tree
Hide file tree
Showing 18 changed files with 144 additions and 134 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.11.0
Date: 2024-05-14 11:03:19 UTC
SHA: 7d4b17ca5b19aa185fc945dd91945b43bb62c90c
42 changes: 22 additions & 20 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rgoogleads
Title: Loading Data from 'Google Ads API'
Version: 0.10.0.9000
Version: 0.11.0
Authors@R:
c(person(given = "Alexey",
family = "Seleznev",
Expand All @@ -16,27 +16,29 @@ License: MIT + file LICENSE
BugReports: https://github.com/selesnow/rgoogleads/issues
URL: https://selesnow.github.io/rgoogleads/, https://selesnow.github.io/rgoogleads/docs/, https://github.com/selesnow/rgoogleads
Encoding: UTF-8
Imports: gargle (>= 1.2.0),
httr,
stringr,
rlang,
dplyr (>= 1.0.0),
tidyr (>= 1.0.0),
jsonlite,
snakecase,
cli (>= 3.0.0),
pbapply,
purrr,
withr,
rlist,
rvest (>= 1.0.0),
memoise,
cachem,
rappdirs,
utils
Imports:
gargle (>= 1.2.0),
httr,
stringr,
rlang,
dplyr (>= 1.0.0),
tidyr (>= 1.0.0),
jsonlite,
snakecase,
cli (>= 3.0.0),
pbapply,
purrr,
withr,
rlist,
rvest (>= 1.0.0),
memoise,
cachem,
rappdirs,
utils,
lifecycle
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Suggests:
rmarkdown,
knitr,
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# rgoogleads (development version)
# rgoogleads 0.11.0
* Пакет переведён на работу с Google Ads API v16.

# rgoogleads 0.10.0
* Пакет переведён на работу с Google Ads API v14.
Expand Down
21 changes: 14 additions & 7 deletions R/gads_auth.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# initialization happens in .onLoad
.auth <- NULL
app <- NULL

## The roxygen comments for these functions are mostly generated from data
## in this list and template text maintained in gargle.
Expand Down Expand Up @@ -189,20 +190,26 @@ gads_has_token <- function() {
#' gs4_auth_configure(app = original_app, api_key = original_api_key)
#' }
#' @export
gads_auth_configure <- function(app, path, api_key, developer_token) {
if (!missing(app) && !missing(path)) {
gads_abort("Must supply exactly one of {.arg app} or {.arg path}, not both")
gads_auth_configure <- function(client, path, api_key, developer_token, app = lifecycle::deprecated()) {

if (lifecycle::is_present(app)) {
gads_auth_configure(client = app, path = path, api_key = api_key)
}

if (!missing(client) && !missing(path)) {
gads_abort("Must supply exactly one of {.arg client} or {.arg path}, not both")
}

stopifnot(missing(api_key) || is.null(api_key) || is_string(api_key))

if (!missing(path)) {
stopifnot(is_string(path))
app <- gargle::oauth_app_from_json(path)
client <- gargle::oauth_app_from_json(path)
}
stopifnot(missing(app) || is.null(app) || inherits(app, "oauth_app"))
stopifnot(missing(client) || is.null(client) || inherits(client, "oauth_app"))

if (!missing(app) || !missing(path)) {
.auth$set_app(app)
if (!missing(client) || !missing(path)) {
.auth$set_app(client)
}

if (!missing(api_key)) {
Expand Down
2 changes: 1 addition & 1 deletion R/gads_get_accessible_customers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @return List of your accessible accounts from top level
#' @export
#'
#' @seealso \href{https://developers.google.com/google-ads/api/rest/reference/rest/v13/customers/listAccessibleCustomers}{Method: customers.listAccessibleCustomers documentation}
#' @seealso \href{https://developers.google.com/google-ads/api/rest/reference/rest/v16/customers/listAccessibleCustomers}{Method: customers.listAccessibleCustomers documentation}
#'
#' @examples
#' \dontrun{
Expand Down
2 changes: 0 additions & 2 deletions R/gads_get_ad_group_criterions.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ gads_get_ad_group_criterions <- function(
'ad_group_criterion.listing_group.case_value.hotel_class.value',
'ad_group_criterion.listing_group.case_value.hotel_id.value',
'ad_group_criterion.listing_group.case_value.hotel_state.state_criterion',
'ad_group_criterion.listing_group.case_value.product_bidding_category.id',
'ad_group_criterion.listing_group.case_value.product_bidding_category.level',
'ad_group_criterion.listing_group.case_value.product_brand.value',
'ad_group_criterion.listing_group.case_value.product_channel.channel',
'ad_group_criterion.listing_group.case_value.product_condition.condition',
Expand Down
12 changes: 0 additions & 12 deletions R/gads_get_ads.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,6 @@ gads_get_ads <- function(
'ad_group_ad.ad.final_url_suffix',
'ad_group_ad.ad.final_urls',
'ad_group_ad.ad.final_mobile_urls',
'ad_group_ad.ad.gmail_ad.header_image',
'ad_group_ad.ad.gmail_ad.marketing_image',
'ad_group_ad.ad.gmail_ad.marketing_image_description',
'ad_group_ad.ad.gmail_ad.marketing_image_display_call_to_action.text',
'ad_group_ad.ad.gmail_ad.marketing_image_display_call_to_action.text_color',
'ad_group_ad.ad.gmail_ad.marketing_image_display_call_to_action.url_collection_id',
'ad_group_ad.ad.gmail_ad.marketing_image_headline',
'ad_group_ad.ad.gmail_ad.product_images',
'ad_group_ad.ad.gmail_ad.teaser.business_name',
'ad_group_ad.ad.gmail_ad.teaser.description',
'ad_group_ad.ad.gmail_ad.teaser.headline',
'ad_group_ad.ad.gmail_ad.teaser.logo_image',
'ad_group_ad.ad.hotel_ad',
'ad_group_ad.ad.image_ad.image_url',
'ad_group_ad.ad.image_ad.mime_type',
Expand Down
1 change: 0 additions & 1 deletion R/gads_get_campaigns.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ gads_get_campaigns <- function(
'campaign.payment_mode',
'campaign.serving_status',
'campaign.shopping_setting.campaign_priority',
'campaign.shopping_setting.sales_country',
'campaign.target_roas.target_roas',
'campaign.tracking_url_template',
'customer.descriptive_name',
Expand Down
8 changes: 7 additions & 1 deletion R/gads_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ gads_make_request <- function(
# --------------
# get answer
if (verbose) cli_alert_info('Get answer query')
out <- response_process(ans, error_message = gads_check_errors2)
tryCatch(
{out <- response_process(ans, error_message = gads_check_errors2)},
error = function(e) {
gads_check_errors2(ans)
stop()
}
)

# requests_ids
if ( !is.null(ans$headers$`request-id`) ) {
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# options
op <- options()
op.gads <- list(gads.developer.token = developer_token,
gads.api.version = "v15",
gads.api.version = "v16",
gads.login.customer.id = login_customer_id,
gads.customer.id = customer_id,
gads.multi.account.verbos = FALSE,
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## R CMD check results

0 errors | 0 warnings | 0 note
0 errors | 0 warnings | 1 note

* Change Google Ads API versions.
* Migrate to Google Ads API v.16.
55 changes: 31 additions & 24 deletions man/gads_auth.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 24 additions & 13 deletions man/gads_auth_configure.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/gads_get_accessible_customers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions man/gads_get_ad_group_criterions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bca86ad

Please sign in to comment.