{
  "icons": {
    "x16": "https://www.google.com/images/icons/product/translate-16.png",
    "x32": "https://www.google.com/images/icons/product/translate-32.png"
  },
  "description": "The Google Cloud Translation API lets websites and programs integrate with\n    Google Translate programmatically.",
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/cloud-translation": {
          "description": "Translate text from one language to another using Google Translate"
        },
        "https://www.googleapis.com/auth/cloud-platform": {
          "description": "View and manage your data across Google Cloud Platform services"
        }
      }
    }
  },
  "id": "translate:v2",
  "servicePath": "language/translate/",
  "parameters": {
    "alt": {
      "location": "query",
      "type": "string",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "description": "Data format for response.",
      "default": "json"
    },
    "uploadType": {
      "type": "string",
      "location": "query",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
    },
    "pp": {
      "location": "query",
      "description": "Pretty-print response.",
      "default": "true",
      "type": "boolean"
    },
    "oauth_token": {
      "type": "string",
      "location": "query",
      "description": "OAuth 2.0 token for the current user."
    },
    "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"
    },
    "$.xgafv": {
      "enum": [
        "1",
        "2"
      ],
      "description": "V1 error format.",
      "type": "string",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query"
    },
    "quotaUser": {
      "location": "query",
      "type": "string",
      "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. Overrides userIp if both are provided."
    },
    "bearer_token": {
      "type": "string",
      "description": "OAuth bearer token.",
      "location": "query"
    },
    "access_token": {
      "type": "string",
      "location": "query",
      "description": "OAuth access token."
    },
    "fields": {
      "description": "Selector specifying which fields to include in a partial response.",
      "location": "query",
      "type": "string"
    },
    "callback": {
      "description": "JSONP",
      "type": "string",
      "location": "query"
    },
    "prettyPrint": {
      "location": "query",
      "type": "boolean",
      "description": "Returns response with indentations and line breaks.",
      "default": "true"
    },
    "upload_protocol": {
      "type": "string",
      "location": "query",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")."
    }
  },
  "rootUrl": "https://translation.googleapis.com/",
  "schemas": {
    "DetectionsListResponse": {
      "id": "DetectionsListResponse",
      "properties": {
        "detections": {
          "items": {
            "$ref": "DetectionsResource"
          },
          "description": "A detections contains detection results of several text",
          "type": "array"
        }
      },
      "type": "object"
    },
    "TranslationsResource": {
      "properties": {
        "translatedText": {
          "type": "string",
          "description": "Text translated into the target language."
        },
        "detectedSourceLanguage": {
          "description": "The source language of the initial request, detected automatically, if\nno source language was passed within the initial request. If the\nsource language was passed, auto-detection of the language will not\noccur and this field will be empty.",
          "type": "string"
        },
        "model": {
          "description": "The `model` type used for this translation. Valid values are\nlisted in public documentation. Can be different from requested `model`.\nPresent only if specific model type was explicitly requested.",
          "type": "string"
        }
      },
      "id": "TranslationsResource",
      "type": "object"
    },
    "LanguagesResource": {
      "type": "object",
      "id": "LanguagesResource",
      "properties": {
        "language": {
          "type": "string",
          "description": "Supported language code, generally consisting of its ISO 639-1\nidentifier. (E.g. 'en', 'ja'). In certain cases, BCP-47 codes including\nlanguage + region identifiers are returned (e.g. 'zh-TW' and 'zh-CH')"
        },
        "name": {
          "description": "Human readable name of the language localized to the target language.",
          "type": "string"
        }
      }
    },
    "GetSupportedLanguagesRequest": {
      "type": "object",
      "description": "The request message for discovering supported languages.",
      "properties": {
        "target": {
          "type": "string",
          "description": "The language to use to return localized, human readable names of supported\nlanguages."
        }
      },
      "id": "GetSupportedLanguagesRequest"
    },
    "DetectLanguageRequest": {
      "type": "object",
      "description": "The request message for language detection.",
      "id": "DetectLanguageRequest",
      "properties": {
        "q": {
          "description": "The input text upon which to perform language detection. Repeat this\nparameter to perform language detection on multiple text inputs.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      }
    },
    "LanguagesListResponse": {
      "id": "LanguagesListResponse",
      "properties": {
        "languages": {
          "description": "List of source/target languages supported by the translation API. If target parameter is unspecified, the list is sorted by the ASCII code point order of the language code. If target parameter is specified, the list is sorted by the collation order of the language name in the target language.",
          "items": {
            "$ref": "LanguagesResource"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "TranslateTextRequest": {
      "description": "The main translation request message for the Cloud Translation API.",
      "properties": {
        "format": {
          "type": "string",
          "description": "The format of the source text, in either HTML (default) or plain-text. A\nvalue of \"html\" indicates HTML and a value of \"text\" indicates plain-text."
        },
        "model": {
          "type": "string",
          "description": "The `model` type requested for this translation. Valid values are\nlisted in public documentation."
        },
        "q": {
          "items": {
            "type": "string"
          },
          "description": "The input text to translate. Repeat this parameter to perform translation\noperations on multiple text inputs.",
          "type": "array"
        },
        "target": {
          "description": "The language to use for translation of the input text, set to one of the\nlanguage codes listed in Language Support.",
          "type": "string"
        },
        "source": {
          "description": "The language of the source text, set to one of the language codes listed in\nLanguage Support. If the source language is not specified, the API will\nattempt to identify the source language automatically and return it within\nthe response.",
          "type": "string"
        }
      },
      "type": "object",
      "id": "TranslateTextRequest"
    },
    "TranslationsListResponse": {
      "properties": {
        "translations": {
          "description": "Translations contains list of translation results of given text",
          "type": "array",
          "items": {
            "$ref": "TranslationsResource"
          }
        }
      },
      "description": "The main language translation response message.",
      "type": "object",
      "id": "TranslationsListResponse"
    },
    "DetectionsResource": {
      "id": "DetectionsResource",
      "description": "An array of languages which we detect for the given text The most likely language list first.",
      "items": {
        "type": "object",
        "properties": {
          "confidence": {
            "format": "float",
            "description": "The confidence of the detection result of this language.",
            "type": "number"
          },
          "isReliable": {
            "type": "boolean",
            "description": "A boolean to indicate is the language detection result reliable."
          },
          "language": {
            "type": "string",
            "description": "The language we detected."
          }
        }
      },
      "type": "array"
    }
  },
  "batchPath": "batch/translate",
  "revision": "20170525",
  "baseUrl": "https://translation.googleapis.com/language/translate/",
  "resources": {
    "languages": {
      "methods": {
        "list": {
          "path": "v2/languages",
          "httpMethod": "GET",
          "response": {
            "$ref": "LanguagesListResponse"
          },
          "parameters": {
            "target": {
              "type": "string",
              "description": "The language to use to return localized, human readable names of supported\nlanguages.",
              "location": "query"
            },
            "model": {
              "description": "The model type for which supported languages should be returned.",
              "type": "string",
              "location": "query"
            }
          },
          "description": "Returns a list of supported languages for translation.",
          "id": "language.languages.list",
          "scopes": [
            "https://www.googleapis.com/auth/cloud-translation",
            "https://www.googleapis.com/auth/cloud-platform"
          ]
        }
      }
    },
    "translations": {
      "methods": {
        "translate": {
          "request": {
            "$ref": "TranslateTextRequest"
          },
          "response": {
            "$ref": "TranslationsListResponse"
          },
          "parameterOrder": [],
          "path": "v2",
          "description": "Translates input text, returning translated text.",
          "httpMethod": "POST",
          "parameters": {},
          "id": "language.translations.translate",
          "scopes": [
            "https://www.googleapis.com/auth/cloud-translation",
            "https://www.googleapis.com/auth/cloud-platform"
          ]
        },
        "list": {
          "httpMethod": "GET",
          "parameterOrder": [
            "q",
            "target"
          ],
          "parameters": {
            "cid": {
              "type": "string",
              "location": "query",
              "description": "The customization id for translate",
              "repeated": true
            },
            "model": {
              "location": "query",
              "type": "string",
              "description": "The `model` type requested for this translation. Valid values are\nlisted in public documentation."
            },
            "source": {
              "location": "query",
              "type": "string",
              "description": "The language of the source text, set to one of the language codes listed in\nLanguage Support. If the source language is not specified, the API will\nattempt to identify the source language automatically and return it within\nthe response."
            },
            "q": {
              "type": "string",
              "repeated": true,
              "required": true,
              "description": "The input text to translate. Repeat this parameter to perform translation\noperations on multiple text inputs.",
              "location": "query"
            },
            "target": {
              "description": "The language to use for translation of the input text, set to one of the\nlanguage codes listed in Language Support.",
              "type": "string",
              "location": "query",
              "required": true
            },
            "format": {
              "enum": [
                "html",
                "text"
              ],
              "enumDescriptions": [
                "Specifies the input is in HTML",
                "Specifies the input is in plain textual format"
              ],
              "type": "string",
              "description": "The format of the source text, in either HTML (default) or plain-text. A\nvalue of \"html\" indicates HTML and a value of \"text\" indicates plain-text.",
              "location": "query"
            }
          },
          "description": "Translates input text, returning translated text.",
          "id": "language.translations.list",
          "scopes": [
            "https://www.googleapis.com/auth/cloud-translation",
            "https://www.googleapis.com/auth/cloud-platform"
          ],
          "response": {
            "$ref": "TranslationsListResponse"
          },
          "path": "v2"
        }
      }
    },
    "detections": {
      "methods": {
        "list": {
          "description": "Detects the language of text within a request.",
          "parameters": {
            "q": {
              "location": "query",
              "description": "The input text upon which to perform language detection. Repeat this\nparameter to perform language detection on multiple text inputs.",
              "type": "string",
              "required": true,
              "repeated": true
            }
          },
          "httpMethod": "GET",
          "path": "v2/detect",
          "id": "language.detections.list",
          "parameterOrder": [
            "q"
          ],
          "response": {
            "$ref": "DetectionsListResponse"
          },
          "scopes": [
            "https://www.googleapis.com/auth/cloud-translation",
            "https://www.googleapis.com/auth/cloud-platform"
          ]
        },
        "detect": {
          "response": {
            "$ref": "DetectionsListResponse"
          },
          "parameterOrder": [],
          "scopes": [
            "https://www.googleapis.com/auth/cloud-translation",
            "https://www.googleapis.com/auth/cloud-platform"
          ],
          "description": "Detects the language of text within a request.",
          "id": "language.detections.detect",
          "request": {
            "$ref": "DetectLanguageRequest"
          },
          "parameters": {},
          "httpMethod": "POST",
          "path": "v2/detect"
        }
      }
    }
  },
  "canonicalName": "Translate",
  "title": "Google Cloud Translation API",
  "basePath": "/language/translate/",
  "version": "v2",
  "kind": "discovery#restDescription",
  "features": [
    "dataWrapper"
  ],
  "protocol": "rest",
  "name": "translate",
  "documentationLink": "https://code.google.com/apis/language/translate/v2/getting_started.html",
  "ownerName": "Google",
  "discoveryVersion": "v1",
  "ownerDomain": "google.com"
}
