Skip to content

Commit

Permalink
generalise auth files
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEdmondson1234 committed Nov 14, 2017
1 parent 847d766 commit bdecbaf
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 104 deletions.
4 changes: 2 additions & 2 deletions tests/testthat/test-integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ test_that("Encoding parameters works (#100 & #101)", {
"GET",pars_args=list(q=query))()
}

googleAuthR::gar_auth("gdrive.oauth")
googleAuthR::gar_auth(Sys.getenv("GAR_TEST_DRIVE_FILE"))

searchResponse <- fileSearch("mimeType != 'application/vnd.google-apps.folder'")

Expand All @@ -226,7 +226,7 @@ test_that("Can do batching with caching (#106)", {
skip_on_cran()
skip_if_no_env_auth(auth_env)

googleAuthR::gar_auth("googleAuthR_tests.httr-oauth")
googleAuthR::gar_auth(Sys.getenv("GAR_TEST_GA_FILE"))

f <- function(req){
if(!is.null(req$content$reports)){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
{
"ownerDomain": "google.com",
"name": "acceleratedmobilepageurl",
"batchPath": "batch",
"id": "acceleratedmobilepageurl:v1",
"documentationLink": "https://developers.google.com/amp/cache/",
"revision": "20171025",
"title": "Accelerated Mobile Pages (AMP) URL API",
"discoveryVersion": "v1",
"ownerName": "Google",
"version_module": true,
"resources": {
"ampUrls": {
"methods": {
"batchGet": {
"httpMethod": "POST",
"parameterOrder": [],
"response": {
"$ref": "BatchGetAmpUrlsResponse"
},
"parameterOrder": [],
"httpMethod": "POST",
"parameters": {},
"flatPath": "v1/ampUrls:batchGet",
"id": "acceleratedmobilepageurl.ampUrls.batchGet",
Expand All @@ -31,6 +24,37 @@
}
},
"parameters": {
"access_token": {
"description": "OAuth access token.",
"type": "string",
"location": "query"
},
"key": {
"location": "query",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"type": "string"
},
"quotaUser": {
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"type": "string",
"location": "query"
},
"pp": {
"description": "Pretty-print response.",
"type": "boolean",
"default": "true",
"location": "query"
},
"oauth_token": {
"location": "query",
"description": "OAuth 2.0 token for the current user.",
"type": "string"
},
"bearer_token": {
"description": "OAuth bearer token.",
"type": "string",
"location": "query"
},
"upload_protocol": {
"location": "query",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
Expand All @@ -39,36 +63,36 @@
"prettyPrint": {
"location": "query",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"type": "boolean"
"type": "boolean",
"default": "true"
},
"fields": {
"location": "query",
"description": "Selector specifying which fields to include in a partial response.",
"type": "string"
"type": "string",
"location": "query"
},
"uploadType": {
"location": "query",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"type": "string"
},
"callback": {
"location": "query",
"description": "JSONP",
"type": "string"
},
"$.xgafv": {
"enum": [
"1",
"2"
],
"description": "V1 error format.",
"type": "string",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
"location": "query",
"enum": [
"1",
"2"
]
},
"callback": {
"location": "query",
"description": "JSONP",
"type": "string"
},
"alt": {
"description": "Data format for response.",
Expand All @@ -85,68 +109,57 @@
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"key": {
"location": "query",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"type": "string"
},
"access_token": {
"description": "OAuth access token.",
"type": "string",
"location": "query"
},
"quotaUser": {
"location": "query",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"type": "string"
},
"pp": {
"description": "Pretty-print response.",
"default": "true",
"type": "boolean",
"location": "query"
},
"oauth_token": {
"description": "OAuth 2.0 token for the current user.",
"type": "string",
"location": "query"
},
"bearer_token": {
"description": "OAuth bearer token.",
"type": "string",
"location": "query"
}
},
"schemas": {
"BatchGetAmpUrlsResponse": {
"description": "Batch AMP URL response.",
"type": "object",
"properties": {
"ampUrls": {
"description": "For each URL in BatchAmpUrlsRequest, the URL response. The response might\nnot be in the same order as URLs in the batch request.\nIf BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated\nonly once.",
"type": "array",
"items": {
"$ref": "AmpUrl"
}
},
"urlErrors": {
"description": "The errors for requested URLs that have no AMP URL.",
"type": "array",
"items": {
"$ref": "AmpUrlError"
}
}
},
"id": "BatchGetAmpUrlsResponse"
},
"AmpUrl": {
"id": "AmpUrl",
"description": "AMP URL response for a requested URL.",
"type": "object",
"properties": {
"cdnAmpUrl": {
"description": "The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to\nthe cached document in the Google AMP Cache.",
"type": "string"
},
"ampUrl": {
"description": "The AMP URL pointing to the publisher's web server.",
"type": "string"
},
"originalUrl": {
"description": "The original non-AMP URL.",
"type": "string"
},
"ampUrl": {
"description": "The AMP URL pointing to the publisher's web server.",
"type": "string"
}
},
"id": "AmpUrl"
}
},
"AmpUrlError": {
"id": "AmpUrlError",
"description": "AMP URL Error resource for a requested URL that couldn't be found.",
"type": "object",
"properties": {
"errorMessage": {
"description": "An optional descriptive error message.",
"type": "string"
},
"errorCode": {
"description": "The error code of an API call.",
"type": "string",
"enumDescriptions": [
"Not specified error.",
"Indicates the requested URL is not found in the index, possibly because\nit's unable to be found, not able to be accessed by Googlebot, or some\nother error.",
Expand All @@ -162,75 +175,62 @@
"APPLICATION_ERROR",
"URL_IS_VALID_AMP",
"URL_IS_INVALID_AMP"
],
"description": "The error code of an API call.",
"type": "string"
]
},
"originalUrl": {
"description": "The original non-AMP URL.",
"type": "string"
},
"errorMessage": {
"description": "An optional descriptive error message.",
"type": "string"
}
},
"id": "AmpUrlError"
}
},
"BatchGetAmpUrlsRequest": {
"description": "AMP URL request for a batch of URLs.",
"type": "object",
"properties": {
"lookupStrategy": {
"enum": [
"FETCH_LIVE_DOC",
"IN_INDEX_DOC"
],
"description": "The lookup_strategy being requested.",
"type": "string",
"enumDescriptions": [
"FETCH_LIVE_DOC strategy involves live document fetch of URLs not found in\nthe index. Any request URL not found in the index is crawled in realtime\nto validate if there is a corresponding AMP URL. This strategy has higher\ncoverage but with extra latency introduced by realtime crawling. This is\nthe default strategy. Applications using this strategy should set higher\nHTTP timeouts of the API calls.",
"IN_INDEX_DOC strategy skips fetching live documents of URL(s) not found\nin index. For applications which need low latency use of IN_INDEX_DOC\nstrategy is recommended."
],
"enum": [
"FETCH_LIVE_DOC",
"IN_INDEX_DOC"
]
},
"urls": {
"description": "List of URLs to look up for the paired AMP URLs.\nThe URLs are case-sensitive. Up to 50 URLs per lookup\n(see [Usage Limits](/amp/cache/reference/limits)).",
"type": "array",
"items": {
"type": "string"
},
"type": "array"
}
}
},
"id": "BatchGetAmpUrlsRequest"
},
"BatchGetAmpUrlsResponse": {
"properties": {
"urlErrors": {
"description": "The errors for requested URLs that have no AMP URL.",
"items": {
"$ref": "AmpUrlError"
},
"type": "array"
},
"ampUrls": {
"description": "For each URL in BatchAmpUrlsRequest, the URL response. The response might\nnot be in the same order as URLs in the batch request.\nIf BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated\nonly once.",
"items": {
"$ref": "AmpUrl"
},
"type": "array"
}
},
"id": "BatchGetAmpUrlsResponse",
"description": "Batch AMP URL response.",
"type": "object"
}
},
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
"x32": "http://www.google.com/images/icons/product/search-32.gif",
"x16": "http://www.google.com/images/icons/product/search-16.gif"
},
"protocol": "rest",
"version": "v1",
"baseUrl": "https://acceleratedmobilepageurl.googleapis.com/",
"servicePath": "",
"description": "Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s).\n",
"kind": "discovery#restDescription",
"description": "Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s).\n",
"servicePath": "",
"rootUrl": "https://acceleratedmobilepageurl.googleapis.com/",
"basePath": ""
"basePath": "",
"ownerDomain": "google.com",
"name": "acceleratedmobilepageurl",
"batchPath": "batch",
"revision": "20171025",
"documentationLink": "https://developers.google.com/amp/cache/",
"id": "acceleratedmobilepageurl:v1",
"title": "Accelerated Mobile Pages (AMP) URL API"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"kind": "urlshortener#url",
"id": "https://goo.gl/RdBuHQ",
"id": "https://goo.gl/jJ1dxV",
"longUrl": "http://markedmondson.me/"
}

0 comments on commit bdecbaf

Please sign in to comment.