Skip to content

Instantly share code, notes, and snippets.

@AlexDev404
Created June 20, 2022 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDev404/1bef398337c825fdfad9a9feb4a18e71 to your computer and use it in GitHub Desktop.
Save AlexDev404/1bef398337c825fdfad9a9feb4a18e71 to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"title": "Takeout API",
"description": "",
"contact": {
"name": "Google",
"url": "https://google.com"
},
"version": "v2"
},
"host": "takeout-pa.googleapis.com",
"basePath": "/",
"schemes": [
"https"
],
"definitions": {
"ErrorProto": {
"description": "Describes one specific error.",
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location of the error, as specified by the location type.\n\nIf location_type is PATH, this should be a path to a field that's\nrelative to the request, using FieldPath notation\n(net/proto2/util/public/field_path.h).\n\nExamples:\n authenticated_user.gaia_id\n resource.address[2].country"
},
"debugInfo": {
"description": "Debugging information, which should not be\nshared externally.",
"type": "string"
},
"code": {
"description": "Error code in the error domain. This should correspond to\na value of the enum type whose name is in domain. See\nthe core error domain in error_domain.proto.",
"type": "string"
},
"locationType": {
"type": "string",
"enum": [
"PATH",
"OTHER",
"PARAMETER"
]
},
"argument": {
"description": "Error arguments, to be used when building user-friendly error messages\ngiven the error domain and code. Different error codes require different\narguments.",
"type": "array",
"items": {
"type": "string"
}
},
"externalErrorMessage": {
"description": "A short explanation for the error, which can be shared outside Google.\n\nPlease set domain, code and arguments whenever possible instead of this\nerror message so that external APIs can build safe error messages\nthemselves.\n\nExternal messages built in a RoSy interface will most likely refer to\ninformation and concepts that are not available externally and should not\nbe exposed. It is safer if external APIs can understand the errors and\ndecide what the error message should look like.",
"type": "string"
},
"domain": {
"type": "string",
"description": "Error domain. RoSy services can define their own\ndomain and error codes. This should normally be\nthe name of an enum type, such as: gdata.CoreErrorDomain"
}
}
},
"Errors": {
"description": "Request Error information.\n\nThe presence of an error field signals that the operation\nhas failed.",
"type": "object",
"properties": {
"error": {
"description": "Specific error description and codes",
"type": "array",
"items": {
"$ref": "#/definitions/ErrorProto"
}
},
"code": {
"description": "Global error code. Deprecated and ignored.\nSet custom error codes in ErrorProto.domain and ErrorProto.code\ninstead.",
"type": "string",
"enum": [
"BAD_REQUEST",
"FORBIDDEN",
"NOT_FOUND",
"CONFLICT",
"GONE",
"PRECONDITION_FAILED",
"INTERNAL_ERROR",
"SERVICE_UNAVAILABLE"
]
},
"requestId": {
"type": "string",
"description": "Request identifier generated by the service, which can be\nused to identify the error in the logs"
}
}
},
"ExportJob": {
"type": "object",
"properties": {
"failedItemInfos": {
"description": "The set of items that couldn't be included in the archive.\nIf a directory was specified in ExportRequest.items and items in that\ndirectory failed, each individual file that failed will have an entry in\nfailed_item_infos.",
"type": "array",
"items": {
"$ref": "#/definitions/FailedItemInfo"
}
},
"status": {
"enum": [
"UNKNOWN",
"QUEUED",
"COUNTING",
"BUILDING",
"SUCCEEDED",
"FAILED"
],
"description": "The current status of this export job.",
"type": "string"
},
"failedItems": {
"description": "Use failed_item_info instead.",
"type": "array",
"items": {
"type": "string"
}
},
"debugFailureInfo": {
"description": "Detailed information about what failed in the case status = FAILED.\nThis information is for internal debugging only and should not be shared\nwith user.",
"type": "string"
},
"archives": {
"type": "array",
"items": {
"$ref": "#/definitions/Archive"
},
"description": "A set of records that contain information about the completed archives\ncreated by this job. This will only be present if status = SUCCEEDED."
},
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/TakeoutItem"
},
"description": "The items being exported. If a directory is present all\nitems under that directory will be included."
},
"id": {
"description": "The ID of this job. Can be used to get or cancel this job.",
"type": "string"
}
},
"description": "The representation of an export job. Used for creating new jobs\nand reporting the state of existing jobs."
},
"ExportRequest": {
"type": "object",
"properties": {
"locale": {
"type": "string",
"description": "Allows the client to specify a locale for the request.\nThe format of the string is an IETF\nlanguage tag, such as \"en-US\", as defined in\nBCP 47 (http://tools.ietf.org/html/bcp47). More practically, the content\nof the string should be one that is appropriate for creating a java\nLocale object. Defaults to \"en-US\" if not specified."
},
"items": {
"description": "The requested items to export. If a directory is specified, all\nitems under that directory will be exported, but only top-level\nitems are captured in this field.",
"type": "array",
"items": {
"$ref": "#/definitions/TakeoutItem"
}
},
"initiatingClientService": {
"enum": [
"UNKNOWN_SERVICE",
"ACCOUNT_CENTRAL",
"LIS",
"DASHER",
"PATRONUS",
"PROBATE",
"DRIVE_SERVICE",
"TAKEDOWN",
"DASHER_SUPPLEMENTAL",
"LRTOOL_SOCIAL_RETENTION",
"ACCOUNT_MIGRATION_UI",
"NEST_SERVICE",
"ACCOUNT_CENTRAL_SCHEDULED",
"TRANSFER",
"PHOTOS_DOWNLOAD_SERVICE",
"TAKEOUT_INTERNAL"
],
"type": "string"
},
"archivePrefix": {
"description": "Optional prefix for the archive filename. Will be followed by a '-'\n& an ISO standard timestamp in yyyyMMdd'T'HHmmssZ format. Prefix\ndefaults to \"takeout\" if none specified, resulting in an archive\nname like \"takeout-20150924T221439Z.zip\".",
"type": "string"
},
"service": {
"type": "string",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java."
}
},
"description": "A request to create a new export."
},
"CreateExportResponse": {
"description": "The result of a request to create a new export.",
"type": "object",
"properties": {
"exportJob": {
"$ref": "#/definitions/ExportJob",
"description": "Details about the created export."
},
"errors": {
"description": "If present provides details on any errors that occurred.",
"$ref": "#/definitions/Errors"
}
}
},
"FailedItemInfo": {
"description": "Info about a failed item (file or folder) in an export.",
"type": "object",
"properties": {
"title": {
"description": "The user visible title of the item that failed, empty if the failure was\ndue to permissions.",
"type": "string"
},
"cause": {
"enum": [
"UNKNOWN",
"GENERIC",
"ITEM_NOT_FOUND",
"DOWNLOAD_PROHIBITED",
"CONTAINS_VIRUS"
],
"description": "The cause of the failure, if known.",
"type": "string"
},
"relativePath": {
"description": "The path to the failed item from one of the root items specified when\nstarting the export. The path includes the file name.\nIf this item is reachable via multiple paths (e.g. the individual item\nwas selected as well as the parent folder or the item is multi-included\nin several folders) it is undefined (and non-deterministic) which root\nnode this path will be relative to.",
"type": "string"
},
"docId": {
"description": "The document ID of the item that failed.",
"type": "string"
},
"mediaType": {
"type": "string",
"description": "The mime type of the file."
}
}
},
"Archive": {
"description": "A completed archive file (e.g. zip or tgz).",
"type": "object",
"properties": {
"storagePath": {
"description": "The downloadable url of the completed archive.",
"type": "string"
},
"compressedSize": {
"description": "The size, in bytes, of the compressed archive.",
"format": "uint64",
"type": "string"
},
"fileName": {
"description": "The full name of the archive file, including extension (but not\nincluding path).",
"type": "string"
},
"sizeOfContents": {
"description": "The size, in bytes, of all the items in the archive.",
"format": "uint64",
"type": "string"
}
}
},
"GetExportResponse": {
"description": "Details about a given export.",
"type": "object",
"properties": {
"exportJob": {
"$ref": "#/definitions/ExportJob",
"description": "Details on the requested export."
},
"percentDone": {
"description": "Percent done (# completed files) / (# total files).\nIncluded for BUILDING exports only.",
"format": "int32",
"type": "integer"
},
"numFetchedFiles": {
"type": "integer",
"description": "Total number of fetched files. Set for completed exports only.\nIf a folder containing 2 files was downloaded, num_fetched_files = 2.",
"format": "int32"
},
"errors": {
"$ref": "#/definitions/Errors",
"description": "If present provides details on any errors that occurred."
}
}
},
"TakeoutItem": {
"description": "Represents an item (file/folder/album) in the product.",
"type": "object",
"properties": {
"id": {
"description": "The ID of the item, must line up with the id that that service's\nTakeout integration produces.",
"type": "string"
}
}
},
"CancelExportResponse": {
"description": "The result of a request to cancel a given export.",
"type": "object",
"properties": {
"errors": {
"description": "If present provides details on any errors that occurred.",
"$ref": "#/definitions/Errors"
},
"succeeded": {
"description": "Whether the export was successfully cancelled",
"type": "boolean"
}
}
}
},
"parameters": {
"key": {
"name": "key",
"in": "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": {
"name": "access_token",
"in": "query",
"description": "OAuth access token.",
"type": "string"
},
"upload_protocol": {
"name": "upload_protocol",
"in": "query",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"type": "string"
},
"prettyPrint": {
"name": "prettyPrint",
"in": "query",
"description": "Returns response with indentations and line breaks.",
"default": true,
"type": "boolean"
},
"quotaUser": {
"name": "quotaUser",
"in": "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"
},
"fields": {
"name": "fields",
"in": "query",
"description": "Selector specifying which fields to include in a partial response.",
"type": "string"
},
"uploadType": {
"name": "uploadType",
"in": "query",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"type": "string"
},
"$.xgafv": {
"name": "$.xgafv",
"in": "query",
"description": "V1 error format.",
"type": "string",
"enum": [
"1",
"2"
]
},
"oauth_token": {
"name": "oauth_token",
"in": "query",
"description": "OAuth 2.0 token for the current user.",
"type": "string"
},
"callback": {
"name": "callback",
"in": "query",
"description": "JSONP",
"type": "string"
},
"alt": {
"name": "alt",
"in": "query",
"description": "Data format for response.",
"default": "json",
"type": "string",
"enum": [
"json",
"media",
"proto"
]
}
},
"securityDefinitions": {
"Oauth2": {
"type": "oauth2",
"description": "Oauth 2.0 authentication",
"flow": "implicit",
"authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
"scopes": {
"https://www.googleapis.com/auth/drive.readonly": "See and download all your Google Drive files"
}
}
},
"paths": {
"/v2/{service}/exports/{exportId}": {
"get": {
"description": "Gets the status of a single export job.",
"operationId": "takeout_pa.exports.get",
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/GetExportResponse"
}
}
},
"parameters": [
{
"name": "service",
"in": "path",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java.",
"required": true,
"type": "string"
},
{
"name": "exportId",
"in": "path",
"description": "The ID of the export to get.",
"required": true,
"type": "string"
}
],
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/drive.readonly"
]
}
],
"tags": [
"exports"
]
},
"parameters": [
{
"$ref": "#/parameters/key"
},
{
"$ref": "#/parameters/access_token"
},
{
"$ref": "#/parameters/upload_protocol"
},
{
"$ref": "#/parameters/prettyPrint"
},
{
"$ref": "#/parameters/quotaUser"
},
{
"$ref": "#/parameters/fields"
},
{
"$ref": "#/parameters/uploadType"
},
{
"$ref": "#/parameters/$.xgafv"
},
{
"$ref": "#/parameters/oauth_token"
},
{
"$ref": "#/parameters/callback"
},
{
"$ref": "#/parameters/alt"
}
]
},
"/v2/{service}/exports": {
"post": {
"description": "Creates a new Export Job for the user. This will return immediately,\nthe ID in the response can then be used to poll GetExport to tell when\nthe job is done.",
"operationId": "takeout_pa.exports.create",
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/CreateExportResponse"
}
}
},
"parameters": [
{
"name": "service",
"in": "path",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java.",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/ExportRequest"
}
}
],
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/drive.readonly"
]
}
],
"tags": [
"exports"
]
},
"parameters": [
{
"$ref": "#/parameters/key"
},
{
"$ref": "#/parameters/access_token"
},
{
"$ref": "#/parameters/upload_protocol"
},
{
"$ref": "#/parameters/prettyPrint"
},
{
"$ref": "#/parameters/quotaUser"
},
{
"$ref": "#/parameters/fields"
},
{
"$ref": "#/parameters/uploadType"
},
{
"$ref": "#/parameters/$.xgafv"
},
{
"$ref": "#/parameters/oauth_token"
},
{
"$ref": "#/parameters/callback"
},
{
"$ref": "#/parameters/alt"
}
]
},
"/v2/{service}/exports/{exportId}:cancel": {
"post": {
"description": "Cancels a running export job.",
"operationId": "takeout_pa.exports.cancel",
"responses": {
"200": {
"description": "Successful response",
"schema": {
"$ref": "#/definitions/CancelExportResponse"
}
}
},
"parameters": [
{
"name": "service",
"in": "path",
"description": "The Takeout service, from jcg/dataliberation/common/model/Service.java.",
"required": true,
"type": "string"
},
{
"name": "exportId",
"in": "path",
"description": "The ID of the export to cancel.",
"required": true,
"type": "string"
}
],
"security": [
{
"Oauth2": [
"https://www.googleapis.com/auth/drive.readonly"
]
}
],
"tags": [
"exports"
]
},
"parameters": [
{
"$ref": "#/parameters/key"
},
{
"$ref": "#/parameters/access_token"
},
{
"$ref": "#/parameters/upload_protocol"
},
{
"$ref": "#/parameters/prettyPrint"
},
{
"$ref": "#/parameters/quotaUser"
},
{
"$ref": "#/parameters/fields"
},
{
"$ref": "#/parameters/uploadType"
},
{
"$ref": "#/parameters/$.xgafv"
},
{
"$ref": "#/parameters/oauth_token"
},
{
"$ref": "#/parameters/callback"
},
{
"$ref": "#/parameters/alt"
}
]
}
},
"tags": [
{
"name": "exports"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment