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