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