R/youtubeAnalytics_functions.R

#' YouTube Analytics API
#' Retrieves your YouTube Analytics data.
#'
#' Auto-generated code by googleAuthR::gar_create_api_skeleton
#'  at 2016-09-03 23:51:25
#' filename: /Users/mark/dev/R/autoGoogleAPI/googleyoutubeAnalyticsv1.auto/R/youtubeAnalytics_functions.R
#' api_json: api_json
#'
#' @details
#' Authentication scopes used are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtube.readonly
#' \item https://www.googleapis.com/auth/youtubepartner
#' \item https://www.googleapis.com/auth/yt-analytics-monetary.readonly
#' \item https://www.googleapis.com/auth/yt-analytics.readonly
#' }
#'
#' @docType package
#' @name youtubeAnalytics_googleAuthR
#'
NULL
## NULL


#' Retrieves a list of available batch report definitions.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/yt-analytics-monetary.readonly
#' \item https://www.googleapis.com/auth/yt-analytics.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/yt-analytics-monetary.readonly, https://www.googleapis.com/auth/yt-analytics.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param onBehalfOfContentOwner The onBehalfOfContentOwner parameter identifies the content owner that the user is acting on behalf of
#' @importFrom googleAuthR gar_api_generator
#' @export
batchReportDefinitions.list <- function(onBehalfOfContentOwner) {
    url <- "https://youtubeanalytics.googleapis.com/v2/batchReportDefinitions"
    # youtubeAnalytics.batchReportDefinitions.list
    f <- gar_api_generator(url, "GET", pars_args = list(onBehalfOfContentOwner = onBehalfOfContentOwner),
        data_parse_function = function(x) x)
    f()

}

#' Retrieves a list of processed batch reports.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/yt-analytics-monetary.readonly
#' \item https://www.googleapis.com/auth/yt-analytics.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/yt-analytics-monetary.readonly, https://www.googleapis.com/auth/yt-analytics.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param batchReportDefinitionId The batchReportDefinitionId parameter specifies the ID of the batch reportort definition for which you are retrieving reports
#' @param onBehalfOfContentOwner The onBehalfOfContentOwner parameter identifies the content owner that the user is acting on behalf of
#' @importFrom googleAuthR gar_api_generator
#' @export
batchReports.list <- function(batchReportDefinitionId, onBehalfOfContentOwner) {
    url <- "https://youtubeanalytics.googleapis.com/v2/batchReports"
    # youtubeAnalytics.batchReports.list
    f <- gar_api_generator(url, "GET", pars_args = list(batchReportDefinitionId = batchReportDefinitionId,
        onBehalfOfContentOwner = onBehalfOfContentOwner), data_parse_function = function(x) x)
    f()

}

#' Removes an item from a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtubepartner
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/youtubepartner)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param id The id parameter specifies the YouTube group item ID for the group that is being deleted
#' @param onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners
#' @importFrom googleAuthR gar_api_generator
#' @export
groupItems.delete <- function(id, onBehalfOfContentOwner = NULL) {
    url <- "https://youtubeanalytics.googleapis.com/v2/groupItems"
    # youtubeAnalytics.groupItems.delete
    f <- gar_api_generator(url, "DELETE", pars_args = list(id = id, onBehalfOfContentOwner = onBehalfOfContentOwner),
        data_parse_function = function(x) x)
    f()

}

#' Creates a group item.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtubepartner
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/youtubepartner)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param GroupItem The \link{GroupItem} object to pass to this method
#' @param onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners
#' @importFrom googleAuthR gar_api_generator
#' @family GroupItem functions
#' @export
groupItems.insert <- function(GroupItem, onBehalfOfContentOwner = NULL) {
    url <- "https://youtubeanalytics.googleapis.com/v2/groupItems"
    # youtubeAnalytics.groupItems.insert
    f <- gar_api_generator(url, "POST", pars_args = list(onBehalfOfContentOwner = onBehalfOfContentOwner),
        data_parse_function = function(x) x)
    stopifnot(inherits(GroupItem, "gar_GroupItem"))

    f(the_body = GroupItem)

}

#' Returns a collection of group items that match the API request parameters.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtube.readonly
#' \item https://www.googleapis.com/auth/youtubepartner
#' \item https://www.googleapis.com/auth/yt-analytics.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/youtube.readonly, https://www.googleapis.com/auth/youtubepartner, https://www.googleapis.com/auth/yt-analytics.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param groupId The id parameter specifies the unique ID of the group for which you want to retrieve group items
#' @param onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners
#' @importFrom googleAuthR gar_api_generator
#' @export
groupItems.list <- function(groupId, onBehalfOfContentOwner = NULL) {
    url <- "https://youtubeanalytics.googleapis.com/v2/groupItems"
    # youtubeAnalytics.groupItems.list
    f <- gar_api_generator(url, "GET", pars_args = list(groupId = groupId, onBehalfOfContentOwner = onBehalfOfContentOwner),
        data_parse_function = function(x) x)
    f()

}

#' Deletes a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtubepartner
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/youtubepartner)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param id The id parameter specifies the YouTube group ID for the group that is being deleted
#' @param onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners
#' @importFrom googleAuthR gar_api_generator
#' @export
groups.delete <- function(id, onBehalfOfContentOwner = NULL) {
    url <- "https://youtubeanalytics.googleapis.com/v2/groups"
    # youtubeAnalytics.groups.delete
    f <- gar_api_generator(url, "DELETE", pars_args = list(id = id, onBehalfOfContentOwner = onBehalfOfContentOwner),
        data_parse_function = function(x) x)
    f()

}

#' Creates a group.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtubepartner
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/youtubepartner)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Group The \link{Group} object to pass to this method
#' @param onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners
#' @importFrom googleAuthR gar_api_generator
#' @family Group functions
#' @export
groups.insert <- function(Group, onBehalfOfContentOwner = NULL) {
    url <- "https://youtubeanalytics.googleapis.com/v2/groups"
    # youtubeAnalytics.groups.insert
    f <- gar_api_generator(url, "POST", pars_args = list(onBehalfOfContentOwner = onBehalfOfContentOwner),
        data_parse_function = function(x) x)
    stopifnot(inherits(Group, "gar_Group"))

    f(the_body = Group)

}

#' Returns a collection of groups that match the API request parameters. For example, you can retrieve all groups that the authenticated user owns, or you can retrieve one or more groups by their unique IDs.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtube.readonly
#' \item https://www.googleapis.com/auth/youtubepartner
#' \item https://www.googleapis.com/auth/yt-analytics.readonly
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/youtube.readonly, https://www.googleapis.com/auth/youtubepartner, https://www.googleapis.com/auth/yt-analytics.readonly)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param id The id parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved
#' @param mine Set this parameter's value to true to instruct the API to only return groups owned by the authenticated user
#' @param onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners
#' @param pageToken The pageToken parameter identifies a specific page in the result set that should be returned
#' @importFrom googleAuthR gar_api_generator
#' @export
groups.list <- function(id = NULL, mine = NULL, onBehalfOfContentOwner = NULL, pageToken = NULL) {
    url <- "https://youtubeanalytics.googleapis.com/v2/groups"
    # youtubeAnalytics.groups.list
    f <- gar_api_generator(url, "GET", pars_args = list(id = id, mine = mine, onBehalfOfContentOwner = onBehalfOfContentOwner,
        pageToken = pageToken), data_parse_function = function(x) x)
    f()

}

#' Modifies a group. For example, you could change a group's title.
#'
#' Autogenerated via \code{\link[googleAuthR]{gar_create_api_skeleton}}
#'
#' @seealso \href{http://developers.google.com/youtube/analytics/}{Google Documentation}
#'
#' @details
#' Authentication scopes used by this function are:
#' \itemize{
#'   \item https://www.googleapis.com/auth/youtube
#' \item https://www.googleapis.com/auth/youtubepartner
#' }
#'
#' Set \code{options(googleAuthR.scopes.selected = c(https://www.googleapis.com/auth/youtube, https://www.googleapis.com/auth/youtubepartner)}
#' Then run \code{googleAuthR::gar_auth()} to authenticate.
#' See \code{\link[googleAuthR]{gar_auth}} for details.
#'
#' @param Group The \link{Group} object to pass to this method
#' @param onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners
#' @importFrom googleAuthR gar_api_generator
#' @family Group functions
#' @export
groups.update <- function(Group, onBehalfOfContentOwner = NULL) {
    url <- "https://youtubeanalytics.googleapis.com/v2/groups"
    # youtubeAnalytics.groups.update
    f <- gar_api_generator(url, "PUT", pars_args = list(onBehalfOfContentOwner = onBehalfOfContentOwner),
        data_parse_function = function(x) x)
    stopifnot(inherits(Group, "gar_Group"))

    f(the_body = Group)

}
MarkEdmondson1234/youtubeAnalyticsR documentation built on May 7, 2019, 3:34 p.m.