I am using the Google API Discovery service to access the natural language API.
Everything works well for the natural language API v1 and v1beta2. Unfortunately if I try to use it with v2 it does not work because the API is unknown
UnknownApiNameOrVersion: name: language version: v2
Can you share more details how to use v2 of that API.
{
"kind": "discovery#directoryItem",
"id": "language:v2",
"name": "language",
"version": "v2",
"title": "Cloud Natural Language API",
"description": "Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers.",
"discoveryRestUrl": "https://language.googleapis.com/$discovery/rest?version=v2",
"icons": {
"x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
"x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
},
"documentationLink": "https://cloud.google.com/natural-language/",
"preferred": true
}
But when I run discovery.build(‘language’, ‘v2’, credentials) it fails with the error message mentioned above. It works for ‘v1’ and ‘v1beta2’. So for some reason v2 of that API is not available via discovery.build.