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 or default values are omitted from API requests. However, any 153 // non-pointer, non-interface field appearing in ForceSendFields will be 154 // sent to the server regardless of whether the field is empty or not. 155 // This may be 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 or default values are omitted from API requests. However, any 216 // non-pointer, non-interface field appearing in ForceSendFields will be 217 // sent to the server regardless of whether the field is empty or not. 218 // This may be 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 or default values are omitted from API requests. However, any 248 // non-pointer, non-interface field appearing in ForceSendFields will be 249 // sent to the server regardless of whether the field is empty or not. 250 // This may be 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 or default values are omitted from API requests. However, any 348 // non-pointer, non-interface field appearing in ForceSendFields will be 349 // sent to the server regardless of whether the field is empty or not. 350 // This may be 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 or default values are omitted from API requests. However, any 377 // non-pointer, non-interface field appearing in ForceSendFields will be 378 // sent to the server regardless of whether the field is empty or not. 379 // This may be 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 or default values are omitted from API requests. However, any 410 // non-pointer, non-interface field appearing in ForceSendFields will be 411 // sent to the server regardless of whether the field is empty or not. 412 // This may be 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 or default values are omitted from API requests. However, any 438 // non-pointer, non-interface field appearing in ForceSendFields will be 439 // sent to the server regardless of whether the field is empty or not. 440 // This may be 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 or default values are omitted from API requests. However, any 562 // non-pointer, non-interface field appearing in ForceSendFields will be 563 // sent to the server regardless of whether the field is empty or not. 564 // This may be 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 or default values are omitted from API requests. However, any 590 // non-pointer, non-interface field appearing in ForceSendFields will be 591 // sent to the server regardless of whether the field is empty or not. 592 // This may be 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 or default values are omitted from API requests. However, any 618 // non-pointer, non-interface field appearing in ForceSendFields will be 619 // sent to the server regardless of whether the field is empty or not. 620 // This may be 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 or default values are omitted from API requests. However, any 646 // non-pointer, non-interface field appearing in ForceSendFields will be 647 // sent to the server regardless of whether the field is empty or not. 648 // This may be 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 or default values are omitted from API requests. However, any 678 // non-pointer, non-interface field appearing in ForceSendFields will be 679 // sent to the server regardless of whether the field is empty or not. 680 // This may be 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 // FlatPath: The URI path of this REST method in (RFC 6570) format 707 // without level 2 features ({+var}). Supplementary to the path 708 // property. 709 FlatPath string `json:"flatPath,omitempty"` 710 711 // HttpMethod: HTTP method used by this method. 712 HttpMethod string `json:"httpMethod,omitempty"` 713 714 // Id: A unique ID for this method. This property can be used to match 715 // methods between different versions of Discovery. 716 Id string `json:"id,omitempty"` 717 718 // MediaUpload: Media upload parameters. 719 MediaUpload *RestMethodMediaUpload `json:"mediaUpload,omitempty"` 720 721 // ParameterOrder: Ordered list of required parameters, serves as a hint 722 // to clients on how to structure their method signatures. The array is 723 // ordered such that the "most-significant" parameter appears first. 724 ParameterOrder []string `json:"parameterOrder,omitempty"` 725 726 // Parameters: Details for all parameters in this method. 727 Parameters map[string]JsonSchema `json:"parameters,omitempty"` 728 729 // Path: The URI path of this REST method. Should be used in conjunction 730 // with the basePath property at the api-level. 731 Path string `json:"path,omitempty"` 732 733 // Request: The schema for the request. 734 Request *RestMethodRequest `json:"request,omitempty"` 735 736 // Response: The schema for the response. 737 Response *RestMethodResponse `json:"response,omitempty"` 738 739 // Scopes: OAuth 2.0 scopes applicable to this method. 740 Scopes []string `json:"scopes,omitempty"` 741 742 // SupportsMediaDownload: Whether this method supports media downloads. 743 SupportsMediaDownload bool `json:"supportsMediaDownload,omitempty"` 744 745 // SupportsMediaUpload: Whether this method supports media uploads. 746 SupportsMediaUpload bool `json:"supportsMediaUpload,omitempty"` 747 748 // SupportsSubscription: Whether this method supports subscriptions. 749 SupportsSubscription bool `json:"supportsSubscription,omitempty"` 750 751 // UseMediaDownloadService: Indicates that downloads from this method 752 // should use the download service URL (i.e. "/download"). Only applies 753 // if the method supports media download. 754 UseMediaDownloadService bool `json:"useMediaDownloadService,omitempty"` 755 756 // ForceSendFields is a list of field names (e.g. "Description") to 757 // unconditionally include in API requests. By default, fields with 758 // empty or default values are omitted from API requests. However, any 759 // non-pointer, non-interface field appearing in ForceSendFields will be 760 // sent to the server regardless of whether the field is empty or not. 761 // This may be used to include empty fields in Patch requests. 762 ForceSendFields []string `json:"-"` 763 764 // NullFields is a list of field names (e.g. "Description") to include 765 // in API requests with the JSON null value. By default, fields with 766 // empty values are omitted from API requests. However, any field with 767 // an empty value appearing in NullFields will be sent to the server as 768 // null. It is an error if a field in this list has a non-empty value. 769 // This may be used to include null fields in Patch requests. 770 NullFields []string `json:"-"` 771} 772 773func (s *RestMethod) MarshalJSON() ([]byte, error) { 774 type NoMethod RestMethod 775 raw := NoMethod(*s) 776 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 777} 778 779// RestMethodMediaUpload: Media upload parameters. 780type RestMethodMediaUpload struct { 781 // Accept: MIME Media Ranges for acceptable media uploads to this 782 // method. 783 Accept []string `json:"accept,omitempty"` 784 785 // MaxSize: Maximum size of a media upload, such as "1MB", "2GB" or 786 // "3TB". 787 MaxSize string `json:"maxSize,omitempty"` 788 789 // Protocols: Supported upload protocols. 790 Protocols *RestMethodMediaUploadProtocols `json:"protocols,omitempty"` 791 792 // ForceSendFields is a list of field names (e.g. "Accept") to 793 // unconditionally include in API requests. By default, fields with 794 // empty or default values are omitted from API requests. However, any 795 // non-pointer, non-interface field appearing in ForceSendFields will be 796 // sent to the server regardless of whether the field is empty or not. 797 // This may be used to include empty fields in Patch requests. 798 ForceSendFields []string `json:"-"` 799 800 // NullFields is a list of field names (e.g. "Accept") to include in API 801 // requests with the JSON null value. By default, fields with empty 802 // values are omitted from API requests. However, any field with an 803 // empty value appearing in NullFields will be sent to the server as 804 // null. It is an error if a field in this list has a non-empty value. 805 // This may be used to include null fields in Patch requests. 806 NullFields []string `json:"-"` 807} 808 809func (s *RestMethodMediaUpload) MarshalJSON() ([]byte, error) { 810 type NoMethod RestMethodMediaUpload 811 raw := NoMethod(*s) 812 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 813} 814 815// RestMethodMediaUploadProtocols: Supported upload protocols. 816type RestMethodMediaUploadProtocols struct { 817 // Resumable: Supports the Resumable Media Upload protocol. 818 Resumable *RestMethodMediaUploadProtocolsResumable `json:"resumable,omitempty"` 819 820 // Simple: Supports uploading as a single HTTP request. 821 Simple *RestMethodMediaUploadProtocolsSimple `json:"simple,omitempty"` 822 823 // ForceSendFields is a list of field names (e.g. "Resumable") to 824 // unconditionally include in API requests. By default, fields with 825 // empty or default values are omitted from API requests. However, any 826 // non-pointer, non-interface field appearing in ForceSendFields will be 827 // sent to the server regardless of whether the field is empty or not. 828 // This may be used to include empty fields in Patch requests. 829 ForceSendFields []string `json:"-"` 830 831 // NullFields is a list of field names (e.g. "Resumable") to include in 832 // API requests with the JSON null value. By default, fields with empty 833 // values are omitted from API requests. However, any field with an 834 // empty value appearing in NullFields will be sent to the server as 835 // null. It is an error if a field in this list has a non-empty value. 836 // This may be used to include null fields in Patch requests. 837 NullFields []string `json:"-"` 838} 839 840func (s *RestMethodMediaUploadProtocols) MarshalJSON() ([]byte, error) { 841 type NoMethod RestMethodMediaUploadProtocols 842 raw := NoMethod(*s) 843 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 844} 845 846// RestMethodMediaUploadProtocolsResumable: Supports the Resumable Media 847// Upload protocol. 848type RestMethodMediaUploadProtocolsResumable struct { 849 // Multipart: True if this endpoint supports uploading multipart media. 850 // 851 // Default: true 852 Multipart *bool `json:"multipart,omitempty"` 853 854 // Path: The URI path to be used for upload. Should be used in 855 // conjunction with the basePath property at the api-level. 856 Path string `json:"path,omitempty"` 857 858 // ForceSendFields is a list of field names (e.g. "Multipart") to 859 // unconditionally include in API requests. By default, fields with 860 // empty or default values are omitted from API requests. However, any 861 // non-pointer, non-interface field appearing in ForceSendFields will be 862 // sent to the server regardless of whether the field is empty or not. 863 // This may be used to include empty fields in Patch requests. 864 ForceSendFields []string `json:"-"` 865 866 // NullFields is a list of field names (e.g. "Multipart") to include in 867 // API requests with the JSON null value. By default, fields with empty 868 // values are omitted from API requests. However, any field with an 869 // empty value appearing in NullFields will be sent to the server as 870 // null. It is an error if a field in this list has a non-empty value. 871 // This may be used to include null fields in Patch requests. 872 NullFields []string `json:"-"` 873} 874 875func (s *RestMethodMediaUploadProtocolsResumable) MarshalJSON() ([]byte, error) { 876 type NoMethod RestMethodMediaUploadProtocolsResumable 877 raw := NoMethod(*s) 878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 879} 880 881// RestMethodMediaUploadProtocolsSimple: Supports uploading as a single 882// HTTP request. 883type RestMethodMediaUploadProtocolsSimple struct { 884 // Multipart: True if this endpoint supports upload multipart media. 885 // 886 // Default: true 887 Multipart *bool `json:"multipart,omitempty"` 888 889 // Path: The URI path to be used for upload. Should be used in 890 // conjunction with the basePath property at the api-level. 891 Path string `json:"path,omitempty"` 892 893 // ForceSendFields is a list of field names (e.g. "Multipart") to 894 // unconditionally include in API requests. By default, fields with 895 // empty or default values are omitted from API requests. However, any 896 // non-pointer, non-interface field appearing in ForceSendFields will be 897 // sent to the server regardless of whether the field is empty or not. 898 // This may be used to include empty fields in Patch requests. 899 ForceSendFields []string `json:"-"` 900 901 // NullFields is a list of field names (e.g. "Multipart") to include in 902 // API requests with the JSON null value. By default, fields with empty 903 // values are omitted from API requests. However, any field with an 904 // empty value appearing in NullFields will be sent to the server as 905 // null. It is an error if a field in this list has a non-empty value. 906 // This may be used to include null fields in Patch requests. 907 NullFields []string `json:"-"` 908} 909 910func (s *RestMethodMediaUploadProtocolsSimple) MarshalJSON() ([]byte, error) { 911 type NoMethod RestMethodMediaUploadProtocolsSimple 912 raw := NoMethod(*s) 913 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 914} 915 916// RestMethodRequest: The schema for the request. 917type RestMethodRequest struct { 918 // Ref: Schema ID for the request schema. 919 Ref string `json:"$ref,omitempty"` 920 921 // ParameterName: parameter name. 922 ParameterName string `json:"parameterName,omitempty"` 923 924 // ForceSendFields is a list of field names (e.g. "Ref") to 925 // unconditionally include in API requests. By default, fields with 926 // empty or default values are omitted from API requests. However, any 927 // non-pointer, non-interface field appearing in ForceSendFields will be 928 // sent to the server regardless of whether the field is empty or not. 929 // This may be used to include empty fields in Patch requests. 930 ForceSendFields []string `json:"-"` 931 932 // NullFields is a list of field names (e.g. "Ref") to include in API 933 // requests with the JSON null value. By default, fields with empty 934 // values are omitted from API requests. However, any field with an 935 // empty value appearing in NullFields will be sent to the server as 936 // null. It is an error if a field in this list has a non-empty value. 937 // This may be used to include null fields in Patch requests. 938 NullFields []string `json:"-"` 939} 940 941func (s *RestMethodRequest) MarshalJSON() ([]byte, error) { 942 type NoMethod RestMethodRequest 943 raw := NoMethod(*s) 944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 945} 946 947// RestMethodResponse: The schema for the response. 948type RestMethodResponse struct { 949 // Ref: Schema ID for the response schema. 950 Ref string `json:"$ref,omitempty"` 951 952 // ForceSendFields is a list of field names (e.g. "Ref") to 953 // unconditionally include in API requests. By default, fields with 954 // empty or default values are omitted from API requests. However, any 955 // non-pointer, non-interface field appearing in ForceSendFields will be 956 // sent to the server regardless of whether the field is empty or not. 957 // This may be used to include empty fields in Patch requests. 958 ForceSendFields []string `json:"-"` 959 960 // NullFields is a list of field names (e.g. "Ref") to include in API 961 // requests with the JSON null value. By default, fields with empty 962 // values are omitted from API requests. However, any field with an 963 // empty value appearing in NullFields will be sent to the server as 964 // null. It is an error if a field in this list has a non-empty value. 965 // This may be used to include null fields in Patch requests. 966 NullFields []string `json:"-"` 967} 968 969func (s *RestMethodResponse) MarshalJSON() ([]byte, error) { 970 type NoMethod RestMethodResponse 971 raw := NoMethod(*s) 972 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 973} 974 975type RestResource struct { 976 // Methods: Methods on this resource. 977 Methods map[string]RestMethod `json:"methods,omitempty"` 978 979 // Resources: Sub-resources on this resource. 980 Resources map[string]RestResource `json:"resources,omitempty"` 981 982 // ForceSendFields is a list of field names (e.g. "Methods") to 983 // unconditionally include in API requests. By default, fields with 984 // empty or default values are omitted from API requests. However, any 985 // non-pointer, non-interface field appearing in ForceSendFields will be 986 // sent to the server regardless of whether the field is empty or not. 987 // This may be used to include empty fields in Patch requests. 988 ForceSendFields []string `json:"-"` 989 990 // NullFields is a list of field names (e.g. "Methods") to include in 991 // API requests with the JSON null value. By default, fields with empty 992 // values are omitted from API requests. However, any field with an 993 // empty value appearing in NullFields will be sent to the server as 994 // null. It is an error if a field in this list has a non-empty value. 995 // This may be used to include null fields in Patch requests. 996 NullFields []string `json:"-"` 997} 998 999func (s *RestResource) MarshalJSON() ([]byte, error) { 1000 type NoMethod RestResource 1001 raw := NoMethod(*s) 1002 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1003} 1004 1005// method id "discovery.apis.getRest": 1006 1007type ApisGetRestCall struct { 1008 s *Service 1009 api string 1010 version string 1011 urlParams_ gensupport.URLParams 1012 ifNoneMatch_ string 1013 ctx_ context.Context 1014 header_ http.Header 1015} 1016 1017// GetRest: Retrieve the description of a particular version of an api. 1018// 1019// - api: The name of the API. 1020// - version: The version of the API. 1021func (r *ApisService) GetRest(api string, version string) *ApisGetRestCall { 1022 c := &ApisGetRestCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1023 c.api = api 1024 c.version = version 1025 return c 1026} 1027 1028// Fields allows partial responses to be retrieved. See 1029// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1030// for more information. 1031func (c *ApisGetRestCall) Fields(s ...googleapi.Field) *ApisGetRestCall { 1032 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1033 return c 1034} 1035 1036// IfNoneMatch sets the optional parameter which makes the operation 1037// fail if the object's ETag matches the given value. This is useful for 1038// getting updates only after the object has changed since the last 1039// request. Use googleapi.IsNotModified to check whether the response 1040// error from Do is the result of In-None-Match. 1041func (c *ApisGetRestCall) IfNoneMatch(entityTag string) *ApisGetRestCall { 1042 c.ifNoneMatch_ = entityTag 1043 return c 1044} 1045 1046// Context sets the context to be used in this call's Do method. Any 1047// pending HTTP request will be aborted if the provided context is 1048// canceled. 1049func (c *ApisGetRestCall) Context(ctx context.Context) *ApisGetRestCall { 1050 c.ctx_ = ctx 1051 return c 1052} 1053 1054// Header returns an http.Header that can be modified by the caller to 1055// add HTTP headers to the request. 1056func (c *ApisGetRestCall) Header() http.Header { 1057 if c.header_ == nil { 1058 c.header_ = make(http.Header) 1059 } 1060 return c.header_ 1061} 1062 1063func (c *ApisGetRestCall) doRequest(alt string) (*http.Response, error) { 1064 reqHeaders := make(http.Header) 1065 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1066 for k, v := range c.header_ { 1067 reqHeaders[k] = v 1068 } 1069 reqHeaders.Set("User-Agent", c.s.userAgent()) 1070 if c.ifNoneMatch_ != "" { 1071 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1072 } 1073 var body io.Reader = nil 1074 c.urlParams_.Set("alt", alt) 1075 c.urlParams_.Set("prettyPrint", "false") 1076 urls := googleapi.ResolveRelative(c.s.BasePath, "apis/{api}/{version}/rest") 1077 urls += "?" + c.urlParams_.Encode() 1078 req, err := http.NewRequest("GET", urls, body) 1079 if err != nil { 1080 return nil, err 1081 } 1082 req.Header = reqHeaders 1083 googleapi.Expand(req.URL, map[string]string{ 1084 "api": c.api, 1085 "version": c.version, 1086 }) 1087 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1088} 1089 1090// Do executes the "discovery.apis.getRest" call. 1091// Exactly one of *RestDescription or error will be non-nil. Any non-2xx 1092// status code is an error. Response headers are in either 1093// *RestDescription.ServerResponse.Header or (if a response was returned 1094// at all) in error.(*googleapi.Error).Header. Use 1095// googleapi.IsNotModified to check whether the returned error was 1096// because http.StatusNotModified was returned. 1097func (c *ApisGetRestCall) Do(opts ...googleapi.CallOption) (*RestDescription, error) { 1098 gensupport.SetOptions(c.urlParams_, opts...) 1099 res, err := c.doRequest("json") 1100 if res != nil && res.StatusCode == http.StatusNotModified { 1101 if res.Body != nil { 1102 res.Body.Close() 1103 } 1104 return nil, &googleapi.Error{ 1105 Code: res.StatusCode, 1106 Header: res.Header, 1107 } 1108 } 1109 if err != nil { 1110 return nil, err 1111 } 1112 defer googleapi.CloseBody(res) 1113 if err := googleapi.CheckResponse(res); err != nil { 1114 return nil, err 1115 } 1116 ret := &RestDescription{ 1117 ServerResponse: googleapi.ServerResponse{ 1118 Header: res.Header, 1119 HTTPStatusCode: res.StatusCode, 1120 }, 1121 } 1122 target := &ret 1123 if err := gensupport.DecodeResponse(target, res); err != nil { 1124 return nil, err 1125 } 1126 return ret, nil 1127 // { 1128 // "description": "Retrieve the description of a particular version of an api.", 1129 // "httpMethod": "GET", 1130 // "id": "discovery.apis.getRest", 1131 // "parameterOrder": [ 1132 // "api", 1133 // "version" 1134 // ], 1135 // "parameters": { 1136 // "api": { 1137 // "description": "The name of the API.", 1138 // "location": "path", 1139 // "required": true, 1140 // "type": "string" 1141 // }, 1142 // "version": { 1143 // "description": "The version of the API.", 1144 // "location": "path", 1145 // "required": true, 1146 // "type": "string" 1147 // } 1148 // }, 1149 // "path": "apis/{api}/{version}/rest", 1150 // "response": { 1151 // "$ref": "RestDescription" 1152 // } 1153 // } 1154 1155} 1156 1157// method id "discovery.apis.list": 1158 1159type ApisListCall struct { 1160 s *Service 1161 urlParams_ gensupport.URLParams 1162 ifNoneMatch_ string 1163 ctx_ context.Context 1164 header_ http.Header 1165} 1166 1167// List: Retrieve the list of APIs supported at this endpoint. 1168func (r *ApisService) List() *ApisListCall { 1169 c := &ApisListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1170 return c 1171} 1172 1173// Name sets the optional parameter "name": Only include APIs with the 1174// given name. 1175func (c *ApisListCall) Name(name string) *ApisListCall { 1176 c.urlParams_.Set("name", name) 1177 return c 1178} 1179 1180// Preferred sets the optional parameter "preferred": Return only the 1181// preferred version of an API. 1182func (c *ApisListCall) Preferred(preferred bool) *ApisListCall { 1183 c.urlParams_.Set("preferred", fmt.Sprint(preferred)) 1184 return c 1185} 1186 1187// Fields allows partial responses to be retrieved. See 1188// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1189// for more information. 1190func (c *ApisListCall) Fields(s ...googleapi.Field) *ApisListCall { 1191 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1192 return c 1193} 1194 1195// IfNoneMatch sets the optional parameter which makes the operation 1196// fail if the object's ETag matches the given value. This is useful for 1197// getting updates only after the object has changed since the last 1198// request. Use googleapi.IsNotModified to check whether the response 1199// error from Do is the result of In-None-Match. 1200func (c *ApisListCall) IfNoneMatch(entityTag string) *ApisListCall { 1201 c.ifNoneMatch_ = entityTag 1202 return c 1203} 1204 1205// Context sets the context to be used in this call's Do method. Any 1206// pending HTTP request will be aborted if the provided context is 1207// canceled. 1208func (c *ApisListCall) Context(ctx context.Context) *ApisListCall { 1209 c.ctx_ = ctx 1210 return c 1211} 1212 1213// Header returns an http.Header that can be modified by the caller to 1214// add HTTP headers to the request. 1215func (c *ApisListCall) Header() http.Header { 1216 if c.header_ == nil { 1217 c.header_ = make(http.Header) 1218 } 1219 return c.header_ 1220} 1221 1222func (c *ApisListCall) doRequest(alt string) (*http.Response, error) { 1223 reqHeaders := make(http.Header) 1224 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1225 for k, v := range c.header_ { 1226 reqHeaders[k] = v 1227 } 1228 reqHeaders.Set("User-Agent", c.s.userAgent()) 1229 if c.ifNoneMatch_ != "" { 1230 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1231 } 1232 var body io.Reader = nil 1233 c.urlParams_.Set("alt", alt) 1234 c.urlParams_.Set("prettyPrint", "false") 1235 urls := googleapi.ResolveRelative(c.s.BasePath, "apis") 1236 urls += "?" + c.urlParams_.Encode() 1237 req, err := http.NewRequest("GET", urls, body) 1238 if err != nil { 1239 return nil, err 1240 } 1241 req.Header = reqHeaders 1242 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1243} 1244 1245// Do executes the "discovery.apis.list" call. 1246// Exactly one of *DirectoryList or error will be non-nil. Any non-2xx 1247// status code is an error. Response headers are in either 1248// *DirectoryList.ServerResponse.Header or (if a response was returned 1249// at all) in error.(*googleapi.Error).Header. Use 1250// googleapi.IsNotModified to check whether the returned error was 1251// because http.StatusNotModified was returned. 1252func (c *ApisListCall) Do(opts ...googleapi.CallOption) (*DirectoryList, error) { 1253 gensupport.SetOptions(c.urlParams_, opts...) 1254 res, err := c.doRequest("json") 1255 if res != nil && res.StatusCode == http.StatusNotModified { 1256 if res.Body != nil { 1257 res.Body.Close() 1258 } 1259 return nil, &googleapi.Error{ 1260 Code: res.StatusCode, 1261 Header: res.Header, 1262 } 1263 } 1264 if err != nil { 1265 return nil, err 1266 } 1267 defer googleapi.CloseBody(res) 1268 if err := googleapi.CheckResponse(res); err != nil { 1269 return nil, err 1270 } 1271 ret := &DirectoryList{ 1272 ServerResponse: googleapi.ServerResponse{ 1273 Header: res.Header, 1274 HTTPStatusCode: res.StatusCode, 1275 }, 1276 } 1277 target := &ret 1278 if err := gensupport.DecodeResponse(target, res); err != nil { 1279 return nil, err 1280 } 1281 return ret, nil 1282 // { 1283 // "description": "Retrieve the list of APIs supported at this endpoint.", 1284 // "httpMethod": "GET", 1285 // "id": "discovery.apis.list", 1286 // "parameters": { 1287 // "name": { 1288 // "description": "Only include APIs with the given name.", 1289 // "location": "query", 1290 // "type": "string" 1291 // }, 1292 // "preferred": { 1293 // "default": "false", 1294 // "description": "Return only the preferred version of an API.", 1295 // "location": "query", 1296 // "type": "boolean" 1297 // } 1298 // }, 1299 // "path": "apis", 1300 // "response": { 1301 // "$ref": "DirectoryList" 1302 // } 1303 // } 1304 1305} 1306