translate-gen.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. // Package translate provides access to the Translate API.
  2. //
  3. // See https://developers.google.com/translate/v2/using_rest
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/translate/v2"
  8. // ...
  9. // translateService, err := translate.New(oauthHttpClient)
  10. package translate // import "google.golang.org/api/translate/v2"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "translate:v2"
  41. const apiName = "translate"
  42. const apiVersion = "v2"
  43. const basePath = "https://www.googleapis.com/language/translate/"
  44. func New(client *http.Client) (*Service, error) {
  45. if client == nil {
  46. return nil, errors.New("client is nil")
  47. }
  48. s := &Service{client: client, BasePath: basePath}
  49. s.Detections = NewDetectionsService(s)
  50. s.Languages = NewLanguagesService(s)
  51. s.Translations = NewTranslationsService(s)
  52. return s, nil
  53. }
  54. type Service struct {
  55. client *http.Client
  56. BasePath string // API endpoint base URL
  57. UserAgent string // optional additional User-Agent fragment
  58. Detections *DetectionsService
  59. Languages *LanguagesService
  60. Translations *TranslationsService
  61. }
  62. func (s *Service) userAgent() string {
  63. if s.UserAgent == "" {
  64. return googleapi.UserAgent
  65. }
  66. return googleapi.UserAgent + " " + s.UserAgent
  67. }
  68. func NewDetectionsService(s *Service) *DetectionsService {
  69. rs := &DetectionsService{s: s}
  70. return rs
  71. }
  72. type DetectionsService struct {
  73. s *Service
  74. }
  75. func NewLanguagesService(s *Service) *LanguagesService {
  76. rs := &LanguagesService{s: s}
  77. return rs
  78. }
  79. type LanguagesService struct {
  80. s *Service
  81. }
  82. func NewTranslationsService(s *Service) *TranslationsService {
  83. rs := &TranslationsService{s: s}
  84. return rs
  85. }
  86. type TranslationsService struct {
  87. s *Service
  88. }
  89. type DetectionsListResponse struct {
  90. // Detections: A detections contains detection results of several text
  91. Detections [][]*DetectionsResourceItem `json:"detections,omitempty"`
  92. // ServerResponse contains the HTTP response code and headers from the
  93. // server.
  94. googleapi.ServerResponse `json:"-"`
  95. // ForceSendFields is a list of field names (e.g. "Detections") to
  96. // unconditionally include in API requests. By default, fields with
  97. // empty values are omitted from API requests. However, any non-pointer,
  98. // non-interface field appearing in ForceSendFields will be sent to the
  99. // server regardless of whether the field is empty or not. This may be
  100. // used to include empty fields in Patch requests.
  101. ForceSendFields []string `json:"-"`
  102. }
  103. func (s *DetectionsListResponse) MarshalJSON() ([]byte, error) {
  104. type noMethod DetectionsListResponse
  105. raw := noMethod(*s)
  106. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  107. }
  108. type DetectionsResourceItem struct {
  109. // Confidence: The confidence of the detection resul of this language.
  110. Confidence float64 `json:"confidence,omitempty"`
  111. // IsReliable: A boolean to indicate is the language detection result
  112. // reliable.
  113. IsReliable bool `json:"isReliable,omitempty"`
  114. // Language: The language we detect
  115. Language string `json:"language,omitempty"`
  116. // ForceSendFields is a list of field names (e.g. "Confidence") to
  117. // unconditionally include in API requests. By default, fields with
  118. // empty values are omitted from API requests. However, any non-pointer,
  119. // non-interface field appearing in ForceSendFields will be sent to the
  120. // server regardless of whether the field is empty or not. This may be
  121. // used to include empty fields in Patch requests.
  122. ForceSendFields []string `json:"-"`
  123. }
  124. func (s *DetectionsResourceItem) MarshalJSON() ([]byte, error) {
  125. type noMethod DetectionsResourceItem
  126. raw := noMethod(*s)
  127. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  128. }
  129. type LanguagesListResponse struct {
  130. // Languages: List of source/target languages supported by the
  131. // translation API. If target parameter is unspecified, the list is
  132. // sorted by the ASCII code point order of the language code. If target
  133. // parameter is specified, the list is sorted by the collation order of
  134. // the language name in the target language.
  135. Languages []*LanguagesResource `json:"languages,omitempty"`
  136. // ServerResponse contains the HTTP response code and headers from the
  137. // server.
  138. googleapi.ServerResponse `json:"-"`
  139. // ForceSendFields is a list of field names (e.g. "Languages") to
  140. // unconditionally include in API requests. By default, fields with
  141. // empty values are omitted from API requests. However, any non-pointer,
  142. // non-interface field appearing in ForceSendFields will be sent to the
  143. // server regardless of whether the field is empty or not. This may be
  144. // used to include empty fields in Patch requests.
  145. ForceSendFields []string `json:"-"`
  146. }
  147. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  148. type noMethod LanguagesListResponse
  149. raw := noMethod(*s)
  150. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  151. }
  152. type LanguagesResource struct {
  153. // Language: The language code.
  154. Language string `json:"language,omitempty"`
  155. // Name: The localized name of the language if target parameter is
  156. // given.
  157. Name string `json:"name,omitempty"`
  158. // ForceSendFields is a list of field names (e.g. "Language") to
  159. // unconditionally include in API requests. By default, fields with
  160. // empty values are omitted from API requests. However, any non-pointer,
  161. // non-interface field appearing in ForceSendFields will be sent to the
  162. // server regardless of whether the field is empty or not. This may be
  163. // used to include empty fields in Patch requests.
  164. ForceSendFields []string `json:"-"`
  165. }
  166. func (s *LanguagesResource) MarshalJSON() ([]byte, error) {
  167. type noMethod LanguagesResource
  168. raw := noMethod(*s)
  169. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  170. }
  171. type TranslationsListResponse struct {
  172. // Translations: Translations contains list of translation results of
  173. // given text
  174. Translations []*TranslationsResource `json:"translations,omitempty"`
  175. // ServerResponse contains the HTTP response code and headers from the
  176. // server.
  177. googleapi.ServerResponse `json:"-"`
  178. // ForceSendFields is a list of field names (e.g. "Translations") to
  179. // unconditionally include in API requests. By default, fields with
  180. // empty values are omitted from API requests. However, any non-pointer,
  181. // non-interface field appearing in ForceSendFields will be sent to the
  182. // server regardless of whether the field is empty or not. This may be
  183. // used to include empty fields in Patch requests.
  184. ForceSendFields []string `json:"-"`
  185. }
  186. func (s *TranslationsListResponse) MarshalJSON() ([]byte, error) {
  187. type noMethod TranslationsListResponse
  188. raw := noMethod(*s)
  189. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  190. }
  191. type TranslationsResource struct {
  192. // DetectedSourceLanguage: Detected source language if source parameter
  193. // is unspecified.
  194. DetectedSourceLanguage string `json:"detectedSourceLanguage,omitempty"`
  195. // TranslatedText: The translation.
  196. TranslatedText string `json:"translatedText,omitempty"`
  197. // ForceSendFields is a list of field names (e.g.
  198. // "DetectedSourceLanguage") to unconditionally include in API requests.
  199. // By default, fields with empty values are omitted from API requests.
  200. // However, any non-pointer, non-interface field appearing in
  201. // ForceSendFields will be sent to the server regardless of whether the
  202. // field is empty or not. This may be used to include empty fields in
  203. // Patch requests.
  204. ForceSendFields []string `json:"-"`
  205. }
  206. func (s *TranslationsResource) MarshalJSON() ([]byte, error) {
  207. type noMethod TranslationsResource
  208. raw := noMethod(*s)
  209. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  210. }
  211. // method id "language.detections.list":
  212. type DetectionsListCall struct {
  213. s *Service
  214. urlParams_ gensupport.URLParams
  215. ifNoneMatch_ string
  216. ctx_ context.Context
  217. }
  218. // List: Detect the language of text.
  219. func (r *DetectionsService) List(q []string) *DetectionsListCall {
  220. c := &DetectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  221. c.urlParams_.SetMulti("q", append([]string{}, q...))
  222. return c
  223. }
  224. // Fields allows partial responses to be retrieved. See
  225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  226. // for more information.
  227. func (c *DetectionsListCall) Fields(s ...googleapi.Field) *DetectionsListCall {
  228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  229. return c
  230. }
  231. // IfNoneMatch sets the optional parameter which makes the operation
  232. // fail if the object's ETag matches the given value. This is useful for
  233. // getting updates only after the object has changed since the last
  234. // request. Use googleapi.IsNotModified to check whether the response
  235. // error from Do is the result of In-None-Match.
  236. func (c *DetectionsListCall) IfNoneMatch(entityTag string) *DetectionsListCall {
  237. c.ifNoneMatch_ = entityTag
  238. return c
  239. }
  240. // Context sets the context to be used in this call's Do method. Any
  241. // pending HTTP request will be aborted if the provided context is
  242. // canceled.
  243. func (c *DetectionsListCall) Context(ctx context.Context) *DetectionsListCall {
  244. c.ctx_ = ctx
  245. return c
  246. }
  247. func (c *DetectionsListCall) doRequest(alt string) (*http.Response, error) {
  248. var body io.Reader = nil
  249. c.urlParams_.Set("alt", alt)
  250. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/detect")
  251. urls += "?" + c.urlParams_.Encode()
  252. req, _ := http.NewRequest("GET", urls, body)
  253. googleapi.SetOpaque(req.URL)
  254. req.Header.Set("User-Agent", c.s.userAgent())
  255. if c.ifNoneMatch_ != "" {
  256. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  257. }
  258. if c.ctx_ != nil {
  259. return ctxhttp.Do(c.ctx_, c.s.client, req)
  260. }
  261. return c.s.client.Do(req)
  262. }
  263. // Do executes the "language.detections.list" call.
  264. // Exactly one of *DetectionsListResponse or error will be non-nil. Any
  265. // non-2xx status code is an error. Response headers are in either
  266. // *DetectionsListResponse.ServerResponse.Header or (if a response was
  267. // returned at all) in error.(*googleapi.Error).Header. Use
  268. // googleapi.IsNotModified to check whether the returned error was
  269. // because http.StatusNotModified was returned.
  270. func (c *DetectionsListCall) Do(opts ...googleapi.CallOption) (*DetectionsListResponse, error) {
  271. gensupport.SetOptions(c.urlParams_, opts...)
  272. res, err := c.doRequest("json")
  273. if res != nil && res.StatusCode == http.StatusNotModified {
  274. if res.Body != nil {
  275. res.Body.Close()
  276. }
  277. return nil, &googleapi.Error{
  278. Code: res.StatusCode,
  279. Header: res.Header,
  280. }
  281. }
  282. if err != nil {
  283. return nil, err
  284. }
  285. defer googleapi.CloseBody(res)
  286. if err := googleapi.CheckResponse(res); err != nil {
  287. return nil, err
  288. }
  289. ret := &DetectionsListResponse{
  290. ServerResponse: googleapi.ServerResponse{
  291. Header: res.Header,
  292. HTTPStatusCode: res.StatusCode,
  293. },
  294. }
  295. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  296. return nil, err
  297. }
  298. return ret, nil
  299. // {
  300. // "description": "Detect the language of text.",
  301. // "httpMethod": "GET",
  302. // "id": "language.detections.list",
  303. // "parameterOrder": [
  304. // "q"
  305. // ],
  306. // "parameters": {
  307. // "q": {
  308. // "description": "The text to detect",
  309. // "location": "query",
  310. // "repeated": true,
  311. // "required": true,
  312. // "type": "string"
  313. // }
  314. // },
  315. // "path": "v2/detect",
  316. // "response": {
  317. // "$ref": "DetectionsListResponse"
  318. // }
  319. // }
  320. }
  321. // method id "language.languages.list":
  322. type LanguagesListCall struct {
  323. s *Service
  324. urlParams_ gensupport.URLParams
  325. ifNoneMatch_ string
  326. ctx_ context.Context
  327. }
  328. // List: List the source/target languages supported by the API
  329. func (r *LanguagesService) List() *LanguagesListCall {
  330. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  331. return c
  332. }
  333. // Target sets the optional parameter "target": the language and
  334. // collation in which the localized results should be returned
  335. func (c *LanguagesListCall) Target(target string) *LanguagesListCall {
  336. c.urlParams_.Set("target", target)
  337. return c
  338. }
  339. // Fields allows partial responses to be retrieved. See
  340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  341. // for more information.
  342. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  344. return c
  345. }
  346. // IfNoneMatch sets the optional parameter which makes the operation
  347. // fail if the object's ETag matches the given value. This is useful for
  348. // getting updates only after the object has changed since the last
  349. // request. Use googleapi.IsNotModified to check whether the response
  350. // error from Do is the result of In-None-Match.
  351. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  352. c.ifNoneMatch_ = entityTag
  353. return c
  354. }
  355. // Context sets the context to be used in this call's Do method. Any
  356. // pending HTTP request will be aborted if the provided context is
  357. // canceled.
  358. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  359. c.ctx_ = ctx
  360. return c
  361. }
  362. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  363. var body io.Reader = nil
  364. c.urlParams_.Set("alt", alt)
  365. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/languages")
  366. urls += "?" + c.urlParams_.Encode()
  367. req, _ := http.NewRequest("GET", urls, body)
  368. googleapi.SetOpaque(req.URL)
  369. req.Header.Set("User-Agent", c.s.userAgent())
  370. if c.ifNoneMatch_ != "" {
  371. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  372. }
  373. if c.ctx_ != nil {
  374. return ctxhttp.Do(c.ctx_, c.s.client, req)
  375. }
  376. return c.s.client.Do(req)
  377. }
  378. // Do executes the "language.languages.list" call.
  379. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  380. // non-2xx status code is an error. Response headers are in either
  381. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  382. // returned at all) in error.(*googleapi.Error).Header. Use
  383. // googleapi.IsNotModified to check whether the returned error was
  384. // because http.StatusNotModified was returned.
  385. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  386. gensupport.SetOptions(c.urlParams_, opts...)
  387. res, err := c.doRequest("json")
  388. if res != nil && res.StatusCode == http.StatusNotModified {
  389. if res.Body != nil {
  390. res.Body.Close()
  391. }
  392. return nil, &googleapi.Error{
  393. Code: res.StatusCode,
  394. Header: res.Header,
  395. }
  396. }
  397. if err != nil {
  398. return nil, err
  399. }
  400. defer googleapi.CloseBody(res)
  401. if err := googleapi.CheckResponse(res); err != nil {
  402. return nil, err
  403. }
  404. ret := &LanguagesListResponse{
  405. ServerResponse: googleapi.ServerResponse{
  406. Header: res.Header,
  407. HTTPStatusCode: res.StatusCode,
  408. },
  409. }
  410. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  411. return nil, err
  412. }
  413. return ret, nil
  414. // {
  415. // "description": "List the source/target languages supported by the API",
  416. // "httpMethod": "GET",
  417. // "id": "language.languages.list",
  418. // "parameters": {
  419. // "target": {
  420. // "description": "the language and collation in which the localized results should be returned",
  421. // "location": "query",
  422. // "type": "string"
  423. // }
  424. // },
  425. // "path": "v2/languages",
  426. // "response": {
  427. // "$ref": "LanguagesListResponse"
  428. // }
  429. // }
  430. }
  431. // method id "language.translations.list":
  432. type TranslationsListCall struct {
  433. s *Service
  434. urlParams_ gensupport.URLParams
  435. ifNoneMatch_ string
  436. ctx_ context.Context
  437. }
  438. // List: Returns text translations from one language to another.
  439. func (r *TranslationsService) List(q []string, target string) *TranslationsListCall {
  440. c := &TranslationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  441. c.urlParams_.SetMulti("q", append([]string{}, q...))
  442. c.urlParams_.Set("target", target)
  443. return c
  444. }
  445. // Cid sets the optional parameter "cid": The customization id for
  446. // translate
  447. func (c *TranslationsListCall) Cid(cid ...string) *TranslationsListCall {
  448. c.urlParams_.SetMulti("cid", append([]string{}, cid...))
  449. return c
  450. }
  451. // Format sets the optional parameter "format": The format of the text
  452. //
  453. // Possible values:
  454. // "html" - Specifies the input is in HTML
  455. // "text" - Specifies the input is in plain textual format
  456. func (c *TranslationsListCall) Format(format string) *TranslationsListCall {
  457. c.urlParams_.Set("format", format)
  458. return c
  459. }
  460. // Source sets the optional parameter "source": The source language of
  461. // the text
  462. func (c *TranslationsListCall) Source(source string) *TranslationsListCall {
  463. c.urlParams_.Set("source", source)
  464. return c
  465. }
  466. // Fields allows partial responses to be retrieved. See
  467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  468. // for more information.
  469. func (c *TranslationsListCall) Fields(s ...googleapi.Field) *TranslationsListCall {
  470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  471. return c
  472. }
  473. // IfNoneMatch sets the optional parameter which makes the operation
  474. // fail if the object's ETag matches the given value. This is useful for
  475. // getting updates only after the object has changed since the last
  476. // request. Use googleapi.IsNotModified to check whether the response
  477. // error from Do is the result of In-None-Match.
  478. func (c *TranslationsListCall) IfNoneMatch(entityTag string) *TranslationsListCall {
  479. c.ifNoneMatch_ = entityTag
  480. return c
  481. }
  482. // Context sets the context to be used in this call's Do method. Any
  483. // pending HTTP request will be aborted if the provided context is
  484. // canceled.
  485. func (c *TranslationsListCall) Context(ctx context.Context) *TranslationsListCall {
  486. c.ctx_ = ctx
  487. return c
  488. }
  489. func (c *TranslationsListCall) doRequest(alt string) (*http.Response, error) {
  490. var body io.Reader = nil
  491. c.urlParams_.Set("alt", alt)
  492. urls := googleapi.ResolveRelative(c.s.BasePath, "v2")
  493. urls += "?" + c.urlParams_.Encode()
  494. req, _ := http.NewRequest("GET", urls, body)
  495. googleapi.SetOpaque(req.URL)
  496. req.Header.Set("User-Agent", c.s.userAgent())
  497. if c.ifNoneMatch_ != "" {
  498. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  499. }
  500. if c.ctx_ != nil {
  501. return ctxhttp.Do(c.ctx_, c.s.client, req)
  502. }
  503. return c.s.client.Do(req)
  504. }
  505. // Do executes the "language.translations.list" call.
  506. // Exactly one of *TranslationsListResponse or error will be non-nil.
  507. // Any non-2xx status code is an error. Response headers are in either
  508. // *TranslationsListResponse.ServerResponse.Header or (if a response was
  509. // returned at all) in error.(*googleapi.Error).Header. Use
  510. // googleapi.IsNotModified to check whether the returned error was
  511. // because http.StatusNotModified was returned.
  512. func (c *TranslationsListCall) Do(opts ...googleapi.CallOption) (*TranslationsListResponse, error) {
  513. gensupport.SetOptions(c.urlParams_, opts...)
  514. res, err := c.doRequest("json")
  515. if res != nil && res.StatusCode == http.StatusNotModified {
  516. if res.Body != nil {
  517. res.Body.Close()
  518. }
  519. return nil, &googleapi.Error{
  520. Code: res.StatusCode,
  521. Header: res.Header,
  522. }
  523. }
  524. if err != nil {
  525. return nil, err
  526. }
  527. defer googleapi.CloseBody(res)
  528. if err := googleapi.CheckResponse(res); err != nil {
  529. return nil, err
  530. }
  531. ret := &TranslationsListResponse{
  532. ServerResponse: googleapi.ServerResponse{
  533. Header: res.Header,
  534. HTTPStatusCode: res.StatusCode,
  535. },
  536. }
  537. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  538. return nil, err
  539. }
  540. return ret, nil
  541. // {
  542. // "description": "Returns text translations from one language to another.",
  543. // "httpMethod": "GET",
  544. // "id": "language.translations.list",
  545. // "parameterOrder": [
  546. // "q",
  547. // "target"
  548. // ],
  549. // "parameters": {
  550. // "cid": {
  551. // "description": "The customization id for translate",
  552. // "location": "query",
  553. // "repeated": true,
  554. // "type": "string"
  555. // },
  556. // "format": {
  557. // "description": "The format of the text",
  558. // "enum": [
  559. // "html",
  560. // "text"
  561. // ],
  562. // "enumDescriptions": [
  563. // "Specifies the input is in HTML",
  564. // "Specifies the input is in plain textual format"
  565. // ],
  566. // "location": "query",
  567. // "type": "string"
  568. // },
  569. // "q": {
  570. // "description": "The text to translate",
  571. // "location": "query",
  572. // "repeated": true,
  573. // "required": true,
  574. // "type": "string"
  575. // },
  576. // "source": {
  577. // "description": "The source language of the text",
  578. // "location": "query",
  579. // "type": "string"
  580. // },
  581. // "target": {
  582. // "description": "The target language into which the text should be translated",
  583. // "location": "query",
  584. // "required": true,
  585. // "type": "string"
  586. // }
  587. // },
  588. // "path": "v2",
  589. // "response": {
  590. // "$ref": "TranslationsListResponse"
  591. // }
  592. // }
  593. }