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.
 
 
 

1235 lines
46 KiB

  1. // Package discovery provides access to the APIs Discovery Service.
  2. //
  3. // See https://developers.google.com/discovery/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/discovery/v1"
  8. // ...
  9. // discoveryService, err := discovery.New(oauthHttpClient)
  10. package discovery // import "google.golang.org/api/discovery/v1"
  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 = "discovery:v1"
  41. const apiName = "discovery"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/discovery/v1/"
  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.Apis = NewApisService(s)
  50. return s, nil
  51. }
  52. type Service struct {
  53. client *http.Client
  54. BasePath string // API endpoint base URL
  55. UserAgent string // optional additional User-Agent fragment
  56. Apis *ApisService
  57. }
  58. func (s *Service) userAgent() string {
  59. if s.UserAgent == "" {
  60. return googleapi.UserAgent
  61. }
  62. return googleapi.UserAgent + " " + s.UserAgent
  63. }
  64. func NewApisService(s *Service) *ApisService {
  65. rs := &ApisService{s: s}
  66. return rs
  67. }
  68. type ApisService struct {
  69. s *Service
  70. }
  71. type DirectoryList struct {
  72. // DiscoveryVersion: Indicate the version of the Discovery API used to
  73. // generate this doc.
  74. DiscoveryVersion string `json:"discoveryVersion,omitempty"`
  75. // Items: The individual directory entries. One entry per api/version
  76. // pair.
  77. Items []*DirectoryListItems `json:"items,omitempty"`
  78. // Kind: The kind for this response.
  79. Kind string `json:"kind,omitempty"`
  80. // ServerResponse contains the HTTP response code and headers from the
  81. // server.
  82. googleapi.ServerResponse `json:"-"`
  83. // ForceSendFields is a list of field names (e.g. "DiscoveryVersion") to
  84. // unconditionally include in API requests. By default, fields with
  85. // empty values are omitted from API requests. However, any non-pointer,
  86. // non-interface field appearing in ForceSendFields will be sent to the
  87. // server regardless of whether the field is empty or not. This may be
  88. // used to include empty fields in Patch requests.
  89. ForceSendFields []string `json:"-"`
  90. // NullFields is a list of field names (e.g. "DiscoveryVersion") to
  91. // include in API requests with the JSON null value. By default, fields
  92. // with empty values are omitted from API requests. However, any field
  93. // with an empty value appearing in NullFields will be sent to the
  94. // server as null. It is an error if a field in this list has a
  95. // non-empty value. This may be used to include null fields in Patch
  96. // requests.
  97. NullFields []string `json:"-"`
  98. }
  99. func (s *DirectoryList) MarshalJSON() ([]byte, error) {
  100. type NoMethod DirectoryList
  101. raw := NoMethod(*s)
  102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  103. }
  104. type DirectoryListItems struct {
  105. // Description: The description of this API.
  106. Description string `json:"description,omitempty"`
  107. // DiscoveryLink: A link to the discovery document.
  108. DiscoveryLink string `json:"discoveryLink,omitempty"`
  109. // DiscoveryRestUrl: The URL for the discovery REST document.
  110. DiscoveryRestUrl string `json:"discoveryRestUrl,omitempty"`
  111. // DocumentationLink: A link to human readable documentation for the
  112. // API.
  113. DocumentationLink string `json:"documentationLink,omitempty"`
  114. // Icons: Links to 16x16 and 32x32 icons representing the API.
  115. Icons *DirectoryListItemsIcons `json:"icons,omitempty"`
  116. // Id: The id of this API.
  117. Id string `json:"id,omitempty"`
  118. // Kind: The kind for this response.
  119. Kind string `json:"kind,omitempty"`
  120. // Labels: Labels for the status of this API, such as labs or
  121. // deprecated.
  122. Labels []string `json:"labels,omitempty"`
  123. // Name: The name of the API.
  124. Name string `json:"name,omitempty"`
  125. // Preferred: True if this version is the preferred version to use.
  126. Preferred bool `json:"preferred,omitempty"`
  127. // Title: The title of this API.
  128. Title string `json:"title,omitempty"`
  129. // Version: The version of the API.
  130. Version string `json:"version,omitempty"`
  131. // ForceSendFields is a list of field names (e.g. "Description") to
  132. // unconditionally include in API requests. By default, fields with
  133. // empty values are omitted from API requests. However, any non-pointer,
  134. // non-interface field appearing in ForceSendFields will be sent to the
  135. // server regardless of whether the field is empty or not. This may be
  136. // used to include empty fields in Patch requests.
  137. ForceSendFields []string `json:"-"`
  138. // NullFields is a list of field names (e.g. "Description") to include
  139. // in API requests with the JSON null value. By default, fields with
  140. // empty values are omitted from API requests. However, any field with
  141. // an empty value appearing in NullFields will be sent to the server as
  142. // null. It is an error if a field in this list has a non-empty value.
  143. // This may be used to include null fields in Patch requests.
  144. NullFields []string `json:"-"`
  145. }
  146. func (s *DirectoryListItems) MarshalJSON() ([]byte, error) {
  147. type NoMethod DirectoryListItems
  148. raw := NoMethod(*s)
  149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  150. }
  151. // DirectoryListItemsIcons: Links to 16x16 and 32x32 icons representing
  152. // the API.
  153. type DirectoryListItemsIcons struct {
  154. // X16: The URL of the 16x16 icon.
  155. X16 string `json:"x16,omitempty"`
  156. // X32: The URL of the 32x32 icon.
  157. X32 string `json:"x32,omitempty"`
  158. // ForceSendFields is a list of field names (e.g. "X16") 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. // NullFields is a list of field names (e.g. "X16") to include in API
  166. // requests with the JSON null value. By default, fields with empty
  167. // values are omitted from API requests. However, any field with an
  168. // empty value appearing in NullFields will be sent to the server as
  169. // null. It is an error if a field in this list has a non-empty value.
  170. // This may be used to include null fields in Patch requests.
  171. NullFields []string `json:"-"`
  172. }
  173. func (s *DirectoryListItemsIcons) MarshalJSON() ([]byte, error) {
  174. type NoMethod DirectoryListItemsIcons
  175. raw := NoMethod(*s)
  176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  177. }
  178. type JsonSchema struct {
  179. // Ref: A reference to another schema. The value of this property is the
  180. // "id" of another schema.
  181. Ref string `json:"$ref,omitempty"`
  182. // AdditionalProperties: If this is a schema for an object, this
  183. // property is the schema for any additional properties with dynamic
  184. // keys on this object.
  185. AdditionalProperties *JsonSchema `json:"additionalProperties,omitempty"`
  186. // Annotations: Additional information about this property.
  187. Annotations *JsonSchemaAnnotations `json:"annotations,omitempty"`
  188. // Default: The default value of this property (if one exists).
  189. Default string `json:"default,omitempty"`
  190. // Description: A description of this object.
  191. Description string `json:"description,omitempty"`
  192. // Enum: Values this parameter may take (if it is an enum).
  193. Enum []string `json:"enum,omitempty"`
  194. // EnumDescriptions: The descriptions for the enums. Each position maps
  195. // to the corresponding value in the "enum" array.
  196. EnumDescriptions []string `json:"enumDescriptions,omitempty"`
  197. // Format: An additional regular expression or key that helps constrain
  198. // the value. For more details see:
  199. // http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23
  200. Format string `json:"format,omitempty"`
  201. // Id: Unique identifier for this schema.
  202. Id string `json:"id,omitempty"`
  203. // Items: If this is a schema for an array, this property is the schema
  204. // for each element in the array.
  205. Items *JsonSchema `json:"items,omitempty"`
  206. // Location: Whether this parameter goes in the query or the path for
  207. // REST requests.
  208. Location string `json:"location,omitempty"`
  209. // Maximum: The maximum value of this parameter.
  210. Maximum string `json:"maximum,omitempty"`
  211. // Minimum: The minimum value of this parameter.
  212. Minimum string `json:"minimum,omitempty"`
  213. // Pattern: The regular expression this parameter must conform to. Uses
  214. // Java 6 regex format:
  215. // http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
  216. Pattern string `json:"pattern,omitempty"`
  217. // Properties: If this is a schema for an object, list the schema for
  218. // each property of this object.
  219. Properties map[string]JsonSchema `json:"properties,omitempty"`
  220. // ReadOnly: The value is read-only, generated by the service. The value
  221. // cannot be modified by the client. If the value is included in a POST,
  222. // PUT, or PATCH request, it is ignored by the service.
  223. ReadOnly bool `json:"readOnly,omitempty"`
  224. // Repeated: Whether this parameter may appear multiple times.
  225. Repeated bool `json:"repeated,omitempty"`
  226. // Required: Whether the parameter is required.
  227. Required bool `json:"required,omitempty"`
  228. // Type: The value type for this schema. A list of values can be found
  229. // here: http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
  230. Type string `json:"type,omitempty"`
  231. // Variant: In a variant data type, the value of one property is used to
  232. // determine how to interpret the entire entity. Its value must exist in
  233. // a map of descriminant values to schema names.
  234. Variant *JsonSchemaVariant `json:"variant,omitempty"`
  235. // ForceSendFields is a list of field names (e.g. "Ref") to
  236. // unconditionally include in API requests. By default, fields with
  237. // empty values are omitted from API requests. However, any non-pointer,
  238. // non-interface field appearing in ForceSendFields will be sent to the
  239. // server regardless of whether the field is empty or not. This may be
  240. // used to include empty fields in Patch requests.
  241. ForceSendFields []string `json:"-"`
  242. // NullFields is a list of field names (e.g. "Ref") to include in API
  243. // requests with the JSON null value. By default, fields with empty
  244. // values are omitted from API requests. However, any field with an
  245. // empty value appearing in NullFields will be sent to the server as
  246. // null. It is an error if a field in this list has a non-empty value.
  247. // This may be used to include null fields in Patch requests.
  248. NullFields []string `json:"-"`
  249. }
  250. func (s *JsonSchema) MarshalJSON() ([]byte, error) {
  251. type NoMethod JsonSchema
  252. raw := NoMethod(*s)
  253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  254. }
  255. // JsonSchemaAnnotations: Additional information about this property.
  256. type JsonSchemaAnnotations struct {
  257. // Required: A list of methods for which this property is required on
  258. // requests.
  259. Required []string `json:"required,omitempty"`
  260. // ForceSendFields is a list of field names (e.g. "Required") to
  261. // unconditionally include in API requests. By default, fields with
  262. // empty values are omitted from API requests. However, any non-pointer,
  263. // non-interface field appearing in ForceSendFields will be sent to the
  264. // server regardless of whether the field is empty or not. This may be
  265. // used to include empty fields in Patch requests.
  266. ForceSendFields []string `json:"-"`
  267. // NullFields is a list of field names (e.g. "Required") to include in
  268. // API requests with the JSON null value. By default, fields with empty
  269. // values are omitted from API requests. However, any field with an
  270. // empty value appearing in NullFields will be sent to the server as
  271. // null. It is an error if a field in this list has a non-empty value.
  272. // This may be used to include null fields in Patch requests.
  273. NullFields []string `json:"-"`
  274. }
  275. func (s *JsonSchemaAnnotations) MarshalJSON() ([]byte, error) {
  276. type NoMethod JsonSchemaAnnotations
  277. raw := NoMethod(*s)
  278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  279. }
  280. // JsonSchemaVariant: In a variant data type, the value of one property
  281. // is used to determine how to interpret the entire entity. Its value
  282. // must exist in a map of descriminant values to schema names.
  283. type JsonSchemaVariant struct {
  284. // Discriminant: The name of the type discriminant property.
  285. Discriminant string `json:"discriminant,omitempty"`
  286. // Map: The map of discriminant value to schema to use for parsing..
  287. Map []*JsonSchemaVariantMap `json:"map,omitempty"`
  288. // ForceSendFields is a list of field names (e.g. "Discriminant") to
  289. // unconditionally include in API requests. By default, fields with
  290. // empty values are omitted from API requests. However, any non-pointer,
  291. // non-interface field appearing in ForceSendFields will be sent to the
  292. // server regardless of whether the field is empty or not. This may be
  293. // used to include empty fields in Patch requests.
  294. ForceSendFields []string `json:"-"`
  295. // NullFields is a list of field names (e.g. "Discriminant") to include
  296. // in API requests with the JSON null value. By default, fields with
  297. // empty values are omitted from API requests. However, any field with
  298. // an empty value appearing in NullFields will be sent to the server as
  299. // null. It is an error if a field in this list has a non-empty value.
  300. // This may be used to include null fields in Patch requests.
  301. NullFields []string `json:"-"`
  302. }
  303. func (s *JsonSchemaVariant) MarshalJSON() ([]byte, error) {
  304. type NoMethod JsonSchemaVariant
  305. raw := NoMethod(*s)
  306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  307. }
  308. type JsonSchemaVariantMap struct {
  309. Ref string `json:"$ref,omitempty"`
  310. TypeValue string `json:"type_value,omitempty"`
  311. // ForceSendFields is a list of field names (e.g. "Ref") to
  312. // unconditionally include in API requests. By default, fields with
  313. // empty values are omitted from API requests. However, any non-pointer,
  314. // non-interface field appearing in ForceSendFields will be sent to the
  315. // server regardless of whether the field is empty or not. This may be
  316. // used to include empty fields in Patch requests.
  317. ForceSendFields []string `json:"-"`
  318. // NullFields is a list of field names (e.g. "Ref") to include in API
  319. // requests with the JSON null value. By default, fields with empty
  320. // values are omitted from API requests. However, any field with an
  321. // empty value appearing in NullFields will be sent to the server as
  322. // null. It is an error if a field in this list has a non-empty value.
  323. // This may be used to include null fields in Patch requests.
  324. NullFields []string `json:"-"`
  325. }
  326. func (s *JsonSchemaVariantMap) MarshalJSON() ([]byte, error) {
  327. type NoMethod JsonSchemaVariantMap
  328. raw := NoMethod(*s)
  329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  330. }
  331. type RestDescription struct {
  332. // Auth: Authentication information.
  333. Auth *RestDescriptionAuth `json:"auth,omitempty"`
  334. // BasePath: [DEPRECATED] The base path for REST requests.
  335. BasePath string `json:"basePath,omitempty"`
  336. // BaseUrl: [DEPRECATED] The base URL for REST requests.
  337. BaseUrl string `json:"baseUrl,omitempty"`
  338. // BatchPath: The path for REST batch requests.
  339. BatchPath string `json:"batchPath,omitempty"`
  340. // CanonicalName: Indicates how the API name should be capitalized and
  341. // split into various parts. Useful for generating pretty class names.
  342. CanonicalName string `json:"canonicalName,omitempty"`
  343. // Description: The description of this API.
  344. Description string `json:"description,omitempty"`
  345. // DiscoveryVersion: Indicate the version of the Discovery API used to
  346. // generate this doc.
  347. DiscoveryVersion string `json:"discoveryVersion,omitempty"`
  348. // DocumentationLink: A link to human readable documentation for the
  349. // API.
  350. DocumentationLink string `json:"documentationLink,omitempty"`
  351. // Etag: The ETag for this response.
  352. Etag string `json:"etag,omitempty"`
  353. // ExponentialBackoffDefault: Enable exponential backoff for suitable
  354. // methods in the generated clients.
  355. ExponentialBackoffDefault bool `json:"exponentialBackoffDefault,omitempty"`
  356. // Features: A list of supported features for this API.
  357. Features []string `json:"features,omitempty"`
  358. // Icons: Links to 16x16 and 32x32 icons representing the API.
  359. Icons *RestDescriptionIcons `json:"icons,omitempty"`
  360. // Id: The ID of this API.
  361. Id string `json:"id,omitempty"`
  362. // Kind: The kind for this response.
  363. Kind string `json:"kind,omitempty"`
  364. // Labels: Labels for the status of this API, such as labs or
  365. // deprecated.
  366. Labels []string `json:"labels,omitempty"`
  367. // Methods: API-level methods for this API.
  368. Methods map[string]RestMethod `json:"methods,omitempty"`
  369. // Name: The name of this API.
  370. Name string `json:"name,omitempty"`
  371. // OwnerDomain: The domain of the owner of this API. Together with the
  372. // ownerName and a packagePath values, this can be used to generate a
  373. // library for this API which would have a unique fully qualified name.
  374. OwnerDomain string `json:"ownerDomain,omitempty"`
  375. // OwnerName: The name of the owner of this API. See ownerDomain.
  376. OwnerName string `json:"ownerName,omitempty"`
  377. // PackagePath: The package of the owner of this API. See ownerDomain.
  378. PackagePath string `json:"packagePath,omitempty"`
  379. // Parameters: Common parameters that apply across all apis.
  380. Parameters map[string]JsonSchema `json:"parameters,omitempty"`
  381. // Protocol: The protocol described by this document.
  382. Protocol string `json:"protocol,omitempty"`
  383. // Resources: The resources in this API.
  384. Resources map[string]RestResource `json:"resources,omitempty"`
  385. // Revision: The version of this API.
  386. Revision string `json:"revision,omitempty"`
  387. // RootUrl: The root URL under which all API services live.
  388. RootUrl string `json:"rootUrl,omitempty"`
  389. // Schemas: The schemas for this API.
  390. Schemas map[string]JsonSchema `json:"schemas,omitempty"`
  391. // ServicePath: The base path for all REST requests.
  392. ServicePath string `json:"servicePath,omitempty"`
  393. // Title: The title of this API.
  394. Title string `json:"title,omitempty"`
  395. // Version: The version of this API.
  396. Version string `json:"version,omitempty"`
  397. VersionModule bool `json:"version_module,omitempty"`
  398. // ServerResponse contains the HTTP response code and headers from the
  399. // server.
  400. googleapi.ServerResponse `json:"-"`
  401. // ForceSendFields is a list of field names (e.g. "Auth") to
  402. // unconditionally include in API requests. By default, fields with
  403. // empty values are omitted from API requests. However, any non-pointer,
  404. // non-interface field appearing in ForceSendFields will be sent to the
  405. // server regardless of whether the field is empty or not. This may be
  406. // used to include empty fields in Patch requests.
  407. ForceSendFields []string `json:"-"`
  408. // NullFields is a list of field names (e.g. "Auth") to include in API
  409. // requests with the JSON null value. By default, fields with empty
  410. // values are omitted from API requests. However, any field with an
  411. // empty value appearing in NullFields will be sent to the server as
  412. // null. It is an error if a field in this list has a non-empty value.
  413. // This may be used to include null fields in Patch requests.
  414. NullFields []string `json:"-"`
  415. }
  416. func (s *RestDescription) MarshalJSON() ([]byte, error) {
  417. type NoMethod RestDescription
  418. raw := NoMethod(*s)
  419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  420. }
  421. // RestDescriptionAuth: Authentication information.
  422. type RestDescriptionAuth struct {
  423. // Oauth2: OAuth 2.0 authentication information.
  424. Oauth2 *RestDescriptionAuthOauth2 `json:"oauth2,omitempty"`
  425. // ForceSendFields is a list of field names (e.g. "Oauth2") to
  426. // unconditionally include in API requests. By default, fields with
  427. // empty values are omitted from API requests. However, any non-pointer,
  428. // non-interface field appearing in ForceSendFields will be sent to the
  429. // server regardless of whether the field is empty or not. This may be
  430. // used to include empty fields in Patch requests.
  431. ForceSendFields []string `json:"-"`
  432. // NullFields is a list of field names (e.g. "Oauth2") to include in API
  433. // requests with the JSON null value. By default, fields with empty
  434. // values are omitted from API requests. However, any field with an
  435. // empty value appearing in NullFields will be sent to the server as
  436. // null. It is an error if a field in this list has a non-empty value.
  437. // This may be used to include null fields in Patch requests.
  438. NullFields []string `json:"-"`
  439. }
  440. func (s *RestDescriptionAuth) MarshalJSON() ([]byte, error) {
  441. type NoMethod RestDescriptionAuth
  442. raw := NoMethod(*s)
  443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  444. }
  445. // RestDescriptionAuthOauth2: OAuth 2.0 authentication information.
  446. type RestDescriptionAuthOauth2 struct {
  447. // Scopes: Available OAuth 2.0 scopes.
  448. Scopes map[string]RestDescriptionAuthOauth2Scopes `json:"scopes,omitempty"`
  449. // ForceSendFields is a list of field names (e.g. "Scopes") to
  450. // unconditionally include in API requests. By default, fields with
  451. // empty values are omitted from API requests. However, any non-pointer,
  452. // non-interface field appearing in ForceSendFields will be sent to the
  453. // server regardless of whether the field is empty or not. This may be
  454. // used to include empty fields in Patch requests.
  455. ForceSendFields []string `json:"-"`
  456. // NullFields is a list of field names (e.g. "Scopes") to include in API
  457. // requests with the JSON null value. By default, fields with empty
  458. // values are omitted from API requests. However, any field with an
  459. // empty value appearing in NullFields will be sent to the server as
  460. // null. It is an error if a field in this list has a non-empty value.
  461. // This may be used to include null fields in Patch requests.
  462. NullFields []string `json:"-"`
  463. }
  464. func (s *RestDescriptionAuthOauth2) MarshalJSON() ([]byte, error) {
  465. type NoMethod RestDescriptionAuthOauth2
  466. raw := NoMethod(*s)
  467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  468. }
  469. // RestDescriptionAuthOauth2Scopes: The scope value.
  470. type RestDescriptionAuthOauth2Scopes struct {
  471. // Description: Description of scope.
  472. Description string `json:"description,omitempty"`
  473. // ForceSendFields is a list of field names (e.g. "Description") to
  474. // unconditionally include in API requests. By default, fields with
  475. // empty values are omitted from API requests. However, any non-pointer,
  476. // non-interface field appearing in ForceSendFields will be sent to the
  477. // server regardless of whether the field is empty or not. This may be
  478. // used to include empty fields in Patch requests.
  479. ForceSendFields []string `json:"-"`
  480. // NullFields is a list of field names (e.g. "Description") to include
  481. // in API requests with the JSON null value. By default, fields with
  482. // empty values are omitted from API requests. However, any field with
  483. // an empty value appearing in NullFields will be sent to the server as
  484. // null. It is an error if a field in this list has a non-empty value.
  485. // This may be used to include null fields in Patch requests.
  486. NullFields []string `json:"-"`
  487. }
  488. func (s *RestDescriptionAuthOauth2Scopes) MarshalJSON() ([]byte, error) {
  489. type NoMethod RestDescriptionAuthOauth2Scopes
  490. raw := NoMethod(*s)
  491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  492. }
  493. // RestDescriptionIcons: Links to 16x16 and 32x32 icons representing the
  494. // API.
  495. type RestDescriptionIcons struct {
  496. // X16: The URL of the 16x16 icon.
  497. X16 string `json:"x16,omitempty"`
  498. // X32: The URL of the 32x32 icon.
  499. X32 string `json:"x32,omitempty"`
  500. // ForceSendFields is a list of field names (e.g. "X16") to
  501. // unconditionally include in API requests. By default, fields with
  502. // empty values are omitted from API requests. However, any non-pointer,
  503. // non-interface field appearing in ForceSendFields will be sent to the
  504. // server regardless of whether the field is empty or not. This may be
  505. // used to include empty fields in Patch requests.
  506. ForceSendFields []string `json:"-"`
  507. // NullFields is a list of field names (e.g. "X16") to include in API
  508. // requests with the JSON null value. By default, fields with empty
  509. // values are omitted from API requests. However, any field with an
  510. // empty value appearing in NullFields will be sent to the server as
  511. // null. It is an error if a field in this list has a non-empty value.
  512. // This may be used to include null fields in Patch requests.
  513. NullFields []string `json:"-"`
  514. }
  515. func (s *RestDescriptionIcons) MarshalJSON() ([]byte, error) {
  516. type NoMethod RestDescriptionIcons
  517. raw := NoMethod(*s)
  518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  519. }
  520. type RestMethod struct {
  521. // Description: Description of this method.
  522. Description string `json:"description,omitempty"`
  523. // EtagRequired: Whether this method requires an ETag to be specified.
  524. // The ETag is sent as an HTTP If-Match or If-None-Match header.
  525. EtagRequired bool `json:"etagRequired,omitempty"`
  526. // HttpMethod: HTTP method used by this method.
  527. HttpMethod string `json:"httpMethod,omitempty"`
  528. // Id: A unique ID for this method. This property can be used to match
  529. // methods between different versions of Discovery.
  530. Id string `json:"id,omitempty"`
  531. // MediaUpload: Media upload parameters.
  532. MediaUpload *RestMethodMediaUpload `json:"mediaUpload,omitempty"`
  533. // ParameterOrder: Ordered list of required parameters, serves as a hint
  534. // to clients on how to structure their method signatures. The array is
  535. // ordered such that the "most-significant" parameter appears first.
  536. ParameterOrder []string `json:"parameterOrder,omitempty"`
  537. // Parameters: Details for all parameters in this method.
  538. Parameters map[string]JsonSchema `json:"parameters,omitempty"`
  539. // Path: The URI path of this REST method. Should be used in conjunction
  540. // with the basePath property at the api-level.
  541. Path string `json:"path,omitempty"`
  542. // Request: The schema for the request.
  543. Request *RestMethodRequest `json:"request,omitempty"`
  544. // Response: The schema for the response.
  545. Response *RestMethodResponse `json:"response,omitempty"`
  546. // Scopes: OAuth 2.0 scopes applicable to this method.
  547. Scopes []string `json:"scopes,omitempty"`
  548. // SupportsMediaDownload: Whether this method supports media downloads.
  549. SupportsMediaDownload bool `json:"supportsMediaDownload,omitempty"`
  550. // SupportsMediaUpload: Whether this method supports media uploads.
  551. SupportsMediaUpload bool `json:"supportsMediaUpload,omitempty"`
  552. // SupportsSubscription: Whether this method supports subscriptions.
  553. SupportsSubscription bool `json:"supportsSubscription,omitempty"`
  554. // UseMediaDownloadService: Indicates that downloads from this method
  555. // should use the download service URL (i.e. "/download"). Only applies
  556. // if the method supports media download.
  557. UseMediaDownloadService bool `json:"useMediaDownloadService,omitempty"`
  558. // ForceSendFields is a list of field names (e.g. "Description") to
  559. // unconditionally include in API requests. By default, fields with
  560. // empty values are omitted from API requests. However, any non-pointer,
  561. // non-interface field appearing in ForceSendFields will be sent to the
  562. // server regardless of whether the field is empty or not. This may be
  563. // used to include empty fields in Patch requests.
  564. ForceSendFields []string `json:"-"`
  565. // NullFields is a list of field names (e.g. "Description") to include
  566. // in API requests with the JSON null value. By default, fields with
  567. // empty values are omitted from API requests. However, any field with
  568. // an empty value appearing in NullFields will be sent to the server as
  569. // null. It is an error if a field in this list has a non-empty value.
  570. // This may be used to include null fields in Patch requests.
  571. NullFields []string `json:"-"`
  572. }
  573. func (s *RestMethod) MarshalJSON() ([]byte, error) {
  574. type NoMethod RestMethod
  575. raw := NoMethod(*s)
  576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  577. }
  578. // RestMethodMediaUpload: Media upload parameters.
  579. type RestMethodMediaUpload struct {
  580. // Accept: MIME Media Ranges for acceptable media uploads to this
  581. // method.
  582. Accept []string `json:"accept,omitempty"`
  583. // MaxSize: Maximum size of a media upload, such as "1MB", "2GB" or
  584. // "3TB".
  585. MaxSize string `json:"maxSize,omitempty"`
  586. // Protocols: Supported upload protocols.
  587. Protocols *RestMethodMediaUploadProtocols `json:"protocols,omitempty"`
  588. // ForceSendFields is a list of field names (e.g. "Accept") to
  589. // unconditionally include in API requests. By default, fields with
  590. // empty values are omitted from API requests. However, any non-pointer,
  591. // non-interface field appearing in ForceSendFields will be sent to the
  592. // server regardless of whether the field is empty or not. This may be
  593. // used to include empty fields in Patch requests.
  594. ForceSendFields []string `json:"-"`
  595. // NullFields is a list of field names (e.g. "Accept") to include in API
  596. // requests with the JSON null value. By default, fields with empty
  597. // values are omitted from API requests. However, any field with an
  598. // empty value appearing in NullFields will be sent to the server as
  599. // null. It is an error if a field in this list has a non-empty value.
  600. // This may be used to include null fields in Patch requests.
  601. NullFields []string `json:"-"`
  602. }
  603. func (s *RestMethodMediaUpload) MarshalJSON() ([]byte, error) {
  604. type NoMethod RestMethodMediaUpload
  605. raw := NoMethod(*s)
  606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  607. }
  608. // RestMethodMediaUploadProtocols: Supported upload protocols.
  609. type RestMethodMediaUploadProtocols struct {
  610. // Resumable: Supports the Resumable Media Upload protocol.
  611. Resumable *RestMethodMediaUploadProtocolsResumable `json:"resumable,omitempty"`
  612. // Simple: Supports uploading as a single HTTP request.
  613. Simple *RestMethodMediaUploadProtocolsSimple `json:"simple,omitempty"`
  614. // ForceSendFields is a list of field names (e.g. "Resumable") to
  615. // unconditionally include in API requests. By default, fields with
  616. // empty values are omitted from API requests. However, any non-pointer,
  617. // non-interface field appearing in ForceSendFields will be sent to the
  618. // server regardless of whether the field is empty or not. This may be
  619. // used to include empty fields in Patch requests.
  620. ForceSendFields []string `json:"-"`
  621. // NullFields is a list of field names (e.g. "Resumable") to include in
  622. // API requests with the JSON null value. By default, fields with empty
  623. // values are omitted from API requests. However, any field with an
  624. // empty value appearing in NullFields will be sent to the server as
  625. // null. It is an error if a field in this list has a non-empty value.
  626. // This may be used to include null fields in Patch requests.
  627. NullFields []string `json:"-"`
  628. }
  629. func (s *RestMethodMediaUploadProtocols) MarshalJSON() ([]byte, error) {
  630. type NoMethod RestMethodMediaUploadProtocols
  631. raw := NoMethod(*s)
  632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  633. }
  634. // RestMethodMediaUploadProtocolsResumable: Supports the Resumable Media
  635. // Upload protocol.
  636. type RestMethodMediaUploadProtocolsResumable struct {
  637. // Multipart: True if this endpoint supports uploading multipart media.
  638. //
  639. // Default: true
  640. Multipart *bool `json:"multipart,omitempty"`
  641. // Path: The URI path to be used for upload. Should be used in
  642. // conjunction with the basePath property at the api-level.
  643. Path string `json:"path,omitempty"`
  644. // ForceSendFields is a list of field names (e.g. "Multipart") to
  645. // unconditionally include in API requests. By default, fields with
  646. // empty values are omitted from API requests. However, any non-pointer,
  647. // non-interface field appearing in ForceSendFields will be sent to the
  648. // server regardless of whether the field is empty or not. This may be
  649. // used to include empty fields in Patch requests.
  650. ForceSendFields []string `json:"-"`
  651. // NullFields is a list of field names (e.g. "Multipart") to include in
  652. // API requests with the JSON null value. By default, fields with empty
  653. // values are omitted from API requests. However, any field with an
  654. // empty value appearing in NullFields will be sent to the server as
  655. // null. It is an error if a field in this list has a non-empty value.
  656. // This may be used to include null fields in Patch requests.
  657. NullFields []string `json:"-"`
  658. }
  659. func (s *RestMethodMediaUploadProtocolsResumable) MarshalJSON() ([]byte, error) {
  660. type NoMethod RestMethodMediaUploadProtocolsResumable
  661. raw := NoMethod(*s)
  662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  663. }
  664. // RestMethodMediaUploadProtocolsSimple: Supports uploading as a single
  665. // HTTP request.
  666. type RestMethodMediaUploadProtocolsSimple struct {
  667. // Multipart: True if this endpoint supports upload multipart media.
  668. //
  669. // Default: true
  670. Multipart *bool `json:"multipart,omitempty"`
  671. // Path: The URI path to be used for upload. Should be used in
  672. // conjunction with the basePath property at the api-level.
  673. Path string `json:"path,omitempty"`
  674. // ForceSendFields is a list of field names (e.g. "Multipart") to
  675. // unconditionally include in API requests. By default, fields with
  676. // empty values are omitted from API requests. However, any non-pointer,
  677. // non-interface field appearing in ForceSendFields will be sent to the
  678. // server regardless of whether the field is empty or not. This may be
  679. // used to include empty fields in Patch requests.
  680. ForceSendFields []string `json:"-"`
  681. // NullFields is a list of field names (e.g. "Multipart") to include in
  682. // API requests with the JSON null value. By default, fields with empty
  683. // values are omitted from API requests. However, any field with an
  684. // empty value appearing in NullFields will be sent to the server as
  685. // null. It is an error if a field in this list has a non-empty value.
  686. // This may be used to include null fields in Patch requests.
  687. NullFields []string `json:"-"`
  688. }
  689. func (s *RestMethodMediaUploadProtocolsSimple) MarshalJSON() ([]byte, error) {
  690. type NoMethod RestMethodMediaUploadProtocolsSimple
  691. raw := NoMethod(*s)
  692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  693. }
  694. // RestMethodRequest: The schema for the request.
  695. type RestMethodRequest struct {
  696. // Ref: Schema ID for the request schema.
  697. Ref string `json:"$ref,omitempty"`
  698. // ParameterName: parameter name.
  699. ParameterName string `json:"parameterName,omitempty"`
  700. // ForceSendFields is a list of field names (e.g. "Ref") to
  701. // unconditionally include in API requests. By default, fields with
  702. // empty values are omitted from API requests. However, any non-pointer,
  703. // non-interface field appearing in ForceSendFields will be sent to the
  704. // server regardless of whether the field is empty or not. This may be
  705. // used to include empty fields in Patch requests.
  706. ForceSendFields []string `json:"-"`
  707. // NullFields is a list of field names (e.g. "Ref") to include in API
  708. // requests with the JSON null value. By default, fields with empty
  709. // values are omitted from API requests. However, any field with an
  710. // empty value appearing in NullFields will be sent to the server as
  711. // null. It is an error if a field in this list has a non-empty value.
  712. // This may be used to include null fields in Patch requests.
  713. NullFields []string `json:"-"`
  714. }
  715. func (s *RestMethodRequest) MarshalJSON() ([]byte, error) {
  716. type NoMethod RestMethodRequest
  717. raw := NoMethod(*s)
  718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  719. }
  720. // RestMethodResponse: The schema for the response.
  721. type RestMethodResponse struct {
  722. // Ref: Schema ID for the response schema.
  723. Ref string `json:"$ref,omitempty"`
  724. // ForceSendFields is a list of field names (e.g. "Ref") to
  725. // unconditionally include in API requests. By default, fields with
  726. // empty values are omitted from API requests. However, any non-pointer,
  727. // non-interface field appearing in ForceSendFields will be sent to the
  728. // server regardless of whether the field is empty or not. This may be
  729. // used to include empty fields in Patch requests.
  730. ForceSendFields []string `json:"-"`
  731. // NullFields is a list of field names (e.g. "Ref") to include in API
  732. // requests with the JSON null value. By default, fields with empty
  733. // values are omitted from API requests. However, any field with an
  734. // empty value appearing in NullFields will be sent to the server as
  735. // null. It is an error if a field in this list has a non-empty value.
  736. // This may be used to include null fields in Patch requests.
  737. NullFields []string `json:"-"`
  738. }
  739. func (s *RestMethodResponse) MarshalJSON() ([]byte, error) {
  740. type NoMethod RestMethodResponse
  741. raw := NoMethod(*s)
  742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  743. }
  744. type RestResource struct {
  745. // Methods: Methods on this resource.
  746. Methods map[string]RestMethod `json:"methods,omitempty"`
  747. // Resources: Sub-resources on this resource.
  748. Resources map[string]RestResource `json:"resources,omitempty"`
  749. // ForceSendFields is a list of field names (e.g. "Methods") to
  750. // unconditionally include in API requests. By default, fields with
  751. // empty values are omitted from API requests. However, any non-pointer,
  752. // non-interface field appearing in ForceSendFields will be sent to the
  753. // server regardless of whether the field is empty or not. This may be
  754. // used to include empty fields in Patch requests.
  755. ForceSendFields []string `json:"-"`
  756. // NullFields is a list of field names (e.g. "Methods") to include in
  757. // API requests with the JSON null value. By default, fields with empty
  758. // values are omitted from API requests. However, any field with an
  759. // empty value appearing in NullFields will be sent to the server as
  760. // null. It is an error if a field in this list has a non-empty value.
  761. // This may be used to include null fields in Patch requests.
  762. NullFields []string `json:"-"`
  763. }
  764. func (s *RestResource) MarshalJSON() ([]byte, error) {
  765. type NoMethod RestResource
  766. raw := NoMethod(*s)
  767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  768. }
  769. // method id "discovery.apis.getRest":
  770. type ApisGetRestCall struct {
  771. s *Service
  772. api string
  773. version string
  774. urlParams_ gensupport.URLParams
  775. ifNoneMatch_ string
  776. ctx_ context.Context
  777. header_ http.Header
  778. }
  779. // GetRest: Retrieve the description of a particular version of an api.
  780. func (r *ApisService) GetRest(api string, version string) *ApisGetRestCall {
  781. c := &ApisGetRestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  782. c.api = api
  783. c.version = version
  784. return c
  785. }
  786. // Fields allows partial responses to be retrieved. See
  787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  788. // for more information.
  789. func (c *ApisGetRestCall) Fields(s ...googleapi.Field) *ApisGetRestCall {
  790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  791. return c
  792. }
  793. // IfNoneMatch sets the optional parameter which makes the operation
  794. // fail if the object's ETag matches the given value. This is useful for
  795. // getting updates only after the object has changed since the last
  796. // request. Use googleapi.IsNotModified to check whether the response
  797. // error from Do is the result of In-None-Match.
  798. func (c *ApisGetRestCall) IfNoneMatch(entityTag string) *ApisGetRestCall {
  799. c.ifNoneMatch_ = entityTag
  800. return c
  801. }
  802. // Context sets the context to be used in this call's Do method. Any
  803. // pending HTTP request will be aborted if the provided context is
  804. // canceled.
  805. func (c *ApisGetRestCall) Context(ctx context.Context) *ApisGetRestCall {
  806. c.ctx_ = ctx
  807. return c
  808. }
  809. // Header returns an http.Header that can be modified by the caller to
  810. // add HTTP headers to the request.
  811. func (c *ApisGetRestCall) Header() http.Header {
  812. if c.header_ == nil {
  813. c.header_ = make(http.Header)
  814. }
  815. return c.header_
  816. }
  817. func (c *ApisGetRestCall) doRequest(alt string) (*http.Response, error) {
  818. reqHeaders := make(http.Header)
  819. for k, v := range c.header_ {
  820. reqHeaders[k] = v
  821. }
  822. reqHeaders.Set("User-Agent", c.s.userAgent())
  823. if c.ifNoneMatch_ != "" {
  824. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  825. }
  826. var body io.Reader = nil
  827. c.urlParams_.Set("alt", alt)
  828. urls := googleapi.ResolveRelative(c.s.BasePath, "apis/{api}/{version}/rest")
  829. urls += "?" + c.urlParams_.Encode()
  830. req, _ := http.NewRequest("GET", urls, body)
  831. req.Header = reqHeaders
  832. googleapi.Expand(req.URL, map[string]string{
  833. "api": c.api,
  834. "version": c.version,
  835. })
  836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  837. }
  838. // Do executes the "discovery.apis.getRest" call.
  839. // Exactly one of *RestDescription or error will be non-nil. Any non-2xx
  840. // status code is an error. Response headers are in either
  841. // *RestDescription.ServerResponse.Header or (if a response was returned
  842. // at all) in error.(*googleapi.Error).Header. Use
  843. // googleapi.IsNotModified to check whether the returned error was
  844. // because http.StatusNotModified was returned.
  845. func (c *ApisGetRestCall) Do(opts ...googleapi.CallOption) (*RestDescription, error) {
  846. gensupport.SetOptions(c.urlParams_, opts...)
  847. res, err := c.doRequest("json")
  848. if res != nil && res.StatusCode == http.StatusNotModified {
  849. if res.Body != nil {
  850. res.Body.Close()
  851. }
  852. return nil, &googleapi.Error{
  853. Code: res.StatusCode,
  854. Header: res.Header,
  855. }
  856. }
  857. if err != nil {
  858. return nil, err
  859. }
  860. defer googleapi.CloseBody(res)
  861. if err := googleapi.CheckResponse(res); err != nil {
  862. return nil, err
  863. }
  864. ret := &RestDescription{
  865. ServerResponse: googleapi.ServerResponse{
  866. Header: res.Header,
  867. HTTPStatusCode: res.StatusCode,
  868. },
  869. }
  870. target := &ret
  871. if err := gensupport.DecodeResponse(target, res); err != nil {
  872. return nil, err
  873. }
  874. return ret, nil
  875. // {
  876. // "description": "Retrieve the description of a particular version of an api.",
  877. // "httpMethod": "GET",
  878. // "id": "discovery.apis.getRest",
  879. // "parameterOrder": [
  880. // "api",
  881. // "version"
  882. // ],
  883. // "parameters": {
  884. // "api": {
  885. // "description": "The name of the API.",
  886. // "location": "path",
  887. // "required": true,
  888. // "type": "string"
  889. // },
  890. // "version": {
  891. // "description": "The version of the API.",
  892. // "location": "path",
  893. // "required": true,
  894. // "type": "string"
  895. // }
  896. // },
  897. // "path": "apis/{api}/{version}/rest",
  898. // "response": {
  899. // "$ref": "RestDescription"
  900. // }
  901. // }
  902. }
  903. // method id "discovery.apis.list":
  904. type ApisListCall struct {
  905. s *Service
  906. urlParams_ gensupport.URLParams
  907. ifNoneMatch_ string
  908. ctx_ context.Context
  909. header_ http.Header
  910. }
  911. // List: Retrieve the list of APIs supported at this endpoint.
  912. func (r *ApisService) List() *ApisListCall {
  913. c := &ApisListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  914. return c
  915. }
  916. // Name sets the optional parameter "name": Only include APIs with the
  917. // given name.
  918. func (c *ApisListCall) Name(name string) *ApisListCall {
  919. c.urlParams_.Set("name", name)
  920. return c
  921. }
  922. // Preferred sets the optional parameter "preferred": Return only the
  923. // preferred version of an API.
  924. func (c *ApisListCall) Preferred(preferred bool) *ApisListCall {
  925. c.urlParams_.Set("preferred", fmt.Sprint(preferred))
  926. return c
  927. }
  928. // Fields allows partial responses to be retrieved. See
  929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  930. // for more information.
  931. func (c *ApisListCall) Fields(s ...googleapi.Field) *ApisListCall {
  932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  933. return c
  934. }
  935. // IfNoneMatch sets the optional parameter which makes the operation
  936. // fail if the object's ETag matches the given value. This is useful for
  937. // getting updates only after the object has changed since the last
  938. // request. Use googleapi.IsNotModified to check whether the response
  939. // error from Do is the result of In-None-Match.
  940. func (c *ApisListCall) IfNoneMatch(entityTag string) *ApisListCall {
  941. c.ifNoneMatch_ = entityTag
  942. return c
  943. }
  944. // Context sets the context to be used in this call's Do method. Any
  945. // pending HTTP request will be aborted if the provided context is
  946. // canceled.
  947. func (c *ApisListCall) Context(ctx context.Context) *ApisListCall {
  948. c.ctx_ = ctx
  949. return c
  950. }
  951. // Header returns an http.Header that can be modified by the caller to
  952. // add HTTP headers to the request.
  953. func (c *ApisListCall) Header() http.Header {
  954. if c.header_ == nil {
  955. c.header_ = make(http.Header)
  956. }
  957. return c.header_
  958. }
  959. func (c *ApisListCall) doRequest(alt string) (*http.Response, error) {
  960. reqHeaders := make(http.Header)
  961. for k, v := range c.header_ {
  962. reqHeaders[k] = v
  963. }
  964. reqHeaders.Set("User-Agent", c.s.userAgent())
  965. if c.ifNoneMatch_ != "" {
  966. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  967. }
  968. var body io.Reader = nil
  969. c.urlParams_.Set("alt", alt)
  970. urls := googleapi.ResolveRelative(c.s.BasePath, "apis")
  971. urls += "?" + c.urlParams_.Encode()
  972. req, _ := http.NewRequest("GET", urls, body)
  973. req.Header = reqHeaders
  974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  975. }
  976. // Do executes the "discovery.apis.list" call.
  977. // Exactly one of *DirectoryList or error will be non-nil. Any non-2xx
  978. // status code is an error. Response headers are in either
  979. // *DirectoryList.ServerResponse.Header or (if a response was returned
  980. // at all) in error.(*googleapi.Error).Header. Use
  981. // googleapi.IsNotModified to check whether the returned error was
  982. // because http.StatusNotModified was returned.
  983. func (c *ApisListCall) Do(opts ...googleapi.CallOption) (*DirectoryList, error) {
  984. gensupport.SetOptions(c.urlParams_, opts...)
  985. res, err := c.doRequest("json")
  986. if res != nil && res.StatusCode == http.StatusNotModified {
  987. if res.Body != nil {
  988. res.Body.Close()
  989. }
  990. return nil, &googleapi.Error{
  991. Code: res.StatusCode,
  992. Header: res.Header,
  993. }
  994. }
  995. if err != nil {
  996. return nil, err
  997. }
  998. defer googleapi.CloseBody(res)
  999. if err := googleapi.CheckResponse(res); err != nil {
  1000. return nil, err
  1001. }
  1002. ret := &DirectoryList{
  1003. ServerResponse: googleapi.ServerResponse{
  1004. Header: res.Header,
  1005. HTTPStatusCode: res.StatusCode,
  1006. },
  1007. }
  1008. target := &ret
  1009. if err := gensupport.DecodeResponse(target, res); err != nil {
  1010. return nil, err
  1011. }
  1012. return ret, nil
  1013. // {
  1014. // "description": "Retrieve the list of APIs supported at this endpoint.",
  1015. // "httpMethod": "GET",
  1016. // "id": "discovery.apis.list",
  1017. // "parameters": {
  1018. // "name": {
  1019. // "description": "Only include APIs with the given name.",
  1020. // "location": "query",
  1021. // "type": "string"
  1022. // },
  1023. // "preferred": {
  1024. // "default": "false",
  1025. // "description": "Return only the preferred version of an API.",
  1026. // "location": "query",
  1027. // "type": "boolean"
  1028. // }
  1029. // },
  1030. // "path": "apis",
  1031. // "response": {
  1032. // "$ref": "DirectoryList"
  1033. // }
  1034. // }
  1035. }