You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1286 lines
44 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package translate provides access to the Google Cloud Translation API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/translate instead.
  8. //
  9. // For product documentation, see: https://code.google.com/apis/language/translate/v2/getting_started.html
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/translate/v2"
  16. // ...
  17. // ctx := context.Background()
  18. // translateService, err := translate.NewService(ctx)
  19. //
  20. // In this example, Google Application Default Credentials are used for authentication.
  21. //
  22. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  23. //
  24. // Other authentication options
  25. //
  26. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  27. //
  28. // translateService, err := translate.NewService(ctx, option.WithScopes(translate.CloudTranslationScope))
  29. //
  30. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  31. //
  32. // translateService, err := translate.NewService(ctx, option.WithAPIKey("AIza..."))
  33. //
  34. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  35. //
  36. // config := &oauth2.Config{...}
  37. // // ...
  38. // token, err := config.Exchange(ctx, ...)
  39. // translateService, err := translate.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  40. //
  41. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  42. package translate // import "google.golang.org/api/translate/v2"
  43. import (
  44. "bytes"
  45. "context"
  46. "encoding/json"
  47. "errors"
  48. "fmt"
  49. "io"
  50. "net/http"
  51. "net/url"
  52. "strconv"
  53. "strings"
  54. gensupport "google.golang.org/api/gensupport"
  55. googleapi "google.golang.org/api/googleapi"
  56. option "google.golang.org/api/option"
  57. htransport "google.golang.org/api/transport/http"
  58. )
  59. // Always reference these packages, just in case the auto-generated code
  60. // below doesn't.
  61. var _ = bytes.NewBuffer
  62. var _ = strconv.Itoa
  63. var _ = fmt.Sprintf
  64. var _ = json.NewDecoder
  65. var _ = io.Copy
  66. var _ = url.Parse
  67. var _ = gensupport.MarshalJSON
  68. var _ = googleapi.Version
  69. var _ = errors.New
  70. var _ = strings.Replace
  71. var _ = context.Canceled
  72. const apiId = "translate:v2"
  73. const apiName = "translate"
  74. const apiVersion = "v2"
  75. const basePath = "https://translation.googleapis.com/language/translate/"
  76. // OAuth2 scopes used by this API.
  77. const (
  78. // View and manage your data across Google Cloud Platform services
  79. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  80. // Translate text from one language to another using Google Translate
  81. CloudTranslationScope = "https://www.googleapis.com/auth/cloud-translation"
  82. )
  83. // NewService creates a new Service.
  84. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  85. scopesOption := option.WithScopes(
  86. "https://www.googleapis.com/auth/cloud-platform",
  87. "https://www.googleapis.com/auth/cloud-translation",
  88. )
  89. // NOTE: prepend, so we don't override user-specified scopes.
  90. opts = append([]option.ClientOption{scopesOption}, opts...)
  91. client, endpoint, err := htransport.NewClient(ctx, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. s, err := New(client)
  96. if err != nil {
  97. return nil, err
  98. }
  99. if endpoint != "" {
  100. s.BasePath = endpoint
  101. }
  102. return s, nil
  103. }
  104. // New creates a new Service. It uses the provided http.Client for requests.
  105. //
  106. // Deprecated: please use NewService instead.
  107. // To provide a custom HTTP client, use option.WithHTTPClient.
  108. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  109. func New(client *http.Client) (*Service, error) {
  110. if client == nil {
  111. return nil, errors.New("client is nil")
  112. }
  113. s := &Service{client: client, BasePath: basePath}
  114. s.Detections = NewDetectionsService(s)
  115. s.Languages = NewLanguagesService(s)
  116. s.Translations = NewTranslationsService(s)
  117. return s, nil
  118. }
  119. type Service struct {
  120. client *http.Client
  121. BasePath string // API endpoint base URL
  122. UserAgent string // optional additional User-Agent fragment
  123. Detections *DetectionsService
  124. Languages *LanguagesService
  125. Translations *TranslationsService
  126. }
  127. func (s *Service) userAgent() string {
  128. if s.UserAgent == "" {
  129. return googleapi.UserAgent
  130. }
  131. return googleapi.UserAgent + " " + s.UserAgent
  132. }
  133. func NewDetectionsService(s *Service) *DetectionsService {
  134. rs := &DetectionsService{s: s}
  135. return rs
  136. }
  137. type DetectionsService struct {
  138. s *Service
  139. }
  140. func NewLanguagesService(s *Service) *LanguagesService {
  141. rs := &LanguagesService{s: s}
  142. return rs
  143. }
  144. type LanguagesService struct {
  145. s *Service
  146. }
  147. func NewTranslationsService(s *Service) *TranslationsService {
  148. rs := &TranslationsService{s: s}
  149. return rs
  150. }
  151. type TranslationsService struct {
  152. s *Service
  153. }
  154. // DetectLanguageRequest: The request message for language detection.
  155. type DetectLanguageRequest struct {
  156. // Q: The input text upon which to perform language detection. Repeat
  157. // this
  158. // parameter to perform language detection on multiple text inputs.
  159. Q []string `json:"q,omitempty"`
  160. // ForceSendFields is a list of field names (e.g. "Q") to
  161. // unconditionally include in API requests. By default, fields with
  162. // empty values are omitted from API requests. However, any non-pointer,
  163. // non-interface field appearing in ForceSendFields will be sent to the
  164. // server regardless of whether the field is empty or not. This may be
  165. // used to include empty fields in Patch requests.
  166. ForceSendFields []string `json:"-"`
  167. // NullFields is a list of field names (e.g. "Q") to include in API
  168. // requests with the JSON null value. By default, fields with empty
  169. // values are omitted from API requests. However, any field with an
  170. // empty value appearing in NullFields will be sent to the server as
  171. // null. It is an error if a field in this list has a non-empty value.
  172. // This may be used to include null fields in Patch requests.
  173. NullFields []string `json:"-"`
  174. }
  175. func (s *DetectLanguageRequest) MarshalJSON() ([]byte, error) {
  176. type NoMethod DetectLanguageRequest
  177. raw := NoMethod(*s)
  178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  179. }
  180. type DetectionsListResponse struct {
  181. // Detections: A detections contains detection results of several text
  182. Detections [][]*DetectionsResourceItem `json:"detections,omitempty"`
  183. // ServerResponse contains the HTTP response code and headers from the
  184. // server.
  185. googleapi.ServerResponse `json:"-"`
  186. // ForceSendFields is a list of field names (e.g. "Detections") to
  187. // unconditionally include in API requests. By default, fields with
  188. // empty values are omitted from API requests. However, any non-pointer,
  189. // non-interface field appearing in ForceSendFields will be sent to the
  190. // server regardless of whether the field is empty or not. This may be
  191. // used to include empty fields in Patch requests.
  192. ForceSendFields []string `json:"-"`
  193. // NullFields is a list of field names (e.g. "Detections") to include in
  194. // API requests with the JSON null value. By default, fields with empty
  195. // values are omitted from API requests. However, any field with an
  196. // empty value appearing in NullFields will be sent to the server as
  197. // null. It is an error if a field in this list has a non-empty value.
  198. // This may be used to include null fields in Patch requests.
  199. NullFields []string `json:"-"`
  200. }
  201. func (s *DetectionsListResponse) MarshalJSON() ([]byte, error) {
  202. type NoMethod DetectionsListResponse
  203. raw := NoMethod(*s)
  204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  205. }
  206. type DetectionsResourceItem struct {
  207. // Confidence: The confidence of the detection result of this language.
  208. Confidence float64 `json:"confidence,omitempty"`
  209. // IsReliable: A boolean to indicate is the language detection result
  210. // reliable.
  211. IsReliable bool `json:"isReliable,omitempty"`
  212. // Language: The language we detected.
  213. Language string `json:"language,omitempty"`
  214. // ForceSendFields is a list of field names (e.g. "Confidence") to
  215. // unconditionally include in API requests. By default, fields with
  216. // empty values are omitted from API requests. However, any non-pointer,
  217. // non-interface field appearing in ForceSendFields will be sent to the
  218. // server regardless of whether the field is empty or not. This may be
  219. // used to include empty fields in Patch requests.
  220. ForceSendFields []string `json:"-"`
  221. // NullFields is a list of field names (e.g. "Confidence") to include in
  222. // API requests with the JSON null value. By default, fields with empty
  223. // values are omitted from API requests. However, any field with an
  224. // empty value appearing in NullFields will be sent to the server as
  225. // null. It is an error if a field in this list has a non-empty value.
  226. // This may be used to include null fields in Patch requests.
  227. NullFields []string `json:"-"`
  228. }
  229. func (s *DetectionsResourceItem) MarshalJSON() ([]byte, error) {
  230. type NoMethod DetectionsResourceItem
  231. raw := NoMethod(*s)
  232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  233. }
  234. func (s *DetectionsResourceItem) UnmarshalJSON(data []byte) error {
  235. type NoMethod DetectionsResourceItem
  236. var s1 struct {
  237. Confidence gensupport.JSONFloat64 `json:"confidence"`
  238. *NoMethod
  239. }
  240. s1.NoMethod = (*NoMethod)(s)
  241. if err := json.Unmarshal(data, &s1); err != nil {
  242. return err
  243. }
  244. s.Confidence = float64(s1.Confidence)
  245. return nil
  246. }
  247. // GetSupportedLanguagesRequest: The request message for discovering
  248. // supported languages.
  249. type GetSupportedLanguagesRequest struct {
  250. // Target: The language to use to return localized, human readable names
  251. // of supported
  252. // languages.
  253. Target string `json:"target,omitempty"`
  254. // ForceSendFields is a list of field names (e.g. "Target") to
  255. // unconditionally include in API requests. By default, fields with
  256. // empty values are omitted from API requests. However, any non-pointer,
  257. // non-interface field appearing in ForceSendFields will be sent to the
  258. // server regardless of whether the field is empty or not. This may be
  259. // used to include empty fields in Patch requests.
  260. ForceSendFields []string `json:"-"`
  261. // NullFields is a list of field names (e.g. "Target") to include in API
  262. // requests with the JSON null value. By default, fields with empty
  263. // values are omitted from API requests. However, any field with an
  264. // empty value appearing in NullFields will be sent to the server as
  265. // null. It is an error if a field in this list has a non-empty value.
  266. // This may be used to include null fields in Patch requests.
  267. NullFields []string `json:"-"`
  268. }
  269. func (s *GetSupportedLanguagesRequest) MarshalJSON() ([]byte, error) {
  270. type NoMethod GetSupportedLanguagesRequest
  271. raw := NoMethod(*s)
  272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  273. }
  274. type LanguagesListResponse struct {
  275. // Languages: List of source/target languages supported by the
  276. // translation API. If target parameter is unspecified, the list is
  277. // sorted by the ASCII code point order of the language code. If target
  278. // parameter is specified, the list is sorted by the collation order of
  279. // the language name in the target language.
  280. Languages []*LanguagesResource `json:"languages,omitempty"`
  281. // ServerResponse contains the HTTP response code and headers from the
  282. // server.
  283. googleapi.ServerResponse `json:"-"`
  284. // ForceSendFields is a list of field names (e.g. "Languages") to
  285. // unconditionally include in API requests. By default, fields with
  286. // empty values are omitted from API requests. However, any non-pointer,
  287. // non-interface field appearing in ForceSendFields will be sent to the
  288. // server regardless of whether the field is empty or not. This may be
  289. // used to include empty fields in Patch requests.
  290. ForceSendFields []string `json:"-"`
  291. // NullFields is a list of field names (e.g. "Languages") to include in
  292. // API requests with the JSON null value. By default, fields with empty
  293. // values are omitted from API requests. However, any field with an
  294. // empty value appearing in NullFields will be sent to the server as
  295. // null. It is an error if a field in this list has a non-empty value.
  296. // This may be used to include null fields in Patch requests.
  297. NullFields []string `json:"-"`
  298. }
  299. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  300. type NoMethod LanguagesListResponse
  301. raw := NoMethod(*s)
  302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  303. }
  304. type LanguagesResource struct {
  305. // Language: Supported language code, generally consisting of its ISO
  306. // 639-1
  307. // identifier. (E.g. 'en', 'ja'). In certain cases, BCP-47 codes
  308. // including
  309. // language + region identifiers are returned (e.g. 'zh-TW' and 'zh-CH')
  310. Language string `json:"language,omitempty"`
  311. // Name: Human readable name of the language localized to the target
  312. // language.
  313. Name string `json:"name,omitempty"`
  314. // ForceSendFields is a list of field names (e.g. "Language") to
  315. // unconditionally include in API requests. By default, fields with
  316. // empty values are omitted from API requests. However, any non-pointer,
  317. // non-interface field appearing in ForceSendFields will be sent to the
  318. // server regardless of whether the field is empty or not. This may be
  319. // used to include empty fields in Patch requests.
  320. ForceSendFields []string `json:"-"`
  321. // NullFields is a list of field names (e.g. "Language") to include in
  322. // API requests with the JSON null value. By default, fields with empty
  323. // values are omitted from API requests. However, any field with an
  324. // empty value appearing in NullFields will be sent to the server as
  325. // null. It is an error if a field in this list has a non-empty value.
  326. // This may be used to include null fields in Patch requests.
  327. NullFields []string `json:"-"`
  328. }
  329. func (s *LanguagesResource) MarshalJSON() ([]byte, error) {
  330. type NoMethod LanguagesResource
  331. raw := NoMethod(*s)
  332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  333. }
  334. // TranslateTextRequest: The main translation request message for the
  335. // Cloud Translation API.
  336. type TranslateTextRequest struct {
  337. // Format: The format of the source text, in either HTML (default) or
  338. // plain-text. A
  339. // value of "html" indicates HTML and a value of "text" indicates
  340. // plain-text.
  341. Format string `json:"format,omitempty"`
  342. // Model: The `model` type requested for this translation. Valid values
  343. // are
  344. // listed in public documentation.
  345. Model string `json:"model,omitempty"`
  346. // Q: The input text to translate. Repeat this parameter to perform
  347. // translation
  348. // operations on multiple text inputs.
  349. Q []string `json:"q,omitempty"`
  350. // Source: The language of the source text, set to one of the language
  351. // codes listed in
  352. // Language Support. If the source language is not specified, the API
  353. // will
  354. // attempt to identify the source language automatically and return it
  355. // within
  356. // the response.
  357. Source string `json:"source,omitempty"`
  358. // Target: The language to use for translation of the input text, set to
  359. // one of the
  360. // language codes listed in Language Support.
  361. Target string `json:"target,omitempty"`
  362. // ForceSendFields is a list of field names (e.g. "Format") to
  363. // unconditionally include in API requests. By default, fields with
  364. // empty values are omitted from API requests. However, any non-pointer,
  365. // non-interface field appearing in ForceSendFields will be sent to the
  366. // server regardless of whether the field is empty or not. This may be
  367. // used to include empty fields in Patch requests.
  368. ForceSendFields []string `json:"-"`
  369. // NullFields is a list of field names (e.g. "Format") to include in API
  370. // requests with the JSON null value. By default, fields with empty
  371. // values are omitted from API requests. However, any field with an
  372. // empty value appearing in NullFields will be sent to the server as
  373. // null. It is an error if a field in this list has a non-empty value.
  374. // This may be used to include null fields in Patch requests.
  375. NullFields []string `json:"-"`
  376. }
  377. func (s *TranslateTextRequest) MarshalJSON() ([]byte, error) {
  378. type NoMethod TranslateTextRequest
  379. raw := NoMethod(*s)
  380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  381. }
  382. // TranslationsListResponse: The main language translation response
  383. // message.
  384. type TranslationsListResponse struct {
  385. // Translations: Translations contains list of translation results of
  386. // given text
  387. Translations []*TranslationsResource `json:"translations,omitempty"`
  388. // ServerResponse contains the HTTP response code and headers from the
  389. // server.
  390. googleapi.ServerResponse `json:"-"`
  391. // ForceSendFields is a list of field names (e.g. "Translations") to
  392. // unconditionally include in API requests. By default, fields with
  393. // empty values are omitted from API requests. However, any non-pointer,
  394. // non-interface field appearing in ForceSendFields will be sent to the
  395. // server regardless of whether the field is empty or not. This may be
  396. // used to include empty fields in Patch requests.
  397. ForceSendFields []string `json:"-"`
  398. // NullFields is a list of field names (e.g. "Translations") to include
  399. // in API requests with the JSON null value. By default, fields with
  400. // empty values are omitted from API requests. However, any field with
  401. // an empty value appearing in NullFields will be sent to the server as
  402. // null. It is an error if a field in this list has a non-empty value.
  403. // This may be used to include null fields in Patch requests.
  404. NullFields []string `json:"-"`
  405. }
  406. func (s *TranslationsListResponse) MarshalJSON() ([]byte, error) {
  407. type NoMethod TranslationsListResponse
  408. raw := NoMethod(*s)
  409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  410. }
  411. type TranslationsResource struct {
  412. // DetectedSourceLanguage: The source language of the initial request,
  413. // detected automatically, if
  414. // no source language was passed within the initial request. If
  415. // the
  416. // source language was passed, auto-detection of the language will
  417. // not
  418. // occur and this field will be empty.
  419. DetectedSourceLanguage string `json:"detectedSourceLanguage,omitempty"`
  420. // Model: The `model` type used for this translation. Valid values
  421. // are
  422. // listed in public documentation. Can be different from requested
  423. // `model`.
  424. // Present only if specific model type was explicitly requested.
  425. Model string `json:"model,omitempty"`
  426. // TranslatedText: Text translated into the target language.
  427. TranslatedText string `json:"translatedText,omitempty"`
  428. // ForceSendFields is a list of field names (e.g.
  429. // "DetectedSourceLanguage") to unconditionally include in API requests.
  430. // By default, fields with empty values are omitted from API requests.
  431. // However, any non-pointer, non-interface field appearing in
  432. // ForceSendFields will be sent to the server regardless of whether the
  433. // field is empty or not. This may be used to include empty fields in
  434. // Patch requests.
  435. ForceSendFields []string `json:"-"`
  436. // NullFields is a list of field names (e.g. "DetectedSourceLanguage")
  437. // to include in API requests with the JSON null value. By default,
  438. // fields with empty values are omitted from API requests. However, any
  439. // field with an empty value appearing in NullFields will be sent to the
  440. // server as null. It is an error if a field in this list has a
  441. // non-empty value. This may be used to include null fields in Patch
  442. // requests.
  443. NullFields []string `json:"-"`
  444. }
  445. func (s *TranslationsResource) MarshalJSON() ([]byte, error) {
  446. type NoMethod TranslationsResource
  447. raw := NoMethod(*s)
  448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  449. }
  450. // method id "language.detections.detect":
  451. type DetectionsDetectCall struct {
  452. s *Service
  453. detectlanguagerequest *DetectLanguageRequest
  454. urlParams_ gensupport.URLParams
  455. ctx_ context.Context
  456. header_ http.Header
  457. }
  458. // Detect: Detects the language of text within a request.
  459. func (r *DetectionsService) Detect(detectlanguagerequest *DetectLanguageRequest) *DetectionsDetectCall {
  460. c := &DetectionsDetectCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  461. c.detectlanguagerequest = detectlanguagerequest
  462. return c
  463. }
  464. // Fields allows partial responses to be retrieved. See
  465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  466. // for more information.
  467. func (c *DetectionsDetectCall) Fields(s ...googleapi.Field) *DetectionsDetectCall {
  468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  469. return c
  470. }
  471. // Context sets the context to be used in this call's Do method. Any
  472. // pending HTTP request will be aborted if the provided context is
  473. // canceled.
  474. func (c *DetectionsDetectCall) Context(ctx context.Context) *DetectionsDetectCall {
  475. c.ctx_ = ctx
  476. return c
  477. }
  478. // Header returns an http.Header that can be modified by the caller to
  479. // add HTTP headers to the request.
  480. func (c *DetectionsDetectCall) Header() http.Header {
  481. if c.header_ == nil {
  482. c.header_ = make(http.Header)
  483. }
  484. return c.header_
  485. }
  486. func (c *DetectionsDetectCall) doRequest(alt string) (*http.Response, error) {
  487. reqHeaders := make(http.Header)
  488. for k, v := range c.header_ {
  489. reqHeaders[k] = v
  490. }
  491. reqHeaders.Set("User-Agent", c.s.userAgent())
  492. var body io.Reader = nil
  493. body, err := googleapi.WithDataWrapper.JSONReader(c.detectlanguagerequest)
  494. if err != nil {
  495. return nil, err
  496. }
  497. reqHeaders.Set("Content-Type", "application/json")
  498. c.urlParams_.Set("alt", alt)
  499. c.urlParams_.Set("prettyPrint", "false")
  500. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/detect")
  501. urls += "?" + c.urlParams_.Encode()
  502. req, err := http.NewRequest("POST", urls, body)
  503. if err != nil {
  504. return nil, err
  505. }
  506. req.Header = reqHeaders
  507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  508. }
  509. // Do executes the "language.detections.detect" call.
  510. // Exactly one of *DetectionsListResponse or error will be non-nil. Any
  511. // non-2xx status code is an error. Response headers are in either
  512. // *DetectionsListResponse.ServerResponse.Header or (if a response was
  513. // returned at all) in error.(*googleapi.Error).Header. Use
  514. // googleapi.IsNotModified to check whether the returned error was
  515. // because http.StatusNotModified was returned.
  516. func (c *DetectionsDetectCall) Do(opts ...googleapi.CallOption) (*DetectionsListResponse, error) {
  517. gensupport.SetOptions(c.urlParams_, opts...)
  518. res, err := c.doRequest("json")
  519. if res != nil && res.StatusCode == http.StatusNotModified {
  520. if res.Body != nil {
  521. res.Body.Close()
  522. }
  523. return nil, &googleapi.Error{
  524. Code: res.StatusCode,
  525. Header: res.Header,
  526. }
  527. }
  528. if err != nil {
  529. return nil, err
  530. }
  531. defer googleapi.CloseBody(res)
  532. if err := googleapi.CheckResponse(res); err != nil {
  533. return nil, err
  534. }
  535. ret := &DetectionsListResponse{
  536. ServerResponse: googleapi.ServerResponse{
  537. Header: res.Header,
  538. HTTPStatusCode: res.StatusCode,
  539. },
  540. }
  541. target := &struct {
  542. Data *DetectionsListResponse `json:"data"`
  543. }{ret}
  544. if err := gensupport.DecodeResponse(target, res); err != nil {
  545. return nil, err
  546. }
  547. return ret, nil
  548. // {
  549. // "description": "Detects the language of text within a request.",
  550. // "httpMethod": "POST",
  551. // "id": "language.detections.detect",
  552. // "parameterOrder": [],
  553. // "parameters": {},
  554. // "path": "v2/detect",
  555. // "request": {
  556. // "$ref": "DetectLanguageRequest"
  557. // },
  558. // "response": {
  559. // "$ref": "DetectionsListResponse"
  560. // },
  561. // "scopes": [
  562. // "https://www.googleapis.com/auth/cloud-translation",
  563. // "https://www.googleapis.com/auth/cloud-platform"
  564. // ]
  565. // }
  566. }
  567. // method id "language.detections.list":
  568. type DetectionsListCall struct {
  569. s *Service
  570. urlParams_ gensupport.URLParams
  571. ifNoneMatch_ string
  572. ctx_ context.Context
  573. header_ http.Header
  574. }
  575. // List: Detects the language of text within a request.
  576. func (r *DetectionsService) List(q []string) *DetectionsListCall {
  577. c := &DetectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  578. c.urlParams_.SetMulti("q", append([]string{}, q...))
  579. return c
  580. }
  581. // Fields allows partial responses to be retrieved. See
  582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  583. // for more information.
  584. func (c *DetectionsListCall) Fields(s ...googleapi.Field) *DetectionsListCall {
  585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  586. return c
  587. }
  588. // IfNoneMatch sets the optional parameter which makes the operation
  589. // fail if the object's ETag matches the given value. This is useful for
  590. // getting updates only after the object has changed since the last
  591. // request. Use googleapi.IsNotModified to check whether the response
  592. // error from Do is the result of In-None-Match.
  593. func (c *DetectionsListCall) IfNoneMatch(entityTag string) *DetectionsListCall {
  594. c.ifNoneMatch_ = entityTag
  595. return c
  596. }
  597. // Context sets the context to be used in this call's Do method. Any
  598. // pending HTTP request will be aborted if the provided context is
  599. // canceled.
  600. func (c *DetectionsListCall) Context(ctx context.Context) *DetectionsListCall {
  601. c.ctx_ = ctx
  602. return c
  603. }
  604. // Header returns an http.Header that can be modified by the caller to
  605. // add HTTP headers to the request.
  606. func (c *DetectionsListCall) Header() http.Header {
  607. if c.header_ == nil {
  608. c.header_ = make(http.Header)
  609. }
  610. return c.header_
  611. }
  612. func (c *DetectionsListCall) doRequest(alt string) (*http.Response, error) {
  613. reqHeaders := make(http.Header)
  614. for k, v := range c.header_ {
  615. reqHeaders[k] = v
  616. }
  617. reqHeaders.Set("User-Agent", c.s.userAgent())
  618. if c.ifNoneMatch_ != "" {
  619. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  620. }
  621. var body io.Reader = nil
  622. c.urlParams_.Set("alt", alt)
  623. c.urlParams_.Set("prettyPrint", "false")
  624. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/detect")
  625. urls += "?" + c.urlParams_.Encode()
  626. req, err := http.NewRequest("GET", urls, body)
  627. if err != nil {
  628. return nil, err
  629. }
  630. req.Header = reqHeaders
  631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  632. }
  633. // Do executes the "language.detections.list" call.
  634. // Exactly one of *DetectionsListResponse or error will be non-nil. Any
  635. // non-2xx status code is an error. Response headers are in either
  636. // *DetectionsListResponse.ServerResponse.Header or (if a response was
  637. // returned at all) in error.(*googleapi.Error).Header. Use
  638. // googleapi.IsNotModified to check whether the returned error was
  639. // because http.StatusNotModified was returned.
  640. func (c *DetectionsListCall) Do(opts ...googleapi.CallOption) (*DetectionsListResponse, error) {
  641. gensupport.SetOptions(c.urlParams_, opts...)
  642. res, err := c.doRequest("json")
  643. if res != nil && res.StatusCode == http.StatusNotModified {
  644. if res.Body != nil {
  645. res.Body.Close()
  646. }
  647. return nil, &googleapi.Error{
  648. Code: res.StatusCode,
  649. Header: res.Header,
  650. }
  651. }
  652. if err != nil {
  653. return nil, err
  654. }
  655. defer googleapi.CloseBody(res)
  656. if err := googleapi.CheckResponse(res); err != nil {
  657. return nil, err
  658. }
  659. ret := &DetectionsListResponse{
  660. ServerResponse: googleapi.ServerResponse{
  661. Header: res.Header,
  662. HTTPStatusCode: res.StatusCode,
  663. },
  664. }
  665. target := &struct {
  666. Data *DetectionsListResponse `json:"data"`
  667. }{ret}
  668. if err := gensupport.DecodeResponse(target, res); err != nil {
  669. return nil, err
  670. }
  671. return ret, nil
  672. // {
  673. // "description": "Detects the language of text within a request.",
  674. // "httpMethod": "GET",
  675. // "id": "language.detections.list",
  676. // "parameterOrder": [
  677. // "q"
  678. // ],
  679. // "parameters": {
  680. // "q": {
  681. // "description": "The input text upon which to perform language detection. Repeat this\nparameter to perform language detection on multiple text inputs.",
  682. // "location": "query",
  683. // "repeated": true,
  684. // "required": true,
  685. // "type": "string"
  686. // }
  687. // },
  688. // "path": "v2/detect",
  689. // "response": {
  690. // "$ref": "DetectionsListResponse"
  691. // },
  692. // "scopes": [
  693. // "https://www.googleapis.com/auth/cloud-translation",
  694. // "https://www.googleapis.com/auth/cloud-platform"
  695. // ]
  696. // }
  697. }
  698. // method id "language.languages.list":
  699. type LanguagesListCall struct {
  700. s *Service
  701. urlParams_ gensupport.URLParams
  702. ifNoneMatch_ string
  703. ctx_ context.Context
  704. header_ http.Header
  705. }
  706. // List: Returns a list of supported languages for translation.
  707. func (r *LanguagesService) List() *LanguagesListCall {
  708. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  709. return c
  710. }
  711. // Model sets the optional parameter "model": The model type for which
  712. // supported languages should be returned.
  713. func (c *LanguagesListCall) Model(model string) *LanguagesListCall {
  714. c.urlParams_.Set("model", model)
  715. return c
  716. }
  717. // Target sets the optional parameter "target": The language to use to
  718. // return localized, human readable names of supported
  719. // languages.
  720. func (c *LanguagesListCall) Target(target string) *LanguagesListCall {
  721. c.urlParams_.Set("target", target)
  722. return c
  723. }
  724. // Fields allows partial responses to be retrieved. See
  725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  726. // for more information.
  727. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  729. return c
  730. }
  731. // IfNoneMatch sets the optional parameter which makes the operation
  732. // fail if the object's ETag matches the given value. This is useful for
  733. // getting updates only after the object has changed since the last
  734. // request. Use googleapi.IsNotModified to check whether the response
  735. // error from Do is the result of In-None-Match.
  736. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  737. c.ifNoneMatch_ = entityTag
  738. return c
  739. }
  740. // Context sets the context to be used in this call's Do method. Any
  741. // pending HTTP request will be aborted if the provided context is
  742. // canceled.
  743. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  744. c.ctx_ = ctx
  745. return c
  746. }
  747. // Header returns an http.Header that can be modified by the caller to
  748. // add HTTP headers to the request.
  749. func (c *LanguagesListCall) Header() http.Header {
  750. if c.header_ == nil {
  751. c.header_ = make(http.Header)
  752. }
  753. return c.header_
  754. }
  755. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  756. reqHeaders := make(http.Header)
  757. for k, v := range c.header_ {
  758. reqHeaders[k] = v
  759. }
  760. reqHeaders.Set("User-Agent", c.s.userAgent())
  761. if c.ifNoneMatch_ != "" {
  762. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  763. }
  764. var body io.Reader = nil
  765. c.urlParams_.Set("alt", alt)
  766. c.urlParams_.Set("prettyPrint", "false")
  767. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/languages")
  768. urls += "?" + c.urlParams_.Encode()
  769. req, err := http.NewRequest("GET", urls, body)
  770. if err != nil {
  771. return nil, err
  772. }
  773. req.Header = reqHeaders
  774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  775. }
  776. // Do executes the "language.languages.list" call.
  777. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  778. // non-2xx status code is an error. Response headers are in either
  779. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  780. // returned at all) in error.(*googleapi.Error).Header. Use
  781. // googleapi.IsNotModified to check whether the returned error was
  782. // because http.StatusNotModified was returned.
  783. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  784. gensupport.SetOptions(c.urlParams_, opts...)
  785. res, err := c.doRequest("json")
  786. if res != nil && res.StatusCode == http.StatusNotModified {
  787. if res.Body != nil {
  788. res.Body.Close()
  789. }
  790. return nil, &googleapi.Error{
  791. Code: res.StatusCode,
  792. Header: res.Header,
  793. }
  794. }
  795. if err != nil {
  796. return nil, err
  797. }
  798. defer googleapi.CloseBody(res)
  799. if err := googleapi.CheckResponse(res); err != nil {
  800. return nil, err
  801. }
  802. ret := &LanguagesListResponse{
  803. ServerResponse: googleapi.ServerResponse{
  804. Header: res.Header,
  805. HTTPStatusCode: res.StatusCode,
  806. },
  807. }
  808. target := &struct {
  809. Data *LanguagesListResponse `json:"data"`
  810. }{ret}
  811. if err := gensupport.DecodeResponse(target, res); err != nil {
  812. return nil, err
  813. }
  814. return ret, nil
  815. // {
  816. // "description": "Returns a list of supported languages for translation.",
  817. // "httpMethod": "GET",
  818. // "id": "language.languages.list",
  819. // "parameters": {
  820. // "model": {
  821. // "description": "The model type for which supported languages should be returned.",
  822. // "location": "query",
  823. // "type": "string"
  824. // },
  825. // "target": {
  826. // "description": "The language to use to return localized, human readable names of supported\nlanguages.",
  827. // "location": "query",
  828. // "type": "string"
  829. // }
  830. // },
  831. // "path": "v2/languages",
  832. // "response": {
  833. // "$ref": "LanguagesListResponse"
  834. // },
  835. // "scopes": [
  836. // "https://www.googleapis.com/auth/cloud-translation",
  837. // "https://www.googleapis.com/auth/cloud-platform"
  838. // ]
  839. // }
  840. }
  841. // method id "language.translations.list":
  842. type TranslationsListCall struct {
  843. s *Service
  844. urlParams_ gensupport.URLParams
  845. ifNoneMatch_ string
  846. ctx_ context.Context
  847. header_ http.Header
  848. }
  849. // List: Translates input text, returning translated text.
  850. func (r *TranslationsService) List(q []string, target string) *TranslationsListCall {
  851. c := &TranslationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  852. c.urlParams_.SetMulti("q", append([]string{}, q...))
  853. c.urlParams_.Set("target", target)
  854. return c
  855. }
  856. // Cid sets the optional parameter "cid": The customization id for
  857. // translate
  858. func (c *TranslationsListCall) Cid(cid ...string) *TranslationsListCall {
  859. c.urlParams_.SetMulti("cid", append([]string{}, cid...))
  860. return c
  861. }
  862. // Format sets the optional parameter "format": The format of the source
  863. // text, in either HTML (default) or plain-text. A
  864. // value of "html" indicates HTML and a value of "text" indicates
  865. // plain-text.
  866. //
  867. // Possible values:
  868. // "html" - Specifies the input is in HTML
  869. // "text" - Specifies the input is in plain textual format
  870. func (c *TranslationsListCall) Format(format string) *TranslationsListCall {
  871. c.urlParams_.Set("format", format)
  872. return c
  873. }
  874. // Model sets the optional parameter "model": The `model` type requested
  875. // for this translation. Valid values are
  876. // listed in public documentation.
  877. func (c *TranslationsListCall) Model(model string) *TranslationsListCall {
  878. c.urlParams_.Set("model", model)
  879. return c
  880. }
  881. // Source sets the optional parameter "source": The language of the
  882. // source text, set to one of the language codes listed in
  883. // Language Support. If the source language is not specified, the API
  884. // will
  885. // attempt to identify the source language automatically and return it
  886. // within
  887. // the response.
  888. func (c *TranslationsListCall) Source(source string) *TranslationsListCall {
  889. c.urlParams_.Set("source", source)
  890. return c
  891. }
  892. // Fields allows partial responses to be retrieved. See
  893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  894. // for more information.
  895. func (c *TranslationsListCall) Fields(s ...googleapi.Field) *TranslationsListCall {
  896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  897. return c
  898. }
  899. // IfNoneMatch sets the optional parameter which makes the operation
  900. // fail if the object's ETag matches the given value. This is useful for
  901. // getting updates only after the object has changed since the last
  902. // request. Use googleapi.IsNotModified to check whether the response
  903. // error from Do is the result of In-None-Match.
  904. func (c *TranslationsListCall) IfNoneMatch(entityTag string) *TranslationsListCall {
  905. c.ifNoneMatch_ = entityTag
  906. return c
  907. }
  908. // Context sets the context to be used in this call's Do method. Any
  909. // pending HTTP request will be aborted if the provided context is
  910. // canceled.
  911. func (c *TranslationsListCall) Context(ctx context.Context) *TranslationsListCall {
  912. c.ctx_ = ctx
  913. return c
  914. }
  915. // Header returns an http.Header that can be modified by the caller to
  916. // add HTTP headers to the request.
  917. func (c *TranslationsListCall) Header() http.Header {
  918. if c.header_ == nil {
  919. c.header_ = make(http.Header)
  920. }
  921. return c.header_
  922. }
  923. func (c *TranslationsListCall) doRequest(alt string) (*http.Response, error) {
  924. reqHeaders := make(http.Header)
  925. for k, v := range c.header_ {
  926. reqHeaders[k] = v
  927. }
  928. reqHeaders.Set("User-Agent", c.s.userAgent())
  929. if c.ifNoneMatch_ != "" {
  930. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  931. }
  932. var body io.Reader = nil
  933. c.urlParams_.Set("alt", alt)
  934. c.urlParams_.Set("prettyPrint", "false")
  935. urls := googleapi.ResolveRelative(c.s.BasePath, "v2")
  936. urls += "?" + c.urlParams_.Encode()
  937. req, err := http.NewRequest("GET", urls, body)
  938. if err != nil {
  939. return nil, err
  940. }
  941. req.Header = reqHeaders
  942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  943. }
  944. // Do executes the "language.translations.list" call.
  945. // Exactly one of *TranslationsListResponse or error will be non-nil.
  946. // Any non-2xx status code is an error. Response headers are in either
  947. // *TranslationsListResponse.ServerResponse.Header or (if a response was
  948. // returned at all) in error.(*googleapi.Error).Header. Use
  949. // googleapi.IsNotModified to check whether the returned error was
  950. // because http.StatusNotModified was returned.
  951. func (c *TranslationsListCall) Do(opts ...googleapi.CallOption) (*TranslationsListResponse, error) {
  952. gensupport.SetOptions(c.urlParams_, opts...)
  953. res, err := c.doRequest("json")
  954. if res != nil && res.StatusCode == http.StatusNotModified {
  955. if res.Body != nil {
  956. res.Body.Close()
  957. }
  958. return nil, &googleapi.Error{
  959. Code: res.StatusCode,
  960. Header: res.Header,
  961. }
  962. }
  963. if err != nil {
  964. return nil, err
  965. }
  966. defer googleapi.CloseBody(res)
  967. if err := googleapi.CheckResponse(res); err != nil {
  968. return nil, err
  969. }
  970. ret := &TranslationsListResponse{
  971. ServerResponse: googleapi.ServerResponse{
  972. Header: res.Header,
  973. HTTPStatusCode: res.StatusCode,
  974. },
  975. }
  976. target := &struct {
  977. Data *TranslationsListResponse `json:"data"`
  978. }{ret}
  979. if err := gensupport.DecodeResponse(target, res); err != nil {
  980. return nil, err
  981. }
  982. return ret, nil
  983. // {
  984. // "description": "Translates input text, returning translated text.",
  985. // "httpMethod": "GET",
  986. // "id": "language.translations.list",
  987. // "parameterOrder": [
  988. // "q",
  989. // "target"
  990. // ],
  991. // "parameters": {
  992. // "cid": {
  993. // "description": "The customization id for translate",
  994. // "location": "query",
  995. // "repeated": true,
  996. // "type": "string"
  997. // },
  998. // "format": {
  999. // "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.",
  1000. // "enum": [
  1001. // "html",
  1002. // "text"
  1003. // ],
  1004. // "enumDescriptions": [
  1005. // "Specifies the input is in HTML",
  1006. // "Specifies the input is in plain textual format"
  1007. // ],
  1008. // "location": "query",
  1009. // "type": "string"
  1010. // },
  1011. // "model": {
  1012. // "description": "The `model` type requested for this translation. Valid values are\nlisted in public documentation.",
  1013. // "location": "query",
  1014. // "type": "string"
  1015. // },
  1016. // "q": {
  1017. // "description": "The input text to translate. Repeat this parameter to perform translation\noperations on multiple text inputs.",
  1018. // "location": "query",
  1019. // "repeated": true,
  1020. // "required": true,
  1021. // "type": "string"
  1022. // },
  1023. // "source": {
  1024. // "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.",
  1025. // "location": "query",
  1026. // "type": "string"
  1027. // },
  1028. // "target": {
  1029. // "description": "The language to use for translation of the input text, set to one of the\nlanguage codes listed in Language Support.",
  1030. // "location": "query",
  1031. // "required": true,
  1032. // "type": "string"
  1033. // }
  1034. // },
  1035. // "path": "v2",
  1036. // "response": {
  1037. // "$ref": "TranslationsListResponse"
  1038. // },
  1039. // "scopes": [
  1040. // "https://www.googleapis.com/auth/cloud-translation",
  1041. // "https://www.googleapis.com/auth/cloud-platform"
  1042. // ]
  1043. // }
  1044. }
  1045. // method id "language.translations.translate":
  1046. type TranslationsTranslateCall struct {
  1047. s *Service
  1048. translatetextrequest *TranslateTextRequest
  1049. urlParams_ gensupport.URLParams
  1050. ctx_ context.Context
  1051. header_ http.Header
  1052. }
  1053. // Translate: Translates input text, returning translated text.
  1054. func (r *TranslationsService) Translate(translatetextrequest *TranslateTextRequest) *TranslationsTranslateCall {
  1055. c := &TranslationsTranslateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1056. c.translatetextrequest = translatetextrequest
  1057. return c
  1058. }
  1059. // Fields allows partial responses to be retrieved. See
  1060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1061. // for more information.
  1062. func (c *TranslationsTranslateCall) Fields(s ...googleapi.Field) *TranslationsTranslateCall {
  1063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1064. return c
  1065. }
  1066. // Context sets the context to be used in this call's Do method. Any
  1067. // pending HTTP request will be aborted if the provided context is
  1068. // canceled.
  1069. func (c *TranslationsTranslateCall) Context(ctx context.Context) *TranslationsTranslateCall {
  1070. c.ctx_ = ctx
  1071. return c
  1072. }
  1073. // Header returns an http.Header that can be modified by the caller to
  1074. // add HTTP headers to the request.
  1075. func (c *TranslationsTranslateCall) Header() http.Header {
  1076. if c.header_ == nil {
  1077. c.header_ = make(http.Header)
  1078. }
  1079. return c.header_
  1080. }
  1081. func (c *TranslationsTranslateCall) doRequest(alt string) (*http.Response, error) {
  1082. reqHeaders := make(http.Header)
  1083. for k, v := range c.header_ {
  1084. reqHeaders[k] = v
  1085. }
  1086. reqHeaders.Set("User-Agent", c.s.userAgent())
  1087. var body io.Reader = nil
  1088. body, err := googleapi.WithDataWrapper.JSONReader(c.translatetextrequest)
  1089. if err != nil {
  1090. return nil, err
  1091. }
  1092. reqHeaders.Set("Content-Type", "application/json")
  1093. c.urlParams_.Set("alt", alt)
  1094. c.urlParams_.Set("prettyPrint", "false")
  1095. urls := googleapi.ResolveRelative(c.s.BasePath, "v2")
  1096. urls += "?" + c.urlParams_.Encode()
  1097. req, err := http.NewRequest("POST", urls, body)
  1098. if err != nil {
  1099. return nil, err
  1100. }
  1101. req.Header = reqHeaders
  1102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1103. }
  1104. // Do executes the "language.translations.translate" call.
  1105. // Exactly one of *TranslationsListResponse or error will be non-nil.
  1106. // Any non-2xx status code is an error. Response headers are in either
  1107. // *TranslationsListResponse.ServerResponse.Header or (if a response was
  1108. // returned at all) in error.(*googleapi.Error).Header. Use
  1109. // googleapi.IsNotModified to check whether the returned error was
  1110. // because http.StatusNotModified was returned.
  1111. func (c *TranslationsTranslateCall) Do(opts ...googleapi.CallOption) (*TranslationsListResponse, error) {
  1112. gensupport.SetOptions(c.urlParams_, opts...)
  1113. res, err := c.doRequest("json")
  1114. if res != nil && res.StatusCode == http.StatusNotModified {
  1115. if res.Body != nil {
  1116. res.Body.Close()
  1117. }
  1118. return nil, &googleapi.Error{
  1119. Code: res.StatusCode,
  1120. Header: res.Header,
  1121. }
  1122. }
  1123. if err != nil {
  1124. return nil, err
  1125. }
  1126. defer googleapi.CloseBody(res)
  1127. if err := googleapi.CheckResponse(res); err != nil {
  1128. return nil, err
  1129. }
  1130. ret := &TranslationsListResponse{
  1131. ServerResponse: googleapi.ServerResponse{
  1132. Header: res.Header,
  1133. HTTPStatusCode: res.StatusCode,
  1134. },
  1135. }
  1136. target := &struct {
  1137. Data *TranslationsListResponse `json:"data"`
  1138. }{ret}
  1139. if err := gensupport.DecodeResponse(target, res); err != nil {
  1140. return nil, err
  1141. }
  1142. return ret, nil
  1143. // {
  1144. // "description": "Translates input text, returning translated text.",
  1145. // "httpMethod": "POST",
  1146. // "id": "language.translations.translate",
  1147. // "parameterOrder": [],
  1148. // "parameters": {},
  1149. // "path": "v2",
  1150. // "request": {
  1151. // "$ref": "TranslateTextRequest"
  1152. // },
  1153. // "response": {
  1154. // "$ref": "TranslationsListResponse"
  1155. // },
  1156. // "scopes": [
  1157. // "https://www.googleapis.com/auth/cloud-translation",
  1158. // "https://www.googleapis.com/auth/cloud-platform"
  1159. // ]
  1160. // }
  1161. }