1// Copyright 2020 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 storage provides access to the Cloud Storage JSON API. 8// 9// This package is DEPRECATED. Use package cloud.google.com/go/storage instead. 10// 11// For product documentation, see: https://developers.google.com/storage/docs/json_api/ 12// 13// Creating a client 14// 15// Usage example: 16// 17// import "google.golang.org/api/storage/v1" 18// ... 19// ctx := context.Background() 20// storageService, err := storage.NewService(ctx) 21// 22// In this example, Google Application Default Credentials are used for authentication. 23// 24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 25// 26// Other authentication options 27// 28// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 29// 30// storageService, err := storage.NewService(ctx, option.WithScopes(storage.DevstorageReadWriteScope)) 31// 32// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 33// 34// storageService, err := storage.NewService(ctx, option.WithAPIKey("AIza...")) 35// 36// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 37// 38// config := &oauth2.Config{...} 39// // ... 40// token, err := config.Exchange(ctx, ...) 41// storageService, err := storage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 42// 43// See https://godoc.org/google.golang.org/api/option/ for details on options. 44package storage // import "google.golang.org/api/storage/v1" 45 46import ( 47 "bytes" 48 "context" 49 "encoding/json" 50 "errors" 51 "fmt" 52 "io" 53 "net/http" 54 "net/url" 55 "strconv" 56 "strings" 57 58 googleapi "google.golang.org/api/googleapi" 59 gensupport "google.golang.org/api/internal/gensupport" 60 option "google.golang.org/api/option" 61 internaloption "google.golang.org/api/option/internaloption" 62 htransport "google.golang.org/api/transport/http" 63) 64 65// Always reference these packages, just in case the auto-generated code 66// below doesn't. 67var _ = bytes.NewBuffer 68var _ = strconv.Itoa 69var _ = fmt.Sprintf 70var _ = json.NewDecoder 71var _ = io.Copy 72var _ = url.Parse 73var _ = gensupport.MarshalJSON 74var _ = googleapi.Version 75var _ = errors.New 76var _ = strings.Replace 77var _ = context.Canceled 78var _ = internaloption.WithDefaultEndpoint 79 80const apiId = "storage:v1" 81const apiName = "storage" 82const apiVersion = "v1" 83const basePath = "https://storage.googleapis.com/storage/v1/" 84const mtlsBasePath = "https://storage.mtls.googleapis.com/storage/v1/" 85 86// OAuth2 scopes used by this API. 87const ( 88 // View and manage your data across Google Cloud Platform services 89 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 90 91 // View your data across Google Cloud Platform services 92 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 93 94 // Manage your data and permissions in Google Cloud Storage 95 DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" 96 97 // View your data in Google Cloud Storage 98 DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" 99 100 // Manage your data in Google Cloud Storage 101 DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" 102) 103 104// NewService creates a new Service. 105func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 106 scopesOption := option.WithScopes( 107 "https://www.googleapis.com/auth/cloud-platform", 108 "https://www.googleapis.com/auth/cloud-platform.read-only", 109 "https://www.googleapis.com/auth/devstorage.full_control", 110 "https://www.googleapis.com/auth/devstorage.read_only", 111 "https://www.googleapis.com/auth/devstorage.read_write", 112 ) 113 // NOTE: prepend, so we don't override user-specified scopes. 114 opts = append([]option.ClientOption{scopesOption}, opts...) 115 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 116 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 117 client, endpoint, err := htransport.NewClient(ctx, opts...) 118 if err != nil { 119 return nil, err 120 } 121 s, err := New(client) 122 if err != nil { 123 return nil, err 124 } 125 if endpoint != "" { 126 s.BasePath = endpoint 127 } 128 return s, nil 129} 130 131// New creates a new Service. It uses the provided http.Client for requests. 132// 133// Deprecated: please use NewService instead. 134// To provide a custom HTTP client, use option.WithHTTPClient. 135// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 136func New(client *http.Client) (*Service, error) { 137 if client == nil { 138 return nil, errors.New("client is nil") 139 } 140 s := &Service{client: client, BasePath: basePath} 141 s.BucketAccessControls = NewBucketAccessControlsService(s) 142 s.Buckets = NewBucketsService(s) 143 s.Channels = NewChannelsService(s) 144 s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s) 145 s.Notifications = NewNotificationsService(s) 146 s.ObjectAccessControls = NewObjectAccessControlsService(s) 147 s.Objects = NewObjectsService(s) 148 s.Projects = NewProjectsService(s) 149 return s, nil 150} 151 152type Service struct { 153 client *http.Client 154 BasePath string // API endpoint base URL 155 UserAgent string // optional additional User-Agent fragment 156 157 BucketAccessControls *BucketAccessControlsService 158 159 Buckets *BucketsService 160 161 Channels *ChannelsService 162 163 DefaultObjectAccessControls *DefaultObjectAccessControlsService 164 165 Notifications *NotificationsService 166 167 ObjectAccessControls *ObjectAccessControlsService 168 169 Objects *ObjectsService 170 171 Projects *ProjectsService 172} 173 174func (s *Service) userAgent() string { 175 if s.UserAgent == "" { 176 return googleapi.UserAgent 177 } 178 return googleapi.UserAgent + " " + s.UserAgent 179} 180 181func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService { 182 rs := &BucketAccessControlsService{s: s} 183 return rs 184} 185 186type BucketAccessControlsService struct { 187 s *Service 188} 189 190func NewBucketsService(s *Service) *BucketsService { 191 rs := &BucketsService{s: s} 192 return rs 193} 194 195type BucketsService struct { 196 s *Service 197} 198 199func NewChannelsService(s *Service) *ChannelsService { 200 rs := &ChannelsService{s: s} 201 return rs 202} 203 204type ChannelsService struct { 205 s *Service 206} 207 208func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService { 209 rs := &DefaultObjectAccessControlsService{s: s} 210 return rs 211} 212 213type DefaultObjectAccessControlsService struct { 214 s *Service 215} 216 217func NewNotificationsService(s *Service) *NotificationsService { 218 rs := &NotificationsService{s: s} 219 return rs 220} 221 222type NotificationsService struct { 223 s *Service 224} 225 226func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService { 227 rs := &ObjectAccessControlsService{s: s} 228 return rs 229} 230 231type ObjectAccessControlsService struct { 232 s *Service 233} 234 235func NewObjectsService(s *Service) *ObjectsService { 236 rs := &ObjectsService{s: s} 237 return rs 238} 239 240type ObjectsService struct { 241 s *Service 242} 243 244func NewProjectsService(s *Service) *ProjectsService { 245 rs := &ProjectsService{s: s} 246 rs.HmacKeys = NewProjectsHmacKeysService(s) 247 rs.ServiceAccount = NewProjectsServiceAccountService(s) 248 return rs 249} 250 251type ProjectsService struct { 252 s *Service 253 254 HmacKeys *ProjectsHmacKeysService 255 256 ServiceAccount *ProjectsServiceAccountService 257} 258 259func NewProjectsHmacKeysService(s *Service) *ProjectsHmacKeysService { 260 rs := &ProjectsHmacKeysService{s: s} 261 return rs 262} 263 264type ProjectsHmacKeysService struct { 265 s *Service 266} 267 268func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService { 269 rs := &ProjectsServiceAccountService{s: s} 270 return rs 271} 272 273type ProjectsServiceAccountService struct { 274 s *Service 275} 276 277// Bucket: A bucket. 278type Bucket struct { 279 // Acl: Access controls on the bucket. 280 Acl []*BucketAccessControl `json:"acl,omitempty"` 281 282 // Billing: The bucket's billing configuration. 283 Billing *BucketBilling `json:"billing,omitempty"` 284 285 // Cors: The bucket's Cross-Origin Resource Sharing (CORS) 286 // configuration. 287 Cors []*BucketCors `json:"cors,omitempty"` 288 289 // DefaultEventBasedHold: The default value for event-based hold on 290 // newly created objects in this bucket. Event-based hold is a way to 291 // retain objects indefinitely until an event occurs, signified by the 292 // hold's release. After being released, such objects will be subject to 293 // bucket-level retention (if any). One sample use case of this flag is 294 // for banks to hold loan documents for at least 3 years after loan is 295 // paid in full. Here, bucket-level retention is 3 years and the event 296 // is loan being paid in full. In this example, these objects will be 297 // held intact for any number of years until the event has occurred 298 // (event-based hold on the object is released) and then 3 more years 299 // after that. That means retention duration of the objects begins from 300 // the moment event-based hold transitioned from true to false. Objects 301 // under event-based hold cannot be deleted, overwritten or archived 302 // until the hold is removed. 303 DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"` 304 305 // DefaultObjectAcl: Default access controls to apply to new objects 306 // when no ACL is provided. 307 DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"` 308 309 // Encryption: Encryption configuration for a bucket. 310 Encryption *BucketEncryption `json:"encryption,omitempty"` 311 312 // Etag: HTTP 1.1 Entity tag for the bucket. 313 Etag string `json:"etag,omitempty"` 314 315 // IamConfiguration: The bucket's IAM configuration. 316 IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"` 317 318 // Id: The ID of the bucket. For buckets, the id and name properties are 319 // the same. 320 Id string `json:"id,omitempty"` 321 322 // Kind: The kind of item this is. For buckets, this is always 323 // storage#bucket. 324 Kind string `json:"kind,omitempty"` 325 326 // Labels: User-provided labels, in key/value pairs. 327 Labels map[string]string `json:"labels,omitempty"` 328 329 // Lifecycle: The bucket's lifecycle configuration. See lifecycle 330 // management for more information. 331 Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"` 332 333 // Location: The location of the bucket. Object data for objects in the 334 // bucket resides in physical storage within this region. Defaults to 335 // US. See the developer's guide for the authoritative list. 336 Location string `json:"location,omitempty"` 337 338 // LocationType: The type of the bucket location. 339 LocationType string `json:"locationType,omitempty"` 340 341 // Logging: The bucket's logging configuration, which defines the 342 // destination bucket and optional name prefix for the current bucket's 343 // logs. 344 Logging *BucketLogging `json:"logging,omitempty"` 345 346 // Metageneration: The metadata generation of this bucket. 347 Metageneration int64 `json:"metageneration,omitempty,string"` 348 349 // Name: The name of the bucket. 350 Name string `json:"name,omitempty"` 351 352 // Owner: The owner of the bucket. This is always the project team's 353 // owner group. 354 Owner *BucketOwner `json:"owner,omitempty"` 355 356 // ProjectNumber: The project number of the project the bucket belongs 357 // to. 358 ProjectNumber uint64 `json:"projectNumber,omitempty,string"` 359 360 // RetentionPolicy: The bucket's retention policy. The retention policy 361 // enforces a minimum retention time for all objects contained in the 362 // bucket, based on their creation time. Any attempt to overwrite or 363 // delete objects younger than the retention period will result in a 364 // PERMISSION_DENIED error. An unlocked retention policy can be modified 365 // or removed from the bucket via a storage.buckets.update operation. A 366 // locked retention policy cannot be removed or shortened in duration 367 // for the lifetime of the bucket. Attempting to remove or decrease 368 // period of a locked retention policy will result in a 369 // PERMISSION_DENIED error. 370 RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"` 371 372 // SelfLink: The URI of this bucket. 373 SelfLink string `json:"selfLink,omitempty"` 374 375 // StorageClass: The bucket's default storage class, used whenever no 376 // storageClass is specified for a newly-created object. This defines 377 // how objects in the bucket are stored and determines the SLA and the 378 // cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, 379 // NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If 380 // this value is not specified when the bucket is created, it will 381 // default to STANDARD. For more information, see storage classes. 382 StorageClass string `json:"storageClass,omitempty"` 383 384 // TimeCreated: The creation time of the bucket in RFC 3339 format. 385 TimeCreated string `json:"timeCreated,omitempty"` 386 387 // Updated: The modification time of the bucket in RFC 3339 format. 388 Updated string `json:"updated,omitempty"` 389 390 // Versioning: The bucket's versioning configuration. 391 Versioning *BucketVersioning `json:"versioning,omitempty"` 392 393 // Website: The bucket's website configuration, controlling how the 394 // service behaves when accessing bucket contents as a web site. See the 395 // Static Website Examples for more information. 396 Website *BucketWebsite `json:"website,omitempty"` 397 398 // ZoneAffinity: The zone or zones from which the bucket is intended to 399 // use zonal quota. Requests for data from outside the specified 400 // affinities are still allowed but won't be able to use zonal quota. 401 // The zone or zones need to be within the bucket location otherwise the 402 // requests will fail with a 400 Bad Request response. 403 ZoneAffinity []string `json:"zoneAffinity,omitempty"` 404 405 // ServerResponse contains the HTTP response code and headers from the 406 // server. 407 googleapi.ServerResponse `json:"-"` 408 409 // ForceSendFields is a list of field names (e.g. "Acl") to 410 // unconditionally include in API requests. By default, fields with 411 // empty values are omitted from API requests. However, any non-pointer, 412 // non-interface field appearing in ForceSendFields will be sent to the 413 // server regardless of whether the field is empty or not. This may be 414 // used to include empty fields in Patch requests. 415 ForceSendFields []string `json:"-"` 416 417 // NullFields is a list of field names (e.g. "Acl") to include in API 418 // requests with the JSON null value. By default, fields with empty 419 // values are omitted from API requests. However, any field with an 420 // empty value appearing in NullFields will be sent to the server as 421 // null. It is an error if a field in this list has a non-empty value. 422 // This may be used to include null fields in Patch requests. 423 NullFields []string `json:"-"` 424} 425 426func (s *Bucket) MarshalJSON() ([]byte, error) { 427 type NoMethod Bucket 428 raw := NoMethod(*s) 429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 430} 431 432// BucketBilling: The bucket's billing configuration. 433type BucketBilling struct { 434 // RequesterPays: When set to true, Requester Pays is enabled for this 435 // bucket. 436 RequesterPays bool `json:"requesterPays,omitempty"` 437 438 // ForceSendFields is a list of field names (e.g. "RequesterPays") to 439 // unconditionally include in API requests. By default, fields with 440 // empty values are omitted from API requests. However, any non-pointer, 441 // non-interface field appearing in ForceSendFields will be sent to the 442 // server regardless of whether the field is empty or not. This may be 443 // used to include empty fields in Patch requests. 444 ForceSendFields []string `json:"-"` 445 446 // NullFields is a list of field names (e.g. "RequesterPays") to include 447 // in API requests with the JSON null value. By default, fields with 448 // empty values are omitted from API requests. However, any field with 449 // an empty value appearing in NullFields will be sent to the server as 450 // null. It is an error if a field in this list has a non-empty value. 451 // This may be used to include null fields in Patch requests. 452 NullFields []string `json:"-"` 453} 454 455func (s *BucketBilling) MarshalJSON() ([]byte, error) { 456 type NoMethod BucketBilling 457 raw := NoMethod(*s) 458 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 459} 460 461type BucketCors struct { 462 // MaxAgeSeconds: The value, in seconds, to return in the 463 // Access-Control-Max-Age header used in preflight responses. 464 MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"` 465 466 // Method: The list of HTTP methods on which to include CORS response 467 // headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list 468 // of methods, and means "any method". 469 Method []string `json:"method,omitempty"` 470 471 // Origin: The list of Origins eligible to receive CORS response 472 // headers. Note: "*" is permitted in the list of origins, and means 473 // "any Origin". 474 Origin []string `json:"origin,omitempty"` 475 476 // ResponseHeader: The list of HTTP headers other than the simple 477 // response headers to give permission for the user-agent to share 478 // across domains. 479 ResponseHeader []string `json:"responseHeader,omitempty"` 480 481 // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to 482 // unconditionally include in API requests. By default, fields with 483 // empty values are omitted from API requests. However, any non-pointer, 484 // non-interface field appearing in ForceSendFields will be sent to the 485 // server regardless of whether the field is empty or not. This may be 486 // used to include empty fields in Patch requests. 487 ForceSendFields []string `json:"-"` 488 489 // NullFields is a list of field names (e.g. "MaxAgeSeconds") to include 490 // in API requests with the JSON null value. By default, fields with 491 // empty values are omitted from API requests. However, any field with 492 // an empty value appearing in NullFields will be sent to the server as 493 // null. It is an error if a field in this list has a non-empty value. 494 // This may be used to include null fields in Patch requests. 495 NullFields []string `json:"-"` 496} 497 498func (s *BucketCors) MarshalJSON() ([]byte, error) { 499 type NoMethod BucketCors 500 raw := NoMethod(*s) 501 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 502} 503 504// BucketEncryption: Encryption configuration for a bucket. 505type BucketEncryption struct { 506 // DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt 507 // objects inserted into this bucket, if no encryption method is 508 // specified. 509 DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"` 510 511 // ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName") 512 // to unconditionally include in API requests. By default, fields with 513 // empty values are omitted from API requests. However, any non-pointer, 514 // non-interface field appearing in ForceSendFields will be sent to the 515 // server regardless of whether the field is empty or not. This may be 516 // used to include empty fields in Patch requests. 517 ForceSendFields []string `json:"-"` 518 519 // NullFields is a list of field names (e.g. "DefaultKmsKeyName") to 520 // include in API requests with the JSON null value. By default, fields 521 // with empty values are omitted from API requests. However, any field 522 // with an empty value appearing in NullFields will be sent to the 523 // server as null. It is an error if a field in this list has a 524 // non-empty value. This may be used to include null fields in Patch 525 // requests. 526 NullFields []string `json:"-"` 527} 528 529func (s *BucketEncryption) MarshalJSON() ([]byte, error) { 530 type NoMethod BucketEncryption 531 raw := NoMethod(*s) 532 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 533} 534 535// BucketIamConfiguration: The bucket's IAM configuration. 536type BucketIamConfiguration struct { 537 // BucketPolicyOnly: The bucket's uniform bucket-level access 538 // configuration. The feature was formerly known as Bucket Policy Only. 539 // For backward compatibility, this field will be populated with 540 // identical information as the uniformBucketLevelAccess field. We 541 // recommend using the uniformBucketLevelAccess field to enable and 542 // disable the feature. 543 BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"` 544 545 // PublicAccessPrevention: The bucket's Public Access Prevention 546 // configuration. Currently, 'unspecified' and 'enforced' are supported. 547 PublicAccessPrevention string `json:"publicAccessPrevention,omitempty"` 548 549 // UniformBucketLevelAccess: The bucket's uniform bucket-level access 550 // configuration. 551 UniformBucketLevelAccess *BucketIamConfigurationUniformBucketLevelAccess `json:"uniformBucketLevelAccess,omitempty"` 552 553 // ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to 554 // unconditionally include in API requests. By default, fields with 555 // empty values are omitted from API requests. However, any non-pointer, 556 // non-interface field appearing in ForceSendFields will be sent to the 557 // server regardless of whether the field is empty or not. This may be 558 // used to include empty fields in Patch requests. 559 ForceSendFields []string `json:"-"` 560 561 // NullFields is a list of field names (e.g. "BucketPolicyOnly") to 562 // include in API requests with the JSON null value. By default, fields 563 // with empty values are omitted from API requests. However, any field 564 // with an empty value appearing in NullFields will be sent to the 565 // server as null. It is an error if a field in this list has a 566 // non-empty value. This may be used to include null fields in Patch 567 // requests. 568 NullFields []string `json:"-"` 569} 570 571func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) { 572 type NoMethod BucketIamConfiguration 573 raw := NoMethod(*s) 574 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 575} 576 577// BucketIamConfigurationBucketPolicyOnly: The bucket's uniform 578// bucket-level access configuration. The feature was formerly known as 579// Bucket Policy Only. For backward compatibility, this field will be 580// populated with identical information as the uniformBucketLevelAccess 581// field. We recommend using the uniformBucketLevelAccess field to 582// enable and disable the feature. 583type BucketIamConfigurationBucketPolicyOnly struct { 584 // Enabled: If set, access is controlled only by bucket-level or above 585 // IAM policies. 586 Enabled bool `json:"enabled,omitempty"` 587 588 // LockedTime: The deadline for changing 589 // iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 590 // 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed 591 // from true to false until the locked time, after which the field is 592 // immutable. 593 LockedTime string `json:"lockedTime,omitempty"` 594 595 // ForceSendFields is a list of field names (e.g. "Enabled") to 596 // unconditionally include in API requests. By default, fields with 597 // empty values are omitted from API requests. However, any non-pointer, 598 // non-interface field appearing in ForceSendFields will be sent to the 599 // server regardless of whether the field is empty or not. This may be 600 // used to include empty fields in Patch requests. 601 ForceSendFields []string `json:"-"` 602 603 // NullFields is a list of field names (e.g. "Enabled") to include in 604 // API requests with the JSON null value. By default, fields with empty 605 // values are omitted from API requests. However, any field with an 606 // empty value appearing in NullFields will be sent to the server as 607 // null. It is an error if a field in this list has a non-empty value. 608 // This may be used to include null fields in Patch requests. 609 NullFields []string `json:"-"` 610} 611 612func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) { 613 type NoMethod BucketIamConfigurationBucketPolicyOnly 614 raw := NoMethod(*s) 615 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 616} 617 618// BucketIamConfigurationUniformBucketLevelAccess: The bucket's uniform 619// bucket-level access configuration. 620type BucketIamConfigurationUniformBucketLevelAccess struct { 621 // Enabled: If set, access is controlled only by bucket-level or above 622 // IAM policies. 623 Enabled bool `json:"enabled,omitempty"` 624 625 // LockedTime: The deadline for changing 626 // iamConfiguration.uniformBucketLevelAccess.enabled from true to false 627 // in RFC 3339 format. 628 // iamConfiguration.uniformBucketLevelAccess.enabled may be changed from 629 // true to false until the locked time, after which the field is 630 // immutable. 631 LockedTime string `json:"lockedTime,omitempty"` 632 633 // ForceSendFields is a list of field names (e.g. "Enabled") to 634 // unconditionally include in API requests. By default, fields with 635 // empty values are omitted from API requests. However, any non-pointer, 636 // non-interface field appearing in ForceSendFields will be sent to the 637 // server regardless of whether the field is empty or not. This may be 638 // used to include empty fields in Patch requests. 639 ForceSendFields []string `json:"-"` 640 641 // NullFields is a list of field names (e.g. "Enabled") to include in 642 // API requests with the JSON null value. By default, fields with empty 643 // values are omitted from API requests. However, any field with an 644 // empty value appearing in NullFields will be sent to the server as 645 // null. It is an error if a field in this list has a non-empty value. 646 // This may be used to include null fields in Patch requests. 647 NullFields []string `json:"-"` 648} 649 650func (s *BucketIamConfigurationUniformBucketLevelAccess) MarshalJSON() ([]byte, error) { 651 type NoMethod BucketIamConfigurationUniformBucketLevelAccess 652 raw := NoMethod(*s) 653 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 654} 655 656// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle 657// management for more information. 658type BucketLifecycle struct { 659 // Rule: A lifecycle management rule, which is made of an action to take 660 // and the condition(s) under which the action will be taken. 661 Rule []*BucketLifecycleRule `json:"rule,omitempty"` 662 663 // ForceSendFields is a list of field names (e.g. "Rule") to 664 // unconditionally include in API requests. By default, fields with 665 // empty values are omitted from API requests. However, any non-pointer, 666 // non-interface field appearing in ForceSendFields will be sent to the 667 // server regardless of whether the field is empty or not. This may be 668 // used to include empty fields in Patch requests. 669 ForceSendFields []string `json:"-"` 670 671 // NullFields is a list of field names (e.g. "Rule") to include in API 672 // requests with the JSON null value. By default, fields with empty 673 // values are omitted from API requests. However, any field with an 674 // empty value appearing in NullFields will be sent to the server as 675 // null. It is an error if a field in this list has a non-empty value. 676 // This may be used to include null fields in Patch requests. 677 NullFields []string `json:"-"` 678} 679 680func (s *BucketLifecycle) MarshalJSON() ([]byte, error) { 681 type NoMethod BucketLifecycle 682 raw := NoMethod(*s) 683 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 684} 685 686type BucketLifecycleRule struct { 687 // Action: The action to take. 688 Action *BucketLifecycleRuleAction `json:"action,omitempty"` 689 690 // Condition: The condition(s) under which the action will be taken. 691 Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"` 692 693 // ForceSendFields is a list of field names (e.g. "Action") to 694 // unconditionally include in API requests. By default, fields with 695 // empty values are omitted from API requests. However, any non-pointer, 696 // non-interface field appearing in ForceSendFields will be sent to the 697 // server regardless of whether the field is empty or not. This may be 698 // used to include empty fields in Patch requests. 699 ForceSendFields []string `json:"-"` 700 701 // NullFields is a list of field names (e.g. "Action") to include in API 702 // requests with the JSON null value. By default, fields with empty 703 // values are omitted from API requests. However, any field with an 704 // empty value appearing in NullFields will be sent to the server as 705 // null. It is an error if a field in this list has a non-empty value. 706 // This may be used to include null fields in Patch requests. 707 NullFields []string `json:"-"` 708} 709 710func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) { 711 type NoMethod BucketLifecycleRule 712 raw := NoMethod(*s) 713 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 714} 715 716// BucketLifecycleRuleAction: The action to take. 717type BucketLifecycleRuleAction struct { 718 // StorageClass: Target storage class. Required iff the type of the 719 // action is SetStorageClass. 720 StorageClass string `json:"storageClass,omitempty"` 721 722 // Type: Type of the action. Currently, only Delete and SetStorageClass 723 // are supported. 724 Type string `json:"type,omitempty"` 725 726 // ForceSendFields is a list of field names (e.g. "StorageClass") to 727 // unconditionally include in API requests. By default, fields with 728 // empty values are omitted from API requests. However, any non-pointer, 729 // non-interface field appearing in ForceSendFields will be sent to the 730 // server regardless of whether the field is empty or not. This may be 731 // used to include empty fields in Patch requests. 732 ForceSendFields []string `json:"-"` 733 734 // NullFields is a list of field names (e.g. "StorageClass") to include 735 // in API requests with the JSON null value. By default, fields with 736 // empty values are omitted from API requests. However, any field with 737 // an empty value appearing in NullFields will be sent to the server as 738 // null. It is an error if a field in this list has a non-empty value. 739 // This may be used to include null fields in Patch requests. 740 NullFields []string `json:"-"` 741} 742 743func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) { 744 type NoMethod BucketLifecycleRuleAction 745 raw := NoMethod(*s) 746 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 747} 748 749// BucketLifecycleRuleCondition: The condition(s) under which the action 750// will be taken. 751type BucketLifecycleRuleCondition struct { 752 // Age: Age of an object (in days). This condition is satisfied when an 753 // object reaches the specified age. 754 Age int64 `json:"age,omitempty"` 755 756 // CreatedBefore: A date in RFC 3339 format with only the date part (for 757 // instance, "2013-01-15"). This condition is satisfied when an object 758 // is created before midnight of the specified date in UTC. 759 CreatedBefore string `json:"createdBefore,omitempty"` 760 761 // CustomTimeBefore: A date in RFC 3339 format with only the date part 762 // (for instance, "2013-01-15"). This condition is satisfied when the 763 // custom time on an object is before this date in UTC. 764 CustomTimeBefore string `json:"customTimeBefore,omitempty"` 765 766 // DaysSinceCustomTime: Number of days elapsed since the user-specified 767 // timestamp set on an object. The condition is satisfied if the days 768 // elapsed is at least this number. If no custom timestamp is specified 769 // on an object, the condition does not apply. 770 DaysSinceCustomTime int64 `json:"daysSinceCustomTime,omitempty"` 771 772 // DaysSinceNoncurrentTime: Number of days elapsed since the noncurrent 773 // timestamp of an object. The condition is satisfied if the days 774 // elapsed is at least this number. This condition is relevant only for 775 // versioned objects. The value of the field must be a nonnegative 776 // integer. If it's zero, the object version will become eligible for 777 // Lifecycle action as soon as it becomes noncurrent. 778 DaysSinceNoncurrentTime int64 `json:"daysSinceNoncurrentTime,omitempty"` 779 780 // IsLive: Relevant only for versioned objects. If the value is true, 781 // this condition matches live objects; if the value is false, it 782 // matches archived objects. 783 IsLive *bool `json:"isLive,omitempty"` 784 785 // MatchesPattern: A regular expression that satisfies the RE2 syntax. 786 // This condition is satisfied when the name of the object matches the 787 // RE2 pattern. Note: This feature is currently in the "Early Access" 788 // launch stage and is only available to a whitelisted set of users; 789 // that means that this feature may be changed in backward-incompatible 790 // ways and that it is not guaranteed to be released. 791 MatchesPattern string `json:"matchesPattern,omitempty"` 792 793 // MatchesStorageClass: Objects having any of the storage classes 794 // specified by this condition will be matched. Values include 795 // MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and 796 // DURABLE_REDUCED_AVAILABILITY. 797 MatchesStorageClass []string `json:"matchesStorageClass,omitempty"` 798 799 // NoncurrentTimeBefore: A date in RFC 3339 format with only the date 800 // part (for instance, "2013-01-15"). This condition is satisfied when 801 // the noncurrent time on an object is before this date in UTC. This 802 // condition is relevant only for versioned objects. 803 NoncurrentTimeBefore string `json:"noncurrentTimeBefore,omitempty"` 804 805 // NumNewerVersions: Relevant only for versioned objects. If the value 806 // is N, this condition is satisfied when there are at least N versions 807 // (including the live version) newer than this version of the object. 808 NumNewerVersions int64 `json:"numNewerVersions,omitempty"` 809 810 // ForceSendFields is a list of field names (e.g. "Age") to 811 // unconditionally include in API requests. By default, fields with 812 // empty values are omitted from API requests. However, any non-pointer, 813 // non-interface field appearing in ForceSendFields will be sent to the 814 // server regardless of whether the field is empty or not. This may be 815 // used to include empty fields in Patch requests. 816 ForceSendFields []string `json:"-"` 817 818 // NullFields is a list of field names (e.g. "Age") to include in API 819 // requests with the JSON null value. By default, fields with empty 820 // values are omitted from API requests. However, any field with an 821 // empty value appearing in NullFields will be sent to the server as 822 // null. It is an error if a field in this list has a non-empty value. 823 // This may be used to include null fields in Patch requests. 824 NullFields []string `json:"-"` 825} 826 827func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) { 828 type NoMethod BucketLifecycleRuleCondition 829 raw := NoMethod(*s) 830 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 831} 832 833// BucketLogging: The bucket's logging configuration, which defines the 834// destination bucket and optional name prefix for the current bucket's 835// logs. 836type BucketLogging struct { 837 // LogBucket: The destination bucket where the current bucket's logs 838 // should be placed. 839 LogBucket string `json:"logBucket,omitempty"` 840 841 // LogObjectPrefix: A prefix for log object names. 842 LogObjectPrefix string `json:"logObjectPrefix,omitempty"` 843 844 // ForceSendFields is a list of field names (e.g. "LogBucket") to 845 // unconditionally include in API requests. By default, fields with 846 // empty values are omitted from API requests. However, any non-pointer, 847 // non-interface field appearing in ForceSendFields will be sent to the 848 // server regardless of whether the field is empty or not. This may be 849 // used to include empty fields in Patch requests. 850 ForceSendFields []string `json:"-"` 851 852 // NullFields is a list of field names (e.g. "LogBucket") to include in 853 // API requests with the JSON null value. By default, fields with empty 854 // values are omitted from API requests. However, any field with an 855 // empty value appearing in NullFields will be sent to the server as 856 // null. It is an error if a field in this list has a non-empty value. 857 // This may be used to include null fields in Patch requests. 858 NullFields []string `json:"-"` 859} 860 861func (s *BucketLogging) MarshalJSON() ([]byte, error) { 862 type NoMethod BucketLogging 863 raw := NoMethod(*s) 864 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 865} 866 867// BucketOwner: The owner of the bucket. This is always the project 868// team's owner group. 869type BucketOwner struct { 870 // Entity: The entity, in the form project-owner-projectId. 871 Entity string `json:"entity,omitempty"` 872 873 // EntityId: The ID for the entity. 874 EntityId string `json:"entityId,omitempty"` 875 876 // ForceSendFields is a list of field names (e.g. "Entity") to 877 // unconditionally include in API requests. By default, fields with 878 // empty values are omitted from API requests. However, any non-pointer, 879 // non-interface field appearing in ForceSendFields will be sent to the 880 // server regardless of whether the field is empty or not. This may be 881 // used to include empty fields in Patch requests. 882 ForceSendFields []string `json:"-"` 883 884 // NullFields is a list of field names (e.g. "Entity") to include in API 885 // requests with the JSON null value. By default, fields with empty 886 // values are omitted from API requests. However, any field with an 887 // empty value appearing in NullFields will be sent to the server as 888 // null. It is an error if a field in this list has a non-empty value. 889 // This may be used to include null fields in Patch requests. 890 NullFields []string `json:"-"` 891} 892 893func (s *BucketOwner) MarshalJSON() ([]byte, error) { 894 type NoMethod BucketOwner 895 raw := NoMethod(*s) 896 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 897} 898 899// BucketRetentionPolicy: The bucket's retention policy. The retention 900// policy enforces a minimum retention time for all objects contained in 901// the bucket, based on their creation time. Any attempt to overwrite or 902// delete objects younger than the retention period will result in a 903// PERMISSION_DENIED error. An unlocked retention policy can be modified 904// or removed from the bucket via a storage.buckets.update operation. A 905// locked retention policy cannot be removed or shortened in duration 906// for the lifetime of the bucket. Attempting to remove or decrease 907// period of a locked retention policy will result in a 908// PERMISSION_DENIED error. 909type BucketRetentionPolicy struct { 910 // EffectiveTime: Server-determined value that indicates the time from 911 // which policy was enforced and effective. This value is in RFC 3339 912 // format. 913 EffectiveTime string `json:"effectiveTime,omitempty"` 914 915 // IsLocked: Once locked, an object retention policy cannot be modified. 916 IsLocked bool `json:"isLocked,omitempty"` 917 918 // RetentionPeriod: The duration in seconds that objects need to be 919 // retained. Retention duration must be greater than zero and less than 920 // 100 years. Note that enforcement of retention periods less than a day 921 // is not guaranteed. Such periods should only be used for testing 922 // purposes. 923 RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"` 924 925 // ForceSendFields is a list of field names (e.g. "EffectiveTime") to 926 // unconditionally include in API requests. By default, fields with 927 // empty values are omitted from API requests. However, any non-pointer, 928 // non-interface field appearing in ForceSendFields will be sent to the 929 // server regardless of whether the field is empty or not. This may be 930 // used to include empty fields in Patch requests. 931 ForceSendFields []string `json:"-"` 932 933 // NullFields is a list of field names (e.g. "EffectiveTime") to include 934 // in API requests with the JSON null value. By default, fields with 935 // empty values are omitted from API requests. However, any field with 936 // an empty value appearing in NullFields will be sent to the server as 937 // null. It is an error if a field in this list has a non-empty value. 938 // This may be used to include null fields in Patch requests. 939 NullFields []string `json:"-"` 940} 941 942func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) { 943 type NoMethod BucketRetentionPolicy 944 raw := NoMethod(*s) 945 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 946} 947 948// BucketVersioning: The bucket's versioning configuration. 949type BucketVersioning struct { 950 // Enabled: While set to true, versioning is fully enabled for this 951 // bucket. 952 Enabled bool `json:"enabled,omitempty"` 953 954 // ForceSendFields is a list of field names (e.g. "Enabled") to 955 // unconditionally include in API requests. By default, fields with 956 // empty values are omitted from API requests. However, any non-pointer, 957 // non-interface field appearing in ForceSendFields will be sent to the 958 // server regardless of whether the field is empty or not. This may be 959 // used to include empty fields in Patch requests. 960 ForceSendFields []string `json:"-"` 961 962 // NullFields is a list of field names (e.g. "Enabled") to include in 963 // API requests with the JSON null value. By default, fields with empty 964 // values are omitted from API requests. However, any field with an 965 // empty value appearing in NullFields will be sent to the server as 966 // null. It is an error if a field in this list has a non-empty value. 967 // This may be used to include null fields in Patch requests. 968 NullFields []string `json:"-"` 969} 970 971func (s *BucketVersioning) MarshalJSON() ([]byte, error) { 972 type NoMethod BucketVersioning 973 raw := NoMethod(*s) 974 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 975} 976 977// BucketWebsite: The bucket's website configuration, controlling how 978// the service behaves when accessing bucket contents as a web site. See 979// the Static Website Examples for more information. 980type BucketWebsite struct { 981 // MainPageSuffix: If the requested object path is missing, the service 982 // will ensure the path has a trailing '/', append this suffix, and 983 // attempt to retrieve the resulting object. This allows the creation of 984 // index.html objects to represent directory pages. 985 MainPageSuffix string `json:"mainPageSuffix,omitempty"` 986 987 // NotFoundPage: If the requested object path is missing, and any 988 // mainPageSuffix object is missing, if applicable, the service will 989 // return the named object from this bucket as the content for a 404 Not 990 // Found result. 991 NotFoundPage string `json:"notFoundPage,omitempty"` 992 993 // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to 994 // unconditionally include in API requests. By default, fields with 995 // empty values are omitted from API requests. However, any non-pointer, 996 // non-interface field appearing in ForceSendFields will be sent to the 997 // server regardless of whether the field is empty or not. This may be 998 // used to include empty fields in Patch requests. 999 ForceSendFields []string `json:"-"` 1000 1001 // NullFields is a list of field names (e.g. "MainPageSuffix") to 1002 // include in API requests with the JSON null value. By default, fields 1003 // with empty values are omitted from API requests. However, any field 1004 // with an empty value appearing in NullFields will be sent to the 1005 // server as null. It is an error if a field in this list has a 1006 // non-empty value. This may be used to include null fields in Patch 1007 // requests. 1008 NullFields []string `json:"-"` 1009} 1010 1011func (s *BucketWebsite) MarshalJSON() ([]byte, error) { 1012 type NoMethod BucketWebsite 1013 raw := NoMethod(*s) 1014 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1015} 1016 1017// BucketAccessControl: An access-control entry. 1018type BucketAccessControl struct { 1019 // Bucket: The name of the bucket. 1020 Bucket string `json:"bucket,omitempty"` 1021 1022 // Domain: The domain associated with the entity, if any. 1023 Domain string `json:"domain,omitempty"` 1024 1025 // Email: The email address associated with the entity, if any. 1026 Email string `json:"email,omitempty"` 1027 1028 // Entity: The entity holding the permission, in one of the following 1029 // forms: 1030 // - user-userId 1031 // - user-email 1032 // - group-groupId 1033 // - group-email 1034 // - domain-domain 1035 // - project-team-projectId 1036 // - allUsers 1037 // - allAuthenticatedUsers Examples: 1038 // - The user liz@example.com would be user-liz@example.com. 1039 // - The group example@googlegroups.com would be 1040 // group-example@googlegroups.com. 1041 // - To refer to all members of the Google Apps for Business domain 1042 // example.com, the entity would be domain-example.com. 1043 Entity string `json:"entity,omitempty"` 1044 1045 // EntityId: The ID for the entity, if any. 1046 EntityId string `json:"entityId,omitempty"` 1047 1048 // Etag: HTTP 1.1 Entity tag for the access-control entry. 1049 Etag string `json:"etag,omitempty"` 1050 1051 // Id: The ID of the access-control entry. 1052 Id string `json:"id,omitempty"` 1053 1054 // Kind: The kind of item this is. For bucket access control entries, 1055 // this is always storage#bucketAccessControl. 1056 Kind string `json:"kind,omitempty"` 1057 1058 // ProjectTeam: The project team associated with the entity, if any. 1059 ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"` 1060 1061 // Role: The access permission for the entity. 1062 Role string `json:"role,omitempty"` 1063 1064 // SelfLink: The link to this access-control entry. 1065 SelfLink string `json:"selfLink,omitempty"` 1066 1067 // ServerResponse contains the HTTP response code and headers from the 1068 // server. 1069 googleapi.ServerResponse `json:"-"` 1070 1071 // ForceSendFields is a list of field names (e.g. "Bucket") to 1072 // unconditionally include in API requests. By default, fields with 1073 // empty values are omitted from API requests. However, any non-pointer, 1074 // non-interface field appearing in ForceSendFields will be sent to the 1075 // server regardless of whether the field is empty or not. This may be 1076 // used to include empty fields in Patch requests. 1077 ForceSendFields []string `json:"-"` 1078 1079 // NullFields is a list of field names (e.g. "Bucket") to include in API 1080 // requests with the JSON null value. By default, fields with empty 1081 // values are omitted from API requests. However, any field with an 1082 // empty value appearing in NullFields will be sent to the server as 1083 // null. It is an error if a field in this list has a non-empty value. 1084 // This may be used to include null fields in Patch requests. 1085 NullFields []string `json:"-"` 1086} 1087 1088func (s *BucketAccessControl) MarshalJSON() ([]byte, error) { 1089 type NoMethod BucketAccessControl 1090 raw := NoMethod(*s) 1091 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1092} 1093 1094// BucketAccessControlProjectTeam: The project team associated with the 1095// entity, if any. 1096type BucketAccessControlProjectTeam struct { 1097 // ProjectNumber: The project number. 1098 ProjectNumber string `json:"projectNumber,omitempty"` 1099 1100 // Team: The team. 1101 Team string `json:"team,omitempty"` 1102 1103 // ForceSendFields is a list of field names (e.g. "ProjectNumber") to 1104 // unconditionally include in API requests. By default, fields with 1105 // empty values are omitted from API requests. However, any non-pointer, 1106 // non-interface field appearing in ForceSendFields will be sent to the 1107 // server regardless of whether the field is empty or not. This may be 1108 // used to include empty fields in Patch requests. 1109 ForceSendFields []string `json:"-"` 1110 1111 // NullFields is a list of field names (e.g. "ProjectNumber") to include 1112 // in API requests with the JSON null value. By default, fields with 1113 // empty values are omitted from API requests. However, any field with 1114 // an empty value appearing in NullFields will be sent to the server as 1115 // null. It is an error if a field in this list has a non-empty value. 1116 // This may be used to include null fields in Patch requests. 1117 NullFields []string `json:"-"` 1118} 1119 1120func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) { 1121 type NoMethod BucketAccessControlProjectTeam 1122 raw := NoMethod(*s) 1123 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1124} 1125 1126// BucketAccessControls: An access-control list. 1127type BucketAccessControls struct { 1128 // Items: The list of items. 1129 Items []*BucketAccessControl `json:"items,omitempty"` 1130 1131 // Kind: The kind of item this is. For lists of bucket access control 1132 // entries, this is always storage#bucketAccessControls. 1133 Kind string `json:"kind,omitempty"` 1134 1135 // ServerResponse contains the HTTP response code and headers from the 1136 // server. 1137 googleapi.ServerResponse `json:"-"` 1138 1139 // ForceSendFields is a list of field names (e.g. "Items") to 1140 // unconditionally include in API requests. By default, fields with 1141 // empty values are omitted from API requests. However, any non-pointer, 1142 // non-interface field appearing in ForceSendFields will be sent to the 1143 // server regardless of whether the field is empty or not. This may be 1144 // used to include empty fields in Patch requests. 1145 ForceSendFields []string `json:"-"` 1146 1147 // NullFields is a list of field names (e.g. "Items") to include in API 1148 // requests with the JSON null value. By default, fields with empty 1149 // values are omitted from API requests. However, any field with an 1150 // empty value appearing in NullFields will be sent to the server as 1151 // null. It is an error if a field in this list has a non-empty value. 1152 // This may be used to include null fields in Patch requests. 1153 NullFields []string `json:"-"` 1154} 1155 1156func (s *BucketAccessControls) MarshalJSON() ([]byte, error) { 1157 type NoMethod BucketAccessControls 1158 raw := NoMethod(*s) 1159 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1160} 1161 1162// Buckets: A list of buckets. 1163type Buckets struct { 1164 // Items: The list of items. 1165 Items []*Bucket `json:"items,omitempty"` 1166 1167 // Kind: The kind of item this is. For lists of buckets, this is always 1168 // storage#buckets. 1169 Kind string `json:"kind,omitempty"` 1170 1171 // NextPageToken: The continuation token, used to page through large 1172 // result sets. Provide this value in a subsequent request to return the 1173 // next page of results. 1174 NextPageToken string `json:"nextPageToken,omitempty"` 1175 1176 // ServerResponse contains the HTTP response code and headers from the 1177 // server. 1178 googleapi.ServerResponse `json:"-"` 1179 1180 // ForceSendFields is a list of field names (e.g. "Items") to 1181 // unconditionally include in API requests. By default, fields with 1182 // empty values are omitted from API requests. However, any non-pointer, 1183 // non-interface field appearing in ForceSendFields will be sent to the 1184 // server regardless of whether the field is empty or not. This may be 1185 // used to include empty fields in Patch requests. 1186 ForceSendFields []string `json:"-"` 1187 1188 // NullFields is a list of field names (e.g. "Items") to include in API 1189 // requests with the JSON null value. By default, fields with empty 1190 // values are omitted from API requests. However, any field with an 1191 // empty value appearing in NullFields will be sent to the server as 1192 // null. It is an error if a field in this list has a non-empty value. 1193 // This may be used to include null fields in Patch requests. 1194 NullFields []string `json:"-"` 1195} 1196 1197func (s *Buckets) MarshalJSON() ([]byte, error) { 1198 type NoMethod Buckets 1199 raw := NoMethod(*s) 1200 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1201} 1202 1203// Channel: An notification channel used to watch for resource changes. 1204type Channel struct { 1205 // Address: The address where notifications are delivered for this 1206 // channel. 1207 Address string `json:"address,omitempty"` 1208 1209 // Expiration: Date and time of notification channel expiration, 1210 // expressed as a Unix timestamp, in milliseconds. Optional. 1211 Expiration int64 `json:"expiration,omitempty,string"` 1212 1213 // Id: A UUID or similar unique string that identifies this channel. 1214 Id string `json:"id,omitempty"` 1215 1216 // Kind: Identifies this as a notification channel used to watch for 1217 // changes to a resource, which is "api#channel". 1218 Kind string `json:"kind,omitempty"` 1219 1220 // Params: Additional parameters controlling delivery channel behavior. 1221 // Optional. 1222 Params map[string]string `json:"params,omitempty"` 1223 1224 // Payload: A Boolean value to indicate whether payload is wanted. 1225 // Optional. 1226 Payload bool `json:"payload,omitempty"` 1227 1228 // ResourceId: An opaque ID that identifies the resource being watched 1229 // on this channel. Stable across different API versions. 1230 ResourceId string `json:"resourceId,omitempty"` 1231 1232 // ResourceUri: A version-specific identifier for the watched resource. 1233 ResourceUri string `json:"resourceUri,omitempty"` 1234 1235 // Token: An arbitrary string delivered to the target address with each 1236 // notification delivered over this channel. Optional. 1237 Token string `json:"token,omitempty"` 1238 1239 // Type: The type of delivery mechanism used for this channel. 1240 Type string `json:"type,omitempty"` 1241 1242 // ServerResponse contains the HTTP response code and headers from the 1243 // server. 1244 googleapi.ServerResponse `json:"-"` 1245 1246 // ForceSendFields is a list of field names (e.g. "Address") to 1247 // unconditionally include in API requests. By default, fields with 1248 // empty values are omitted from API requests. However, any non-pointer, 1249 // non-interface field appearing in ForceSendFields will be sent to the 1250 // server regardless of whether the field is empty or not. This may be 1251 // used to include empty fields in Patch requests. 1252 ForceSendFields []string `json:"-"` 1253 1254 // NullFields is a list of field names (e.g. "Address") to include in 1255 // API requests with the JSON null value. By default, fields with empty 1256 // values are omitted from API requests. However, any field with an 1257 // empty value appearing in NullFields will be sent to the server as 1258 // null. It is an error if a field in this list has a non-empty value. 1259 // This may be used to include null fields in Patch requests. 1260 NullFields []string `json:"-"` 1261} 1262 1263func (s *Channel) MarshalJSON() ([]byte, error) { 1264 type NoMethod Channel 1265 raw := NoMethod(*s) 1266 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1267} 1268 1269// ComposeRequest: A Compose request. 1270type ComposeRequest struct { 1271 // Destination: Properties of the resulting object. 1272 Destination *Object `json:"destination,omitempty"` 1273 1274 // Kind: The kind of item this is. 1275 Kind string `json:"kind,omitempty"` 1276 1277 // SourceObjects: The list of source objects that will be concatenated 1278 // into a single object. 1279 SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"` 1280 1281 // ForceSendFields is a list of field names (e.g. "Destination") to 1282 // unconditionally include in API requests. By default, fields with 1283 // empty values are omitted from API requests. However, any non-pointer, 1284 // non-interface field appearing in ForceSendFields will be sent to the 1285 // server regardless of whether the field is empty or not. This may be 1286 // used to include empty fields in Patch requests. 1287 ForceSendFields []string `json:"-"` 1288 1289 // NullFields is a list of field names (e.g. "Destination") to include 1290 // in API requests with the JSON null value. By default, fields with 1291 // empty values are omitted from API requests. However, any field with 1292 // an empty value appearing in NullFields will be sent to the server as 1293 // null. It is an error if a field in this list has a non-empty value. 1294 // This may be used to include null fields in Patch requests. 1295 NullFields []string `json:"-"` 1296} 1297 1298func (s *ComposeRequest) MarshalJSON() ([]byte, error) { 1299 type NoMethod ComposeRequest 1300 raw := NoMethod(*s) 1301 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1302} 1303 1304type ComposeRequestSourceObjects struct { 1305 // Generation: The generation of this object to use as the source. 1306 Generation int64 `json:"generation,omitempty,string"` 1307 1308 // Name: The source object's name. All source objects must reside in the 1309 // same bucket. 1310 Name string `json:"name,omitempty"` 1311 1312 // ObjectPreconditions: Conditions that must be met for this operation 1313 // to execute. 1314 ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"` 1315 1316 // ForceSendFields is a list of field names (e.g. "Generation") to 1317 // unconditionally include in API requests. By default, fields with 1318 // empty values are omitted from API requests. However, any non-pointer, 1319 // non-interface field appearing in ForceSendFields will be sent to the 1320 // server regardless of whether the field is empty or not. This may be 1321 // used to include empty fields in Patch requests. 1322 ForceSendFields []string `json:"-"` 1323 1324 // NullFields is a list of field names (e.g. "Generation") to include in 1325 // API requests with the JSON null value. By default, fields with empty 1326 // values are omitted from API requests. However, any field with an 1327 // empty value appearing in NullFields will be sent to the server as 1328 // null. It is an error if a field in this list has a non-empty value. 1329 // This may be used to include null fields in Patch requests. 1330 NullFields []string `json:"-"` 1331} 1332 1333func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) { 1334 type NoMethod ComposeRequestSourceObjects 1335 raw := NoMethod(*s) 1336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1337} 1338 1339// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must 1340// be met for this operation to execute. 1341type ComposeRequestSourceObjectsObjectPreconditions struct { 1342 // IfGenerationMatch: Only perform the composition if the generation of 1343 // the source object that would be used matches this value. If this 1344 // value and a generation are both specified, they must be the same 1345 // value or the call will fail. 1346 IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"` 1347 1348 // ForceSendFields is a list of field names (e.g. "IfGenerationMatch") 1349 // to unconditionally include in API requests. By default, fields with 1350 // empty values are omitted from API requests. However, any non-pointer, 1351 // non-interface field appearing in ForceSendFields will be sent to the 1352 // server regardless of whether the field is empty or not. This may be 1353 // used to include empty fields in Patch requests. 1354 ForceSendFields []string `json:"-"` 1355 1356 // NullFields is a list of field names (e.g. "IfGenerationMatch") to 1357 // include in API requests with the JSON null value. By default, fields 1358 // with empty values are omitted from API requests. However, any field 1359 // with an empty value appearing in NullFields will be sent to the 1360 // server as null. It is an error if a field in this list has a 1361 // non-empty value. This may be used to include null fields in Patch 1362 // requests. 1363 NullFields []string `json:"-"` 1364} 1365 1366func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) { 1367 type NoMethod ComposeRequestSourceObjectsObjectPreconditions 1368 raw := NoMethod(*s) 1369 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1370} 1371 1372// Expr: Represents an expression text. Example: title: "User account 1373// presence" description: "Determines whether the request has a user 1374// account" expression: "size(request.user) > 0" 1375type Expr struct { 1376 // Description: An optional description of the expression. This is a 1377 // longer text which describes the expression, e.g. when hovered over it 1378 // in a UI. 1379 Description string `json:"description,omitempty"` 1380 1381 // Expression: Textual representation of an expression in Common 1382 // Expression Language syntax. The application context of the containing 1383 // message determines which well-known feature set of CEL is supported. 1384 Expression string `json:"expression,omitempty"` 1385 1386 // Location: An optional string indicating the location of the 1387 // expression for error reporting, e.g. a file name and a position in 1388 // the file. 1389 Location string `json:"location,omitempty"` 1390 1391 // Title: An optional title for the expression, i.e. a short string 1392 // describing its purpose. This can be used e.g. in UIs which allow to 1393 // enter the expression. 1394 Title string `json:"title,omitempty"` 1395 1396 // ForceSendFields is a list of field names (e.g. "Description") to 1397 // unconditionally include in API requests. By default, fields with 1398 // empty values are omitted from API requests. However, any non-pointer, 1399 // non-interface field appearing in ForceSendFields will be sent to the 1400 // server regardless of whether the field is empty or not. This may be 1401 // used to include empty fields in Patch requests. 1402 ForceSendFields []string `json:"-"` 1403 1404 // NullFields is a list of field names (e.g. "Description") to include 1405 // in API requests with the JSON null value. By default, fields with 1406 // empty values are omitted from API requests. However, any field with 1407 // an empty value appearing in NullFields will be sent to the server as 1408 // null. It is an error if a field in this list has a non-empty value. 1409 // This may be used to include null fields in Patch requests. 1410 NullFields []string `json:"-"` 1411} 1412 1413func (s *Expr) MarshalJSON() ([]byte, error) { 1414 type NoMethod Expr 1415 raw := NoMethod(*s) 1416 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1417} 1418 1419// HmacKey: JSON template to produce a JSON-style HMAC Key resource for 1420// Create responses. 1421type HmacKey struct { 1422 // Kind: The kind of item this is. For HMAC keys, this is always 1423 // storage#hmacKey. 1424 Kind string `json:"kind,omitempty"` 1425 1426 // Metadata: Key metadata. 1427 Metadata *HmacKeyMetadata `json:"metadata,omitempty"` 1428 1429 // Secret: HMAC secret key material. 1430 Secret string `json:"secret,omitempty"` 1431 1432 // ServerResponse contains the HTTP response code and headers from the 1433 // server. 1434 googleapi.ServerResponse `json:"-"` 1435 1436 // ForceSendFields is a list of field names (e.g. "Kind") to 1437 // unconditionally include in API requests. By default, fields with 1438 // empty values are omitted from API requests. However, any non-pointer, 1439 // non-interface field appearing in ForceSendFields will be sent to the 1440 // server regardless of whether the field is empty or not. This may be 1441 // used to include empty fields in Patch requests. 1442 ForceSendFields []string `json:"-"` 1443 1444 // NullFields is a list of field names (e.g. "Kind") to include in API 1445 // requests with the JSON null value. By default, fields with empty 1446 // values are omitted from API requests. However, any field with an 1447 // empty value appearing in NullFields will be sent to the server as 1448 // null. It is an error if a field in this list has a non-empty value. 1449 // This may be used to include null fields in Patch requests. 1450 NullFields []string `json:"-"` 1451} 1452 1453func (s *HmacKey) MarshalJSON() ([]byte, error) { 1454 type NoMethod HmacKey 1455 raw := NoMethod(*s) 1456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1457} 1458 1459// HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key 1460// metadata resource. 1461type HmacKeyMetadata struct { 1462 // AccessId: The ID of the HMAC Key. 1463 AccessId string `json:"accessId,omitempty"` 1464 1465 // Etag: HTTP 1.1 Entity tag for the HMAC key. 1466 Etag string `json:"etag,omitempty"` 1467 1468 // Id: The ID of the HMAC key, including the Project ID and the Access 1469 // ID. 1470 Id string `json:"id,omitempty"` 1471 1472 // Kind: The kind of item this is. For HMAC Key metadata, this is always 1473 // storage#hmacKeyMetadata. 1474 Kind string `json:"kind,omitempty"` 1475 1476 // ProjectId: Project ID owning the service account to which the key 1477 // authenticates. 1478 ProjectId string `json:"projectId,omitempty"` 1479 1480 // SelfLink: The link to this resource. 1481 SelfLink string `json:"selfLink,omitempty"` 1482 1483 // ServiceAccountEmail: The email address of the key's associated 1484 // service account. 1485 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 1486 1487 // State: The state of the key. Can be one of ACTIVE, INACTIVE, or 1488 // DELETED. 1489 State string `json:"state,omitempty"` 1490 1491 // TimeCreated: The creation time of the HMAC key in RFC 3339 format. 1492 TimeCreated string `json:"timeCreated,omitempty"` 1493 1494 // Updated: The last modification time of the HMAC key metadata in RFC 1495 // 3339 format. 1496 Updated string `json:"updated,omitempty"` 1497 1498 // ServerResponse contains the HTTP response code and headers from the 1499 // server. 1500 googleapi.ServerResponse `json:"-"` 1501 1502 // ForceSendFields is a list of field names (e.g. "AccessId") to 1503 // unconditionally include in API requests. By default, fields with 1504 // empty values are omitted from API requests. However, any non-pointer, 1505 // non-interface field appearing in ForceSendFields will be sent to the 1506 // server regardless of whether the field is empty or not. This may be 1507 // used to include empty fields in Patch requests. 1508 ForceSendFields []string `json:"-"` 1509 1510 // NullFields is a list of field names (e.g. "AccessId") to include in 1511 // API requests with the JSON null value. By default, fields with empty 1512 // values are omitted from API requests. However, any field with an 1513 // empty value appearing in NullFields will be sent to the server as 1514 // null. It is an error if a field in this list has a non-empty value. 1515 // This may be used to include null fields in Patch requests. 1516 NullFields []string `json:"-"` 1517} 1518 1519func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) { 1520 type NoMethod HmacKeyMetadata 1521 raw := NoMethod(*s) 1522 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1523} 1524 1525// HmacKeysMetadata: A list of hmacKeys. 1526type HmacKeysMetadata struct { 1527 // Items: The list of items. 1528 Items []*HmacKeyMetadata `json:"items,omitempty"` 1529 1530 // Kind: The kind of item this is. For lists of hmacKeys, this is always 1531 // storage#hmacKeysMetadata. 1532 Kind string `json:"kind,omitempty"` 1533 1534 // NextPageToken: The continuation token, used to page through large 1535 // result sets. Provide this value in a subsequent request to return the 1536 // next page of results. 1537 NextPageToken string `json:"nextPageToken,omitempty"` 1538 1539 // ServerResponse contains the HTTP response code and headers from the 1540 // server. 1541 googleapi.ServerResponse `json:"-"` 1542 1543 // ForceSendFields is a list of field names (e.g. "Items") to 1544 // unconditionally include in API requests. By default, fields with 1545 // empty values are omitted from API requests. However, any non-pointer, 1546 // non-interface field appearing in ForceSendFields will be sent to the 1547 // server regardless of whether the field is empty or not. This may be 1548 // used to include empty fields in Patch requests. 1549 ForceSendFields []string `json:"-"` 1550 1551 // NullFields is a list of field names (e.g. "Items") to include in API 1552 // requests with the JSON null value. By default, fields with empty 1553 // values are omitted from API requests. However, any field with an 1554 // empty value appearing in NullFields will be sent to the server as 1555 // null. It is an error if a field in this list has a non-empty value. 1556 // This may be used to include null fields in Patch requests. 1557 NullFields []string `json:"-"` 1558} 1559 1560func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) { 1561 type NoMethod HmacKeysMetadata 1562 raw := NoMethod(*s) 1563 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1564} 1565 1566// Notification: A subscription to receive Google PubSub notifications. 1567type Notification struct { 1568 // CustomAttributes: An optional list of additional attributes to attach 1569 // to each Cloud PubSub message published for this notification 1570 // subscription. 1571 CustomAttributes map[string]string `json:"custom_attributes,omitempty"` 1572 1573 // Etag: HTTP 1.1 Entity tag for this subscription notification. 1574 Etag string `json:"etag,omitempty"` 1575 1576 // EventTypes: If present, only send notifications about listed event 1577 // types. If empty, sent notifications for all event types. 1578 EventTypes []string `json:"event_types,omitempty"` 1579 1580 // Id: The ID of the notification. 1581 Id string `json:"id,omitempty"` 1582 1583 // Kind: The kind of item this is. For notifications, this is always 1584 // storage#notification. 1585 Kind string `json:"kind,omitempty"` 1586 1587 // ObjectNamePrefix: If present, only apply this notification 1588 // configuration to object names that begin with this prefix. 1589 ObjectNamePrefix string `json:"object_name_prefix,omitempty"` 1590 1591 // PayloadFormat: The desired content of the Payload. 1592 PayloadFormat string `json:"payload_format,omitempty"` 1593 1594 // SelfLink: The canonical URL of this notification. 1595 SelfLink string `json:"selfLink,omitempty"` 1596 1597 // Topic: The Cloud PubSub topic to which this subscription publishes. 1598 // Formatted as: 1599 // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi 1600 // c}' 1601 Topic string `json:"topic,omitempty"` 1602 1603 // ServerResponse contains the HTTP response code and headers from the 1604 // server. 1605 googleapi.ServerResponse `json:"-"` 1606 1607 // ForceSendFields is a list of field names (e.g. "CustomAttributes") to 1608 // unconditionally include in API requests. By default, fields with 1609 // empty values are omitted from API requests. However, any non-pointer, 1610 // non-interface field appearing in ForceSendFields will be sent to the 1611 // server regardless of whether the field is empty or not. This may be 1612 // used to include empty fields in Patch requests. 1613 ForceSendFields []string `json:"-"` 1614 1615 // NullFields is a list of field names (e.g. "CustomAttributes") to 1616 // include in API requests with the JSON null value. By default, fields 1617 // with empty values are omitted from API requests. However, any field 1618 // with an empty value appearing in NullFields will be sent to the 1619 // server as null. It is an error if a field in this list has a 1620 // non-empty value. This may be used to include null fields in Patch 1621 // requests. 1622 NullFields []string `json:"-"` 1623} 1624 1625func (s *Notification) MarshalJSON() ([]byte, error) { 1626 type NoMethod Notification 1627 raw := NoMethod(*s) 1628 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1629} 1630 1631// Notifications: A list of notification subscriptions. 1632type Notifications struct { 1633 // Items: The list of items. 1634 Items []*Notification `json:"items,omitempty"` 1635 1636 // Kind: The kind of item this is. For lists of notifications, this is 1637 // always storage#notifications. 1638 Kind string `json:"kind,omitempty"` 1639 1640 // ServerResponse contains the HTTP response code and headers from the 1641 // server. 1642 googleapi.ServerResponse `json:"-"` 1643 1644 // ForceSendFields is a list of field names (e.g. "Items") to 1645 // unconditionally include in API requests. By default, fields with 1646 // empty values are omitted from API requests. However, any non-pointer, 1647 // non-interface field appearing in ForceSendFields will be sent to the 1648 // server regardless of whether the field is empty or not. This may be 1649 // used to include empty fields in Patch requests. 1650 ForceSendFields []string `json:"-"` 1651 1652 // NullFields is a list of field names (e.g. "Items") to include in API 1653 // requests with the JSON null value. By default, fields with empty 1654 // values are omitted from API requests. However, any field with an 1655 // empty value appearing in NullFields will be sent to the server as 1656 // null. It is an error if a field in this list has a non-empty value. 1657 // This may be used to include null fields in Patch requests. 1658 NullFields []string `json:"-"` 1659} 1660 1661func (s *Notifications) MarshalJSON() ([]byte, error) { 1662 type NoMethod Notifications 1663 raw := NoMethod(*s) 1664 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1665} 1666 1667// Object: An object. 1668type Object struct { 1669 // Acl: Access controls on the object. 1670 Acl []*ObjectAccessControl `json:"acl,omitempty"` 1671 1672 // Bucket: The name of the bucket containing this object. 1673 Bucket string `json:"bucket,omitempty"` 1674 1675 // CacheControl: Cache-Control directive for the object data. If 1676 // omitted, and the object is accessible to all anonymous users, the 1677 // default will be public, max-age=3600. 1678 CacheControl string `json:"cacheControl,omitempty"` 1679 1680 // ComponentCount: Number of underlying components that make up this 1681 // object. Components are accumulated by compose operations. 1682 ComponentCount int64 `json:"componentCount,omitempty"` 1683 1684 // ContentDisposition: Content-Disposition of the object data. 1685 ContentDisposition string `json:"contentDisposition,omitempty"` 1686 1687 // ContentEncoding: Content-Encoding of the object data. 1688 ContentEncoding string `json:"contentEncoding,omitempty"` 1689 1690 // ContentLanguage: Content-Language of the object data. 1691 ContentLanguage string `json:"contentLanguage,omitempty"` 1692 1693 // ContentType: Content-Type of the object data. If an object is stored 1694 // without a Content-Type, it is served as application/octet-stream. 1695 ContentType string `json:"contentType,omitempty"` 1696 1697 // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B; 1698 // encoded using base64 in big-endian byte order. For more information 1699 // about using the CRC32c checksum, see Hashes and ETags: Best 1700 // Practices. 1701 Crc32c string `json:"crc32c,omitempty"` 1702 1703 // CustomTime: A timestamp in RFC 3339 format specified by the user for 1704 // an object. 1705 CustomTime string `json:"customTime,omitempty"` 1706 1707 // CustomerEncryption: Metadata of customer-supplied encryption key, if 1708 // the object is encrypted by such a key. 1709 CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"` 1710 1711 // Etag: HTTP 1.1 Entity tag for the object. 1712 Etag string `json:"etag,omitempty"` 1713 1714 // EventBasedHold: Whether an object is under event-based hold. 1715 // Event-based hold is a way to retain objects until an event occurs, 1716 // which is signified by the hold's release (i.e. this value is set to 1717 // false). After being released (set to false), such objects will be 1718 // subject to bucket-level retention (if any). One sample use case of 1719 // this flag is for banks to hold loan documents for at least 3 years 1720 // after loan is paid in full. Here, bucket-level retention is 3 years 1721 // and the event is the loan being paid in full. In this example, these 1722 // objects will be held intact for any number of years until the event 1723 // has occurred (event-based hold on the object is released) and then 3 1724 // more years after that. That means retention duration of the objects 1725 // begins from the moment event-based hold transitioned from true to 1726 // false. 1727 EventBasedHold bool `json:"eventBasedHold,omitempty"` 1728 1729 // Generation: The content generation of this object. Used for object 1730 // versioning. 1731 Generation int64 `json:"generation,omitempty,string"` 1732 1733 // Id: The ID of the object, including the bucket name, object name, and 1734 // generation number. 1735 Id string `json:"id,omitempty"` 1736 1737 // Kind: The kind of item this is. For objects, this is always 1738 // storage#object. 1739 Kind string `json:"kind,omitempty"` 1740 1741 // KmsKeyName: Not currently supported. Specifying the parameter causes 1742 // the request to fail with status code 400 - Bad Request. 1743 KmsKeyName string `json:"kmsKeyName,omitempty"` 1744 1745 // Md5Hash: MD5 hash of the data; encoded using base64. For more 1746 // information about using the MD5 hash, see Hashes and ETags: Best 1747 // Practices. 1748 Md5Hash string `json:"md5Hash,omitempty"` 1749 1750 // MediaLink: Media download link. 1751 MediaLink string `json:"mediaLink,omitempty"` 1752 1753 // Metadata: User-provided metadata, in key/value pairs. 1754 Metadata map[string]string `json:"metadata,omitempty"` 1755 1756 // Metageneration: The version of the metadata for this object at this 1757 // generation. Used for preconditions and for detecting changes in 1758 // metadata. A metageneration number is only meaningful in the context 1759 // of a particular generation of a particular object. 1760 Metageneration int64 `json:"metageneration,omitempty,string"` 1761 1762 // Name: The name of the object. Required if not specified by URL 1763 // parameter. 1764 Name string `json:"name,omitempty"` 1765 1766 // Owner: The owner of the object. This will always be the uploader of 1767 // the object. 1768 Owner *ObjectOwner `json:"owner,omitempty"` 1769 1770 // RetentionExpirationTime: A server-determined value that specifies the 1771 // earliest time that the object's retention period expires. This value 1772 // is in RFC 3339 format. Note 1: This field is not provided for objects 1773 // with an active event-based hold, since retention expiration is 1774 // unknown until the hold is removed. Note 2: This value can be provided 1775 // even when temporary hold is set (so that the user can reason about 1776 // policy without having to first unset the temporary hold). 1777 RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"` 1778 1779 // SelfLink: The link to this object. 1780 SelfLink string `json:"selfLink,omitempty"` 1781 1782 // Size: Content-Length of the data in bytes. 1783 Size uint64 `json:"size,omitempty,string"` 1784 1785 // StorageClass: Storage class of the object. 1786 StorageClass string `json:"storageClass,omitempty"` 1787 1788 // TemporaryHold: Whether an object is under temporary hold. While this 1789 // flag is set to true, the object is protected against deletion and 1790 // overwrites. A common use case of this flag is regulatory 1791 // investigations where objects need to be retained while the 1792 // investigation is ongoing. Note that unlike event-based hold, 1793 // temporary hold does not impact retention expiration time of an 1794 // object. 1795 TemporaryHold bool `json:"temporaryHold,omitempty"` 1796 1797 // TimeCreated: The creation time of the object in RFC 3339 format. 1798 TimeCreated string `json:"timeCreated,omitempty"` 1799 1800 // TimeDeleted: The deletion time of the object in RFC 3339 format. Will 1801 // be returned if and only if this version of the object has been 1802 // deleted. 1803 TimeDeleted string `json:"timeDeleted,omitempty"` 1804 1805 // TimeStorageClassUpdated: The time at which the object's storage class 1806 // was last changed. When the object is initially created, it will be 1807 // set to timeCreated. 1808 TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"` 1809 1810 // Updated: The modification time of the object metadata in RFC 3339 1811 // format. 1812 Updated string `json:"updated,omitempty"` 1813 1814 // ServerResponse contains the HTTP response code and headers from the 1815 // server. 1816 googleapi.ServerResponse `json:"-"` 1817 1818 // ForceSendFields is a list of field names (e.g. "Acl") to 1819 // unconditionally include in API requests. By default, fields with 1820 // empty values are omitted from API requests. However, any non-pointer, 1821 // non-interface field appearing in ForceSendFields will be sent to the 1822 // server regardless of whether the field is empty or not. This may be 1823 // used to include empty fields in Patch requests. 1824 ForceSendFields []string `json:"-"` 1825 1826 // NullFields is a list of field names (e.g. "Acl") to include in API 1827 // requests with the JSON null value. By default, fields with empty 1828 // values are omitted from API requests. However, any field with an 1829 // empty value appearing in NullFields will be sent to the server as 1830 // null. It is an error if a field in this list has a non-empty value. 1831 // This may be used to include null fields in Patch requests. 1832 NullFields []string `json:"-"` 1833} 1834 1835func (s *Object) MarshalJSON() ([]byte, error) { 1836 type NoMethod Object 1837 raw := NoMethod(*s) 1838 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1839} 1840 1841// ObjectCustomerEncryption: Metadata of customer-supplied encryption 1842// key, if the object is encrypted by such a key. 1843type ObjectCustomerEncryption struct { 1844 // EncryptionAlgorithm: The encryption algorithm. 1845 EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"` 1846 1847 // KeySha256: SHA256 hash value of the encryption key. 1848 KeySha256 string `json:"keySha256,omitempty"` 1849 1850 // ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm") 1851 // to unconditionally include in API requests. By default, fields with 1852 // empty values are omitted from API requests. However, any non-pointer, 1853 // non-interface field appearing in ForceSendFields will be sent to the 1854 // server regardless of whether the field is empty or not. This may be 1855 // used to include empty fields in Patch requests. 1856 ForceSendFields []string `json:"-"` 1857 1858 // NullFields is a list of field names (e.g. "EncryptionAlgorithm") to 1859 // include in API requests with the JSON null value. By default, fields 1860 // with empty values are omitted from API requests. However, any field 1861 // with an empty value appearing in NullFields will be sent to the 1862 // server as null. It is an error if a field in this list has a 1863 // non-empty value. This may be used to include null fields in Patch 1864 // requests. 1865 NullFields []string `json:"-"` 1866} 1867 1868func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) { 1869 type NoMethod ObjectCustomerEncryption 1870 raw := NoMethod(*s) 1871 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1872} 1873 1874// ObjectOwner: The owner of the object. This will always be the 1875// uploader of the object. 1876type ObjectOwner struct { 1877 // Entity: The entity, in the form user-userId. 1878 Entity string `json:"entity,omitempty"` 1879 1880 // EntityId: The ID for the entity. 1881 EntityId string `json:"entityId,omitempty"` 1882 1883 // ForceSendFields is a list of field names (e.g. "Entity") to 1884 // unconditionally include in API requests. By default, fields with 1885 // empty values are omitted from API requests. However, any non-pointer, 1886 // non-interface field appearing in ForceSendFields will be sent to the 1887 // server regardless of whether the field is empty or not. This may be 1888 // used to include empty fields in Patch requests. 1889 ForceSendFields []string `json:"-"` 1890 1891 // NullFields is a list of field names (e.g. "Entity") to include in API 1892 // requests with the JSON null value. By default, fields with empty 1893 // values are omitted from API requests. However, any field with an 1894 // empty value appearing in NullFields will be sent to the server as 1895 // null. It is an error if a field in this list has a non-empty value. 1896 // This may be used to include null fields in Patch requests. 1897 NullFields []string `json:"-"` 1898} 1899 1900func (s *ObjectOwner) MarshalJSON() ([]byte, error) { 1901 type NoMethod ObjectOwner 1902 raw := NoMethod(*s) 1903 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1904} 1905 1906// ObjectAccessControl: An access-control entry. 1907type ObjectAccessControl struct { 1908 // Bucket: The name of the bucket. 1909 Bucket string `json:"bucket,omitempty"` 1910 1911 // Domain: The domain associated with the entity, if any. 1912 Domain string `json:"domain,omitempty"` 1913 1914 // Email: The email address associated with the entity, if any. 1915 Email string `json:"email,omitempty"` 1916 1917 // Entity: The entity holding the permission, in one of the following 1918 // forms: 1919 // - user-userId 1920 // - user-email 1921 // - group-groupId 1922 // - group-email 1923 // - domain-domain 1924 // - project-team-projectId 1925 // - allUsers 1926 // - allAuthenticatedUsers Examples: 1927 // - The user liz@example.com would be user-liz@example.com. 1928 // - The group example@googlegroups.com would be 1929 // group-example@googlegroups.com. 1930 // - To refer to all members of the Google Apps for Business domain 1931 // example.com, the entity would be domain-example.com. 1932 Entity string `json:"entity,omitempty"` 1933 1934 // EntityId: The ID for the entity, if any. 1935 EntityId string `json:"entityId,omitempty"` 1936 1937 // Etag: HTTP 1.1 Entity tag for the access-control entry. 1938 Etag string `json:"etag,omitempty"` 1939 1940 // Generation: The content generation of the object, if applied to an 1941 // object. 1942 Generation int64 `json:"generation,omitempty,string"` 1943 1944 // Id: The ID of the access-control entry. 1945 Id string `json:"id,omitempty"` 1946 1947 // Kind: The kind of item this is. For object access control entries, 1948 // this is always storage#objectAccessControl. 1949 Kind string `json:"kind,omitempty"` 1950 1951 // Object: The name of the object, if applied to an object. 1952 Object string `json:"object,omitempty"` 1953 1954 // ProjectTeam: The project team associated with the entity, if any. 1955 ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"` 1956 1957 // Role: The access permission for the entity. 1958 Role string `json:"role,omitempty"` 1959 1960 // SelfLink: The link to this access-control entry. 1961 SelfLink string `json:"selfLink,omitempty"` 1962 1963 // ServerResponse contains the HTTP response code and headers from the 1964 // server. 1965 googleapi.ServerResponse `json:"-"` 1966 1967 // ForceSendFields is a list of field names (e.g. "Bucket") to 1968 // unconditionally include in API requests. By default, fields with 1969 // empty values are omitted from API requests. However, any non-pointer, 1970 // non-interface field appearing in ForceSendFields will be sent to the 1971 // server regardless of whether the field is empty or not. This may be 1972 // used to include empty fields in Patch requests. 1973 ForceSendFields []string `json:"-"` 1974 1975 // NullFields is a list of field names (e.g. "Bucket") to include in API 1976 // requests with the JSON null value. By default, fields with empty 1977 // values are omitted from API requests. However, any field with an 1978 // empty value appearing in NullFields will be sent to the server as 1979 // null. It is an error if a field in this list has a non-empty value. 1980 // This may be used to include null fields in Patch requests. 1981 NullFields []string `json:"-"` 1982} 1983 1984func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) { 1985 type NoMethod ObjectAccessControl 1986 raw := NoMethod(*s) 1987 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1988} 1989 1990// ObjectAccessControlProjectTeam: The project team associated with the 1991// entity, if any. 1992type ObjectAccessControlProjectTeam struct { 1993 // ProjectNumber: The project number. 1994 ProjectNumber string `json:"projectNumber,omitempty"` 1995 1996 // Team: The team. 1997 Team string `json:"team,omitempty"` 1998 1999 // ForceSendFields is a list of field names (e.g. "ProjectNumber") to 2000 // unconditionally include in API requests. By default, fields with 2001 // empty values are omitted from API requests. However, any non-pointer, 2002 // non-interface field appearing in ForceSendFields will be sent to the 2003 // server regardless of whether the field is empty or not. This may be 2004 // used to include empty fields in Patch requests. 2005 ForceSendFields []string `json:"-"` 2006 2007 // NullFields is a list of field names (e.g. "ProjectNumber") to include 2008 // in API requests with the JSON null value. By default, fields with 2009 // empty values are omitted from API requests. However, any field with 2010 // an empty value appearing in NullFields will be sent to the server as 2011 // null. It is an error if a field in this list has a non-empty value. 2012 // This may be used to include null fields in Patch requests. 2013 NullFields []string `json:"-"` 2014} 2015 2016func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) { 2017 type NoMethod ObjectAccessControlProjectTeam 2018 raw := NoMethod(*s) 2019 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2020} 2021 2022// ObjectAccessControls: An access-control list. 2023type ObjectAccessControls struct { 2024 // Items: The list of items. 2025 Items []*ObjectAccessControl `json:"items,omitempty"` 2026 2027 // Kind: The kind of item this is. For lists of object access control 2028 // entries, this is always storage#objectAccessControls. 2029 Kind string `json:"kind,omitempty"` 2030 2031 // ServerResponse contains the HTTP response code and headers from the 2032 // server. 2033 googleapi.ServerResponse `json:"-"` 2034 2035 // ForceSendFields is a list of field names (e.g. "Items") to 2036 // unconditionally include in API requests. By default, fields with 2037 // empty values are omitted from API requests. However, any non-pointer, 2038 // non-interface field appearing in ForceSendFields will be sent to the 2039 // server regardless of whether the field is empty or not. This may be 2040 // used to include empty fields in Patch requests. 2041 ForceSendFields []string `json:"-"` 2042 2043 // NullFields is a list of field names (e.g. "Items") to include in API 2044 // requests with the JSON null value. By default, fields with empty 2045 // values are omitted from API requests. However, any field with an 2046 // empty value appearing in NullFields will be sent to the server as 2047 // null. It is an error if a field in this list has a non-empty value. 2048 // This may be used to include null fields in Patch requests. 2049 NullFields []string `json:"-"` 2050} 2051 2052func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) { 2053 type NoMethod ObjectAccessControls 2054 raw := NoMethod(*s) 2055 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2056} 2057 2058// Objects: A list of objects. 2059type Objects struct { 2060 // Items: The list of items. 2061 Items []*Object `json:"items,omitempty"` 2062 2063 // Kind: The kind of item this is. For lists of objects, this is always 2064 // storage#objects. 2065 Kind string `json:"kind,omitempty"` 2066 2067 // NextPageToken: The continuation token, used to page through large 2068 // result sets. Provide this value in a subsequent request to return the 2069 // next page of results. 2070 NextPageToken string `json:"nextPageToken,omitempty"` 2071 2072 // Prefixes: The list of prefixes of objects matching-but-not-listed up 2073 // to and including the requested delimiter. 2074 Prefixes []string `json:"prefixes,omitempty"` 2075 2076 // ServerResponse contains the HTTP response code and headers from the 2077 // server. 2078 googleapi.ServerResponse `json:"-"` 2079 2080 // ForceSendFields is a list of field names (e.g. "Items") to 2081 // unconditionally include in API requests. By default, fields with 2082 // empty values are omitted from API requests. However, any non-pointer, 2083 // non-interface field appearing in ForceSendFields will be sent to the 2084 // server regardless of whether the field is empty or not. This may be 2085 // used to include empty fields in Patch requests. 2086 ForceSendFields []string `json:"-"` 2087 2088 // NullFields is a list of field names (e.g. "Items") to include in API 2089 // requests with the JSON null value. By default, fields with empty 2090 // values are omitted from API requests. However, any field with an 2091 // empty value appearing in NullFields will be sent to the server as 2092 // null. It is an error if a field in this list has a non-empty value. 2093 // This may be used to include null fields in Patch requests. 2094 NullFields []string `json:"-"` 2095} 2096 2097func (s *Objects) MarshalJSON() ([]byte, error) { 2098 type NoMethod Objects 2099 raw := NoMethod(*s) 2100 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2101} 2102 2103// Policy: A bucket/object IAM policy. 2104type Policy struct { 2105 // Bindings: An association between a role, which comes with a set of 2106 // permissions, and members who may assume that role. 2107 Bindings []*PolicyBindings `json:"bindings,omitempty"` 2108 2109 // Etag: HTTP 1.1 Entity tag for the policy. 2110 Etag string `json:"etag,omitempty"` 2111 2112 // Kind: The kind of item this is. For policies, this is always 2113 // storage#policy. This field is ignored on input. 2114 Kind string `json:"kind,omitempty"` 2115 2116 // ResourceId: The ID of the resource to which this policy belongs. Will 2117 // be of the form projects/_/buckets/bucket for buckets, and 2118 // projects/_/buckets/bucket/objects/object for objects. A specific 2119 // generation may be specified by appending #generationNumber to the end 2120 // of the object name, e.g. 2121 // projects/_/buckets/my-bucket/objects/data.txt#17. The current 2122 // generation can be denoted with #0. This field is ignored on input. 2123 ResourceId string `json:"resourceId,omitempty"` 2124 2125 // Version: The IAM policy format version. 2126 Version int64 `json:"version,omitempty"` 2127 2128 // ServerResponse contains the HTTP response code and headers from the 2129 // server. 2130 googleapi.ServerResponse `json:"-"` 2131 2132 // ForceSendFields is a list of field names (e.g. "Bindings") to 2133 // unconditionally include in API requests. By default, fields with 2134 // empty values are omitted from API requests. However, any non-pointer, 2135 // non-interface field appearing in ForceSendFields will be sent to the 2136 // server regardless of whether the field is empty or not. This may be 2137 // used to include empty fields in Patch requests. 2138 ForceSendFields []string `json:"-"` 2139 2140 // NullFields is a list of field names (e.g. "Bindings") to include in 2141 // API requests with the JSON null value. By default, fields with empty 2142 // values are omitted from API requests. However, any field with an 2143 // empty value appearing in NullFields will be sent to the server as 2144 // null. It is an error if a field in this list has a non-empty value. 2145 // This may be used to include null fields in Patch requests. 2146 NullFields []string `json:"-"` 2147} 2148 2149func (s *Policy) MarshalJSON() ([]byte, error) { 2150 type NoMethod Policy 2151 raw := NoMethod(*s) 2152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2153} 2154 2155type PolicyBindings struct { 2156 // Condition: The condition that is associated with this binding. NOTE: 2157 // an unsatisfied condition will not allow user access via current 2158 // binding. Different bindings, including their conditions, are examined 2159 // independently. 2160 Condition *Expr `json:"condition,omitempty"` 2161 2162 // Members: A collection of identifiers for members who may assume the 2163 // provided role. Recognized identifiers are as follows: 2164 // - allUsers — A special identifier that represents anyone on the 2165 // internet; with or without a Google account. 2166 // - allAuthenticatedUsers — A special identifier that represents 2167 // anyone who is authenticated with a Google account or a service 2168 // account. 2169 // - user:emailid — An email address that represents a specific 2170 // account. For example, user:alice@gmail.com or user:joe@example.com. 2171 // 2172 // - serviceAccount:emailid — An email address that represents a 2173 // service account. For example, 2174 // serviceAccount:my-other-app@appspot.gserviceaccount.com . 2175 // - group:emailid — An email address that represents a Google group. 2176 // For example, group:admins@example.com. 2177 // - domain:domain — A Google Apps domain name that represents all the 2178 // users of that domain. For example, domain:google.com or 2179 // domain:example.com. 2180 // - projectOwner:projectid — Owners of the given project. For 2181 // example, projectOwner:my-example-project 2182 // - projectEditor:projectid — Editors of the given project. For 2183 // example, projectEditor:my-example-project 2184 // - projectViewer:projectid — Viewers of the given project. For 2185 // example, projectViewer:my-example-project 2186 Members []string `json:"members,omitempty"` 2187 2188 // Role: The role to which members belong. Two types of roles are 2189 // supported: new IAM roles, which grant permissions that do not map 2190 // directly to those provided by ACLs, and legacy IAM roles, which do 2191 // map directly to ACL permissions. All roles are of the format 2192 // roles/storage.specificRole. 2193 // The new IAM roles are: 2194 // - roles/storage.admin — Full control of Google Cloud Storage 2195 // resources. 2196 // - roles/storage.objectViewer — Read-Only access to Google Cloud 2197 // Storage objects. 2198 // - roles/storage.objectCreator — Access to create objects in Google 2199 // Cloud Storage. 2200 // - roles/storage.objectAdmin — Full control of Google Cloud Storage 2201 // objects. The legacy IAM roles are: 2202 // - roles/storage.legacyObjectReader — Read-only access to objects 2203 // without listing. Equivalent to an ACL entry on an object with the 2204 // READER role. 2205 // - roles/storage.legacyObjectOwner — Read/write access to existing 2206 // objects without listing. Equivalent to an ACL entry on an object with 2207 // the OWNER role. 2208 // - roles/storage.legacyBucketReader — Read access to buckets with 2209 // object listing. Equivalent to an ACL entry on a bucket with the 2210 // READER role. 2211 // - roles/storage.legacyBucketWriter — Read access to buckets with 2212 // object listing/creation/deletion. Equivalent to an ACL entry on a 2213 // bucket with the WRITER role. 2214 // - roles/storage.legacyBucketOwner — Read and write access to 2215 // existing buckets with object listing/creation/deletion. Equivalent to 2216 // an ACL entry on a bucket with the OWNER role. 2217 Role string `json:"role,omitempty"` 2218 2219 // ForceSendFields is a list of field names (e.g. "Condition") to 2220 // unconditionally include in API requests. By default, fields with 2221 // empty values are omitted from API requests. However, any non-pointer, 2222 // non-interface field appearing in ForceSendFields will be sent to the 2223 // server regardless of whether the field is empty or not. This may be 2224 // used to include empty fields in Patch requests. 2225 ForceSendFields []string `json:"-"` 2226 2227 // NullFields is a list of field names (e.g. "Condition") to include in 2228 // API requests with the JSON null value. By default, fields with empty 2229 // values are omitted from API requests. However, any field with an 2230 // empty value appearing in NullFields will be sent to the server as 2231 // null. It is an error if a field in this list has a non-empty value. 2232 // This may be used to include null fields in Patch requests. 2233 NullFields []string `json:"-"` 2234} 2235 2236func (s *PolicyBindings) MarshalJSON() ([]byte, error) { 2237 type NoMethod PolicyBindings 2238 raw := NoMethod(*s) 2239 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2240} 2241 2242// RewriteResponse: A rewrite response. 2243type RewriteResponse struct { 2244 // Done: true if the copy is finished; otherwise, false if the copy is 2245 // in progress. This property is always present in the response. 2246 Done bool `json:"done,omitempty"` 2247 2248 // Kind: The kind of item this is. 2249 Kind string `json:"kind,omitempty"` 2250 2251 // ObjectSize: The total size of the object being copied in bytes. This 2252 // property is always present in the response. 2253 ObjectSize int64 `json:"objectSize,omitempty,string"` 2254 2255 // Resource: A resource containing the metadata for the copied-to 2256 // object. This property is present in the response only when copying 2257 // completes. 2258 Resource *Object `json:"resource,omitempty"` 2259 2260 // RewriteToken: A token to use in subsequent requests to continue 2261 // copying data. This token is present in the response only when there 2262 // is more data to copy. 2263 RewriteToken string `json:"rewriteToken,omitempty"` 2264 2265 // TotalBytesRewritten: The total bytes written so far, which can be 2266 // used to provide a waiting user with a progress indicator. This 2267 // property is always present in the response. 2268 TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"` 2269 2270 // ServerResponse contains the HTTP response code and headers from the 2271 // server. 2272 googleapi.ServerResponse `json:"-"` 2273 2274 // ForceSendFields is a list of field names (e.g. "Done") to 2275 // unconditionally include in API requests. By default, fields with 2276 // empty values are omitted from API requests. However, any non-pointer, 2277 // non-interface field appearing in ForceSendFields will be sent to the 2278 // server regardless of whether the field is empty or not. This may be 2279 // used to include empty fields in Patch requests. 2280 ForceSendFields []string `json:"-"` 2281 2282 // NullFields is a list of field names (e.g. "Done") to include in API 2283 // requests with the JSON null value. By default, fields with empty 2284 // values are omitted from API requests. However, any field with an 2285 // empty value appearing in NullFields will be sent to the server as 2286 // null. It is an error if a field in this list has a non-empty value. 2287 // This may be used to include null fields in Patch requests. 2288 NullFields []string `json:"-"` 2289} 2290 2291func (s *RewriteResponse) MarshalJSON() ([]byte, error) { 2292 type NoMethod RewriteResponse 2293 raw := NoMethod(*s) 2294 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2295} 2296 2297// ServiceAccount: A subscription to receive Google PubSub 2298// notifications. 2299type ServiceAccount struct { 2300 // EmailAddress: The ID of the notification. 2301 EmailAddress string `json:"email_address,omitempty"` 2302 2303 // Kind: The kind of item this is. For notifications, this is always 2304 // storage#notification. 2305 Kind string `json:"kind,omitempty"` 2306 2307 // ServerResponse contains the HTTP response code and headers from the 2308 // server. 2309 googleapi.ServerResponse `json:"-"` 2310 2311 // ForceSendFields is a list of field names (e.g. "EmailAddress") to 2312 // unconditionally include in API requests. By default, fields with 2313 // empty values are omitted from API requests. However, any non-pointer, 2314 // non-interface field appearing in ForceSendFields will be sent to the 2315 // server regardless of whether the field is empty or not. This may be 2316 // used to include empty fields in Patch requests. 2317 ForceSendFields []string `json:"-"` 2318 2319 // NullFields is a list of field names (e.g. "EmailAddress") to include 2320 // in API requests with the JSON null value. By default, fields with 2321 // empty values are omitted from API requests. However, any field with 2322 // an empty value appearing in NullFields will be sent to the server as 2323 // null. It is an error if a field in this list has a non-empty value. 2324 // This may be used to include null fields in Patch requests. 2325 NullFields []string `json:"-"` 2326} 2327 2328func (s *ServiceAccount) MarshalJSON() ([]byte, error) { 2329 type NoMethod ServiceAccount 2330 raw := NoMethod(*s) 2331 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2332} 2333 2334// TestIamPermissionsResponse: A 2335// storage.(buckets|objects).testIamPermissions response. 2336type TestIamPermissionsResponse struct { 2337 // Kind: The kind of item this is. 2338 Kind string `json:"kind,omitempty"` 2339 2340 // Permissions: The permissions held by the caller. Permissions are 2341 // always of the format storage.resource.capability, where resource is 2342 // one of buckets or objects. The supported permissions are as follows: 2343 // 2344 // - storage.buckets.delete — Delete bucket. 2345 // - storage.buckets.get — Read bucket metadata. 2346 // - storage.buckets.getIamPolicy — Read bucket IAM policy. 2347 // - storage.buckets.create — Create bucket. 2348 // - storage.buckets.list — List buckets. 2349 // - storage.buckets.setIamPolicy — Update bucket IAM policy. 2350 // - storage.buckets.update — Update bucket metadata. 2351 // - storage.objects.delete — Delete object. 2352 // - storage.objects.get — Read object data and metadata. 2353 // - storage.objects.getIamPolicy — Read object IAM policy. 2354 // - storage.objects.create — Create object. 2355 // - storage.objects.list — List objects. 2356 // - storage.objects.setIamPolicy — Update object IAM policy. 2357 // - storage.objects.update — Update object metadata. 2358 Permissions []string `json:"permissions,omitempty"` 2359 2360 // ServerResponse contains the HTTP response code and headers from the 2361 // server. 2362 googleapi.ServerResponse `json:"-"` 2363 2364 // ForceSendFields is a list of field names (e.g. "Kind") to 2365 // unconditionally include in API requests. By default, fields with 2366 // empty values are omitted from API requests. However, any non-pointer, 2367 // non-interface field appearing in ForceSendFields will be sent to the 2368 // server regardless of whether the field is empty or not. This may be 2369 // used to include empty fields in Patch requests. 2370 ForceSendFields []string `json:"-"` 2371 2372 // NullFields is a list of field names (e.g. "Kind") to include in API 2373 // requests with the JSON null value. By default, fields with empty 2374 // values are omitted from API requests. However, any field with an 2375 // empty value appearing in NullFields will be sent to the server as 2376 // null. It is an error if a field in this list has a non-empty value. 2377 // This may be used to include null fields in Patch requests. 2378 NullFields []string `json:"-"` 2379} 2380 2381func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2382 type NoMethod TestIamPermissionsResponse 2383 raw := NoMethod(*s) 2384 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2385} 2386 2387// method id "storage.bucketAccessControls.delete": 2388 2389type BucketAccessControlsDeleteCall struct { 2390 s *Service 2391 bucket string 2392 entity string 2393 urlParams_ gensupport.URLParams 2394 ctx_ context.Context 2395 header_ http.Header 2396} 2397 2398// Delete: Permanently deletes the ACL entry for the specified entity on 2399// the specified bucket. 2400func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall { 2401 c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2402 c.bucket = bucket 2403 c.entity = entity 2404 return c 2405} 2406 2407// ProvisionalUserProject sets the optional parameter 2408// "provisionalUserProject": The project to be billed for this request 2409// if the target bucket is requester-pays bucket. 2410func (c *BucketAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsDeleteCall { 2411 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2412 return c 2413} 2414 2415// UserProject sets the optional parameter "userProject": The project to 2416// be billed for this request. Required for Requester Pays buckets. 2417func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall { 2418 c.urlParams_.Set("userProject", userProject) 2419 return c 2420} 2421 2422// Fields allows partial responses to be retrieved. See 2423// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2424// for more information. 2425func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall { 2426 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2427 return c 2428} 2429 2430// Context sets the context to be used in this call's Do method. Any 2431// pending HTTP request will be aborted if the provided context is 2432// canceled. 2433func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall { 2434 c.ctx_ = ctx 2435 return c 2436} 2437 2438// Header returns an http.Header that can be modified by the caller to 2439// add HTTP headers to the request. 2440func (c *BucketAccessControlsDeleteCall) Header() http.Header { 2441 if c.header_ == nil { 2442 c.header_ = make(http.Header) 2443 } 2444 return c.header_ 2445} 2446 2447func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 2448 reqHeaders := make(http.Header) 2449 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2450 for k, v := range c.header_ { 2451 reqHeaders[k] = v 2452 } 2453 reqHeaders.Set("User-Agent", c.s.userAgent()) 2454 var body io.Reader = nil 2455 c.urlParams_.Set("alt", alt) 2456 c.urlParams_.Set("prettyPrint", "false") 2457 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 2458 urls += "?" + c.urlParams_.Encode() 2459 req, err := http.NewRequest("DELETE", urls, body) 2460 if err != nil { 2461 return nil, err 2462 } 2463 req.Header = reqHeaders 2464 googleapi.Expand(req.URL, map[string]string{ 2465 "bucket": c.bucket, 2466 "entity": c.entity, 2467 }) 2468 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2469} 2470 2471// Do executes the "storage.bucketAccessControls.delete" call. 2472func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { 2473 gensupport.SetOptions(c.urlParams_, opts...) 2474 res, err := c.doRequest("json") 2475 if err != nil { 2476 return err 2477 } 2478 defer googleapi.CloseBody(res) 2479 if err := googleapi.CheckResponse(res); err != nil { 2480 return err 2481 } 2482 return nil 2483 // { 2484 // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", 2485 // "httpMethod": "DELETE", 2486 // "id": "storage.bucketAccessControls.delete", 2487 // "parameterOrder": [ 2488 // "bucket", 2489 // "entity" 2490 // ], 2491 // "parameters": { 2492 // "bucket": { 2493 // "description": "Name of a bucket.", 2494 // "location": "path", 2495 // "required": true, 2496 // "type": "string" 2497 // }, 2498 // "entity": { 2499 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 2500 // "location": "path", 2501 // "required": true, 2502 // "type": "string" 2503 // }, 2504 // "provisionalUserProject": { 2505 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 2506 // "location": "query", 2507 // "type": "string" 2508 // }, 2509 // "userProject": { 2510 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 2511 // "location": "query", 2512 // "type": "string" 2513 // } 2514 // }, 2515 // "path": "b/{bucket}/acl/{entity}", 2516 // "scopes": [ 2517 // "https://www.googleapis.com/auth/cloud-platform", 2518 // "https://www.googleapis.com/auth/devstorage.full_control" 2519 // ] 2520 // } 2521 2522} 2523 2524// method id "storage.bucketAccessControls.get": 2525 2526type BucketAccessControlsGetCall struct { 2527 s *Service 2528 bucket string 2529 entity string 2530 urlParams_ gensupport.URLParams 2531 ifNoneMatch_ string 2532 ctx_ context.Context 2533 header_ http.Header 2534} 2535 2536// Get: Returns the ACL entry for the specified entity on the specified 2537// bucket. 2538func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall { 2539 c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2540 c.bucket = bucket 2541 c.entity = entity 2542 return c 2543} 2544 2545// ProvisionalUserProject sets the optional parameter 2546// "provisionalUserProject": The project to be billed for this request 2547// if the target bucket is requester-pays bucket. 2548func (c *BucketAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsGetCall { 2549 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2550 return c 2551} 2552 2553// UserProject sets the optional parameter "userProject": The project to 2554// be billed for this request. Required for Requester Pays buckets. 2555func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall { 2556 c.urlParams_.Set("userProject", userProject) 2557 return c 2558} 2559 2560// Fields allows partial responses to be retrieved. See 2561// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2562// for more information. 2563func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall { 2564 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2565 return c 2566} 2567 2568// IfNoneMatch sets the optional parameter which makes the operation 2569// fail if the object's ETag matches the given value. This is useful for 2570// getting updates only after the object has changed since the last 2571// request. Use googleapi.IsNotModified to check whether the response 2572// error from Do is the result of In-None-Match. 2573func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall { 2574 c.ifNoneMatch_ = entityTag 2575 return c 2576} 2577 2578// Context sets the context to be used in this call's Do method. Any 2579// pending HTTP request will be aborted if the provided context is 2580// canceled. 2581func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall { 2582 c.ctx_ = ctx 2583 return c 2584} 2585 2586// Header returns an http.Header that can be modified by the caller to 2587// add HTTP headers to the request. 2588func (c *BucketAccessControlsGetCall) Header() http.Header { 2589 if c.header_ == nil { 2590 c.header_ = make(http.Header) 2591 } 2592 return c.header_ 2593} 2594 2595func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { 2596 reqHeaders := make(http.Header) 2597 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2598 for k, v := range c.header_ { 2599 reqHeaders[k] = v 2600 } 2601 reqHeaders.Set("User-Agent", c.s.userAgent()) 2602 if c.ifNoneMatch_ != "" { 2603 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2604 } 2605 var body io.Reader = nil 2606 c.urlParams_.Set("alt", alt) 2607 c.urlParams_.Set("prettyPrint", "false") 2608 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 2609 urls += "?" + c.urlParams_.Encode() 2610 req, err := http.NewRequest("GET", urls, body) 2611 if err != nil { 2612 return nil, err 2613 } 2614 req.Header = reqHeaders 2615 googleapi.Expand(req.URL, map[string]string{ 2616 "bucket": c.bucket, 2617 "entity": c.entity, 2618 }) 2619 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2620} 2621 2622// Do executes the "storage.bucketAccessControls.get" call. 2623// Exactly one of *BucketAccessControl or error will be non-nil. Any 2624// non-2xx status code is an error. Response headers are in either 2625// *BucketAccessControl.ServerResponse.Header or (if a response was 2626// returned at all) in error.(*googleapi.Error).Header. Use 2627// googleapi.IsNotModified to check whether the returned error was 2628// because http.StatusNotModified was returned. 2629func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 2630 gensupport.SetOptions(c.urlParams_, opts...) 2631 res, err := c.doRequest("json") 2632 if res != nil && res.StatusCode == http.StatusNotModified { 2633 if res.Body != nil { 2634 res.Body.Close() 2635 } 2636 return nil, &googleapi.Error{ 2637 Code: res.StatusCode, 2638 Header: res.Header, 2639 } 2640 } 2641 if err != nil { 2642 return nil, err 2643 } 2644 defer googleapi.CloseBody(res) 2645 if err := googleapi.CheckResponse(res); err != nil { 2646 return nil, err 2647 } 2648 ret := &BucketAccessControl{ 2649 ServerResponse: googleapi.ServerResponse{ 2650 Header: res.Header, 2651 HTTPStatusCode: res.StatusCode, 2652 }, 2653 } 2654 target := &ret 2655 if err := gensupport.DecodeResponse(target, res); err != nil { 2656 return nil, err 2657 } 2658 return ret, nil 2659 // { 2660 // "description": "Returns the ACL entry for the specified entity on the specified bucket.", 2661 // "httpMethod": "GET", 2662 // "id": "storage.bucketAccessControls.get", 2663 // "parameterOrder": [ 2664 // "bucket", 2665 // "entity" 2666 // ], 2667 // "parameters": { 2668 // "bucket": { 2669 // "description": "Name of a bucket.", 2670 // "location": "path", 2671 // "required": true, 2672 // "type": "string" 2673 // }, 2674 // "entity": { 2675 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 2676 // "location": "path", 2677 // "required": true, 2678 // "type": "string" 2679 // }, 2680 // "provisionalUserProject": { 2681 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 2682 // "location": "query", 2683 // "type": "string" 2684 // }, 2685 // "userProject": { 2686 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 2687 // "location": "query", 2688 // "type": "string" 2689 // } 2690 // }, 2691 // "path": "b/{bucket}/acl/{entity}", 2692 // "response": { 2693 // "$ref": "BucketAccessControl" 2694 // }, 2695 // "scopes": [ 2696 // "https://www.googleapis.com/auth/cloud-platform", 2697 // "https://www.googleapis.com/auth/devstorage.full_control" 2698 // ] 2699 // } 2700 2701} 2702 2703// method id "storage.bucketAccessControls.insert": 2704 2705type BucketAccessControlsInsertCall struct { 2706 s *Service 2707 bucket string 2708 bucketaccesscontrol *BucketAccessControl 2709 urlParams_ gensupport.URLParams 2710 ctx_ context.Context 2711 header_ http.Header 2712} 2713 2714// Insert: Creates a new ACL entry on the specified bucket. 2715func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall { 2716 c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2717 c.bucket = bucket 2718 c.bucketaccesscontrol = bucketaccesscontrol 2719 return c 2720} 2721 2722// ProvisionalUserProject sets the optional parameter 2723// "provisionalUserProject": The project to be billed for this request 2724// if the target bucket is requester-pays bucket. 2725func (c *BucketAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsInsertCall { 2726 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2727 return c 2728} 2729 2730// UserProject sets the optional parameter "userProject": The project to 2731// be billed for this request. Required for Requester Pays buckets. 2732func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall { 2733 c.urlParams_.Set("userProject", userProject) 2734 return c 2735} 2736 2737// Fields allows partial responses to be retrieved. See 2738// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2739// for more information. 2740func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall { 2741 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2742 return c 2743} 2744 2745// Context sets the context to be used in this call's Do method. Any 2746// pending HTTP request will be aborted if the provided context is 2747// canceled. 2748func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall { 2749 c.ctx_ = ctx 2750 return c 2751} 2752 2753// Header returns an http.Header that can be modified by the caller to 2754// add HTTP headers to the request. 2755func (c *BucketAccessControlsInsertCall) Header() http.Header { 2756 if c.header_ == nil { 2757 c.header_ = make(http.Header) 2758 } 2759 return c.header_ 2760} 2761 2762func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { 2763 reqHeaders := make(http.Header) 2764 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2765 for k, v := range c.header_ { 2766 reqHeaders[k] = v 2767 } 2768 reqHeaders.Set("User-Agent", c.s.userAgent()) 2769 var body io.Reader = nil 2770 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) 2771 if err != nil { 2772 return nil, err 2773 } 2774 reqHeaders.Set("Content-Type", "application/json") 2775 c.urlParams_.Set("alt", alt) 2776 c.urlParams_.Set("prettyPrint", "false") 2777 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") 2778 urls += "?" + c.urlParams_.Encode() 2779 req, err := http.NewRequest("POST", urls, body) 2780 if err != nil { 2781 return nil, err 2782 } 2783 req.Header = reqHeaders 2784 googleapi.Expand(req.URL, map[string]string{ 2785 "bucket": c.bucket, 2786 }) 2787 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2788} 2789 2790// Do executes the "storage.bucketAccessControls.insert" call. 2791// Exactly one of *BucketAccessControl or error will be non-nil. Any 2792// non-2xx status code is an error. Response headers are in either 2793// *BucketAccessControl.ServerResponse.Header or (if a response was 2794// returned at all) in error.(*googleapi.Error).Header. Use 2795// googleapi.IsNotModified to check whether the returned error was 2796// because http.StatusNotModified was returned. 2797func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 2798 gensupport.SetOptions(c.urlParams_, opts...) 2799 res, err := c.doRequest("json") 2800 if res != nil && res.StatusCode == http.StatusNotModified { 2801 if res.Body != nil { 2802 res.Body.Close() 2803 } 2804 return nil, &googleapi.Error{ 2805 Code: res.StatusCode, 2806 Header: res.Header, 2807 } 2808 } 2809 if err != nil { 2810 return nil, err 2811 } 2812 defer googleapi.CloseBody(res) 2813 if err := googleapi.CheckResponse(res); err != nil { 2814 return nil, err 2815 } 2816 ret := &BucketAccessControl{ 2817 ServerResponse: googleapi.ServerResponse{ 2818 Header: res.Header, 2819 HTTPStatusCode: res.StatusCode, 2820 }, 2821 } 2822 target := &ret 2823 if err := gensupport.DecodeResponse(target, res); err != nil { 2824 return nil, err 2825 } 2826 return ret, nil 2827 // { 2828 // "description": "Creates a new ACL entry on the specified bucket.", 2829 // "httpMethod": "POST", 2830 // "id": "storage.bucketAccessControls.insert", 2831 // "parameterOrder": [ 2832 // "bucket" 2833 // ], 2834 // "parameters": { 2835 // "bucket": { 2836 // "description": "Name of a bucket.", 2837 // "location": "path", 2838 // "required": true, 2839 // "type": "string" 2840 // }, 2841 // "provisionalUserProject": { 2842 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 2843 // "location": "query", 2844 // "type": "string" 2845 // }, 2846 // "userProject": { 2847 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 2848 // "location": "query", 2849 // "type": "string" 2850 // } 2851 // }, 2852 // "path": "b/{bucket}/acl", 2853 // "request": { 2854 // "$ref": "BucketAccessControl" 2855 // }, 2856 // "response": { 2857 // "$ref": "BucketAccessControl" 2858 // }, 2859 // "scopes": [ 2860 // "https://www.googleapis.com/auth/cloud-platform", 2861 // "https://www.googleapis.com/auth/devstorage.full_control" 2862 // ] 2863 // } 2864 2865} 2866 2867// method id "storage.bucketAccessControls.list": 2868 2869type BucketAccessControlsListCall struct { 2870 s *Service 2871 bucket string 2872 urlParams_ gensupport.URLParams 2873 ifNoneMatch_ string 2874 ctx_ context.Context 2875 header_ http.Header 2876} 2877 2878// List: Retrieves ACL entries on the specified bucket. 2879func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall { 2880 c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2881 c.bucket = bucket 2882 return c 2883} 2884 2885// ProvisionalUserProject sets the optional parameter 2886// "provisionalUserProject": The project to be billed for this request 2887// if the target bucket is requester-pays bucket. 2888func (c *BucketAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsListCall { 2889 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2890 return c 2891} 2892 2893// UserProject sets the optional parameter "userProject": The project to 2894// be billed for this request. Required for Requester Pays buckets. 2895func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall { 2896 c.urlParams_.Set("userProject", userProject) 2897 return c 2898} 2899 2900// Fields allows partial responses to be retrieved. See 2901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2902// for more information. 2903func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall { 2904 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2905 return c 2906} 2907 2908// IfNoneMatch sets the optional parameter which makes the operation 2909// fail if the object's ETag matches the given value. This is useful for 2910// getting updates only after the object has changed since the last 2911// request. Use googleapi.IsNotModified to check whether the response 2912// error from Do is the result of In-None-Match. 2913func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall { 2914 c.ifNoneMatch_ = entityTag 2915 return c 2916} 2917 2918// Context sets the context to be used in this call's Do method. Any 2919// pending HTTP request will be aborted if the provided context is 2920// canceled. 2921func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall { 2922 c.ctx_ = ctx 2923 return c 2924} 2925 2926// Header returns an http.Header that can be modified by the caller to 2927// add HTTP headers to the request. 2928func (c *BucketAccessControlsListCall) Header() http.Header { 2929 if c.header_ == nil { 2930 c.header_ = make(http.Header) 2931 } 2932 return c.header_ 2933} 2934 2935func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { 2936 reqHeaders := make(http.Header) 2937 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2938 for k, v := range c.header_ { 2939 reqHeaders[k] = v 2940 } 2941 reqHeaders.Set("User-Agent", c.s.userAgent()) 2942 if c.ifNoneMatch_ != "" { 2943 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2944 } 2945 var body io.Reader = nil 2946 c.urlParams_.Set("alt", alt) 2947 c.urlParams_.Set("prettyPrint", "false") 2948 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") 2949 urls += "?" + c.urlParams_.Encode() 2950 req, err := http.NewRequest("GET", urls, body) 2951 if err != nil { 2952 return nil, err 2953 } 2954 req.Header = reqHeaders 2955 googleapi.Expand(req.URL, map[string]string{ 2956 "bucket": c.bucket, 2957 }) 2958 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2959} 2960 2961// Do executes the "storage.bucketAccessControls.list" call. 2962// Exactly one of *BucketAccessControls or error will be non-nil. Any 2963// non-2xx status code is an error. Response headers are in either 2964// *BucketAccessControls.ServerResponse.Header or (if a response was 2965// returned at all) in error.(*googleapi.Error).Header. Use 2966// googleapi.IsNotModified to check whether the returned error was 2967// because http.StatusNotModified was returned. 2968func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) { 2969 gensupport.SetOptions(c.urlParams_, opts...) 2970 res, err := c.doRequest("json") 2971 if res != nil && res.StatusCode == http.StatusNotModified { 2972 if res.Body != nil { 2973 res.Body.Close() 2974 } 2975 return nil, &googleapi.Error{ 2976 Code: res.StatusCode, 2977 Header: res.Header, 2978 } 2979 } 2980 if err != nil { 2981 return nil, err 2982 } 2983 defer googleapi.CloseBody(res) 2984 if err := googleapi.CheckResponse(res); err != nil { 2985 return nil, err 2986 } 2987 ret := &BucketAccessControls{ 2988 ServerResponse: googleapi.ServerResponse{ 2989 Header: res.Header, 2990 HTTPStatusCode: res.StatusCode, 2991 }, 2992 } 2993 target := &ret 2994 if err := gensupport.DecodeResponse(target, res); err != nil { 2995 return nil, err 2996 } 2997 return ret, nil 2998 // { 2999 // "description": "Retrieves ACL entries on the specified bucket.", 3000 // "httpMethod": "GET", 3001 // "id": "storage.bucketAccessControls.list", 3002 // "parameterOrder": [ 3003 // "bucket" 3004 // ], 3005 // "parameters": { 3006 // "bucket": { 3007 // "description": "Name of a bucket.", 3008 // "location": "path", 3009 // "required": true, 3010 // "type": "string" 3011 // }, 3012 // "provisionalUserProject": { 3013 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3014 // "location": "query", 3015 // "type": "string" 3016 // }, 3017 // "userProject": { 3018 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3019 // "location": "query", 3020 // "type": "string" 3021 // } 3022 // }, 3023 // "path": "b/{bucket}/acl", 3024 // "response": { 3025 // "$ref": "BucketAccessControls" 3026 // }, 3027 // "scopes": [ 3028 // "https://www.googleapis.com/auth/cloud-platform", 3029 // "https://www.googleapis.com/auth/devstorage.full_control" 3030 // ] 3031 // } 3032 3033} 3034 3035// method id "storage.bucketAccessControls.patch": 3036 3037type BucketAccessControlsPatchCall struct { 3038 s *Service 3039 bucket string 3040 entity string 3041 bucketaccesscontrol *BucketAccessControl 3042 urlParams_ gensupport.URLParams 3043 ctx_ context.Context 3044 header_ http.Header 3045} 3046 3047// Patch: Patches an ACL entry on the specified bucket. 3048func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall { 3049 c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3050 c.bucket = bucket 3051 c.entity = entity 3052 c.bucketaccesscontrol = bucketaccesscontrol 3053 return c 3054} 3055 3056// ProvisionalUserProject sets the optional parameter 3057// "provisionalUserProject": The project to be billed for this request 3058// if the target bucket is requester-pays bucket. 3059func (c *BucketAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsPatchCall { 3060 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3061 return c 3062} 3063 3064// UserProject sets the optional parameter "userProject": The project to 3065// be billed for this request. Required for Requester Pays buckets. 3066func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall { 3067 c.urlParams_.Set("userProject", userProject) 3068 return c 3069} 3070 3071// Fields allows partial responses to be retrieved. See 3072// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3073// for more information. 3074func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall { 3075 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3076 return c 3077} 3078 3079// Context sets the context to be used in this call's Do method. Any 3080// pending HTTP request will be aborted if the provided context is 3081// canceled. 3082func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall { 3083 c.ctx_ = ctx 3084 return c 3085} 3086 3087// Header returns an http.Header that can be modified by the caller to 3088// add HTTP headers to the request. 3089func (c *BucketAccessControlsPatchCall) Header() http.Header { 3090 if c.header_ == nil { 3091 c.header_ = make(http.Header) 3092 } 3093 return c.header_ 3094} 3095 3096func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { 3097 reqHeaders := make(http.Header) 3098 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3099 for k, v := range c.header_ { 3100 reqHeaders[k] = v 3101 } 3102 reqHeaders.Set("User-Agent", c.s.userAgent()) 3103 var body io.Reader = nil 3104 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) 3105 if err != nil { 3106 return nil, err 3107 } 3108 reqHeaders.Set("Content-Type", "application/json") 3109 c.urlParams_.Set("alt", alt) 3110 c.urlParams_.Set("prettyPrint", "false") 3111 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 3112 urls += "?" + c.urlParams_.Encode() 3113 req, err := http.NewRequest("PATCH", urls, body) 3114 if err != nil { 3115 return nil, err 3116 } 3117 req.Header = reqHeaders 3118 googleapi.Expand(req.URL, map[string]string{ 3119 "bucket": c.bucket, 3120 "entity": c.entity, 3121 }) 3122 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3123} 3124 3125// Do executes the "storage.bucketAccessControls.patch" call. 3126// Exactly one of *BucketAccessControl or error will be non-nil. Any 3127// non-2xx status code is an error. Response headers are in either 3128// *BucketAccessControl.ServerResponse.Header or (if a response was 3129// returned at all) in error.(*googleapi.Error).Header. Use 3130// googleapi.IsNotModified to check whether the returned error was 3131// because http.StatusNotModified was returned. 3132func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 3133 gensupport.SetOptions(c.urlParams_, opts...) 3134 res, err := c.doRequest("json") 3135 if res != nil && res.StatusCode == http.StatusNotModified { 3136 if res.Body != nil { 3137 res.Body.Close() 3138 } 3139 return nil, &googleapi.Error{ 3140 Code: res.StatusCode, 3141 Header: res.Header, 3142 } 3143 } 3144 if err != nil { 3145 return nil, err 3146 } 3147 defer googleapi.CloseBody(res) 3148 if err := googleapi.CheckResponse(res); err != nil { 3149 return nil, err 3150 } 3151 ret := &BucketAccessControl{ 3152 ServerResponse: googleapi.ServerResponse{ 3153 Header: res.Header, 3154 HTTPStatusCode: res.StatusCode, 3155 }, 3156 } 3157 target := &ret 3158 if err := gensupport.DecodeResponse(target, res); err != nil { 3159 return nil, err 3160 } 3161 return ret, nil 3162 // { 3163 // "description": "Patches an ACL entry on the specified bucket.", 3164 // "httpMethod": "PATCH", 3165 // "id": "storage.bucketAccessControls.patch", 3166 // "parameterOrder": [ 3167 // "bucket", 3168 // "entity" 3169 // ], 3170 // "parameters": { 3171 // "bucket": { 3172 // "description": "Name of a bucket.", 3173 // "location": "path", 3174 // "required": true, 3175 // "type": "string" 3176 // }, 3177 // "entity": { 3178 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 3179 // "location": "path", 3180 // "required": true, 3181 // "type": "string" 3182 // }, 3183 // "provisionalUserProject": { 3184 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3185 // "location": "query", 3186 // "type": "string" 3187 // }, 3188 // "userProject": { 3189 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3190 // "location": "query", 3191 // "type": "string" 3192 // } 3193 // }, 3194 // "path": "b/{bucket}/acl/{entity}", 3195 // "request": { 3196 // "$ref": "BucketAccessControl" 3197 // }, 3198 // "response": { 3199 // "$ref": "BucketAccessControl" 3200 // }, 3201 // "scopes": [ 3202 // "https://www.googleapis.com/auth/cloud-platform", 3203 // "https://www.googleapis.com/auth/devstorage.full_control" 3204 // ] 3205 // } 3206 3207} 3208 3209// method id "storage.bucketAccessControls.update": 3210 3211type BucketAccessControlsUpdateCall struct { 3212 s *Service 3213 bucket string 3214 entity string 3215 bucketaccesscontrol *BucketAccessControl 3216 urlParams_ gensupport.URLParams 3217 ctx_ context.Context 3218 header_ http.Header 3219} 3220 3221// Update: Updates an ACL entry on the specified bucket. 3222func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall { 3223 c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3224 c.bucket = bucket 3225 c.entity = entity 3226 c.bucketaccesscontrol = bucketaccesscontrol 3227 return c 3228} 3229 3230// ProvisionalUserProject sets the optional parameter 3231// "provisionalUserProject": The project to be billed for this request 3232// if the target bucket is requester-pays bucket. 3233func (c *BucketAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsUpdateCall { 3234 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3235 return c 3236} 3237 3238// UserProject sets the optional parameter "userProject": The project to 3239// be billed for this request. Required for Requester Pays buckets. 3240func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall { 3241 c.urlParams_.Set("userProject", userProject) 3242 return c 3243} 3244 3245// Fields allows partial responses to be retrieved. See 3246// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3247// for more information. 3248func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall { 3249 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3250 return c 3251} 3252 3253// Context sets the context to be used in this call's Do method. Any 3254// pending HTTP request will be aborted if the provided context is 3255// canceled. 3256func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall { 3257 c.ctx_ = ctx 3258 return c 3259} 3260 3261// Header returns an http.Header that can be modified by the caller to 3262// add HTTP headers to the request. 3263func (c *BucketAccessControlsUpdateCall) Header() http.Header { 3264 if c.header_ == nil { 3265 c.header_ = make(http.Header) 3266 } 3267 return c.header_ 3268} 3269 3270func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { 3271 reqHeaders := make(http.Header) 3272 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3273 for k, v := range c.header_ { 3274 reqHeaders[k] = v 3275 } 3276 reqHeaders.Set("User-Agent", c.s.userAgent()) 3277 var body io.Reader = nil 3278 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) 3279 if err != nil { 3280 return nil, err 3281 } 3282 reqHeaders.Set("Content-Type", "application/json") 3283 c.urlParams_.Set("alt", alt) 3284 c.urlParams_.Set("prettyPrint", "false") 3285 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 3286 urls += "?" + c.urlParams_.Encode() 3287 req, err := http.NewRequest("PUT", urls, body) 3288 if err != nil { 3289 return nil, err 3290 } 3291 req.Header = reqHeaders 3292 googleapi.Expand(req.URL, map[string]string{ 3293 "bucket": c.bucket, 3294 "entity": c.entity, 3295 }) 3296 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3297} 3298 3299// Do executes the "storage.bucketAccessControls.update" call. 3300// Exactly one of *BucketAccessControl or error will be non-nil. Any 3301// non-2xx status code is an error. Response headers are in either 3302// *BucketAccessControl.ServerResponse.Header or (if a response was 3303// returned at all) in error.(*googleapi.Error).Header. Use 3304// googleapi.IsNotModified to check whether the returned error was 3305// because http.StatusNotModified was returned. 3306func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 3307 gensupport.SetOptions(c.urlParams_, opts...) 3308 res, err := c.doRequest("json") 3309 if res != nil && res.StatusCode == http.StatusNotModified { 3310 if res.Body != nil { 3311 res.Body.Close() 3312 } 3313 return nil, &googleapi.Error{ 3314 Code: res.StatusCode, 3315 Header: res.Header, 3316 } 3317 } 3318 if err != nil { 3319 return nil, err 3320 } 3321 defer googleapi.CloseBody(res) 3322 if err := googleapi.CheckResponse(res); err != nil { 3323 return nil, err 3324 } 3325 ret := &BucketAccessControl{ 3326 ServerResponse: googleapi.ServerResponse{ 3327 Header: res.Header, 3328 HTTPStatusCode: res.StatusCode, 3329 }, 3330 } 3331 target := &ret 3332 if err := gensupport.DecodeResponse(target, res); err != nil { 3333 return nil, err 3334 } 3335 return ret, nil 3336 // { 3337 // "description": "Updates an ACL entry on the specified bucket.", 3338 // "httpMethod": "PUT", 3339 // "id": "storage.bucketAccessControls.update", 3340 // "parameterOrder": [ 3341 // "bucket", 3342 // "entity" 3343 // ], 3344 // "parameters": { 3345 // "bucket": { 3346 // "description": "Name of a bucket.", 3347 // "location": "path", 3348 // "required": true, 3349 // "type": "string" 3350 // }, 3351 // "entity": { 3352 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 3353 // "location": "path", 3354 // "required": true, 3355 // "type": "string" 3356 // }, 3357 // "provisionalUserProject": { 3358 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3359 // "location": "query", 3360 // "type": "string" 3361 // }, 3362 // "userProject": { 3363 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3364 // "location": "query", 3365 // "type": "string" 3366 // } 3367 // }, 3368 // "path": "b/{bucket}/acl/{entity}", 3369 // "request": { 3370 // "$ref": "BucketAccessControl" 3371 // }, 3372 // "response": { 3373 // "$ref": "BucketAccessControl" 3374 // }, 3375 // "scopes": [ 3376 // "https://www.googleapis.com/auth/cloud-platform", 3377 // "https://www.googleapis.com/auth/devstorage.full_control" 3378 // ] 3379 // } 3380 3381} 3382 3383// method id "storage.buckets.delete": 3384 3385type BucketsDeleteCall struct { 3386 s *Service 3387 bucket string 3388 urlParams_ gensupport.URLParams 3389 ctx_ context.Context 3390 header_ http.Header 3391} 3392 3393// Delete: Permanently deletes an empty bucket. 3394func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall { 3395 c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3396 c.bucket = bucket 3397 return c 3398} 3399 3400// IfMetagenerationMatch sets the optional parameter 3401// "ifMetagenerationMatch": If set, only deletes the bucket if its 3402// metageneration matches this value. 3403func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall { 3404 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 3405 return c 3406} 3407 3408// IfMetagenerationNotMatch sets the optional parameter 3409// "ifMetagenerationNotMatch": If set, only deletes the bucket if its 3410// metageneration does not match this value. 3411func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall { 3412 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 3413 return c 3414} 3415 3416// ProvisionalUserProject sets the optional parameter 3417// "provisionalUserProject": The project to be billed for this request 3418// if the target bucket is requester-pays bucket. 3419func (c *BucketsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketsDeleteCall { 3420 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3421 return c 3422} 3423 3424// UserProject sets the optional parameter "userProject": The project to 3425// be billed for this request. Required for Requester Pays buckets. 3426func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall { 3427 c.urlParams_.Set("userProject", userProject) 3428 return c 3429} 3430 3431// Fields allows partial responses to be retrieved. See 3432// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3433// for more information. 3434func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall { 3435 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3436 return c 3437} 3438 3439// Context sets the context to be used in this call's Do method. Any 3440// pending HTTP request will be aborted if the provided context is 3441// canceled. 3442func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall { 3443 c.ctx_ = ctx 3444 return c 3445} 3446 3447// Header returns an http.Header that can be modified by the caller to 3448// add HTTP headers to the request. 3449func (c *BucketsDeleteCall) Header() http.Header { 3450 if c.header_ == nil { 3451 c.header_ = make(http.Header) 3452 } 3453 return c.header_ 3454} 3455 3456func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { 3457 reqHeaders := make(http.Header) 3458 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3459 for k, v := range c.header_ { 3460 reqHeaders[k] = v 3461 } 3462 reqHeaders.Set("User-Agent", c.s.userAgent()) 3463 var body io.Reader = nil 3464 c.urlParams_.Set("alt", alt) 3465 c.urlParams_.Set("prettyPrint", "false") 3466 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 3467 urls += "?" + c.urlParams_.Encode() 3468 req, err := http.NewRequest("DELETE", urls, body) 3469 if err != nil { 3470 return nil, err 3471 } 3472 req.Header = reqHeaders 3473 googleapi.Expand(req.URL, map[string]string{ 3474 "bucket": c.bucket, 3475 }) 3476 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3477} 3478 3479// Do executes the "storage.buckets.delete" call. 3480func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error { 3481 gensupport.SetOptions(c.urlParams_, opts...) 3482 res, err := c.doRequest("json") 3483 if err != nil { 3484 return err 3485 } 3486 defer googleapi.CloseBody(res) 3487 if err := googleapi.CheckResponse(res); err != nil { 3488 return err 3489 } 3490 return nil 3491 // { 3492 // "description": "Permanently deletes an empty bucket.", 3493 // "httpMethod": "DELETE", 3494 // "id": "storage.buckets.delete", 3495 // "parameterOrder": [ 3496 // "bucket" 3497 // ], 3498 // "parameters": { 3499 // "bucket": { 3500 // "description": "Name of a bucket.", 3501 // "location": "path", 3502 // "required": true, 3503 // "type": "string" 3504 // }, 3505 // "ifMetagenerationMatch": { 3506 // "description": "If set, only deletes the bucket if its metageneration matches this value.", 3507 // "format": "int64", 3508 // "location": "query", 3509 // "type": "string" 3510 // }, 3511 // "ifMetagenerationNotMatch": { 3512 // "description": "If set, only deletes the bucket if its metageneration does not match this value.", 3513 // "format": "int64", 3514 // "location": "query", 3515 // "type": "string" 3516 // }, 3517 // "provisionalUserProject": { 3518 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3519 // "location": "query", 3520 // "type": "string" 3521 // }, 3522 // "userProject": { 3523 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3524 // "location": "query", 3525 // "type": "string" 3526 // } 3527 // }, 3528 // "path": "b/{bucket}", 3529 // "scopes": [ 3530 // "https://www.googleapis.com/auth/cloud-platform", 3531 // "https://www.googleapis.com/auth/devstorage.full_control", 3532 // "https://www.googleapis.com/auth/devstorage.read_write" 3533 // ] 3534 // } 3535 3536} 3537 3538// method id "storage.buckets.get": 3539 3540type BucketsGetCall struct { 3541 s *Service 3542 bucket string 3543 urlParams_ gensupport.URLParams 3544 ifNoneMatch_ string 3545 ctx_ context.Context 3546 header_ http.Header 3547} 3548 3549// Get: Returns metadata for the specified bucket. 3550func (r *BucketsService) Get(bucket string) *BucketsGetCall { 3551 c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3552 c.bucket = bucket 3553 return c 3554} 3555 3556// IfMetagenerationMatch sets the optional parameter 3557// "ifMetagenerationMatch": Makes the return of the bucket metadata 3558// conditional on whether the bucket's current metageneration matches 3559// the given value. 3560func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall { 3561 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 3562 return c 3563} 3564 3565// IfMetagenerationNotMatch sets the optional parameter 3566// "ifMetagenerationNotMatch": Makes the return of the bucket metadata 3567// conditional on whether the bucket's current metageneration does not 3568// match the given value. 3569func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall { 3570 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 3571 return c 3572} 3573 3574// Projection sets the optional parameter "projection": Set of 3575// properties to return. Defaults to noAcl. 3576// 3577// Possible values: 3578// "full" - Include all properties. 3579// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 3580func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { 3581 c.urlParams_.Set("projection", projection) 3582 return c 3583} 3584 3585// ProvisionalUserProject sets the optional parameter 3586// "provisionalUserProject": The project to be billed for this request 3587// if the target bucket is requester-pays bucket. 3588func (c *BucketsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetCall { 3589 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3590 return c 3591} 3592 3593// UserProject sets the optional parameter "userProject": The project to 3594// be billed for this request. Required for Requester Pays buckets. 3595func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall { 3596 c.urlParams_.Set("userProject", userProject) 3597 return c 3598} 3599 3600// Fields allows partial responses to be retrieved. See 3601// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3602// for more information. 3603func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall { 3604 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3605 return c 3606} 3607 3608// IfNoneMatch sets the optional parameter which makes the operation 3609// fail if the object's ETag matches the given value. This is useful for 3610// getting updates only after the object has changed since the last 3611// request. Use googleapi.IsNotModified to check whether the response 3612// error from Do is the result of In-None-Match. 3613func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall { 3614 c.ifNoneMatch_ = entityTag 3615 return c 3616} 3617 3618// Context sets the context to be used in this call's Do method. Any 3619// pending HTTP request will be aborted if the provided context is 3620// canceled. 3621func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall { 3622 c.ctx_ = ctx 3623 return c 3624} 3625 3626// Header returns an http.Header that can be modified by the caller to 3627// add HTTP headers to the request. 3628func (c *BucketsGetCall) Header() http.Header { 3629 if c.header_ == nil { 3630 c.header_ = make(http.Header) 3631 } 3632 return c.header_ 3633} 3634 3635func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { 3636 reqHeaders := make(http.Header) 3637 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3638 for k, v := range c.header_ { 3639 reqHeaders[k] = v 3640 } 3641 reqHeaders.Set("User-Agent", c.s.userAgent()) 3642 if c.ifNoneMatch_ != "" { 3643 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3644 } 3645 var body io.Reader = nil 3646 c.urlParams_.Set("alt", alt) 3647 c.urlParams_.Set("prettyPrint", "false") 3648 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 3649 urls += "?" + c.urlParams_.Encode() 3650 req, err := http.NewRequest("GET", urls, body) 3651 if err != nil { 3652 return nil, err 3653 } 3654 req.Header = reqHeaders 3655 googleapi.Expand(req.URL, map[string]string{ 3656 "bucket": c.bucket, 3657 }) 3658 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3659} 3660 3661// Do executes the "storage.buckets.get" call. 3662// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 3663// code is an error. Response headers are in either 3664// *Bucket.ServerResponse.Header or (if a response was returned at all) 3665// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3666// check whether the returned error was because http.StatusNotModified 3667// was returned. 3668func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 3669 gensupport.SetOptions(c.urlParams_, opts...) 3670 res, err := c.doRequest("json") 3671 if res != nil && res.StatusCode == http.StatusNotModified { 3672 if res.Body != nil { 3673 res.Body.Close() 3674 } 3675 return nil, &googleapi.Error{ 3676 Code: res.StatusCode, 3677 Header: res.Header, 3678 } 3679 } 3680 if err != nil { 3681 return nil, err 3682 } 3683 defer googleapi.CloseBody(res) 3684 if err := googleapi.CheckResponse(res); err != nil { 3685 return nil, err 3686 } 3687 ret := &Bucket{ 3688 ServerResponse: googleapi.ServerResponse{ 3689 Header: res.Header, 3690 HTTPStatusCode: res.StatusCode, 3691 }, 3692 } 3693 target := &ret 3694 if err := gensupport.DecodeResponse(target, res); err != nil { 3695 return nil, err 3696 } 3697 return ret, nil 3698 // { 3699 // "description": "Returns metadata for the specified bucket.", 3700 // "httpMethod": "GET", 3701 // "id": "storage.buckets.get", 3702 // "parameterOrder": [ 3703 // "bucket" 3704 // ], 3705 // "parameters": { 3706 // "bucket": { 3707 // "description": "Name of a bucket.", 3708 // "location": "path", 3709 // "required": true, 3710 // "type": "string" 3711 // }, 3712 // "ifMetagenerationMatch": { 3713 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", 3714 // "format": "int64", 3715 // "location": "query", 3716 // "type": "string" 3717 // }, 3718 // "ifMetagenerationNotMatch": { 3719 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", 3720 // "format": "int64", 3721 // "location": "query", 3722 // "type": "string" 3723 // }, 3724 // "projection": { 3725 // "description": "Set of properties to return. Defaults to noAcl.", 3726 // "enum": [ 3727 // "full", 3728 // "noAcl" 3729 // ], 3730 // "enumDescriptions": [ 3731 // "Include all properties.", 3732 // "Omit owner, acl and defaultObjectAcl properties." 3733 // ], 3734 // "location": "query", 3735 // "type": "string" 3736 // }, 3737 // "provisionalUserProject": { 3738 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3739 // "location": "query", 3740 // "type": "string" 3741 // }, 3742 // "userProject": { 3743 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3744 // "location": "query", 3745 // "type": "string" 3746 // } 3747 // }, 3748 // "path": "b/{bucket}", 3749 // "response": { 3750 // "$ref": "Bucket" 3751 // }, 3752 // "scopes": [ 3753 // "https://www.googleapis.com/auth/cloud-platform", 3754 // "https://www.googleapis.com/auth/cloud-platform.read-only", 3755 // "https://www.googleapis.com/auth/devstorage.full_control", 3756 // "https://www.googleapis.com/auth/devstorage.read_only", 3757 // "https://www.googleapis.com/auth/devstorage.read_write" 3758 // ] 3759 // } 3760 3761} 3762 3763// method id "storage.buckets.getIamPolicy": 3764 3765type BucketsGetIamPolicyCall struct { 3766 s *Service 3767 bucket string 3768 urlParams_ gensupport.URLParams 3769 ifNoneMatch_ string 3770 ctx_ context.Context 3771 header_ http.Header 3772} 3773 3774// GetIamPolicy: Returns an IAM policy for the specified bucket. 3775func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall { 3776 c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3777 c.bucket = bucket 3778 return c 3779} 3780 3781// OptionsRequestedPolicyVersion sets the optional parameter 3782// "optionsRequestedPolicyVersion": The IAM policy format version to be 3783// returned. If the optionsRequestedPolicyVersion is for an older 3784// version that doesn't support part of the requested IAM policy, the 3785// request fails. 3786func (c *BucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BucketsGetIamPolicyCall { 3787 c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 3788 return c 3789} 3790 3791// ProvisionalUserProject sets the optional parameter 3792// "provisionalUserProject": The project to be billed for this request 3793// if the target bucket is requester-pays bucket. 3794func (c *BucketsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetIamPolicyCall { 3795 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3796 return c 3797} 3798 3799// UserProject sets the optional parameter "userProject": The project to 3800// be billed for this request. Required for Requester Pays buckets. 3801func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall { 3802 c.urlParams_.Set("userProject", userProject) 3803 return c 3804} 3805 3806// Fields allows partial responses to be retrieved. See 3807// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3808// for more information. 3809func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall { 3810 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3811 return c 3812} 3813 3814// IfNoneMatch sets the optional parameter which makes the operation 3815// fail if the object's ETag matches the given value. This is useful for 3816// getting updates only after the object has changed since the last 3817// request. Use googleapi.IsNotModified to check whether the response 3818// error from Do is the result of In-None-Match. 3819func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall { 3820 c.ifNoneMatch_ = entityTag 3821 return c 3822} 3823 3824// Context sets the context to be used in this call's Do method. Any 3825// pending HTTP request will be aborted if the provided context is 3826// canceled. 3827func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall { 3828 c.ctx_ = ctx 3829 return c 3830} 3831 3832// Header returns an http.Header that can be modified by the caller to 3833// add HTTP headers to the request. 3834func (c *BucketsGetIamPolicyCall) Header() http.Header { 3835 if c.header_ == nil { 3836 c.header_ = make(http.Header) 3837 } 3838 return c.header_ 3839} 3840 3841func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3842 reqHeaders := make(http.Header) 3843 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 3844 for k, v := range c.header_ { 3845 reqHeaders[k] = v 3846 } 3847 reqHeaders.Set("User-Agent", c.s.userAgent()) 3848 if c.ifNoneMatch_ != "" { 3849 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3850 } 3851 var body io.Reader = nil 3852 c.urlParams_.Set("alt", alt) 3853 c.urlParams_.Set("prettyPrint", "false") 3854 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam") 3855 urls += "?" + c.urlParams_.Encode() 3856 req, err := http.NewRequest("GET", urls, body) 3857 if err != nil { 3858 return nil, err 3859 } 3860 req.Header = reqHeaders 3861 googleapi.Expand(req.URL, map[string]string{ 3862 "bucket": c.bucket, 3863 }) 3864 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3865} 3866 3867// Do executes the "storage.buckets.getIamPolicy" call. 3868// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3869// code is an error. Response headers are in either 3870// *Policy.ServerResponse.Header or (if a response was returned at all) 3871// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3872// check whether the returned error was because http.StatusNotModified 3873// was returned. 3874func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3875 gensupport.SetOptions(c.urlParams_, opts...) 3876 res, err := c.doRequest("json") 3877 if res != nil && res.StatusCode == http.StatusNotModified { 3878 if res.Body != nil { 3879 res.Body.Close() 3880 } 3881 return nil, &googleapi.Error{ 3882 Code: res.StatusCode, 3883 Header: res.Header, 3884 } 3885 } 3886 if err != nil { 3887 return nil, err 3888 } 3889 defer googleapi.CloseBody(res) 3890 if err := googleapi.CheckResponse(res); err != nil { 3891 return nil, err 3892 } 3893 ret := &Policy{ 3894 ServerResponse: googleapi.ServerResponse{ 3895 Header: res.Header, 3896 HTTPStatusCode: res.StatusCode, 3897 }, 3898 } 3899 target := &ret 3900 if err := gensupport.DecodeResponse(target, res); err != nil { 3901 return nil, err 3902 } 3903 return ret, nil 3904 // { 3905 // "description": "Returns an IAM policy for the specified bucket.", 3906 // "httpMethod": "GET", 3907 // "id": "storage.buckets.getIamPolicy", 3908 // "parameterOrder": [ 3909 // "bucket" 3910 // ], 3911 // "parameters": { 3912 // "bucket": { 3913 // "description": "Name of a bucket.", 3914 // "location": "path", 3915 // "required": true, 3916 // "type": "string" 3917 // }, 3918 // "optionsRequestedPolicyVersion": { 3919 // "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", 3920 // "format": "int32", 3921 // "location": "query", 3922 // "minimum": "1", 3923 // "type": "integer" 3924 // }, 3925 // "provisionalUserProject": { 3926 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3927 // "location": "query", 3928 // "type": "string" 3929 // }, 3930 // "userProject": { 3931 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3932 // "location": "query", 3933 // "type": "string" 3934 // } 3935 // }, 3936 // "path": "b/{bucket}/iam", 3937 // "response": { 3938 // "$ref": "Policy" 3939 // }, 3940 // "scopes": [ 3941 // "https://www.googleapis.com/auth/cloud-platform", 3942 // "https://www.googleapis.com/auth/devstorage.full_control" 3943 // ] 3944 // } 3945 3946} 3947 3948// method id "storage.buckets.insert": 3949 3950type BucketsInsertCall struct { 3951 s *Service 3952 bucket *Bucket 3953 urlParams_ gensupport.URLParams 3954 ctx_ context.Context 3955 header_ http.Header 3956} 3957 3958// Insert: Creates a new bucket. 3959func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall { 3960 c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3961 c.urlParams_.Set("project", projectid) 3962 c.bucket = bucket 3963 return c 3964} 3965 3966// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 3967// predefined set of access controls to this bucket. 3968// 3969// Possible values: 3970// "authenticatedRead" - Project team owners get OWNER access, and 3971// allAuthenticatedUsers get READER access. 3972// "private" - Project team owners get OWNER access. 3973// "projectPrivate" - Project team members get access according to 3974// their roles. 3975// "publicRead" - Project team owners get OWNER access, and allUsers 3976// get READER access. 3977// "publicReadWrite" - Project team owners get OWNER access, and 3978// allUsers get WRITER access. 3979func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall { 3980 c.urlParams_.Set("predefinedAcl", predefinedAcl) 3981 return c 3982} 3983 3984// PredefinedDefaultObjectAcl sets the optional parameter 3985// "predefinedDefaultObjectAcl": Apply a predefined set of default 3986// object access controls to this bucket. 3987// 3988// Possible values: 3989// "authenticatedRead" - Object owner gets OWNER access, and 3990// allAuthenticatedUsers get READER access. 3991// "bucketOwnerFullControl" - Object owner gets OWNER access, and 3992// project team owners get OWNER access. 3993// "bucketOwnerRead" - Object owner gets OWNER access, and project 3994// team owners get READER access. 3995// "private" - Object owner gets OWNER access. 3996// "projectPrivate" - Object owner gets OWNER access, and project team 3997// members get access according to their roles. 3998// "publicRead" - Object owner gets OWNER access, and allUsers get 3999// READER access. 4000func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall { 4001 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) 4002 return c 4003} 4004 4005// Projection sets the optional parameter "projection": Set of 4006// properties to return. Defaults to noAcl, unless the bucket resource 4007// specifies acl or defaultObjectAcl properties, when it defaults to 4008// full. 4009// 4010// Possible values: 4011// "full" - Include all properties. 4012// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 4013func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { 4014 c.urlParams_.Set("projection", projection) 4015 return c 4016} 4017 4018// ProvisionalUserProject sets the optional parameter 4019// "provisionalUserProject": The project to be billed for this request 4020// if the target bucket is requester-pays bucket. 4021func (c *BucketsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketsInsertCall { 4022 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4023 return c 4024} 4025 4026// UserProject sets the optional parameter "userProject": The project to 4027// be billed for this request. 4028func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall { 4029 c.urlParams_.Set("userProject", userProject) 4030 return c 4031} 4032 4033// Fields allows partial responses to be retrieved. See 4034// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4035// for more information. 4036func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall { 4037 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4038 return c 4039} 4040 4041// Context sets the context to be used in this call's Do method. Any 4042// pending HTTP request will be aborted if the provided context is 4043// canceled. 4044func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall { 4045 c.ctx_ = ctx 4046 return c 4047} 4048 4049// Header returns an http.Header that can be modified by the caller to 4050// add HTTP headers to the request. 4051func (c *BucketsInsertCall) Header() http.Header { 4052 if c.header_ == nil { 4053 c.header_ = make(http.Header) 4054 } 4055 return c.header_ 4056} 4057 4058func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { 4059 reqHeaders := make(http.Header) 4060 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4061 for k, v := range c.header_ { 4062 reqHeaders[k] = v 4063 } 4064 reqHeaders.Set("User-Agent", c.s.userAgent()) 4065 var body io.Reader = nil 4066 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) 4067 if err != nil { 4068 return nil, err 4069 } 4070 reqHeaders.Set("Content-Type", "application/json") 4071 c.urlParams_.Set("alt", alt) 4072 c.urlParams_.Set("prettyPrint", "false") 4073 urls := googleapi.ResolveRelative(c.s.BasePath, "b") 4074 urls += "?" + c.urlParams_.Encode() 4075 req, err := http.NewRequest("POST", urls, body) 4076 if err != nil { 4077 return nil, err 4078 } 4079 req.Header = reqHeaders 4080 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4081} 4082 4083// Do executes the "storage.buckets.insert" call. 4084// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 4085// code is an error. Response headers are in either 4086// *Bucket.ServerResponse.Header or (if a response was returned at all) 4087// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4088// check whether the returned error was because http.StatusNotModified 4089// was returned. 4090func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 4091 gensupport.SetOptions(c.urlParams_, opts...) 4092 res, err := c.doRequest("json") 4093 if res != nil && res.StatusCode == http.StatusNotModified { 4094 if res.Body != nil { 4095 res.Body.Close() 4096 } 4097 return nil, &googleapi.Error{ 4098 Code: res.StatusCode, 4099 Header: res.Header, 4100 } 4101 } 4102 if err != nil { 4103 return nil, err 4104 } 4105 defer googleapi.CloseBody(res) 4106 if err := googleapi.CheckResponse(res); err != nil { 4107 return nil, err 4108 } 4109 ret := &Bucket{ 4110 ServerResponse: googleapi.ServerResponse{ 4111 Header: res.Header, 4112 HTTPStatusCode: res.StatusCode, 4113 }, 4114 } 4115 target := &ret 4116 if err := gensupport.DecodeResponse(target, res); err != nil { 4117 return nil, err 4118 } 4119 return ret, nil 4120 // { 4121 // "description": "Creates a new bucket.", 4122 // "httpMethod": "POST", 4123 // "id": "storage.buckets.insert", 4124 // "parameterOrder": [ 4125 // "project" 4126 // ], 4127 // "parameters": { 4128 // "predefinedAcl": { 4129 // "description": "Apply a predefined set of access controls to this bucket.", 4130 // "enum": [ 4131 // "authenticatedRead", 4132 // "private", 4133 // "projectPrivate", 4134 // "publicRead", 4135 // "publicReadWrite" 4136 // ], 4137 // "enumDescriptions": [ 4138 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", 4139 // "Project team owners get OWNER access.", 4140 // "Project team members get access according to their roles.", 4141 // "Project team owners get OWNER access, and allUsers get READER access.", 4142 // "Project team owners get OWNER access, and allUsers get WRITER access." 4143 // ], 4144 // "location": "query", 4145 // "type": "string" 4146 // }, 4147 // "predefinedDefaultObjectAcl": { 4148 // "description": "Apply a predefined set of default object access controls to this bucket.", 4149 // "enum": [ 4150 // "authenticatedRead", 4151 // "bucketOwnerFullControl", 4152 // "bucketOwnerRead", 4153 // "private", 4154 // "projectPrivate", 4155 // "publicRead" 4156 // ], 4157 // "enumDescriptions": [ 4158 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 4159 // "Object owner gets OWNER access, and project team owners get OWNER access.", 4160 // "Object owner gets OWNER access, and project team owners get READER access.", 4161 // "Object owner gets OWNER access.", 4162 // "Object owner gets OWNER access, and project team members get access according to their roles.", 4163 // "Object owner gets OWNER access, and allUsers get READER access." 4164 // ], 4165 // "location": "query", 4166 // "type": "string" 4167 // }, 4168 // "project": { 4169 // "description": "A valid API project identifier.", 4170 // "location": "query", 4171 // "required": true, 4172 // "type": "string" 4173 // }, 4174 // "projection": { 4175 // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", 4176 // "enum": [ 4177 // "full", 4178 // "noAcl" 4179 // ], 4180 // "enumDescriptions": [ 4181 // "Include all properties.", 4182 // "Omit owner, acl and defaultObjectAcl properties." 4183 // ], 4184 // "location": "query", 4185 // "type": "string" 4186 // }, 4187 // "provisionalUserProject": { 4188 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4189 // "location": "query", 4190 // "type": "string" 4191 // }, 4192 // "userProject": { 4193 // "description": "The project to be billed for this request.", 4194 // "location": "query", 4195 // "type": "string" 4196 // } 4197 // }, 4198 // "path": "b", 4199 // "request": { 4200 // "$ref": "Bucket" 4201 // }, 4202 // "response": { 4203 // "$ref": "Bucket" 4204 // }, 4205 // "scopes": [ 4206 // "https://www.googleapis.com/auth/cloud-platform", 4207 // "https://www.googleapis.com/auth/devstorage.full_control", 4208 // "https://www.googleapis.com/auth/devstorage.read_write" 4209 // ] 4210 // } 4211 4212} 4213 4214// method id "storage.buckets.list": 4215 4216type BucketsListCall struct { 4217 s *Service 4218 urlParams_ gensupport.URLParams 4219 ifNoneMatch_ string 4220 ctx_ context.Context 4221 header_ http.Header 4222} 4223 4224// List: Retrieves a list of buckets for a given project. 4225func (r *BucketsService) List(projectid string) *BucketsListCall { 4226 c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4227 c.urlParams_.Set("project", projectid) 4228 return c 4229} 4230 4231// MaxResults sets the optional parameter "maxResults": Maximum number 4232// of buckets to return in a single response. The service will use this 4233// parameter or 1,000 items, whichever is smaller. 4234func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall { 4235 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4236 return c 4237} 4238 4239// PageToken sets the optional parameter "pageToken": A 4240// previously-returned page token representing part of the larger set of 4241// results to view. 4242func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall { 4243 c.urlParams_.Set("pageToken", pageToken) 4244 return c 4245} 4246 4247// Prefix sets the optional parameter "prefix": Filter results to 4248// buckets whose names begin with this prefix. 4249func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall { 4250 c.urlParams_.Set("prefix", prefix) 4251 return c 4252} 4253 4254// Projection sets the optional parameter "projection": Set of 4255// properties to return. Defaults to noAcl. 4256// 4257// Possible values: 4258// "full" - Include all properties. 4259// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 4260func (c *BucketsListCall) Projection(projection string) *BucketsListCall { 4261 c.urlParams_.Set("projection", projection) 4262 return c 4263} 4264 4265// ProvisionalUserProject sets the optional parameter 4266// "provisionalUserProject": The project to be billed for this request 4267// if the target bucket is requester-pays bucket. 4268func (c *BucketsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketsListCall { 4269 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4270 return c 4271} 4272 4273// UserProject sets the optional parameter "userProject": The project to 4274// be billed for this request. 4275func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall { 4276 c.urlParams_.Set("userProject", userProject) 4277 return c 4278} 4279 4280// Fields allows partial responses to be retrieved. See 4281// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4282// for more information. 4283func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall { 4284 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4285 return c 4286} 4287 4288// IfNoneMatch sets the optional parameter which makes the operation 4289// fail if the object's ETag matches the given value. This is useful for 4290// getting updates only after the object has changed since the last 4291// request. Use googleapi.IsNotModified to check whether the response 4292// error from Do is the result of In-None-Match. 4293func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall { 4294 c.ifNoneMatch_ = entityTag 4295 return c 4296} 4297 4298// Context sets the context to be used in this call's Do method. Any 4299// pending HTTP request will be aborted if the provided context is 4300// canceled. 4301func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall { 4302 c.ctx_ = ctx 4303 return c 4304} 4305 4306// Header returns an http.Header that can be modified by the caller to 4307// add HTTP headers to the request. 4308func (c *BucketsListCall) Header() http.Header { 4309 if c.header_ == nil { 4310 c.header_ = make(http.Header) 4311 } 4312 return c.header_ 4313} 4314 4315func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { 4316 reqHeaders := make(http.Header) 4317 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4318 for k, v := range c.header_ { 4319 reqHeaders[k] = v 4320 } 4321 reqHeaders.Set("User-Agent", c.s.userAgent()) 4322 if c.ifNoneMatch_ != "" { 4323 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4324 } 4325 var body io.Reader = nil 4326 c.urlParams_.Set("alt", alt) 4327 c.urlParams_.Set("prettyPrint", "false") 4328 urls := googleapi.ResolveRelative(c.s.BasePath, "b") 4329 urls += "?" + c.urlParams_.Encode() 4330 req, err := http.NewRequest("GET", urls, body) 4331 if err != nil { 4332 return nil, err 4333 } 4334 req.Header = reqHeaders 4335 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4336} 4337 4338// Do executes the "storage.buckets.list" call. 4339// Exactly one of *Buckets or error will be non-nil. Any non-2xx status 4340// code is an error. Response headers are in either 4341// *Buckets.ServerResponse.Header or (if a response was returned at all) 4342// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4343// check whether the returned error was because http.StatusNotModified 4344// was returned. 4345func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) { 4346 gensupport.SetOptions(c.urlParams_, opts...) 4347 res, err := c.doRequest("json") 4348 if res != nil && res.StatusCode == http.StatusNotModified { 4349 if res.Body != nil { 4350 res.Body.Close() 4351 } 4352 return nil, &googleapi.Error{ 4353 Code: res.StatusCode, 4354 Header: res.Header, 4355 } 4356 } 4357 if err != nil { 4358 return nil, err 4359 } 4360 defer googleapi.CloseBody(res) 4361 if err := googleapi.CheckResponse(res); err != nil { 4362 return nil, err 4363 } 4364 ret := &Buckets{ 4365 ServerResponse: googleapi.ServerResponse{ 4366 Header: res.Header, 4367 HTTPStatusCode: res.StatusCode, 4368 }, 4369 } 4370 target := &ret 4371 if err := gensupport.DecodeResponse(target, res); err != nil { 4372 return nil, err 4373 } 4374 return ret, nil 4375 // { 4376 // "description": "Retrieves a list of buckets for a given project.", 4377 // "httpMethod": "GET", 4378 // "id": "storage.buckets.list", 4379 // "parameterOrder": [ 4380 // "project" 4381 // ], 4382 // "parameters": { 4383 // "maxResults": { 4384 // "default": "1000", 4385 // "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", 4386 // "format": "uint32", 4387 // "location": "query", 4388 // "minimum": "0", 4389 // "type": "integer" 4390 // }, 4391 // "pageToken": { 4392 // "description": "A previously-returned page token representing part of the larger set of results to view.", 4393 // "location": "query", 4394 // "type": "string" 4395 // }, 4396 // "prefix": { 4397 // "description": "Filter results to buckets whose names begin with this prefix.", 4398 // "location": "query", 4399 // "type": "string" 4400 // }, 4401 // "project": { 4402 // "description": "A valid API project identifier.", 4403 // "location": "query", 4404 // "required": true, 4405 // "type": "string" 4406 // }, 4407 // "projection": { 4408 // "description": "Set of properties to return. Defaults to noAcl.", 4409 // "enum": [ 4410 // "full", 4411 // "noAcl" 4412 // ], 4413 // "enumDescriptions": [ 4414 // "Include all properties.", 4415 // "Omit owner, acl and defaultObjectAcl properties." 4416 // ], 4417 // "location": "query", 4418 // "type": "string" 4419 // }, 4420 // "provisionalUserProject": { 4421 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4422 // "location": "query", 4423 // "type": "string" 4424 // }, 4425 // "userProject": { 4426 // "description": "The project to be billed for this request.", 4427 // "location": "query", 4428 // "type": "string" 4429 // } 4430 // }, 4431 // "path": "b", 4432 // "response": { 4433 // "$ref": "Buckets" 4434 // }, 4435 // "scopes": [ 4436 // "https://www.googleapis.com/auth/cloud-platform", 4437 // "https://www.googleapis.com/auth/cloud-platform.read-only", 4438 // "https://www.googleapis.com/auth/devstorage.full_control", 4439 // "https://www.googleapis.com/auth/devstorage.read_only", 4440 // "https://www.googleapis.com/auth/devstorage.read_write" 4441 // ] 4442 // } 4443 4444} 4445 4446// Pages invokes f for each page of results. 4447// A non-nil error returned from f will halt the iteration. 4448// The provided context supersedes any context provided to the Context method. 4449func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error { 4450 c.ctx_ = ctx 4451 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4452 for { 4453 x, err := c.Do() 4454 if err != nil { 4455 return err 4456 } 4457 if err := f(x); err != nil { 4458 return err 4459 } 4460 if x.NextPageToken == "" { 4461 return nil 4462 } 4463 c.PageToken(x.NextPageToken) 4464 } 4465} 4466 4467// method id "storage.buckets.lockRetentionPolicy": 4468 4469type BucketsLockRetentionPolicyCall struct { 4470 s *Service 4471 bucket string 4472 urlParams_ gensupport.URLParams 4473 ctx_ context.Context 4474 header_ http.Header 4475} 4476 4477// LockRetentionPolicy: Locks retention policy on a bucket. 4478func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall { 4479 c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4480 c.bucket = bucket 4481 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 4482 return c 4483} 4484 4485// ProvisionalUserProject sets the optional parameter 4486// "provisionalUserProject": The project to be billed for this request 4487// if the target bucket is requester-pays bucket. 4488func (c *BucketsLockRetentionPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsLockRetentionPolicyCall { 4489 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4490 return c 4491} 4492 4493// UserProject sets the optional parameter "userProject": The project to 4494// be billed for this request. Required for Requester Pays buckets. 4495func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall { 4496 c.urlParams_.Set("userProject", userProject) 4497 return c 4498} 4499 4500// Fields allows partial responses to be retrieved. See 4501// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4502// for more information. 4503func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall { 4504 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4505 return c 4506} 4507 4508// Context sets the context to be used in this call's Do method. Any 4509// pending HTTP request will be aborted if the provided context is 4510// canceled. 4511func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall { 4512 c.ctx_ = ctx 4513 return c 4514} 4515 4516// Header returns an http.Header that can be modified by the caller to 4517// add HTTP headers to the request. 4518func (c *BucketsLockRetentionPolicyCall) Header() http.Header { 4519 if c.header_ == nil { 4520 c.header_ = make(http.Header) 4521 } 4522 return c.header_ 4523} 4524 4525func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) { 4526 reqHeaders := make(http.Header) 4527 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4528 for k, v := range c.header_ { 4529 reqHeaders[k] = v 4530 } 4531 reqHeaders.Set("User-Agent", c.s.userAgent()) 4532 var body io.Reader = nil 4533 c.urlParams_.Set("alt", alt) 4534 c.urlParams_.Set("prettyPrint", "false") 4535 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy") 4536 urls += "?" + c.urlParams_.Encode() 4537 req, err := http.NewRequest("POST", urls, body) 4538 if err != nil { 4539 return nil, err 4540 } 4541 req.Header = reqHeaders 4542 googleapi.Expand(req.URL, map[string]string{ 4543 "bucket": c.bucket, 4544 }) 4545 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4546} 4547 4548// Do executes the "storage.buckets.lockRetentionPolicy" call. 4549// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 4550// code is an error. Response headers are in either 4551// *Bucket.ServerResponse.Header or (if a response was returned at all) 4552// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4553// check whether the returned error was because http.StatusNotModified 4554// was returned. 4555func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 4556 gensupport.SetOptions(c.urlParams_, opts...) 4557 res, err := c.doRequest("json") 4558 if res != nil && res.StatusCode == http.StatusNotModified { 4559 if res.Body != nil { 4560 res.Body.Close() 4561 } 4562 return nil, &googleapi.Error{ 4563 Code: res.StatusCode, 4564 Header: res.Header, 4565 } 4566 } 4567 if err != nil { 4568 return nil, err 4569 } 4570 defer googleapi.CloseBody(res) 4571 if err := googleapi.CheckResponse(res); err != nil { 4572 return nil, err 4573 } 4574 ret := &Bucket{ 4575 ServerResponse: googleapi.ServerResponse{ 4576 Header: res.Header, 4577 HTTPStatusCode: res.StatusCode, 4578 }, 4579 } 4580 target := &ret 4581 if err := gensupport.DecodeResponse(target, res); err != nil { 4582 return nil, err 4583 } 4584 return ret, nil 4585 // { 4586 // "description": "Locks retention policy on a bucket.", 4587 // "httpMethod": "POST", 4588 // "id": "storage.buckets.lockRetentionPolicy", 4589 // "parameterOrder": [ 4590 // "bucket", 4591 // "ifMetagenerationMatch" 4592 // ], 4593 // "parameters": { 4594 // "bucket": { 4595 // "description": "Name of a bucket.", 4596 // "location": "path", 4597 // "required": true, 4598 // "type": "string" 4599 // }, 4600 // "ifMetagenerationMatch": { 4601 // "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", 4602 // "format": "int64", 4603 // "location": "query", 4604 // "required": true, 4605 // "type": "string" 4606 // }, 4607 // "provisionalUserProject": { 4608 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4609 // "location": "query", 4610 // "type": "string" 4611 // }, 4612 // "userProject": { 4613 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 4614 // "location": "query", 4615 // "type": "string" 4616 // } 4617 // }, 4618 // "path": "b/{bucket}/lockRetentionPolicy", 4619 // "response": { 4620 // "$ref": "Bucket" 4621 // }, 4622 // "scopes": [ 4623 // "https://www.googleapis.com/auth/cloud-platform", 4624 // "https://www.googleapis.com/auth/devstorage.full_control", 4625 // "https://www.googleapis.com/auth/devstorage.read_write" 4626 // ] 4627 // } 4628 4629} 4630 4631// method id "storage.buckets.patch": 4632 4633type BucketsPatchCall struct { 4634 s *Service 4635 bucket string 4636 bucket2 *Bucket 4637 urlParams_ gensupport.URLParams 4638 ctx_ context.Context 4639 header_ http.Header 4640} 4641 4642// Patch: Patches a bucket. Changes to the bucket will be readable 4643// immediately after writing, but configuration changes may take time to 4644// propagate. 4645func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall { 4646 c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4647 c.bucket = bucket 4648 c.bucket2 = bucket2 4649 return c 4650} 4651 4652// IfMetagenerationMatch sets the optional parameter 4653// "ifMetagenerationMatch": Makes the return of the bucket metadata 4654// conditional on whether the bucket's current metageneration matches 4655// the given value. 4656func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall { 4657 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 4658 return c 4659} 4660 4661// IfMetagenerationNotMatch sets the optional parameter 4662// "ifMetagenerationNotMatch": Makes the return of the bucket metadata 4663// conditional on whether the bucket's current metageneration does not 4664// match the given value. 4665func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall { 4666 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 4667 return c 4668} 4669 4670// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 4671// predefined set of access controls to this bucket. 4672// 4673// Possible values: 4674// "authenticatedRead" - Project team owners get OWNER access, and 4675// allAuthenticatedUsers get READER access. 4676// "private" - Project team owners get OWNER access. 4677// "projectPrivate" - Project team members get access according to 4678// their roles. 4679// "publicRead" - Project team owners get OWNER access, and allUsers 4680// get READER access. 4681// "publicReadWrite" - Project team owners get OWNER access, and 4682// allUsers get WRITER access. 4683func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall { 4684 c.urlParams_.Set("predefinedAcl", predefinedAcl) 4685 return c 4686} 4687 4688// PredefinedDefaultObjectAcl sets the optional parameter 4689// "predefinedDefaultObjectAcl": Apply a predefined set of default 4690// object access controls to this bucket. 4691// 4692// Possible values: 4693// "authenticatedRead" - Object owner gets OWNER access, and 4694// allAuthenticatedUsers get READER access. 4695// "bucketOwnerFullControl" - Object owner gets OWNER access, and 4696// project team owners get OWNER access. 4697// "bucketOwnerRead" - Object owner gets OWNER access, and project 4698// team owners get READER access. 4699// "private" - Object owner gets OWNER access. 4700// "projectPrivate" - Object owner gets OWNER access, and project team 4701// members get access according to their roles. 4702// "publicRead" - Object owner gets OWNER access, and allUsers get 4703// READER access. 4704func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall { 4705 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) 4706 return c 4707} 4708 4709// Projection sets the optional parameter "projection": Set of 4710// properties to return. Defaults to full. 4711// 4712// Possible values: 4713// "full" - Include all properties. 4714// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 4715func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { 4716 c.urlParams_.Set("projection", projection) 4717 return c 4718} 4719 4720// ProvisionalUserProject sets the optional parameter 4721// "provisionalUserProject": The project to be billed for this request 4722// if the target bucket is requester-pays bucket. 4723func (c *BucketsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketsPatchCall { 4724 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4725 return c 4726} 4727 4728// UserProject sets the optional parameter "userProject": The project to 4729// be billed for this request. Required for Requester Pays buckets. 4730func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall { 4731 c.urlParams_.Set("userProject", userProject) 4732 return c 4733} 4734 4735// Fields allows partial responses to be retrieved. See 4736// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4737// for more information. 4738func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall { 4739 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4740 return c 4741} 4742 4743// Context sets the context to be used in this call's Do method. Any 4744// pending HTTP request will be aborted if the provided context is 4745// canceled. 4746func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall { 4747 c.ctx_ = ctx 4748 return c 4749} 4750 4751// Header returns an http.Header that can be modified by the caller to 4752// add HTTP headers to the request. 4753func (c *BucketsPatchCall) Header() http.Header { 4754 if c.header_ == nil { 4755 c.header_ = make(http.Header) 4756 } 4757 return c.header_ 4758} 4759 4760func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { 4761 reqHeaders := make(http.Header) 4762 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4763 for k, v := range c.header_ { 4764 reqHeaders[k] = v 4765 } 4766 reqHeaders.Set("User-Agent", c.s.userAgent()) 4767 var body io.Reader = nil 4768 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) 4769 if err != nil { 4770 return nil, err 4771 } 4772 reqHeaders.Set("Content-Type", "application/json") 4773 c.urlParams_.Set("alt", alt) 4774 c.urlParams_.Set("prettyPrint", "false") 4775 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 4776 urls += "?" + c.urlParams_.Encode() 4777 req, err := http.NewRequest("PATCH", urls, body) 4778 if err != nil { 4779 return nil, err 4780 } 4781 req.Header = reqHeaders 4782 googleapi.Expand(req.URL, map[string]string{ 4783 "bucket": c.bucket, 4784 }) 4785 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4786} 4787 4788// Do executes the "storage.buckets.patch" call. 4789// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 4790// code is an error. Response headers are in either 4791// *Bucket.ServerResponse.Header or (if a response was returned at all) 4792// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4793// check whether the returned error was because http.StatusNotModified 4794// was returned. 4795func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 4796 gensupport.SetOptions(c.urlParams_, opts...) 4797 res, err := c.doRequest("json") 4798 if res != nil && res.StatusCode == http.StatusNotModified { 4799 if res.Body != nil { 4800 res.Body.Close() 4801 } 4802 return nil, &googleapi.Error{ 4803 Code: res.StatusCode, 4804 Header: res.Header, 4805 } 4806 } 4807 if err != nil { 4808 return nil, err 4809 } 4810 defer googleapi.CloseBody(res) 4811 if err := googleapi.CheckResponse(res); err != nil { 4812 return nil, err 4813 } 4814 ret := &Bucket{ 4815 ServerResponse: googleapi.ServerResponse{ 4816 Header: res.Header, 4817 HTTPStatusCode: res.StatusCode, 4818 }, 4819 } 4820 target := &ret 4821 if err := gensupport.DecodeResponse(target, res); err != nil { 4822 return nil, err 4823 } 4824 return ret, nil 4825 // { 4826 // "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", 4827 // "httpMethod": "PATCH", 4828 // "id": "storage.buckets.patch", 4829 // "parameterOrder": [ 4830 // "bucket" 4831 // ], 4832 // "parameters": { 4833 // "bucket": { 4834 // "description": "Name of a bucket.", 4835 // "location": "path", 4836 // "required": true, 4837 // "type": "string" 4838 // }, 4839 // "ifMetagenerationMatch": { 4840 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", 4841 // "format": "int64", 4842 // "location": "query", 4843 // "type": "string" 4844 // }, 4845 // "ifMetagenerationNotMatch": { 4846 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", 4847 // "format": "int64", 4848 // "location": "query", 4849 // "type": "string" 4850 // }, 4851 // "predefinedAcl": { 4852 // "description": "Apply a predefined set of access controls to this bucket.", 4853 // "enum": [ 4854 // "authenticatedRead", 4855 // "private", 4856 // "projectPrivate", 4857 // "publicRead", 4858 // "publicReadWrite" 4859 // ], 4860 // "enumDescriptions": [ 4861 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", 4862 // "Project team owners get OWNER access.", 4863 // "Project team members get access according to their roles.", 4864 // "Project team owners get OWNER access, and allUsers get READER access.", 4865 // "Project team owners get OWNER access, and allUsers get WRITER access." 4866 // ], 4867 // "location": "query", 4868 // "type": "string" 4869 // }, 4870 // "predefinedDefaultObjectAcl": { 4871 // "description": "Apply a predefined set of default object access controls to this bucket.", 4872 // "enum": [ 4873 // "authenticatedRead", 4874 // "bucketOwnerFullControl", 4875 // "bucketOwnerRead", 4876 // "private", 4877 // "projectPrivate", 4878 // "publicRead" 4879 // ], 4880 // "enumDescriptions": [ 4881 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 4882 // "Object owner gets OWNER access, and project team owners get OWNER access.", 4883 // "Object owner gets OWNER access, and project team owners get READER access.", 4884 // "Object owner gets OWNER access.", 4885 // "Object owner gets OWNER access, and project team members get access according to their roles.", 4886 // "Object owner gets OWNER access, and allUsers get READER access." 4887 // ], 4888 // "location": "query", 4889 // "type": "string" 4890 // }, 4891 // "projection": { 4892 // "description": "Set of properties to return. Defaults to full.", 4893 // "enum": [ 4894 // "full", 4895 // "noAcl" 4896 // ], 4897 // "enumDescriptions": [ 4898 // "Include all properties.", 4899 // "Omit owner, acl and defaultObjectAcl properties." 4900 // ], 4901 // "location": "query", 4902 // "type": "string" 4903 // }, 4904 // "provisionalUserProject": { 4905 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4906 // "location": "query", 4907 // "type": "string" 4908 // }, 4909 // "userProject": { 4910 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 4911 // "location": "query", 4912 // "type": "string" 4913 // } 4914 // }, 4915 // "path": "b/{bucket}", 4916 // "request": { 4917 // "$ref": "Bucket" 4918 // }, 4919 // "response": { 4920 // "$ref": "Bucket" 4921 // }, 4922 // "scopes": [ 4923 // "https://www.googleapis.com/auth/cloud-platform", 4924 // "https://www.googleapis.com/auth/devstorage.full_control" 4925 // ] 4926 // } 4927 4928} 4929 4930// method id "storage.buckets.setIamPolicy": 4931 4932type BucketsSetIamPolicyCall struct { 4933 s *Service 4934 bucket string 4935 policy *Policy 4936 urlParams_ gensupport.URLParams 4937 ctx_ context.Context 4938 header_ http.Header 4939} 4940 4941// SetIamPolicy: Updates an IAM policy for the specified bucket. 4942func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall { 4943 c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4944 c.bucket = bucket 4945 c.policy = policy 4946 return c 4947} 4948 4949// ProvisionalUserProject sets the optional parameter 4950// "provisionalUserProject": The project to be billed for this request 4951// if the target bucket is requester-pays bucket. 4952func (c *BucketsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsSetIamPolicyCall { 4953 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4954 return c 4955} 4956 4957// UserProject sets the optional parameter "userProject": The project to 4958// be billed for this request. Required for Requester Pays buckets. 4959func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall { 4960 c.urlParams_.Set("userProject", userProject) 4961 return c 4962} 4963 4964// Fields allows partial responses to be retrieved. See 4965// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4966// for more information. 4967func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall { 4968 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4969 return c 4970} 4971 4972// Context sets the context to be used in this call's Do method. Any 4973// pending HTTP request will be aborted if the provided context is 4974// canceled. 4975func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall { 4976 c.ctx_ = ctx 4977 return c 4978} 4979 4980// Header returns an http.Header that can be modified by the caller to 4981// add HTTP headers to the request. 4982func (c *BucketsSetIamPolicyCall) Header() http.Header { 4983 if c.header_ == nil { 4984 c.header_ = make(http.Header) 4985 } 4986 return c.header_ 4987} 4988 4989func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 4990 reqHeaders := make(http.Header) 4991 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 4992 for k, v := range c.header_ { 4993 reqHeaders[k] = v 4994 } 4995 reqHeaders.Set("User-Agent", c.s.userAgent()) 4996 var body io.Reader = nil 4997 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) 4998 if err != nil { 4999 return nil, err 5000 } 5001 reqHeaders.Set("Content-Type", "application/json") 5002 c.urlParams_.Set("alt", alt) 5003 c.urlParams_.Set("prettyPrint", "false") 5004 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam") 5005 urls += "?" + c.urlParams_.Encode() 5006 req, err := http.NewRequest("PUT", urls, body) 5007 if err != nil { 5008 return nil, err 5009 } 5010 req.Header = reqHeaders 5011 googleapi.Expand(req.URL, map[string]string{ 5012 "bucket": c.bucket, 5013 }) 5014 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5015} 5016 5017// Do executes the "storage.buckets.setIamPolicy" call. 5018// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5019// code is an error. Response headers are in either 5020// *Policy.ServerResponse.Header or (if a response was returned at all) 5021// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5022// check whether the returned error was because http.StatusNotModified 5023// was returned. 5024func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5025 gensupport.SetOptions(c.urlParams_, opts...) 5026 res, err := c.doRequest("json") 5027 if res != nil && res.StatusCode == http.StatusNotModified { 5028 if res.Body != nil { 5029 res.Body.Close() 5030 } 5031 return nil, &googleapi.Error{ 5032 Code: res.StatusCode, 5033 Header: res.Header, 5034 } 5035 } 5036 if err != nil { 5037 return nil, err 5038 } 5039 defer googleapi.CloseBody(res) 5040 if err := googleapi.CheckResponse(res); err != nil { 5041 return nil, err 5042 } 5043 ret := &Policy{ 5044 ServerResponse: googleapi.ServerResponse{ 5045 Header: res.Header, 5046 HTTPStatusCode: res.StatusCode, 5047 }, 5048 } 5049 target := &ret 5050 if err := gensupport.DecodeResponse(target, res); err != nil { 5051 return nil, err 5052 } 5053 return ret, nil 5054 // { 5055 // "description": "Updates an IAM policy for the specified bucket.", 5056 // "httpMethod": "PUT", 5057 // "id": "storage.buckets.setIamPolicy", 5058 // "parameterOrder": [ 5059 // "bucket" 5060 // ], 5061 // "parameters": { 5062 // "bucket": { 5063 // "description": "Name of a bucket.", 5064 // "location": "path", 5065 // "required": true, 5066 // "type": "string" 5067 // }, 5068 // "provisionalUserProject": { 5069 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5070 // "location": "query", 5071 // "type": "string" 5072 // }, 5073 // "userProject": { 5074 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5075 // "location": "query", 5076 // "type": "string" 5077 // } 5078 // }, 5079 // "path": "b/{bucket}/iam", 5080 // "request": { 5081 // "$ref": "Policy" 5082 // }, 5083 // "response": { 5084 // "$ref": "Policy" 5085 // }, 5086 // "scopes": [ 5087 // "https://www.googleapis.com/auth/cloud-platform", 5088 // "https://www.googleapis.com/auth/devstorage.full_control" 5089 // ] 5090 // } 5091 5092} 5093 5094// method id "storage.buckets.testIamPermissions": 5095 5096type BucketsTestIamPermissionsCall struct { 5097 s *Service 5098 bucket string 5099 urlParams_ gensupport.URLParams 5100 ifNoneMatch_ string 5101 ctx_ context.Context 5102 header_ http.Header 5103} 5104 5105// TestIamPermissions: Tests a set of permissions on the given bucket to 5106// see which, if any, are held by the caller. 5107func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall { 5108 c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5109 c.bucket = bucket 5110 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...)) 5111 return c 5112} 5113 5114// ProvisionalUserProject sets the optional parameter 5115// "provisionalUserProject": The project to be billed for this request 5116// if the target bucket is requester-pays bucket. 5117func (c *BucketsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *BucketsTestIamPermissionsCall { 5118 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5119 return c 5120} 5121 5122// UserProject sets the optional parameter "userProject": The project to 5123// be billed for this request. Required for Requester Pays buckets. 5124func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall { 5125 c.urlParams_.Set("userProject", userProject) 5126 return c 5127} 5128 5129// Fields allows partial responses to be retrieved. See 5130// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5131// for more information. 5132func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall { 5133 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5134 return c 5135} 5136 5137// IfNoneMatch sets the optional parameter which makes the operation 5138// fail if the object's ETag matches the given value. This is useful for 5139// getting updates only after the object has changed since the last 5140// request. Use googleapi.IsNotModified to check whether the response 5141// error from Do is the result of In-None-Match. 5142func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall { 5143 c.ifNoneMatch_ = entityTag 5144 return c 5145} 5146 5147// Context sets the context to be used in this call's Do method. Any 5148// pending HTTP request will be aborted if the provided context is 5149// canceled. 5150func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall { 5151 c.ctx_ = ctx 5152 return c 5153} 5154 5155// Header returns an http.Header that can be modified by the caller to 5156// add HTTP headers to the request. 5157func (c *BucketsTestIamPermissionsCall) Header() http.Header { 5158 if c.header_ == nil { 5159 c.header_ = make(http.Header) 5160 } 5161 return c.header_ 5162} 5163 5164func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 5165 reqHeaders := make(http.Header) 5166 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5167 for k, v := range c.header_ { 5168 reqHeaders[k] = v 5169 } 5170 reqHeaders.Set("User-Agent", c.s.userAgent()) 5171 if c.ifNoneMatch_ != "" { 5172 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5173 } 5174 var body io.Reader = nil 5175 c.urlParams_.Set("alt", alt) 5176 c.urlParams_.Set("prettyPrint", "false") 5177 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions") 5178 urls += "?" + c.urlParams_.Encode() 5179 req, err := http.NewRequest("GET", urls, body) 5180 if err != nil { 5181 return nil, err 5182 } 5183 req.Header = reqHeaders 5184 googleapi.Expand(req.URL, map[string]string{ 5185 "bucket": c.bucket, 5186 }) 5187 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5188} 5189 5190// Do executes the "storage.buckets.testIamPermissions" call. 5191// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 5192// Any non-2xx status code is an error. Response headers are in either 5193// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 5194// was returned at all) in error.(*googleapi.Error).Header. Use 5195// googleapi.IsNotModified to check whether the returned error was 5196// because http.StatusNotModified was returned. 5197func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 5198 gensupport.SetOptions(c.urlParams_, opts...) 5199 res, err := c.doRequest("json") 5200 if res != nil && res.StatusCode == http.StatusNotModified { 5201 if res.Body != nil { 5202 res.Body.Close() 5203 } 5204 return nil, &googleapi.Error{ 5205 Code: res.StatusCode, 5206 Header: res.Header, 5207 } 5208 } 5209 if err != nil { 5210 return nil, err 5211 } 5212 defer googleapi.CloseBody(res) 5213 if err := googleapi.CheckResponse(res); err != nil { 5214 return nil, err 5215 } 5216 ret := &TestIamPermissionsResponse{ 5217 ServerResponse: googleapi.ServerResponse{ 5218 Header: res.Header, 5219 HTTPStatusCode: res.StatusCode, 5220 }, 5221 } 5222 target := &ret 5223 if err := gensupport.DecodeResponse(target, res); err != nil { 5224 return nil, err 5225 } 5226 return ret, nil 5227 // { 5228 // "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", 5229 // "httpMethod": "GET", 5230 // "id": "storage.buckets.testIamPermissions", 5231 // "parameterOrder": [ 5232 // "bucket", 5233 // "permissions" 5234 // ], 5235 // "parameters": { 5236 // "bucket": { 5237 // "description": "Name of a bucket.", 5238 // "location": "path", 5239 // "required": true, 5240 // "type": "string" 5241 // }, 5242 // "permissions": { 5243 // "description": "Permissions to test.", 5244 // "location": "query", 5245 // "repeated": true, 5246 // "required": true, 5247 // "type": "string" 5248 // }, 5249 // "provisionalUserProject": { 5250 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5251 // "location": "query", 5252 // "type": "string" 5253 // }, 5254 // "userProject": { 5255 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5256 // "location": "query", 5257 // "type": "string" 5258 // } 5259 // }, 5260 // "path": "b/{bucket}/iam/testPermissions", 5261 // "response": { 5262 // "$ref": "TestIamPermissionsResponse" 5263 // }, 5264 // "scopes": [ 5265 // "https://www.googleapis.com/auth/cloud-platform", 5266 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5267 // "https://www.googleapis.com/auth/devstorage.full_control", 5268 // "https://www.googleapis.com/auth/devstorage.read_only", 5269 // "https://www.googleapis.com/auth/devstorage.read_write" 5270 // ] 5271 // } 5272 5273} 5274 5275// method id "storage.buckets.update": 5276 5277type BucketsUpdateCall struct { 5278 s *Service 5279 bucket string 5280 bucket2 *Bucket 5281 urlParams_ gensupport.URLParams 5282 ctx_ context.Context 5283 header_ http.Header 5284} 5285 5286// Update: Updates a bucket. Changes to the bucket will be readable 5287// immediately after writing, but configuration changes may take time to 5288// propagate. 5289func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall { 5290 c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5291 c.bucket = bucket 5292 c.bucket2 = bucket2 5293 return c 5294} 5295 5296// IfMetagenerationMatch sets the optional parameter 5297// "ifMetagenerationMatch": Makes the return of the bucket metadata 5298// conditional on whether the bucket's current metageneration matches 5299// the given value. 5300func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall { 5301 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 5302 return c 5303} 5304 5305// IfMetagenerationNotMatch sets the optional parameter 5306// "ifMetagenerationNotMatch": Makes the return of the bucket metadata 5307// conditional on whether the bucket's current metageneration does not 5308// match the given value. 5309func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall { 5310 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 5311 return c 5312} 5313 5314// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 5315// predefined set of access controls to this bucket. 5316// 5317// Possible values: 5318// "authenticatedRead" - Project team owners get OWNER access, and 5319// allAuthenticatedUsers get READER access. 5320// "private" - Project team owners get OWNER access. 5321// "projectPrivate" - Project team members get access according to 5322// their roles. 5323// "publicRead" - Project team owners get OWNER access, and allUsers 5324// get READER access. 5325// "publicReadWrite" - Project team owners get OWNER access, and 5326// allUsers get WRITER access. 5327func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall { 5328 c.urlParams_.Set("predefinedAcl", predefinedAcl) 5329 return c 5330} 5331 5332// PredefinedDefaultObjectAcl sets the optional parameter 5333// "predefinedDefaultObjectAcl": Apply a predefined set of default 5334// object access controls to this bucket. 5335// 5336// Possible values: 5337// "authenticatedRead" - Object owner gets OWNER access, and 5338// allAuthenticatedUsers get READER access. 5339// "bucketOwnerFullControl" - Object owner gets OWNER access, and 5340// project team owners get OWNER access. 5341// "bucketOwnerRead" - Object owner gets OWNER access, and project 5342// team owners get READER access. 5343// "private" - Object owner gets OWNER access. 5344// "projectPrivate" - Object owner gets OWNER access, and project team 5345// members get access according to their roles. 5346// "publicRead" - Object owner gets OWNER access, and allUsers get 5347// READER access. 5348func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall { 5349 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) 5350 return c 5351} 5352 5353// Projection sets the optional parameter "projection": Set of 5354// properties to return. Defaults to full. 5355// 5356// Possible values: 5357// "full" - Include all properties. 5358// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 5359func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { 5360 c.urlParams_.Set("projection", projection) 5361 return c 5362} 5363 5364// ProvisionalUserProject sets the optional parameter 5365// "provisionalUserProject": The project to be billed for this request 5366// if the target bucket is requester-pays bucket. 5367func (c *BucketsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketsUpdateCall { 5368 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5369 return c 5370} 5371 5372// UserProject sets the optional parameter "userProject": The project to 5373// be billed for this request. Required for Requester Pays buckets. 5374func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall { 5375 c.urlParams_.Set("userProject", userProject) 5376 return c 5377} 5378 5379// Fields allows partial responses to be retrieved. See 5380// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5381// for more information. 5382func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall { 5383 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5384 return c 5385} 5386 5387// Context sets the context to be used in this call's Do method. Any 5388// pending HTTP request will be aborted if the provided context is 5389// canceled. 5390func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall { 5391 c.ctx_ = ctx 5392 return c 5393} 5394 5395// Header returns an http.Header that can be modified by the caller to 5396// add HTTP headers to the request. 5397func (c *BucketsUpdateCall) Header() http.Header { 5398 if c.header_ == nil { 5399 c.header_ = make(http.Header) 5400 } 5401 return c.header_ 5402} 5403 5404func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { 5405 reqHeaders := make(http.Header) 5406 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5407 for k, v := range c.header_ { 5408 reqHeaders[k] = v 5409 } 5410 reqHeaders.Set("User-Agent", c.s.userAgent()) 5411 var body io.Reader = nil 5412 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) 5413 if err != nil { 5414 return nil, err 5415 } 5416 reqHeaders.Set("Content-Type", "application/json") 5417 c.urlParams_.Set("alt", alt) 5418 c.urlParams_.Set("prettyPrint", "false") 5419 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 5420 urls += "?" + c.urlParams_.Encode() 5421 req, err := http.NewRequest("PUT", urls, body) 5422 if err != nil { 5423 return nil, err 5424 } 5425 req.Header = reqHeaders 5426 googleapi.Expand(req.URL, map[string]string{ 5427 "bucket": c.bucket, 5428 }) 5429 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5430} 5431 5432// Do executes the "storage.buckets.update" call. 5433// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 5434// code is an error. Response headers are in either 5435// *Bucket.ServerResponse.Header or (if a response was returned at all) 5436// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5437// check whether the returned error was because http.StatusNotModified 5438// was returned. 5439func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 5440 gensupport.SetOptions(c.urlParams_, opts...) 5441 res, err := c.doRequest("json") 5442 if res != nil && res.StatusCode == http.StatusNotModified { 5443 if res.Body != nil { 5444 res.Body.Close() 5445 } 5446 return nil, &googleapi.Error{ 5447 Code: res.StatusCode, 5448 Header: res.Header, 5449 } 5450 } 5451 if err != nil { 5452 return nil, err 5453 } 5454 defer googleapi.CloseBody(res) 5455 if err := googleapi.CheckResponse(res); err != nil { 5456 return nil, err 5457 } 5458 ret := &Bucket{ 5459 ServerResponse: googleapi.ServerResponse{ 5460 Header: res.Header, 5461 HTTPStatusCode: res.StatusCode, 5462 }, 5463 } 5464 target := &ret 5465 if err := gensupport.DecodeResponse(target, res); err != nil { 5466 return nil, err 5467 } 5468 return ret, nil 5469 // { 5470 // "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", 5471 // "httpMethod": "PUT", 5472 // "id": "storage.buckets.update", 5473 // "parameterOrder": [ 5474 // "bucket" 5475 // ], 5476 // "parameters": { 5477 // "bucket": { 5478 // "description": "Name of a bucket.", 5479 // "location": "path", 5480 // "required": true, 5481 // "type": "string" 5482 // }, 5483 // "ifMetagenerationMatch": { 5484 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", 5485 // "format": "int64", 5486 // "location": "query", 5487 // "type": "string" 5488 // }, 5489 // "ifMetagenerationNotMatch": { 5490 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", 5491 // "format": "int64", 5492 // "location": "query", 5493 // "type": "string" 5494 // }, 5495 // "predefinedAcl": { 5496 // "description": "Apply a predefined set of access controls to this bucket.", 5497 // "enum": [ 5498 // "authenticatedRead", 5499 // "private", 5500 // "projectPrivate", 5501 // "publicRead", 5502 // "publicReadWrite" 5503 // ], 5504 // "enumDescriptions": [ 5505 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", 5506 // "Project team owners get OWNER access.", 5507 // "Project team members get access according to their roles.", 5508 // "Project team owners get OWNER access, and allUsers get READER access.", 5509 // "Project team owners get OWNER access, and allUsers get WRITER access." 5510 // ], 5511 // "location": "query", 5512 // "type": "string" 5513 // }, 5514 // "predefinedDefaultObjectAcl": { 5515 // "description": "Apply a predefined set of default object access controls to this bucket.", 5516 // "enum": [ 5517 // "authenticatedRead", 5518 // "bucketOwnerFullControl", 5519 // "bucketOwnerRead", 5520 // "private", 5521 // "projectPrivate", 5522 // "publicRead" 5523 // ], 5524 // "enumDescriptions": [ 5525 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 5526 // "Object owner gets OWNER access, and project team owners get OWNER access.", 5527 // "Object owner gets OWNER access, and project team owners get READER access.", 5528 // "Object owner gets OWNER access.", 5529 // "Object owner gets OWNER access, and project team members get access according to their roles.", 5530 // "Object owner gets OWNER access, and allUsers get READER access." 5531 // ], 5532 // "location": "query", 5533 // "type": "string" 5534 // }, 5535 // "projection": { 5536 // "description": "Set of properties to return. Defaults to full.", 5537 // "enum": [ 5538 // "full", 5539 // "noAcl" 5540 // ], 5541 // "enumDescriptions": [ 5542 // "Include all properties.", 5543 // "Omit owner, acl and defaultObjectAcl properties." 5544 // ], 5545 // "location": "query", 5546 // "type": "string" 5547 // }, 5548 // "provisionalUserProject": { 5549 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5550 // "location": "query", 5551 // "type": "string" 5552 // }, 5553 // "userProject": { 5554 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5555 // "location": "query", 5556 // "type": "string" 5557 // } 5558 // }, 5559 // "path": "b/{bucket}", 5560 // "request": { 5561 // "$ref": "Bucket" 5562 // }, 5563 // "response": { 5564 // "$ref": "Bucket" 5565 // }, 5566 // "scopes": [ 5567 // "https://www.googleapis.com/auth/cloud-platform", 5568 // "https://www.googleapis.com/auth/devstorage.full_control" 5569 // ] 5570 // } 5571 5572} 5573 5574// method id "storage.channels.stop": 5575 5576type ChannelsStopCall struct { 5577 s *Service 5578 channel *Channel 5579 urlParams_ gensupport.URLParams 5580 ctx_ context.Context 5581 header_ http.Header 5582} 5583 5584// Stop: Stop watching resources through this channel 5585func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 5586 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5587 c.channel = channel 5588 return c 5589} 5590 5591// Fields allows partial responses to be retrieved. See 5592// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5593// for more information. 5594func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 5595 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5596 return c 5597} 5598 5599// Context sets the context to be used in this call's Do method. Any 5600// pending HTTP request will be aborted if the provided context is 5601// canceled. 5602func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 5603 c.ctx_ = ctx 5604 return c 5605} 5606 5607// Header returns an http.Header that can be modified by the caller to 5608// add HTTP headers to the request. 5609func (c *ChannelsStopCall) Header() http.Header { 5610 if c.header_ == nil { 5611 c.header_ = make(http.Header) 5612 } 5613 return c.header_ 5614} 5615 5616func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 5617 reqHeaders := make(http.Header) 5618 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5619 for k, v := range c.header_ { 5620 reqHeaders[k] = v 5621 } 5622 reqHeaders.Set("User-Agent", c.s.userAgent()) 5623 var body io.Reader = nil 5624 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 5625 if err != nil { 5626 return nil, err 5627 } 5628 reqHeaders.Set("Content-Type", "application/json") 5629 c.urlParams_.Set("alt", alt) 5630 c.urlParams_.Set("prettyPrint", "false") 5631 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") 5632 urls += "?" + c.urlParams_.Encode() 5633 req, err := http.NewRequest("POST", urls, body) 5634 if err != nil { 5635 return nil, err 5636 } 5637 req.Header = reqHeaders 5638 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5639} 5640 5641// Do executes the "storage.channels.stop" call. 5642func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { 5643 gensupport.SetOptions(c.urlParams_, opts...) 5644 res, err := c.doRequest("json") 5645 if err != nil { 5646 return err 5647 } 5648 defer googleapi.CloseBody(res) 5649 if err := googleapi.CheckResponse(res); err != nil { 5650 return err 5651 } 5652 return nil 5653 // { 5654 // "description": "Stop watching resources through this channel", 5655 // "httpMethod": "POST", 5656 // "id": "storage.channels.stop", 5657 // "path": "channels/stop", 5658 // "request": { 5659 // "$ref": "Channel", 5660 // "parameterName": "resource" 5661 // }, 5662 // "scopes": [ 5663 // "https://www.googleapis.com/auth/cloud-platform", 5664 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5665 // "https://www.googleapis.com/auth/devstorage.full_control", 5666 // "https://www.googleapis.com/auth/devstorage.read_only", 5667 // "https://www.googleapis.com/auth/devstorage.read_write" 5668 // ] 5669 // } 5670 5671} 5672 5673// method id "storage.defaultObjectAccessControls.delete": 5674 5675type DefaultObjectAccessControlsDeleteCall struct { 5676 s *Service 5677 bucket string 5678 entity string 5679 urlParams_ gensupport.URLParams 5680 ctx_ context.Context 5681 header_ http.Header 5682} 5683 5684// Delete: Permanently deletes the default object ACL entry for the 5685// specified entity on the specified bucket. 5686func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall { 5687 c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5688 c.bucket = bucket 5689 c.entity = entity 5690 return c 5691} 5692 5693// ProvisionalUserProject sets the optional parameter 5694// "provisionalUserProject": The project to be billed for this request 5695// if the target bucket is requester-pays bucket. 5696func (c *DefaultObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsDeleteCall { 5697 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5698 return c 5699} 5700 5701// UserProject sets the optional parameter "userProject": The project to 5702// be billed for this request. Required for Requester Pays buckets. 5703func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall { 5704 c.urlParams_.Set("userProject", userProject) 5705 return c 5706} 5707 5708// Fields allows partial responses to be retrieved. See 5709// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5710// for more information. 5711func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall { 5712 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5713 return c 5714} 5715 5716// Context sets the context to be used in this call's Do method. Any 5717// pending HTTP request will be aborted if the provided context is 5718// canceled. 5719func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall { 5720 c.ctx_ = ctx 5721 return c 5722} 5723 5724// Header returns an http.Header that can be modified by the caller to 5725// add HTTP headers to the request. 5726func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header { 5727 if c.header_ == nil { 5728 c.header_ = make(http.Header) 5729 } 5730 return c.header_ 5731} 5732 5733func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 5734 reqHeaders := make(http.Header) 5735 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5736 for k, v := range c.header_ { 5737 reqHeaders[k] = v 5738 } 5739 reqHeaders.Set("User-Agent", c.s.userAgent()) 5740 var body io.Reader = nil 5741 c.urlParams_.Set("alt", alt) 5742 c.urlParams_.Set("prettyPrint", "false") 5743 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 5744 urls += "?" + c.urlParams_.Encode() 5745 req, err := http.NewRequest("DELETE", urls, body) 5746 if err != nil { 5747 return nil, err 5748 } 5749 req.Header = reqHeaders 5750 googleapi.Expand(req.URL, map[string]string{ 5751 "bucket": c.bucket, 5752 "entity": c.entity, 5753 }) 5754 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5755} 5756 5757// Do executes the "storage.defaultObjectAccessControls.delete" call. 5758func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { 5759 gensupport.SetOptions(c.urlParams_, opts...) 5760 res, err := c.doRequest("json") 5761 if err != nil { 5762 return err 5763 } 5764 defer googleapi.CloseBody(res) 5765 if err := googleapi.CheckResponse(res); err != nil { 5766 return err 5767 } 5768 return nil 5769 // { 5770 // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", 5771 // "httpMethod": "DELETE", 5772 // "id": "storage.defaultObjectAccessControls.delete", 5773 // "parameterOrder": [ 5774 // "bucket", 5775 // "entity" 5776 // ], 5777 // "parameters": { 5778 // "bucket": { 5779 // "description": "Name of a bucket.", 5780 // "location": "path", 5781 // "required": true, 5782 // "type": "string" 5783 // }, 5784 // "entity": { 5785 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 5786 // "location": "path", 5787 // "required": true, 5788 // "type": "string" 5789 // }, 5790 // "provisionalUserProject": { 5791 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5792 // "location": "query", 5793 // "type": "string" 5794 // }, 5795 // "userProject": { 5796 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5797 // "location": "query", 5798 // "type": "string" 5799 // } 5800 // }, 5801 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 5802 // "scopes": [ 5803 // "https://www.googleapis.com/auth/cloud-platform", 5804 // "https://www.googleapis.com/auth/devstorage.full_control" 5805 // ] 5806 // } 5807 5808} 5809 5810// method id "storage.defaultObjectAccessControls.get": 5811 5812type DefaultObjectAccessControlsGetCall struct { 5813 s *Service 5814 bucket string 5815 entity string 5816 urlParams_ gensupport.URLParams 5817 ifNoneMatch_ string 5818 ctx_ context.Context 5819 header_ http.Header 5820} 5821 5822// Get: Returns the default object ACL entry for the specified entity on 5823// the specified bucket. 5824func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall { 5825 c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5826 c.bucket = bucket 5827 c.entity = entity 5828 return c 5829} 5830 5831// ProvisionalUserProject sets the optional parameter 5832// "provisionalUserProject": The project to be billed for this request 5833// if the target bucket is requester-pays bucket. 5834func (c *DefaultObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsGetCall { 5835 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5836 return c 5837} 5838 5839// UserProject sets the optional parameter "userProject": The project to 5840// be billed for this request. Required for Requester Pays buckets. 5841func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall { 5842 c.urlParams_.Set("userProject", userProject) 5843 return c 5844} 5845 5846// Fields allows partial responses to be retrieved. See 5847// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5848// for more information. 5849func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall { 5850 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5851 return c 5852} 5853 5854// IfNoneMatch sets the optional parameter which makes the operation 5855// fail if the object's ETag matches the given value. This is useful for 5856// getting updates only after the object has changed since the last 5857// request. Use googleapi.IsNotModified to check whether the response 5858// error from Do is the result of In-None-Match. 5859func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall { 5860 c.ifNoneMatch_ = entityTag 5861 return c 5862} 5863 5864// Context sets the context to be used in this call's Do method. Any 5865// pending HTTP request will be aborted if the provided context is 5866// canceled. 5867func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall { 5868 c.ctx_ = ctx 5869 return c 5870} 5871 5872// Header returns an http.Header that can be modified by the caller to 5873// add HTTP headers to the request. 5874func (c *DefaultObjectAccessControlsGetCall) Header() http.Header { 5875 if c.header_ == nil { 5876 c.header_ = make(http.Header) 5877 } 5878 return c.header_ 5879} 5880 5881func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { 5882 reqHeaders := make(http.Header) 5883 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 5884 for k, v := range c.header_ { 5885 reqHeaders[k] = v 5886 } 5887 reqHeaders.Set("User-Agent", c.s.userAgent()) 5888 if c.ifNoneMatch_ != "" { 5889 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5890 } 5891 var body io.Reader = nil 5892 c.urlParams_.Set("alt", alt) 5893 c.urlParams_.Set("prettyPrint", "false") 5894 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 5895 urls += "?" + c.urlParams_.Encode() 5896 req, err := http.NewRequest("GET", urls, body) 5897 if err != nil { 5898 return nil, err 5899 } 5900 req.Header = reqHeaders 5901 googleapi.Expand(req.URL, map[string]string{ 5902 "bucket": c.bucket, 5903 "entity": c.entity, 5904 }) 5905 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5906} 5907 5908// Do executes the "storage.defaultObjectAccessControls.get" call. 5909// Exactly one of *ObjectAccessControl or error will be non-nil. Any 5910// non-2xx status code is an error. Response headers are in either 5911// *ObjectAccessControl.ServerResponse.Header or (if a response was 5912// returned at all) in error.(*googleapi.Error).Header. Use 5913// googleapi.IsNotModified to check whether the returned error was 5914// because http.StatusNotModified was returned. 5915func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 5916 gensupport.SetOptions(c.urlParams_, opts...) 5917 res, err := c.doRequest("json") 5918 if res != nil && res.StatusCode == http.StatusNotModified { 5919 if res.Body != nil { 5920 res.Body.Close() 5921 } 5922 return nil, &googleapi.Error{ 5923 Code: res.StatusCode, 5924 Header: res.Header, 5925 } 5926 } 5927 if err != nil { 5928 return nil, err 5929 } 5930 defer googleapi.CloseBody(res) 5931 if err := googleapi.CheckResponse(res); err != nil { 5932 return nil, err 5933 } 5934 ret := &ObjectAccessControl{ 5935 ServerResponse: googleapi.ServerResponse{ 5936 Header: res.Header, 5937 HTTPStatusCode: res.StatusCode, 5938 }, 5939 } 5940 target := &ret 5941 if err := gensupport.DecodeResponse(target, res); err != nil { 5942 return nil, err 5943 } 5944 return ret, nil 5945 // { 5946 // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", 5947 // "httpMethod": "GET", 5948 // "id": "storage.defaultObjectAccessControls.get", 5949 // "parameterOrder": [ 5950 // "bucket", 5951 // "entity" 5952 // ], 5953 // "parameters": { 5954 // "bucket": { 5955 // "description": "Name of a bucket.", 5956 // "location": "path", 5957 // "required": true, 5958 // "type": "string" 5959 // }, 5960 // "entity": { 5961 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 5962 // "location": "path", 5963 // "required": true, 5964 // "type": "string" 5965 // }, 5966 // "provisionalUserProject": { 5967 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5968 // "location": "query", 5969 // "type": "string" 5970 // }, 5971 // "userProject": { 5972 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5973 // "location": "query", 5974 // "type": "string" 5975 // } 5976 // }, 5977 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 5978 // "response": { 5979 // "$ref": "ObjectAccessControl" 5980 // }, 5981 // "scopes": [ 5982 // "https://www.googleapis.com/auth/cloud-platform", 5983 // "https://www.googleapis.com/auth/devstorage.full_control" 5984 // ] 5985 // } 5986 5987} 5988 5989// method id "storage.defaultObjectAccessControls.insert": 5990 5991type DefaultObjectAccessControlsInsertCall struct { 5992 s *Service 5993 bucket string 5994 objectaccesscontrol *ObjectAccessControl 5995 urlParams_ gensupport.URLParams 5996 ctx_ context.Context 5997 header_ http.Header 5998} 5999 6000// Insert: Creates a new default object ACL entry on the specified 6001// bucket. 6002func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall { 6003 c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6004 c.bucket = bucket 6005 c.objectaccesscontrol = objectaccesscontrol 6006 return c 6007} 6008 6009// ProvisionalUserProject sets the optional parameter 6010// "provisionalUserProject": The project to be billed for this request 6011// if the target bucket is requester-pays bucket. 6012func (c *DefaultObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsInsertCall { 6013 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6014 return c 6015} 6016 6017// UserProject sets the optional parameter "userProject": The project to 6018// be billed for this request. Required for Requester Pays buckets. 6019func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall { 6020 c.urlParams_.Set("userProject", userProject) 6021 return c 6022} 6023 6024// Fields allows partial responses to be retrieved. See 6025// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6026// for more information. 6027func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall { 6028 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6029 return c 6030} 6031 6032// Context sets the context to be used in this call's Do method. Any 6033// pending HTTP request will be aborted if the provided context is 6034// canceled. 6035func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall { 6036 c.ctx_ = ctx 6037 return c 6038} 6039 6040// Header returns an http.Header that can be modified by the caller to 6041// add HTTP headers to the request. 6042func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header { 6043 if c.header_ == nil { 6044 c.header_ = make(http.Header) 6045 } 6046 return c.header_ 6047} 6048 6049func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { 6050 reqHeaders := make(http.Header) 6051 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6052 for k, v := range c.header_ { 6053 reqHeaders[k] = v 6054 } 6055 reqHeaders.Set("User-Agent", c.s.userAgent()) 6056 var body io.Reader = nil 6057 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 6058 if err != nil { 6059 return nil, err 6060 } 6061 reqHeaders.Set("Content-Type", "application/json") 6062 c.urlParams_.Set("alt", alt) 6063 c.urlParams_.Set("prettyPrint", "false") 6064 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") 6065 urls += "?" + c.urlParams_.Encode() 6066 req, err := http.NewRequest("POST", urls, body) 6067 if err != nil { 6068 return nil, err 6069 } 6070 req.Header = reqHeaders 6071 googleapi.Expand(req.URL, map[string]string{ 6072 "bucket": c.bucket, 6073 }) 6074 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6075} 6076 6077// Do executes the "storage.defaultObjectAccessControls.insert" call. 6078// Exactly one of *ObjectAccessControl or error will be non-nil. Any 6079// non-2xx status code is an error. Response headers are in either 6080// *ObjectAccessControl.ServerResponse.Header or (if a response was 6081// returned at all) in error.(*googleapi.Error).Header. Use 6082// googleapi.IsNotModified to check whether the returned error was 6083// because http.StatusNotModified was returned. 6084func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 6085 gensupport.SetOptions(c.urlParams_, opts...) 6086 res, err := c.doRequest("json") 6087 if res != nil && res.StatusCode == http.StatusNotModified { 6088 if res.Body != nil { 6089 res.Body.Close() 6090 } 6091 return nil, &googleapi.Error{ 6092 Code: res.StatusCode, 6093 Header: res.Header, 6094 } 6095 } 6096 if err != nil { 6097 return nil, err 6098 } 6099 defer googleapi.CloseBody(res) 6100 if err := googleapi.CheckResponse(res); err != nil { 6101 return nil, err 6102 } 6103 ret := &ObjectAccessControl{ 6104 ServerResponse: googleapi.ServerResponse{ 6105 Header: res.Header, 6106 HTTPStatusCode: res.StatusCode, 6107 }, 6108 } 6109 target := &ret 6110 if err := gensupport.DecodeResponse(target, res); err != nil { 6111 return nil, err 6112 } 6113 return ret, nil 6114 // { 6115 // "description": "Creates a new default object ACL entry on the specified bucket.", 6116 // "httpMethod": "POST", 6117 // "id": "storage.defaultObjectAccessControls.insert", 6118 // "parameterOrder": [ 6119 // "bucket" 6120 // ], 6121 // "parameters": { 6122 // "bucket": { 6123 // "description": "Name of a bucket.", 6124 // "location": "path", 6125 // "required": true, 6126 // "type": "string" 6127 // }, 6128 // "provisionalUserProject": { 6129 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6130 // "location": "query", 6131 // "type": "string" 6132 // }, 6133 // "userProject": { 6134 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6135 // "location": "query", 6136 // "type": "string" 6137 // } 6138 // }, 6139 // "path": "b/{bucket}/defaultObjectAcl", 6140 // "request": { 6141 // "$ref": "ObjectAccessControl" 6142 // }, 6143 // "response": { 6144 // "$ref": "ObjectAccessControl" 6145 // }, 6146 // "scopes": [ 6147 // "https://www.googleapis.com/auth/cloud-platform", 6148 // "https://www.googleapis.com/auth/devstorage.full_control" 6149 // ] 6150 // } 6151 6152} 6153 6154// method id "storage.defaultObjectAccessControls.list": 6155 6156type DefaultObjectAccessControlsListCall struct { 6157 s *Service 6158 bucket string 6159 urlParams_ gensupport.URLParams 6160 ifNoneMatch_ string 6161 ctx_ context.Context 6162 header_ http.Header 6163} 6164 6165// List: Retrieves default object ACL entries on the specified bucket. 6166func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall { 6167 c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6168 c.bucket = bucket 6169 return c 6170} 6171 6172// IfMetagenerationMatch sets the optional parameter 6173// "ifMetagenerationMatch": If present, only return default ACL listing 6174// if the bucket's current metageneration matches this value. 6175func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall { 6176 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 6177 return c 6178} 6179 6180// IfMetagenerationNotMatch sets the optional parameter 6181// "ifMetagenerationNotMatch": If present, only return default ACL 6182// listing if the bucket's current metageneration does not match the 6183// given value. 6184func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall { 6185 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 6186 return c 6187} 6188 6189// ProvisionalUserProject sets the optional parameter 6190// "provisionalUserProject": The project to be billed for this request 6191// if the target bucket is requester-pays bucket. 6192func (c *DefaultObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsListCall { 6193 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6194 return c 6195} 6196 6197// UserProject sets the optional parameter "userProject": The project to 6198// be billed for this request. Required for Requester Pays buckets. 6199func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall { 6200 c.urlParams_.Set("userProject", userProject) 6201 return c 6202} 6203 6204// Fields allows partial responses to be retrieved. See 6205// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6206// for more information. 6207func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall { 6208 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6209 return c 6210} 6211 6212// IfNoneMatch sets the optional parameter which makes the operation 6213// fail if the object's ETag matches the given value. This is useful for 6214// getting updates only after the object has changed since the last 6215// request. Use googleapi.IsNotModified to check whether the response 6216// error from Do is the result of In-None-Match. 6217func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall { 6218 c.ifNoneMatch_ = entityTag 6219 return c 6220} 6221 6222// Context sets the context to be used in this call's Do method. Any 6223// pending HTTP request will be aborted if the provided context is 6224// canceled. 6225func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall { 6226 c.ctx_ = ctx 6227 return c 6228} 6229 6230// Header returns an http.Header that can be modified by the caller to 6231// add HTTP headers to the request. 6232func (c *DefaultObjectAccessControlsListCall) Header() http.Header { 6233 if c.header_ == nil { 6234 c.header_ = make(http.Header) 6235 } 6236 return c.header_ 6237} 6238 6239func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { 6240 reqHeaders := make(http.Header) 6241 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6242 for k, v := range c.header_ { 6243 reqHeaders[k] = v 6244 } 6245 reqHeaders.Set("User-Agent", c.s.userAgent()) 6246 if c.ifNoneMatch_ != "" { 6247 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6248 } 6249 var body io.Reader = nil 6250 c.urlParams_.Set("alt", alt) 6251 c.urlParams_.Set("prettyPrint", "false") 6252 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") 6253 urls += "?" + c.urlParams_.Encode() 6254 req, err := http.NewRequest("GET", urls, body) 6255 if err != nil { 6256 return nil, err 6257 } 6258 req.Header = reqHeaders 6259 googleapi.Expand(req.URL, map[string]string{ 6260 "bucket": c.bucket, 6261 }) 6262 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6263} 6264 6265// Do executes the "storage.defaultObjectAccessControls.list" call. 6266// Exactly one of *ObjectAccessControls or error will be non-nil. Any 6267// non-2xx status code is an error. Response headers are in either 6268// *ObjectAccessControls.ServerResponse.Header or (if a response was 6269// returned at all) in error.(*googleapi.Error).Header. Use 6270// googleapi.IsNotModified to check whether the returned error was 6271// because http.StatusNotModified was returned. 6272func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) { 6273 gensupport.SetOptions(c.urlParams_, opts...) 6274 res, err := c.doRequest("json") 6275 if res != nil && res.StatusCode == http.StatusNotModified { 6276 if res.Body != nil { 6277 res.Body.Close() 6278 } 6279 return nil, &googleapi.Error{ 6280 Code: res.StatusCode, 6281 Header: res.Header, 6282 } 6283 } 6284 if err != nil { 6285 return nil, err 6286 } 6287 defer googleapi.CloseBody(res) 6288 if err := googleapi.CheckResponse(res); err != nil { 6289 return nil, err 6290 } 6291 ret := &ObjectAccessControls{ 6292 ServerResponse: googleapi.ServerResponse{ 6293 Header: res.Header, 6294 HTTPStatusCode: res.StatusCode, 6295 }, 6296 } 6297 target := &ret 6298 if err := gensupport.DecodeResponse(target, res); err != nil { 6299 return nil, err 6300 } 6301 return ret, nil 6302 // { 6303 // "description": "Retrieves default object ACL entries on the specified bucket.", 6304 // "httpMethod": "GET", 6305 // "id": "storage.defaultObjectAccessControls.list", 6306 // "parameterOrder": [ 6307 // "bucket" 6308 // ], 6309 // "parameters": { 6310 // "bucket": { 6311 // "description": "Name of a bucket.", 6312 // "location": "path", 6313 // "required": true, 6314 // "type": "string" 6315 // }, 6316 // "ifMetagenerationMatch": { 6317 // "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", 6318 // "format": "int64", 6319 // "location": "query", 6320 // "type": "string" 6321 // }, 6322 // "ifMetagenerationNotMatch": { 6323 // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", 6324 // "format": "int64", 6325 // "location": "query", 6326 // "type": "string" 6327 // }, 6328 // "provisionalUserProject": { 6329 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6330 // "location": "query", 6331 // "type": "string" 6332 // }, 6333 // "userProject": { 6334 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6335 // "location": "query", 6336 // "type": "string" 6337 // } 6338 // }, 6339 // "path": "b/{bucket}/defaultObjectAcl", 6340 // "response": { 6341 // "$ref": "ObjectAccessControls" 6342 // }, 6343 // "scopes": [ 6344 // "https://www.googleapis.com/auth/cloud-platform", 6345 // "https://www.googleapis.com/auth/devstorage.full_control" 6346 // ] 6347 // } 6348 6349} 6350 6351// method id "storage.defaultObjectAccessControls.patch": 6352 6353type DefaultObjectAccessControlsPatchCall struct { 6354 s *Service 6355 bucket string 6356 entity string 6357 objectaccesscontrol *ObjectAccessControl 6358 urlParams_ gensupport.URLParams 6359 ctx_ context.Context 6360 header_ http.Header 6361} 6362 6363// Patch: Patches a default object ACL entry on the specified bucket. 6364func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall { 6365 c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6366 c.bucket = bucket 6367 c.entity = entity 6368 c.objectaccesscontrol = objectaccesscontrol 6369 return c 6370} 6371 6372// ProvisionalUserProject sets the optional parameter 6373// "provisionalUserProject": The project to be billed for this request 6374// if the target bucket is requester-pays bucket. 6375func (c *DefaultObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsPatchCall { 6376 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6377 return c 6378} 6379 6380// UserProject sets the optional parameter "userProject": The project to 6381// be billed for this request. Required for Requester Pays buckets. 6382func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall { 6383 c.urlParams_.Set("userProject", userProject) 6384 return c 6385} 6386 6387// Fields allows partial responses to be retrieved. See 6388// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6389// for more information. 6390func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall { 6391 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6392 return c 6393} 6394 6395// Context sets the context to be used in this call's Do method. Any 6396// pending HTTP request will be aborted if the provided context is 6397// canceled. 6398func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall { 6399 c.ctx_ = ctx 6400 return c 6401} 6402 6403// Header returns an http.Header that can be modified by the caller to 6404// add HTTP headers to the request. 6405func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header { 6406 if c.header_ == nil { 6407 c.header_ = make(http.Header) 6408 } 6409 return c.header_ 6410} 6411 6412func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { 6413 reqHeaders := make(http.Header) 6414 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6415 for k, v := range c.header_ { 6416 reqHeaders[k] = v 6417 } 6418 reqHeaders.Set("User-Agent", c.s.userAgent()) 6419 var body io.Reader = nil 6420 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 6421 if err != nil { 6422 return nil, err 6423 } 6424 reqHeaders.Set("Content-Type", "application/json") 6425 c.urlParams_.Set("alt", alt) 6426 c.urlParams_.Set("prettyPrint", "false") 6427 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 6428 urls += "?" + c.urlParams_.Encode() 6429 req, err := http.NewRequest("PATCH", urls, body) 6430 if err != nil { 6431 return nil, err 6432 } 6433 req.Header = reqHeaders 6434 googleapi.Expand(req.URL, map[string]string{ 6435 "bucket": c.bucket, 6436 "entity": c.entity, 6437 }) 6438 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6439} 6440 6441// Do executes the "storage.defaultObjectAccessControls.patch" call. 6442// Exactly one of *ObjectAccessControl or error will be non-nil. Any 6443// non-2xx status code is an error. Response headers are in either 6444// *ObjectAccessControl.ServerResponse.Header or (if a response was 6445// returned at all) in error.(*googleapi.Error).Header. Use 6446// googleapi.IsNotModified to check whether the returned error was 6447// because http.StatusNotModified was returned. 6448func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 6449 gensupport.SetOptions(c.urlParams_, opts...) 6450 res, err := c.doRequest("json") 6451 if res != nil && res.StatusCode == http.StatusNotModified { 6452 if res.Body != nil { 6453 res.Body.Close() 6454 } 6455 return nil, &googleapi.Error{ 6456 Code: res.StatusCode, 6457 Header: res.Header, 6458 } 6459 } 6460 if err != nil { 6461 return nil, err 6462 } 6463 defer googleapi.CloseBody(res) 6464 if err := googleapi.CheckResponse(res); err != nil { 6465 return nil, err 6466 } 6467 ret := &ObjectAccessControl{ 6468 ServerResponse: googleapi.ServerResponse{ 6469 Header: res.Header, 6470 HTTPStatusCode: res.StatusCode, 6471 }, 6472 } 6473 target := &ret 6474 if err := gensupport.DecodeResponse(target, res); err != nil { 6475 return nil, err 6476 } 6477 return ret, nil 6478 // { 6479 // "description": "Patches a default object ACL entry on the specified bucket.", 6480 // "httpMethod": "PATCH", 6481 // "id": "storage.defaultObjectAccessControls.patch", 6482 // "parameterOrder": [ 6483 // "bucket", 6484 // "entity" 6485 // ], 6486 // "parameters": { 6487 // "bucket": { 6488 // "description": "Name of a bucket.", 6489 // "location": "path", 6490 // "required": true, 6491 // "type": "string" 6492 // }, 6493 // "entity": { 6494 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 6495 // "location": "path", 6496 // "required": true, 6497 // "type": "string" 6498 // }, 6499 // "provisionalUserProject": { 6500 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6501 // "location": "query", 6502 // "type": "string" 6503 // }, 6504 // "userProject": { 6505 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6506 // "location": "query", 6507 // "type": "string" 6508 // } 6509 // }, 6510 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 6511 // "request": { 6512 // "$ref": "ObjectAccessControl" 6513 // }, 6514 // "response": { 6515 // "$ref": "ObjectAccessControl" 6516 // }, 6517 // "scopes": [ 6518 // "https://www.googleapis.com/auth/cloud-platform", 6519 // "https://www.googleapis.com/auth/devstorage.full_control" 6520 // ] 6521 // } 6522 6523} 6524 6525// method id "storage.defaultObjectAccessControls.update": 6526 6527type DefaultObjectAccessControlsUpdateCall struct { 6528 s *Service 6529 bucket string 6530 entity string 6531 objectaccesscontrol *ObjectAccessControl 6532 urlParams_ gensupport.URLParams 6533 ctx_ context.Context 6534 header_ http.Header 6535} 6536 6537// Update: Updates a default object ACL entry on the specified bucket. 6538func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall { 6539 c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6540 c.bucket = bucket 6541 c.entity = entity 6542 c.objectaccesscontrol = objectaccesscontrol 6543 return c 6544} 6545 6546// ProvisionalUserProject sets the optional parameter 6547// "provisionalUserProject": The project to be billed for this request 6548// if the target bucket is requester-pays bucket. 6549func (c *DefaultObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsUpdateCall { 6550 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6551 return c 6552} 6553 6554// UserProject sets the optional parameter "userProject": The project to 6555// be billed for this request. Required for Requester Pays buckets. 6556func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall { 6557 c.urlParams_.Set("userProject", userProject) 6558 return c 6559} 6560 6561// Fields allows partial responses to be retrieved. See 6562// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6563// for more information. 6564func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall { 6565 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6566 return c 6567} 6568 6569// Context sets the context to be used in this call's Do method. Any 6570// pending HTTP request will be aborted if the provided context is 6571// canceled. 6572func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall { 6573 c.ctx_ = ctx 6574 return c 6575} 6576 6577// Header returns an http.Header that can be modified by the caller to 6578// add HTTP headers to the request. 6579func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header { 6580 if c.header_ == nil { 6581 c.header_ = make(http.Header) 6582 } 6583 return c.header_ 6584} 6585 6586func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { 6587 reqHeaders := make(http.Header) 6588 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6589 for k, v := range c.header_ { 6590 reqHeaders[k] = v 6591 } 6592 reqHeaders.Set("User-Agent", c.s.userAgent()) 6593 var body io.Reader = nil 6594 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 6595 if err != nil { 6596 return nil, err 6597 } 6598 reqHeaders.Set("Content-Type", "application/json") 6599 c.urlParams_.Set("alt", alt) 6600 c.urlParams_.Set("prettyPrint", "false") 6601 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 6602 urls += "?" + c.urlParams_.Encode() 6603 req, err := http.NewRequest("PUT", urls, body) 6604 if err != nil { 6605 return nil, err 6606 } 6607 req.Header = reqHeaders 6608 googleapi.Expand(req.URL, map[string]string{ 6609 "bucket": c.bucket, 6610 "entity": c.entity, 6611 }) 6612 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6613} 6614 6615// Do executes the "storage.defaultObjectAccessControls.update" call. 6616// Exactly one of *ObjectAccessControl or error will be non-nil. Any 6617// non-2xx status code is an error. Response headers are in either 6618// *ObjectAccessControl.ServerResponse.Header or (if a response was 6619// returned at all) in error.(*googleapi.Error).Header. Use 6620// googleapi.IsNotModified to check whether the returned error was 6621// because http.StatusNotModified was returned. 6622func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 6623 gensupport.SetOptions(c.urlParams_, opts...) 6624 res, err := c.doRequest("json") 6625 if res != nil && res.StatusCode == http.StatusNotModified { 6626 if res.Body != nil { 6627 res.Body.Close() 6628 } 6629 return nil, &googleapi.Error{ 6630 Code: res.StatusCode, 6631 Header: res.Header, 6632 } 6633 } 6634 if err != nil { 6635 return nil, err 6636 } 6637 defer googleapi.CloseBody(res) 6638 if err := googleapi.CheckResponse(res); err != nil { 6639 return nil, err 6640 } 6641 ret := &ObjectAccessControl{ 6642 ServerResponse: googleapi.ServerResponse{ 6643 Header: res.Header, 6644 HTTPStatusCode: res.StatusCode, 6645 }, 6646 } 6647 target := &ret 6648 if err := gensupport.DecodeResponse(target, res); err != nil { 6649 return nil, err 6650 } 6651 return ret, nil 6652 // { 6653 // "description": "Updates a default object ACL entry on the specified bucket.", 6654 // "httpMethod": "PUT", 6655 // "id": "storage.defaultObjectAccessControls.update", 6656 // "parameterOrder": [ 6657 // "bucket", 6658 // "entity" 6659 // ], 6660 // "parameters": { 6661 // "bucket": { 6662 // "description": "Name of a bucket.", 6663 // "location": "path", 6664 // "required": true, 6665 // "type": "string" 6666 // }, 6667 // "entity": { 6668 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 6669 // "location": "path", 6670 // "required": true, 6671 // "type": "string" 6672 // }, 6673 // "provisionalUserProject": { 6674 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6675 // "location": "query", 6676 // "type": "string" 6677 // }, 6678 // "userProject": { 6679 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6680 // "location": "query", 6681 // "type": "string" 6682 // } 6683 // }, 6684 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 6685 // "request": { 6686 // "$ref": "ObjectAccessControl" 6687 // }, 6688 // "response": { 6689 // "$ref": "ObjectAccessControl" 6690 // }, 6691 // "scopes": [ 6692 // "https://www.googleapis.com/auth/cloud-platform", 6693 // "https://www.googleapis.com/auth/devstorage.full_control" 6694 // ] 6695 // } 6696 6697} 6698 6699// method id "storage.notifications.delete": 6700 6701type NotificationsDeleteCall struct { 6702 s *Service 6703 bucket string 6704 notification string 6705 urlParams_ gensupport.URLParams 6706 ctx_ context.Context 6707 header_ http.Header 6708} 6709 6710// Delete: Permanently deletes a notification subscription. 6711func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall { 6712 c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6713 c.bucket = bucket 6714 c.notification = notification 6715 return c 6716} 6717 6718// ProvisionalUserProject sets the optional parameter 6719// "provisionalUserProject": The project to be billed for this request 6720// if the target bucket is requester-pays bucket. 6721func (c *NotificationsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsDeleteCall { 6722 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6723 return c 6724} 6725 6726// UserProject sets the optional parameter "userProject": The project to 6727// be billed for this request. Required for Requester Pays buckets. 6728func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall { 6729 c.urlParams_.Set("userProject", userProject) 6730 return c 6731} 6732 6733// Fields allows partial responses to be retrieved. See 6734// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6735// for more information. 6736func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall { 6737 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6738 return c 6739} 6740 6741// Context sets the context to be used in this call's Do method. Any 6742// pending HTTP request will be aborted if the provided context is 6743// canceled. 6744func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall { 6745 c.ctx_ = ctx 6746 return c 6747} 6748 6749// Header returns an http.Header that can be modified by the caller to 6750// add HTTP headers to the request. 6751func (c *NotificationsDeleteCall) Header() http.Header { 6752 if c.header_ == nil { 6753 c.header_ = make(http.Header) 6754 } 6755 return c.header_ 6756} 6757 6758func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) { 6759 reqHeaders := make(http.Header) 6760 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6761 for k, v := range c.header_ { 6762 reqHeaders[k] = v 6763 } 6764 reqHeaders.Set("User-Agent", c.s.userAgent()) 6765 var body io.Reader = nil 6766 c.urlParams_.Set("alt", alt) 6767 c.urlParams_.Set("prettyPrint", "false") 6768 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") 6769 urls += "?" + c.urlParams_.Encode() 6770 req, err := http.NewRequest("DELETE", urls, body) 6771 if err != nil { 6772 return nil, err 6773 } 6774 req.Header = reqHeaders 6775 googleapi.Expand(req.URL, map[string]string{ 6776 "bucket": c.bucket, 6777 "notification": c.notification, 6778 }) 6779 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6780} 6781 6782// Do executes the "storage.notifications.delete" call. 6783func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error { 6784 gensupport.SetOptions(c.urlParams_, opts...) 6785 res, err := c.doRequest("json") 6786 if err != nil { 6787 return err 6788 } 6789 defer googleapi.CloseBody(res) 6790 if err := googleapi.CheckResponse(res); err != nil { 6791 return err 6792 } 6793 return nil 6794 // { 6795 // "description": "Permanently deletes a notification subscription.", 6796 // "httpMethod": "DELETE", 6797 // "id": "storage.notifications.delete", 6798 // "parameterOrder": [ 6799 // "bucket", 6800 // "notification" 6801 // ], 6802 // "parameters": { 6803 // "bucket": { 6804 // "description": "The parent bucket of the notification.", 6805 // "location": "path", 6806 // "required": true, 6807 // "type": "string" 6808 // }, 6809 // "notification": { 6810 // "description": "ID of the notification to delete.", 6811 // "location": "path", 6812 // "required": true, 6813 // "type": "string" 6814 // }, 6815 // "provisionalUserProject": { 6816 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6817 // "location": "query", 6818 // "type": "string" 6819 // }, 6820 // "userProject": { 6821 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6822 // "location": "query", 6823 // "type": "string" 6824 // } 6825 // }, 6826 // "path": "b/{bucket}/notificationConfigs/{notification}", 6827 // "scopes": [ 6828 // "https://www.googleapis.com/auth/cloud-platform", 6829 // "https://www.googleapis.com/auth/devstorage.full_control", 6830 // "https://www.googleapis.com/auth/devstorage.read_write" 6831 // ] 6832 // } 6833 6834} 6835 6836// method id "storage.notifications.get": 6837 6838type NotificationsGetCall struct { 6839 s *Service 6840 bucket string 6841 notification string 6842 urlParams_ gensupport.URLParams 6843 ifNoneMatch_ string 6844 ctx_ context.Context 6845 header_ http.Header 6846} 6847 6848// Get: View a notification configuration. 6849func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall { 6850 c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6851 c.bucket = bucket 6852 c.notification = notification 6853 return c 6854} 6855 6856// ProvisionalUserProject sets the optional parameter 6857// "provisionalUserProject": The project to be billed for this request 6858// if the target bucket is requester-pays bucket. 6859func (c *NotificationsGetCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsGetCall { 6860 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6861 return c 6862} 6863 6864// UserProject sets the optional parameter "userProject": The project to 6865// be billed for this request. Required for Requester Pays buckets. 6866func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall { 6867 c.urlParams_.Set("userProject", userProject) 6868 return c 6869} 6870 6871// Fields allows partial responses to be retrieved. See 6872// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6873// for more information. 6874func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall { 6875 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6876 return c 6877} 6878 6879// IfNoneMatch sets the optional parameter which makes the operation 6880// fail if the object's ETag matches the given value. This is useful for 6881// getting updates only after the object has changed since the last 6882// request. Use googleapi.IsNotModified to check whether the response 6883// error from Do is the result of In-None-Match. 6884func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall { 6885 c.ifNoneMatch_ = entityTag 6886 return c 6887} 6888 6889// Context sets the context to be used in this call's Do method. Any 6890// pending HTTP request will be aborted if the provided context is 6891// canceled. 6892func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall { 6893 c.ctx_ = ctx 6894 return c 6895} 6896 6897// Header returns an http.Header that can be modified by the caller to 6898// add HTTP headers to the request. 6899func (c *NotificationsGetCall) Header() http.Header { 6900 if c.header_ == nil { 6901 c.header_ = make(http.Header) 6902 } 6903 return c.header_ 6904} 6905 6906func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) { 6907 reqHeaders := make(http.Header) 6908 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 6909 for k, v := range c.header_ { 6910 reqHeaders[k] = v 6911 } 6912 reqHeaders.Set("User-Agent", c.s.userAgent()) 6913 if c.ifNoneMatch_ != "" { 6914 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6915 } 6916 var body io.Reader = nil 6917 c.urlParams_.Set("alt", alt) 6918 c.urlParams_.Set("prettyPrint", "false") 6919 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") 6920 urls += "?" + c.urlParams_.Encode() 6921 req, err := http.NewRequest("GET", urls, body) 6922 if err != nil { 6923 return nil, err 6924 } 6925 req.Header = reqHeaders 6926 googleapi.Expand(req.URL, map[string]string{ 6927 "bucket": c.bucket, 6928 "notification": c.notification, 6929 }) 6930 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6931} 6932 6933// Do executes the "storage.notifications.get" call. 6934// Exactly one of *Notification or error will be non-nil. Any non-2xx 6935// status code is an error. Response headers are in either 6936// *Notification.ServerResponse.Header or (if a response was returned at 6937// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6938// to check whether the returned error was because 6939// http.StatusNotModified was returned. 6940func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) { 6941 gensupport.SetOptions(c.urlParams_, opts...) 6942 res, err := c.doRequest("json") 6943 if res != nil && res.StatusCode == http.StatusNotModified { 6944 if res.Body != nil { 6945 res.Body.Close() 6946 } 6947 return nil, &googleapi.Error{ 6948 Code: res.StatusCode, 6949 Header: res.Header, 6950 } 6951 } 6952 if err != nil { 6953 return nil, err 6954 } 6955 defer googleapi.CloseBody(res) 6956 if err := googleapi.CheckResponse(res); err != nil { 6957 return nil, err 6958 } 6959 ret := &Notification{ 6960 ServerResponse: googleapi.ServerResponse{ 6961 Header: res.Header, 6962 HTTPStatusCode: res.StatusCode, 6963 }, 6964 } 6965 target := &ret 6966 if err := gensupport.DecodeResponse(target, res); err != nil { 6967 return nil, err 6968 } 6969 return ret, nil 6970 // { 6971 // "description": "View a notification configuration.", 6972 // "httpMethod": "GET", 6973 // "id": "storage.notifications.get", 6974 // "parameterOrder": [ 6975 // "bucket", 6976 // "notification" 6977 // ], 6978 // "parameters": { 6979 // "bucket": { 6980 // "description": "The parent bucket of the notification.", 6981 // "location": "path", 6982 // "required": true, 6983 // "type": "string" 6984 // }, 6985 // "notification": { 6986 // "description": "Notification ID", 6987 // "location": "path", 6988 // "required": true, 6989 // "type": "string" 6990 // }, 6991 // "provisionalUserProject": { 6992 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6993 // "location": "query", 6994 // "type": "string" 6995 // }, 6996 // "userProject": { 6997 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6998 // "location": "query", 6999 // "type": "string" 7000 // } 7001 // }, 7002 // "path": "b/{bucket}/notificationConfigs/{notification}", 7003 // "response": { 7004 // "$ref": "Notification" 7005 // }, 7006 // "scopes": [ 7007 // "https://www.googleapis.com/auth/cloud-platform", 7008 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7009 // "https://www.googleapis.com/auth/devstorage.full_control", 7010 // "https://www.googleapis.com/auth/devstorage.read_only", 7011 // "https://www.googleapis.com/auth/devstorage.read_write" 7012 // ] 7013 // } 7014 7015} 7016 7017// method id "storage.notifications.insert": 7018 7019type NotificationsInsertCall struct { 7020 s *Service 7021 bucket string 7022 notification *Notification 7023 urlParams_ gensupport.URLParams 7024 ctx_ context.Context 7025 header_ http.Header 7026} 7027 7028// Insert: Creates a notification subscription for a given bucket. 7029func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall { 7030 c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7031 c.bucket = bucket 7032 c.notification = notification 7033 return c 7034} 7035 7036// ProvisionalUserProject sets the optional parameter 7037// "provisionalUserProject": The project to be billed for this request 7038// if the target bucket is requester-pays bucket. 7039func (c *NotificationsInsertCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsInsertCall { 7040 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7041 return c 7042} 7043 7044// UserProject sets the optional parameter "userProject": The project to 7045// be billed for this request. Required for Requester Pays buckets. 7046func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall { 7047 c.urlParams_.Set("userProject", userProject) 7048 return c 7049} 7050 7051// Fields allows partial responses to be retrieved. See 7052// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7053// for more information. 7054func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall { 7055 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7056 return c 7057} 7058 7059// Context sets the context to be used in this call's Do method. Any 7060// pending HTTP request will be aborted if the provided context is 7061// canceled. 7062func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall { 7063 c.ctx_ = ctx 7064 return c 7065} 7066 7067// Header returns an http.Header that can be modified by the caller to 7068// add HTTP headers to the request. 7069func (c *NotificationsInsertCall) Header() http.Header { 7070 if c.header_ == nil { 7071 c.header_ = make(http.Header) 7072 } 7073 return c.header_ 7074} 7075 7076func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) { 7077 reqHeaders := make(http.Header) 7078 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7079 for k, v := range c.header_ { 7080 reqHeaders[k] = v 7081 } 7082 reqHeaders.Set("User-Agent", c.s.userAgent()) 7083 var body io.Reader = nil 7084 body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification) 7085 if err != nil { 7086 return nil, err 7087 } 7088 reqHeaders.Set("Content-Type", "application/json") 7089 c.urlParams_.Set("alt", alt) 7090 c.urlParams_.Set("prettyPrint", "false") 7091 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs") 7092 urls += "?" + c.urlParams_.Encode() 7093 req, err := http.NewRequest("POST", urls, body) 7094 if err != nil { 7095 return nil, err 7096 } 7097 req.Header = reqHeaders 7098 googleapi.Expand(req.URL, map[string]string{ 7099 "bucket": c.bucket, 7100 }) 7101 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7102} 7103 7104// Do executes the "storage.notifications.insert" call. 7105// Exactly one of *Notification or error will be non-nil. Any non-2xx 7106// status code is an error. Response headers are in either 7107// *Notification.ServerResponse.Header or (if a response was returned at 7108// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7109// to check whether the returned error was because 7110// http.StatusNotModified was returned. 7111func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) { 7112 gensupport.SetOptions(c.urlParams_, opts...) 7113 res, err := c.doRequest("json") 7114 if res != nil && res.StatusCode == http.StatusNotModified { 7115 if res.Body != nil { 7116 res.Body.Close() 7117 } 7118 return nil, &googleapi.Error{ 7119 Code: res.StatusCode, 7120 Header: res.Header, 7121 } 7122 } 7123 if err != nil { 7124 return nil, err 7125 } 7126 defer googleapi.CloseBody(res) 7127 if err := googleapi.CheckResponse(res); err != nil { 7128 return nil, err 7129 } 7130 ret := &Notification{ 7131 ServerResponse: googleapi.ServerResponse{ 7132 Header: res.Header, 7133 HTTPStatusCode: res.StatusCode, 7134 }, 7135 } 7136 target := &ret 7137 if err := gensupport.DecodeResponse(target, res); err != nil { 7138 return nil, err 7139 } 7140 return ret, nil 7141 // { 7142 // "description": "Creates a notification subscription for a given bucket.", 7143 // "httpMethod": "POST", 7144 // "id": "storage.notifications.insert", 7145 // "parameterOrder": [ 7146 // "bucket" 7147 // ], 7148 // "parameters": { 7149 // "bucket": { 7150 // "description": "The parent bucket of the notification.", 7151 // "location": "path", 7152 // "required": true, 7153 // "type": "string" 7154 // }, 7155 // "provisionalUserProject": { 7156 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7157 // "location": "query", 7158 // "type": "string" 7159 // }, 7160 // "userProject": { 7161 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7162 // "location": "query", 7163 // "type": "string" 7164 // } 7165 // }, 7166 // "path": "b/{bucket}/notificationConfigs", 7167 // "request": { 7168 // "$ref": "Notification" 7169 // }, 7170 // "response": { 7171 // "$ref": "Notification" 7172 // }, 7173 // "scopes": [ 7174 // "https://www.googleapis.com/auth/cloud-platform", 7175 // "https://www.googleapis.com/auth/devstorage.full_control", 7176 // "https://www.googleapis.com/auth/devstorage.read_write" 7177 // ] 7178 // } 7179 7180} 7181 7182// method id "storage.notifications.list": 7183 7184type NotificationsListCall struct { 7185 s *Service 7186 bucket string 7187 urlParams_ gensupport.URLParams 7188 ifNoneMatch_ string 7189 ctx_ context.Context 7190 header_ http.Header 7191} 7192 7193// List: Retrieves a list of notification subscriptions for a given 7194// bucket. 7195func (r *NotificationsService) List(bucket string) *NotificationsListCall { 7196 c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7197 c.bucket = bucket 7198 return c 7199} 7200 7201// ProvisionalUserProject sets the optional parameter 7202// "provisionalUserProject": The project to be billed for this request 7203// if the target bucket is requester-pays bucket. 7204func (c *NotificationsListCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsListCall { 7205 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7206 return c 7207} 7208 7209// UserProject sets the optional parameter "userProject": The project to 7210// be billed for this request. Required for Requester Pays buckets. 7211func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall { 7212 c.urlParams_.Set("userProject", userProject) 7213 return c 7214} 7215 7216// Fields allows partial responses to be retrieved. See 7217// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7218// for more information. 7219func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall { 7220 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7221 return c 7222} 7223 7224// IfNoneMatch sets the optional parameter which makes the operation 7225// fail if the object's ETag matches the given value. This is useful for 7226// getting updates only after the object has changed since the last 7227// request. Use googleapi.IsNotModified to check whether the response 7228// error from Do is the result of In-None-Match. 7229func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall { 7230 c.ifNoneMatch_ = entityTag 7231 return c 7232} 7233 7234// Context sets the context to be used in this call's Do method. Any 7235// pending HTTP request will be aborted if the provided context is 7236// canceled. 7237func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall { 7238 c.ctx_ = ctx 7239 return c 7240} 7241 7242// Header returns an http.Header that can be modified by the caller to 7243// add HTTP headers to the request. 7244func (c *NotificationsListCall) Header() http.Header { 7245 if c.header_ == nil { 7246 c.header_ = make(http.Header) 7247 } 7248 return c.header_ 7249} 7250 7251func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) { 7252 reqHeaders := make(http.Header) 7253 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7254 for k, v := range c.header_ { 7255 reqHeaders[k] = v 7256 } 7257 reqHeaders.Set("User-Agent", c.s.userAgent()) 7258 if c.ifNoneMatch_ != "" { 7259 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7260 } 7261 var body io.Reader = nil 7262 c.urlParams_.Set("alt", alt) 7263 c.urlParams_.Set("prettyPrint", "false") 7264 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs") 7265 urls += "?" + c.urlParams_.Encode() 7266 req, err := http.NewRequest("GET", urls, body) 7267 if err != nil { 7268 return nil, err 7269 } 7270 req.Header = reqHeaders 7271 googleapi.Expand(req.URL, map[string]string{ 7272 "bucket": c.bucket, 7273 }) 7274 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7275} 7276 7277// Do executes the "storage.notifications.list" call. 7278// Exactly one of *Notifications or error will be non-nil. Any non-2xx 7279// status code is an error. Response headers are in either 7280// *Notifications.ServerResponse.Header or (if a response was returned 7281// at all) in error.(*googleapi.Error).Header. Use 7282// googleapi.IsNotModified to check whether the returned error was 7283// because http.StatusNotModified was returned. 7284func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) { 7285 gensupport.SetOptions(c.urlParams_, opts...) 7286 res, err := c.doRequest("json") 7287 if res != nil && res.StatusCode == http.StatusNotModified { 7288 if res.Body != nil { 7289 res.Body.Close() 7290 } 7291 return nil, &googleapi.Error{ 7292 Code: res.StatusCode, 7293 Header: res.Header, 7294 } 7295 } 7296 if err != nil { 7297 return nil, err 7298 } 7299 defer googleapi.CloseBody(res) 7300 if err := googleapi.CheckResponse(res); err != nil { 7301 return nil, err 7302 } 7303 ret := &Notifications{ 7304 ServerResponse: googleapi.ServerResponse{ 7305 Header: res.Header, 7306 HTTPStatusCode: res.StatusCode, 7307 }, 7308 } 7309 target := &ret 7310 if err := gensupport.DecodeResponse(target, res); err != nil { 7311 return nil, err 7312 } 7313 return ret, nil 7314 // { 7315 // "description": "Retrieves a list of notification subscriptions for a given bucket.", 7316 // "httpMethod": "GET", 7317 // "id": "storage.notifications.list", 7318 // "parameterOrder": [ 7319 // "bucket" 7320 // ], 7321 // "parameters": { 7322 // "bucket": { 7323 // "description": "Name of a Google Cloud Storage bucket.", 7324 // "location": "path", 7325 // "required": true, 7326 // "type": "string" 7327 // }, 7328 // "provisionalUserProject": { 7329 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7330 // "location": "query", 7331 // "type": "string" 7332 // }, 7333 // "userProject": { 7334 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7335 // "location": "query", 7336 // "type": "string" 7337 // } 7338 // }, 7339 // "path": "b/{bucket}/notificationConfigs", 7340 // "response": { 7341 // "$ref": "Notifications" 7342 // }, 7343 // "scopes": [ 7344 // "https://www.googleapis.com/auth/cloud-platform", 7345 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7346 // "https://www.googleapis.com/auth/devstorage.full_control", 7347 // "https://www.googleapis.com/auth/devstorage.read_only", 7348 // "https://www.googleapis.com/auth/devstorage.read_write" 7349 // ] 7350 // } 7351 7352} 7353 7354// method id "storage.objectAccessControls.delete": 7355 7356type ObjectAccessControlsDeleteCall struct { 7357 s *Service 7358 bucket string 7359 object string 7360 entity string 7361 urlParams_ gensupport.URLParams 7362 ctx_ context.Context 7363 header_ http.Header 7364} 7365 7366// Delete: Permanently deletes the ACL entry for the specified entity on 7367// the specified object. 7368func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall { 7369 c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7370 c.bucket = bucket 7371 c.object = object 7372 c.entity = entity 7373 return c 7374} 7375 7376// Generation sets the optional parameter "generation": If present, 7377// selects a specific revision of this object (as opposed to the latest 7378// version, the default). 7379func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall { 7380 c.urlParams_.Set("generation", fmt.Sprint(generation)) 7381 return c 7382} 7383 7384// ProvisionalUserProject sets the optional parameter 7385// "provisionalUserProject": The project to be billed for this request 7386// if the target bucket is requester-pays bucket. 7387func (c *ObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsDeleteCall { 7388 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7389 return c 7390} 7391 7392// UserProject sets the optional parameter "userProject": The project to 7393// be billed for this request. Required for Requester Pays buckets. 7394func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall { 7395 c.urlParams_.Set("userProject", userProject) 7396 return c 7397} 7398 7399// Fields allows partial responses to be retrieved. See 7400// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7401// for more information. 7402func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall { 7403 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7404 return c 7405} 7406 7407// Context sets the context to be used in this call's Do method. Any 7408// pending HTTP request will be aborted if the provided context is 7409// canceled. 7410func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall { 7411 c.ctx_ = ctx 7412 return c 7413} 7414 7415// Header returns an http.Header that can be modified by the caller to 7416// add HTTP headers to the request. 7417func (c *ObjectAccessControlsDeleteCall) Header() http.Header { 7418 if c.header_ == nil { 7419 c.header_ = make(http.Header) 7420 } 7421 return c.header_ 7422} 7423 7424func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 7425 reqHeaders := make(http.Header) 7426 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7427 for k, v := range c.header_ { 7428 reqHeaders[k] = v 7429 } 7430 reqHeaders.Set("User-Agent", c.s.userAgent()) 7431 var body io.Reader = nil 7432 c.urlParams_.Set("alt", alt) 7433 c.urlParams_.Set("prettyPrint", "false") 7434 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 7435 urls += "?" + c.urlParams_.Encode() 7436 req, err := http.NewRequest("DELETE", urls, body) 7437 if err != nil { 7438 return nil, err 7439 } 7440 req.Header = reqHeaders 7441 googleapi.Expand(req.URL, map[string]string{ 7442 "bucket": c.bucket, 7443 "object": c.object, 7444 "entity": c.entity, 7445 }) 7446 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7447} 7448 7449// Do executes the "storage.objectAccessControls.delete" call. 7450func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { 7451 gensupport.SetOptions(c.urlParams_, opts...) 7452 res, err := c.doRequest("json") 7453 if err != nil { 7454 return err 7455 } 7456 defer googleapi.CloseBody(res) 7457 if err := googleapi.CheckResponse(res); err != nil { 7458 return err 7459 } 7460 return nil 7461 // { 7462 // "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", 7463 // "httpMethod": "DELETE", 7464 // "id": "storage.objectAccessControls.delete", 7465 // "parameterOrder": [ 7466 // "bucket", 7467 // "object", 7468 // "entity" 7469 // ], 7470 // "parameters": { 7471 // "bucket": { 7472 // "description": "Name of a bucket.", 7473 // "location": "path", 7474 // "required": true, 7475 // "type": "string" 7476 // }, 7477 // "entity": { 7478 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 7479 // "location": "path", 7480 // "required": true, 7481 // "type": "string" 7482 // }, 7483 // "generation": { 7484 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 7485 // "format": "int64", 7486 // "location": "query", 7487 // "type": "string" 7488 // }, 7489 // "object": { 7490 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 7491 // "location": "path", 7492 // "required": true, 7493 // "type": "string" 7494 // }, 7495 // "provisionalUserProject": { 7496 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7497 // "location": "query", 7498 // "type": "string" 7499 // }, 7500 // "userProject": { 7501 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7502 // "location": "query", 7503 // "type": "string" 7504 // } 7505 // }, 7506 // "path": "b/{bucket}/o/{object}/acl/{entity}", 7507 // "scopes": [ 7508 // "https://www.googleapis.com/auth/cloud-platform", 7509 // "https://www.googleapis.com/auth/devstorage.full_control" 7510 // ] 7511 // } 7512 7513} 7514 7515// method id "storage.objectAccessControls.get": 7516 7517type ObjectAccessControlsGetCall struct { 7518 s *Service 7519 bucket string 7520 object string 7521 entity string 7522 urlParams_ gensupport.URLParams 7523 ifNoneMatch_ string 7524 ctx_ context.Context 7525 header_ http.Header 7526} 7527 7528// Get: Returns the ACL entry for the specified entity on the specified 7529// object. 7530func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall { 7531 c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7532 c.bucket = bucket 7533 c.object = object 7534 c.entity = entity 7535 return c 7536} 7537 7538// Generation sets the optional parameter "generation": If present, 7539// selects a specific revision of this object (as opposed to the latest 7540// version, the default). 7541func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall { 7542 c.urlParams_.Set("generation", fmt.Sprint(generation)) 7543 return c 7544} 7545 7546// ProvisionalUserProject sets the optional parameter 7547// "provisionalUserProject": The project to be billed for this request 7548// if the target bucket is requester-pays bucket. 7549func (c *ObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsGetCall { 7550 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7551 return c 7552} 7553 7554// UserProject sets the optional parameter "userProject": The project to 7555// be billed for this request. Required for Requester Pays buckets. 7556func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall { 7557 c.urlParams_.Set("userProject", userProject) 7558 return c 7559} 7560 7561// Fields allows partial responses to be retrieved. See 7562// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7563// for more information. 7564func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall { 7565 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7566 return c 7567} 7568 7569// IfNoneMatch sets the optional parameter which makes the operation 7570// fail if the object's ETag matches the given value. This is useful for 7571// getting updates only after the object has changed since the last 7572// request. Use googleapi.IsNotModified to check whether the response 7573// error from Do is the result of In-None-Match. 7574func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall { 7575 c.ifNoneMatch_ = entityTag 7576 return c 7577} 7578 7579// Context sets the context to be used in this call's Do method. Any 7580// pending HTTP request will be aborted if the provided context is 7581// canceled. 7582func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall { 7583 c.ctx_ = ctx 7584 return c 7585} 7586 7587// Header returns an http.Header that can be modified by the caller to 7588// add HTTP headers to the request. 7589func (c *ObjectAccessControlsGetCall) Header() http.Header { 7590 if c.header_ == nil { 7591 c.header_ = make(http.Header) 7592 } 7593 return c.header_ 7594} 7595 7596func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { 7597 reqHeaders := make(http.Header) 7598 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7599 for k, v := range c.header_ { 7600 reqHeaders[k] = v 7601 } 7602 reqHeaders.Set("User-Agent", c.s.userAgent()) 7603 if c.ifNoneMatch_ != "" { 7604 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7605 } 7606 var body io.Reader = nil 7607 c.urlParams_.Set("alt", alt) 7608 c.urlParams_.Set("prettyPrint", "false") 7609 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 7610 urls += "?" + c.urlParams_.Encode() 7611 req, err := http.NewRequest("GET", urls, body) 7612 if err != nil { 7613 return nil, err 7614 } 7615 req.Header = reqHeaders 7616 googleapi.Expand(req.URL, map[string]string{ 7617 "bucket": c.bucket, 7618 "object": c.object, 7619 "entity": c.entity, 7620 }) 7621 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7622} 7623 7624// Do executes the "storage.objectAccessControls.get" call. 7625// Exactly one of *ObjectAccessControl or error will be non-nil. Any 7626// non-2xx status code is an error. Response headers are in either 7627// *ObjectAccessControl.ServerResponse.Header or (if a response was 7628// returned at all) in error.(*googleapi.Error).Header. Use 7629// googleapi.IsNotModified to check whether the returned error was 7630// because http.StatusNotModified was returned. 7631func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 7632 gensupport.SetOptions(c.urlParams_, opts...) 7633 res, err := c.doRequest("json") 7634 if res != nil && res.StatusCode == http.StatusNotModified { 7635 if res.Body != nil { 7636 res.Body.Close() 7637 } 7638 return nil, &googleapi.Error{ 7639 Code: res.StatusCode, 7640 Header: res.Header, 7641 } 7642 } 7643 if err != nil { 7644 return nil, err 7645 } 7646 defer googleapi.CloseBody(res) 7647 if err := googleapi.CheckResponse(res); err != nil { 7648 return nil, err 7649 } 7650 ret := &ObjectAccessControl{ 7651 ServerResponse: googleapi.ServerResponse{ 7652 Header: res.Header, 7653 HTTPStatusCode: res.StatusCode, 7654 }, 7655 } 7656 target := &ret 7657 if err := gensupport.DecodeResponse(target, res); err != nil { 7658 return nil, err 7659 } 7660 return ret, nil 7661 // { 7662 // "description": "Returns the ACL entry for the specified entity on the specified object.", 7663 // "httpMethod": "GET", 7664 // "id": "storage.objectAccessControls.get", 7665 // "parameterOrder": [ 7666 // "bucket", 7667 // "object", 7668 // "entity" 7669 // ], 7670 // "parameters": { 7671 // "bucket": { 7672 // "description": "Name of a bucket.", 7673 // "location": "path", 7674 // "required": true, 7675 // "type": "string" 7676 // }, 7677 // "entity": { 7678 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 7679 // "location": "path", 7680 // "required": true, 7681 // "type": "string" 7682 // }, 7683 // "generation": { 7684 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 7685 // "format": "int64", 7686 // "location": "query", 7687 // "type": "string" 7688 // }, 7689 // "object": { 7690 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 7691 // "location": "path", 7692 // "required": true, 7693 // "type": "string" 7694 // }, 7695 // "provisionalUserProject": { 7696 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7697 // "location": "query", 7698 // "type": "string" 7699 // }, 7700 // "userProject": { 7701 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7702 // "location": "query", 7703 // "type": "string" 7704 // } 7705 // }, 7706 // "path": "b/{bucket}/o/{object}/acl/{entity}", 7707 // "response": { 7708 // "$ref": "ObjectAccessControl" 7709 // }, 7710 // "scopes": [ 7711 // "https://www.googleapis.com/auth/cloud-platform", 7712 // "https://www.googleapis.com/auth/devstorage.full_control" 7713 // ] 7714 // } 7715 7716} 7717 7718// method id "storage.objectAccessControls.insert": 7719 7720type ObjectAccessControlsInsertCall struct { 7721 s *Service 7722 bucket string 7723 object string 7724 objectaccesscontrol *ObjectAccessControl 7725 urlParams_ gensupport.URLParams 7726 ctx_ context.Context 7727 header_ http.Header 7728} 7729 7730// Insert: Creates a new ACL entry on the specified object. 7731func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall { 7732 c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7733 c.bucket = bucket 7734 c.object = object 7735 c.objectaccesscontrol = objectaccesscontrol 7736 return c 7737} 7738 7739// Generation sets the optional parameter "generation": If present, 7740// selects a specific revision of this object (as opposed to the latest 7741// version, the default). 7742func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall { 7743 c.urlParams_.Set("generation", fmt.Sprint(generation)) 7744 return c 7745} 7746 7747// ProvisionalUserProject sets the optional parameter 7748// "provisionalUserProject": The project to be billed for this request 7749// if the target bucket is requester-pays bucket. 7750func (c *ObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsInsertCall { 7751 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7752 return c 7753} 7754 7755// UserProject sets the optional parameter "userProject": The project to 7756// be billed for this request. Required for Requester Pays buckets. 7757func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall { 7758 c.urlParams_.Set("userProject", userProject) 7759 return c 7760} 7761 7762// Fields allows partial responses to be retrieved. See 7763// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7764// for more information. 7765func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall { 7766 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7767 return c 7768} 7769 7770// Context sets the context to be used in this call's Do method. Any 7771// pending HTTP request will be aborted if the provided context is 7772// canceled. 7773func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall { 7774 c.ctx_ = ctx 7775 return c 7776} 7777 7778// Header returns an http.Header that can be modified by the caller to 7779// add HTTP headers to the request. 7780func (c *ObjectAccessControlsInsertCall) Header() http.Header { 7781 if c.header_ == nil { 7782 c.header_ = make(http.Header) 7783 } 7784 return c.header_ 7785} 7786 7787func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { 7788 reqHeaders := make(http.Header) 7789 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7790 for k, v := range c.header_ { 7791 reqHeaders[k] = v 7792 } 7793 reqHeaders.Set("User-Agent", c.s.userAgent()) 7794 var body io.Reader = nil 7795 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 7796 if err != nil { 7797 return nil, err 7798 } 7799 reqHeaders.Set("Content-Type", "application/json") 7800 c.urlParams_.Set("alt", alt) 7801 c.urlParams_.Set("prettyPrint", "false") 7802 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") 7803 urls += "?" + c.urlParams_.Encode() 7804 req, err := http.NewRequest("POST", urls, body) 7805 if err != nil { 7806 return nil, err 7807 } 7808 req.Header = reqHeaders 7809 googleapi.Expand(req.URL, map[string]string{ 7810 "bucket": c.bucket, 7811 "object": c.object, 7812 }) 7813 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7814} 7815 7816// Do executes the "storage.objectAccessControls.insert" call. 7817// Exactly one of *ObjectAccessControl or error will be non-nil. Any 7818// non-2xx status code is an error. Response headers are in either 7819// *ObjectAccessControl.ServerResponse.Header or (if a response was 7820// returned at all) in error.(*googleapi.Error).Header. Use 7821// googleapi.IsNotModified to check whether the returned error was 7822// because http.StatusNotModified was returned. 7823func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 7824 gensupport.SetOptions(c.urlParams_, opts...) 7825 res, err := c.doRequest("json") 7826 if res != nil && res.StatusCode == http.StatusNotModified { 7827 if res.Body != nil { 7828 res.Body.Close() 7829 } 7830 return nil, &googleapi.Error{ 7831 Code: res.StatusCode, 7832 Header: res.Header, 7833 } 7834 } 7835 if err != nil { 7836 return nil, err 7837 } 7838 defer googleapi.CloseBody(res) 7839 if err := googleapi.CheckResponse(res); err != nil { 7840 return nil, err 7841 } 7842 ret := &ObjectAccessControl{ 7843 ServerResponse: googleapi.ServerResponse{ 7844 Header: res.Header, 7845 HTTPStatusCode: res.StatusCode, 7846 }, 7847 } 7848 target := &ret 7849 if err := gensupport.DecodeResponse(target, res); err != nil { 7850 return nil, err 7851 } 7852 return ret, nil 7853 // { 7854 // "description": "Creates a new ACL entry on the specified object.", 7855 // "httpMethod": "POST", 7856 // "id": "storage.objectAccessControls.insert", 7857 // "parameterOrder": [ 7858 // "bucket", 7859 // "object" 7860 // ], 7861 // "parameters": { 7862 // "bucket": { 7863 // "description": "Name of a bucket.", 7864 // "location": "path", 7865 // "required": true, 7866 // "type": "string" 7867 // }, 7868 // "generation": { 7869 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 7870 // "format": "int64", 7871 // "location": "query", 7872 // "type": "string" 7873 // }, 7874 // "object": { 7875 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 7876 // "location": "path", 7877 // "required": true, 7878 // "type": "string" 7879 // }, 7880 // "provisionalUserProject": { 7881 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7882 // "location": "query", 7883 // "type": "string" 7884 // }, 7885 // "userProject": { 7886 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7887 // "location": "query", 7888 // "type": "string" 7889 // } 7890 // }, 7891 // "path": "b/{bucket}/o/{object}/acl", 7892 // "request": { 7893 // "$ref": "ObjectAccessControl" 7894 // }, 7895 // "response": { 7896 // "$ref": "ObjectAccessControl" 7897 // }, 7898 // "scopes": [ 7899 // "https://www.googleapis.com/auth/cloud-platform", 7900 // "https://www.googleapis.com/auth/devstorage.full_control" 7901 // ] 7902 // } 7903 7904} 7905 7906// method id "storage.objectAccessControls.list": 7907 7908type ObjectAccessControlsListCall struct { 7909 s *Service 7910 bucket string 7911 object string 7912 urlParams_ gensupport.URLParams 7913 ifNoneMatch_ string 7914 ctx_ context.Context 7915 header_ http.Header 7916} 7917 7918// List: Retrieves ACL entries on the specified object. 7919func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall { 7920 c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7921 c.bucket = bucket 7922 c.object = object 7923 return c 7924} 7925 7926// Generation sets the optional parameter "generation": If present, 7927// selects a specific revision of this object (as opposed to the latest 7928// version, the default). 7929func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall { 7930 c.urlParams_.Set("generation", fmt.Sprint(generation)) 7931 return c 7932} 7933 7934// ProvisionalUserProject sets the optional parameter 7935// "provisionalUserProject": The project to be billed for this request 7936// if the target bucket is requester-pays bucket. 7937func (c *ObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsListCall { 7938 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7939 return c 7940} 7941 7942// UserProject sets the optional parameter "userProject": The project to 7943// be billed for this request. Required for Requester Pays buckets. 7944func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall { 7945 c.urlParams_.Set("userProject", userProject) 7946 return c 7947} 7948 7949// Fields allows partial responses to be retrieved. See 7950// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7951// for more information. 7952func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall { 7953 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7954 return c 7955} 7956 7957// IfNoneMatch sets the optional parameter which makes the operation 7958// fail if the object's ETag matches the given value. This is useful for 7959// getting updates only after the object has changed since the last 7960// request. Use googleapi.IsNotModified to check whether the response 7961// error from Do is the result of In-None-Match. 7962func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall { 7963 c.ifNoneMatch_ = entityTag 7964 return c 7965} 7966 7967// Context sets the context to be used in this call's Do method. Any 7968// pending HTTP request will be aborted if the provided context is 7969// canceled. 7970func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall { 7971 c.ctx_ = ctx 7972 return c 7973} 7974 7975// Header returns an http.Header that can be modified by the caller to 7976// add HTTP headers to the request. 7977func (c *ObjectAccessControlsListCall) Header() http.Header { 7978 if c.header_ == nil { 7979 c.header_ = make(http.Header) 7980 } 7981 return c.header_ 7982} 7983 7984func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { 7985 reqHeaders := make(http.Header) 7986 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 7987 for k, v := range c.header_ { 7988 reqHeaders[k] = v 7989 } 7990 reqHeaders.Set("User-Agent", c.s.userAgent()) 7991 if c.ifNoneMatch_ != "" { 7992 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7993 } 7994 var body io.Reader = nil 7995 c.urlParams_.Set("alt", alt) 7996 c.urlParams_.Set("prettyPrint", "false") 7997 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") 7998 urls += "?" + c.urlParams_.Encode() 7999 req, err := http.NewRequest("GET", urls, body) 8000 if err != nil { 8001 return nil, err 8002 } 8003 req.Header = reqHeaders 8004 googleapi.Expand(req.URL, map[string]string{ 8005 "bucket": c.bucket, 8006 "object": c.object, 8007 }) 8008 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8009} 8010 8011// Do executes the "storage.objectAccessControls.list" call. 8012// Exactly one of *ObjectAccessControls or error will be non-nil. Any 8013// non-2xx status code is an error. Response headers are in either 8014// *ObjectAccessControls.ServerResponse.Header or (if a response was 8015// returned at all) in error.(*googleapi.Error).Header. Use 8016// googleapi.IsNotModified to check whether the returned error was 8017// because http.StatusNotModified was returned. 8018func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) { 8019 gensupport.SetOptions(c.urlParams_, opts...) 8020 res, err := c.doRequest("json") 8021 if res != nil && res.StatusCode == http.StatusNotModified { 8022 if res.Body != nil { 8023 res.Body.Close() 8024 } 8025 return nil, &googleapi.Error{ 8026 Code: res.StatusCode, 8027 Header: res.Header, 8028 } 8029 } 8030 if err != nil { 8031 return nil, err 8032 } 8033 defer googleapi.CloseBody(res) 8034 if err := googleapi.CheckResponse(res); err != nil { 8035 return nil, err 8036 } 8037 ret := &ObjectAccessControls{ 8038 ServerResponse: googleapi.ServerResponse{ 8039 Header: res.Header, 8040 HTTPStatusCode: res.StatusCode, 8041 }, 8042 } 8043 target := &ret 8044 if err := gensupport.DecodeResponse(target, res); err != nil { 8045 return nil, err 8046 } 8047 return ret, nil 8048 // { 8049 // "description": "Retrieves ACL entries on the specified object.", 8050 // "httpMethod": "GET", 8051 // "id": "storage.objectAccessControls.list", 8052 // "parameterOrder": [ 8053 // "bucket", 8054 // "object" 8055 // ], 8056 // "parameters": { 8057 // "bucket": { 8058 // "description": "Name of a bucket.", 8059 // "location": "path", 8060 // "required": true, 8061 // "type": "string" 8062 // }, 8063 // "generation": { 8064 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 8065 // "format": "int64", 8066 // "location": "query", 8067 // "type": "string" 8068 // }, 8069 // "object": { 8070 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8071 // "location": "path", 8072 // "required": true, 8073 // "type": "string" 8074 // }, 8075 // "provisionalUserProject": { 8076 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8077 // "location": "query", 8078 // "type": "string" 8079 // }, 8080 // "userProject": { 8081 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8082 // "location": "query", 8083 // "type": "string" 8084 // } 8085 // }, 8086 // "path": "b/{bucket}/o/{object}/acl", 8087 // "response": { 8088 // "$ref": "ObjectAccessControls" 8089 // }, 8090 // "scopes": [ 8091 // "https://www.googleapis.com/auth/cloud-platform", 8092 // "https://www.googleapis.com/auth/devstorage.full_control" 8093 // ] 8094 // } 8095 8096} 8097 8098// method id "storage.objectAccessControls.patch": 8099 8100type ObjectAccessControlsPatchCall struct { 8101 s *Service 8102 bucket string 8103 object string 8104 entity string 8105 objectaccesscontrol *ObjectAccessControl 8106 urlParams_ gensupport.URLParams 8107 ctx_ context.Context 8108 header_ http.Header 8109} 8110 8111// Patch: Patches an ACL entry on the specified object. 8112func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall { 8113 c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8114 c.bucket = bucket 8115 c.object = object 8116 c.entity = entity 8117 c.objectaccesscontrol = objectaccesscontrol 8118 return c 8119} 8120 8121// Generation sets the optional parameter "generation": If present, 8122// selects a specific revision of this object (as opposed to the latest 8123// version, the default). 8124func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall { 8125 c.urlParams_.Set("generation", fmt.Sprint(generation)) 8126 return c 8127} 8128 8129// ProvisionalUserProject sets the optional parameter 8130// "provisionalUserProject": The project to be billed for this request 8131// if the target bucket is requester-pays bucket. 8132func (c *ObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsPatchCall { 8133 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8134 return c 8135} 8136 8137// UserProject sets the optional parameter "userProject": The project to 8138// be billed for this request. Required for Requester Pays buckets. 8139func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall { 8140 c.urlParams_.Set("userProject", userProject) 8141 return c 8142} 8143 8144// Fields allows partial responses to be retrieved. See 8145// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8146// for more information. 8147func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall { 8148 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8149 return c 8150} 8151 8152// Context sets the context to be used in this call's Do method. Any 8153// pending HTTP request will be aborted if the provided context is 8154// canceled. 8155func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall { 8156 c.ctx_ = ctx 8157 return c 8158} 8159 8160// Header returns an http.Header that can be modified by the caller to 8161// add HTTP headers to the request. 8162func (c *ObjectAccessControlsPatchCall) Header() http.Header { 8163 if c.header_ == nil { 8164 c.header_ = make(http.Header) 8165 } 8166 return c.header_ 8167} 8168 8169func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { 8170 reqHeaders := make(http.Header) 8171 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8172 for k, v := range c.header_ { 8173 reqHeaders[k] = v 8174 } 8175 reqHeaders.Set("User-Agent", c.s.userAgent()) 8176 var body io.Reader = nil 8177 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 8178 if err != nil { 8179 return nil, err 8180 } 8181 reqHeaders.Set("Content-Type", "application/json") 8182 c.urlParams_.Set("alt", alt) 8183 c.urlParams_.Set("prettyPrint", "false") 8184 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 8185 urls += "?" + c.urlParams_.Encode() 8186 req, err := http.NewRequest("PATCH", urls, body) 8187 if err != nil { 8188 return nil, err 8189 } 8190 req.Header = reqHeaders 8191 googleapi.Expand(req.URL, map[string]string{ 8192 "bucket": c.bucket, 8193 "object": c.object, 8194 "entity": c.entity, 8195 }) 8196 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8197} 8198 8199// Do executes the "storage.objectAccessControls.patch" call. 8200// Exactly one of *ObjectAccessControl or error will be non-nil. Any 8201// non-2xx status code is an error. Response headers are in either 8202// *ObjectAccessControl.ServerResponse.Header or (if a response was 8203// returned at all) in error.(*googleapi.Error).Header. Use 8204// googleapi.IsNotModified to check whether the returned error was 8205// because http.StatusNotModified was returned. 8206func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 8207 gensupport.SetOptions(c.urlParams_, opts...) 8208 res, err := c.doRequest("json") 8209 if res != nil && res.StatusCode == http.StatusNotModified { 8210 if res.Body != nil { 8211 res.Body.Close() 8212 } 8213 return nil, &googleapi.Error{ 8214 Code: res.StatusCode, 8215 Header: res.Header, 8216 } 8217 } 8218 if err != nil { 8219 return nil, err 8220 } 8221 defer googleapi.CloseBody(res) 8222 if err := googleapi.CheckResponse(res); err != nil { 8223 return nil, err 8224 } 8225 ret := &ObjectAccessControl{ 8226 ServerResponse: googleapi.ServerResponse{ 8227 Header: res.Header, 8228 HTTPStatusCode: res.StatusCode, 8229 }, 8230 } 8231 target := &ret 8232 if err := gensupport.DecodeResponse(target, res); err != nil { 8233 return nil, err 8234 } 8235 return ret, nil 8236 // { 8237 // "description": "Patches an ACL entry on the specified object.", 8238 // "httpMethod": "PATCH", 8239 // "id": "storage.objectAccessControls.patch", 8240 // "parameterOrder": [ 8241 // "bucket", 8242 // "object", 8243 // "entity" 8244 // ], 8245 // "parameters": { 8246 // "bucket": { 8247 // "description": "Name of a bucket.", 8248 // "location": "path", 8249 // "required": true, 8250 // "type": "string" 8251 // }, 8252 // "entity": { 8253 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 8254 // "location": "path", 8255 // "required": true, 8256 // "type": "string" 8257 // }, 8258 // "generation": { 8259 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 8260 // "format": "int64", 8261 // "location": "query", 8262 // "type": "string" 8263 // }, 8264 // "object": { 8265 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8266 // "location": "path", 8267 // "required": true, 8268 // "type": "string" 8269 // }, 8270 // "provisionalUserProject": { 8271 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8272 // "location": "query", 8273 // "type": "string" 8274 // }, 8275 // "userProject": { 8276 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8277 // "location": "query", 8278 // "type": "string" 8279 // } 8280 // }, 8281 // "path": "b/{bucket}/o/{object}/acl/{entity}", 8282 // "request": { 8283 // "$ref": "ObjectAccessControl" 8284 // }, 8285 // "response": { 8286 // "$ref": "ObjectAccessControl" 8287 // }, 8288 // "scopes": [ 8289 // "https://www.googleapis.com/auth/cloud-platform", 8290 // "https://www.googleapis.com/auth/devstorage.full_control" 8291 // ] 8292 // } 8293 8294} 8295 8296// method id "storage.objectAccessControls.update": 8297 8298type ObjectAccessControlsUpdateCall struct { 8299 s *Service 8300 bucket string 8301 object string 8302 entity string 8303 objectaccesscontrol *ObjectAccessControl 8304 urlParams_ gensupport.URLParams 8305 ctx_ context.Context 8306 header_ http.Header 8307} 8308 8309// Update: Updates an ACL entry on the specified object. 8310func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall { 8311 c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8312 c.bucket = bucket 8313 c.object = object 8314 c.entity = entity 8315 c.objectaccesscontrol = objectaccesscontrol 8316 return c 8317} 8318 8319// Generation sets the optional parameter "generation": If present, 8320// selects a specific revision of this object (as opposed to the latest 8321// version, the default). 8322func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall { 8323 c.urlParams_.Set("generation", fmt.Sprint(generation)) 8324 return c 8325} 8326 8327// ProvisionalUserProject sets the optional parameter 8328// "provisionalUserProject": The project to be billed for this request 8329// if the target bucket is requester-pays bucket. 8330func (c *ObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsUpdateCall { 8331 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8332 return c 8333} 8334 8335// UserProject sets the optional parameter "userProject": The project to 8336// be billed for this request. Required for Requester Pays buckets. 8337func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall { 8338 c.urlParams_.Set("userProject", userProject) 8339 return c 8340} 8341 8342// Fields allows partial responses to be retrieved. See 8343// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8344// for more information. 8345func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall { 8346 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8347 return c 8348} 8349 8350// Context sets the context to be used in this call's Do method. Any 8351// pending HTTP request will be aborted if the provided context is 8352// canceled. 8353func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall { 8354 c.ctx_ = ctx 8355 return c 8356} 8357 8358// Header returns an http.Header that can be modified by the caller to 8359// add HTTP headers to the request. 8360func (c *ObjectAccessControlsUpdateCall) Header() http.Header { 8361 if c.header_ == nil { 8362 c.header_ = make(http.Header) 8363 } 8364 return c.header_ 8365} 8366 8367func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { 8368 reqHeaders := make(http.Header) 8369 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8370 for k, v := range c.header_ { 8371 reqHeaders[k] = v 8372 } 8373 reqHeaders.Set("User-Agent", c.s.userAgent()) 8374 var body io.Reader = nil 8375 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 8376 if err != nil { 8377 return nil, err 8378 } 8379 reqHeaders.Set("Content-Type", "application/json") 8380 c.urlParams_.Set("alt", alt) 8381 c.urlParams_.Set("prettyPrint", "false") 8382 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 8383 urls += "?" + c.urlParams_.Encode() 8384 req, err := http.NewRequest("PUT", urls, body) 8385 if err != nil { 8386 return nil, err 8387 } 8388 req.Header = reqHeaders 8389 googleapi.Expand(req.URL, map[string]string{ 8390 "bucket": c.bucket, 8391 "object": c.object, 8392 "entity": c.entity, 8393 }) 8394 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8395} 8396 8397// Do executes the "storage.objectAccessControls.update" call. 8398// Exactly one of *ObjectAccessControl or error will be non-nil. Any 8399// non-2xx status code is an error. Response headers are in either 8400// *ObjectAccessControl.ServerResponse.Header or (if a response was 8401// returned at all) in error.(*googleapi.Error).Header. Use 8402// googleapi.IsNotModified to check whether the returned error was 8403// because http.StatusNotModified was returned. 8404func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 8405 gensupport.SetOptions(c.urlParams_, opts...) 8406 res, err := c.doRequest("json") 8407 if res != nil && res.StatusCode == http.StatusNotModified { 8408 if res.Body != nil { 8409 res.Body.Close() 8410 } 8411 return nil, &googleapi.Error{ 8412 Code: res.StatusCode, 8413 Header: res.Header, 8414 } 8415 } 8416 if err != nil { 8417 return nil, err 8418 } 8419 defer googleapi.CloseBody(res) 8420 if err := googleapi.CheckResponse(res); err != nil { 8421 return nil, err 8422 } 8423 ret := &ObjectAccessControl{ 8424 ServerResponse: googleapi.ServerResponse{ 8425 Header: res.Header, 8426 HTTPStatusCode: res.StatusCode, 8427 }, 8428 } 8429 target := &ret 8430 if err := gensupport.DecodeResponse(target, res); err != nil { 8431 return nil, err 8432 } 8433 return ret, nil 8434 // { 8435 // "description": "Updates an ACL entry on the specified object.", 8436 // "httpMethod": "PUT", 8437 // "id": "storage.objectAccessControls.update", 8438 // "parameterOrder": [ 8439 // "bucket", 8440 // "object", 8441 // "entity" 8442 // ], 8443 // "parameters": { 8444 // "bucket": { 8445 // "description": "Name of a bucket.", 8446 // "location": "path", 8447 // "required": true, 8448 // "type": "string" 8449 // }, 8450 // "entity": { 8451 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 8452 // "location": "path", 8453 // "required": true, 8454 // "type": "string" 8455 // }, 8456 // "generation": { 8457 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 8458 // "format": "int64", 8459 // "location": "query", 8460 // "type": "string" 8461 // }, 8462 // "object": { 8463 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8464 // "location": "path", 8465 // "required": true, 8466 // "type": "string" 8467 // }, 8468 // "provisionalUserProject": { 8469 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8470 // "location": "query", 8471 // "type": "string" 8472 // }, 8473 // "userProject": { 8474 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8475 // "location": "query", 8476 // "type": "string" 8477 // } 8478 // }, 8479 // "path": "b/{bucket}/o/{object}/acl/{entity}", 8480 // "request": { 8481 // "$ref": "ObjectAccessControl" 8482 // }, 8483 // "response": { 8484 // "$ref": "ObjectAccessControl" 8485 // }, 8486 // "scopes": [ 8487 // "https://www.googleapis.com/auth/cloud-platform", 8488 // "https://www.googleapis.com/auth/devstorage.full_control" 8489 // ] 8490 // } 8491 8492} 8493 8494// method id "storage.objects.compose": 8495 8496type ObjectsComposeCall struct { 8497 s *Service 8498 destinationBucket string 8499 destinationObject string 8500 composerequest *ComposeRequest 8501 urlParams_ gensupport.URLParams 8502 ctx_ context.Context 8503 header_ http.Header 8504} 8505 8506// Compose: Concatenates a list of existing objects into a new object in 8507// the same bucket. 8508func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall { 8509 c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8510 c.destinationBucket = destinationBucket 8511 c.destinationObject = destinationObject 8512 c.composerequest = composerequest 8513 return c 8514} 8515 8516// DestinationPredefinedAcl sets the optional parameter 8517// "destinationPredefinedAcl": Apply a predefined set of access controls 8518// to the destination object. 8519// 8520// Possible values: 8521// "authenticatedRead" - Object owner gets OWNER access, and 8522// allAuthenticatedUsers get READER access. 8523// "bucketOwnerFullControl" - Object owner gets OWNER access, and 8524// project team owners get OWNER access. 8525// "bucketOwnerRead" - Object owner gets OWNER access, and project 8526// team owners get READER access. 8527// "private" - Object owner gets OWNER access. 8528// "projectPrivate" - Object owner gets OWNER access, and project team 8529// members get access according to their roles. 8530// "publicRead" - Object owner gets OWNER access, and allUsers get 8531// READER access. 8532func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall { 8533 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) 8534 return c 8535} 8536 8537// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 8538// Makes the operation conditional on whether the object's current 8539// generation matches the given value. Setting to 0 makes the operation 8540// succeed only if there are no live versions of the object. 8541func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall { 8542 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 8543 return c 8544} 8545 8546// IfMetagenerationMatch sets the optional parameter 8547// "ifMetagenerationMatch": Makes the operation conditional on whether 8548// the object's current metageneration matches the given value. 8549func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall { 8550 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 8551 return c 8552} 8553 8554// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of 8555// the Cloud KMS key, of the form 8556// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 8557// that will be used to encrypt the object. Overrides the object 8558// metadata's kms_key_name value, if any. 8559func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall { 8560 c.urlParams_.Set("kmsKeyName", kmsKeyName) 8561 return c 8562} 8563 8564// ProvisionalUserProject sets the optional parameter 8565// "provisionalUserProject": The project to be billed for this request 8566// if the target bucket is requester-pays bucket. 8567func (c *ObjectsComposeCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsComposeCall { 8568 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8569 return c 8570} 8571 8572// UserProject sets the optional parameter "userProject": The project to 8573// be billed for this request. Required for Requester Pays buckets. 8574func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall { 8575 c.urlParams_.Set("userProject", userProject) 8576 return c 8577} 8578 8579// Fields allows partial responses to be retrieved. See 8580// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8581// for more information. 8582func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall { 8583 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8584 return c 8585} 8586 8587// Context sets the context to be used in this call's Do method. Any 8588// pending HTTP request will be aborted if the provided context is 8589// canceled. 8590func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall { 8591 c.ctx_ = ctx 8592 return c 8593} 8594 8595// Header returns an http.Header that can be modified by the caller to 8596// add HTTP headers to the request. 8597func (c *ObjectsComposeCall) Header() http.Header { 8598 if c.header_ == nil { 8599 c.header_ = make(http.Header) 8600 } 8601 return c.header_ 8602} 8603 8604func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { 8605 reqHeaders := make(http.Header) 8606 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8607 for k, v := range c.header_ { 8608 reqHeaders[k] = v 8609 } 8610 reqHeaders.Set("User-Agent", c.s.userAgent()) 8611 var body io.Reader = nil 8612 body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest) 8613 if err != nil { 8614 return nil, err 8615 } 8616 reqHeaders.Set("Content-Type", "application/json") 8617 c.urlParams_.Set("alt", alt) 8618 c.urlParams_.Set("prettyPrint", "false") 8619 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose") 8620 urls += "?" + c.urlParams_.Encode() 8621 req, err := http.NewRequest("POST", urls, body) 8622 if err != nil { 8623 return nil, err 8624 } 8625 req.Header = reqHeaders 8626 googleapi.Expand(req.URL, map[string]string{ 8627 "destinationBucket": c.destinationBucket, 8628 "destinationObject": c.destinationObject, 8629 }) 8630 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8631} 8632 8633// Do executes the "storage.objects.compose" call. 8634// Exactly one of *Object or error will be non-nil. Any non-2xx status 8635// code is an error. Response headers are in either 8636// *Object.ServerResponse.Header or (if a response was returned at all) 8637// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8638// check whether the returned error was because http.StatusNotModified 8639// was returned. 8640func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) { 8641 gensupport.SetOptions(c.urlParams_, opts...) 8642 res, err := c.doRequest("json") 8643 if res != nil && res.StatusCode == http.StatusNotModified { 8644 if res.Body != nil { 8645 res.Body.Close() 8646 } 8647 return nil, &googleapi.Error{ 8648 Code: res.StatusCode, 8649 Header: res.Header, 8650 } 8651 } 8652 if err != nil { 8653 return nil, err 8654 } 8655 defer googleapi.CloseBody(res) 8656 if err := googleapi.CheckResponse(res); err != nil { 8657 return nil, err 8658 } 8659 ret := &Object{ 8660 ServerResponse: googleapi.ServerResponse{ 8661 Header: res.Header, 8662 HTTPStatusCode: res.StatusCode, 8663 }, 8664 } 8665 target := &ret 8666 if err := gensupport.DecodeResponse(target, res); err != nil { 8667 return nil, err 8668 } 8669 return ret, nil 8670 // { 8671 // "description": "Concatenates a list of existing objects into a new object in the same bucket.", 8672 // "httpMethod": "POST", 8673 // "id": "storage.objects.compose", 8674 // "parameterOrder": [ 8675 // "destinationBucket", 8676 // "destinationObject" 8677 // ], 8678 // "parameters": { 8679 // "destinationBucket": { 8680 // "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", 8681 // "location": "path", 8682 // "required": true, 8683 // "type": "string" 8684 // }, 8685 // "destinationObject": { 8686 // "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8687 // "location": "path", 8688 // "required": true, 8689 // "type": "string" 8690 // }, 8691 // "destinationPredefinedAcl": { 8692 // "description": "Apply a predefined set of access controls to the destination object.", 8693 // "enum": [ 8694 // "authenticatedRead", 8695 // "bucketOwnerFullControl", 8696 // "bucketOwnerRead", 8697 // "private", 8698 // "projectPrivate", 8699 // "publicRead" 8700 // ], 8701 // "enumDescriptions": [ 8702 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 8703 // "Object owner gets OWNER access, and project team owners get OWNER access.", 8704 // "Object owner gets OWNER access, and project team owners get READER access.", 8705 // "Object owner gets OWNER access.", 8706 // "Object owner gets OWNER access, and project team members get access according to their roles.", 8707 // "Object owner gets OWNER access, and allUsers get READER access." 8708 // ], 8709 // "location": "query", 8710 // "type": "string" 8711 // }, 8712 // "ifGenerationMatch": { 8713 // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 8714 // "format": "int64", 8715 // "location": "query", 8716 // "type": "string" 8717 // }, 8718 // "ifMetagenerationMatch": { 8719 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 8720 // "format": "int64", 8721 // "location": "query", 8722 // "type": "string" 8723 // }, 8724 // "kmsKeyName": { 8725 // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", 8726 // "location": "query", 8727 // "type": "string" 8728 // }, 8729 // "provisionalUserProject": { 8730 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8731 // "location": "query", 8732 // "type": "string" 8733 // }, 8734 // "userProject": { 8735 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8736 // "location": "query", 8737 // "type": "string" 8738 // } 8739 // }, 8740 // "path": "b/{destinationBucket}/o/{destinationObject}/compose", 8741 // "request": { 8742 // "$ref": "ComposeRequest" 8743 // }, 8744 // "response": { 8745 // "$ref": "Object" 8746 // }, 8747 // "scopes": [ 8748 // "https://www.googleapis.com/auth/cloud-platform", 8749 // "https://www.googleapis.com/auth/devstorage.full_control", 8750 // "https://www.googleapis.com/auth/devstorage.read_write" 8751 // ] 8752 // } 8753 8754} 8755 8756// method id "storage.objects.copy": 8757 8758type ObjectsCopyCall struct { 8759 s *Service 8760 sourceBucket string 8761 sourceObject string 8762 destinationBucket string 8763 destinationObject string 8764 object *Object 8765 urlParams_ gensupport.URLParams 8766 ctx_ context.Context 8767 header_ http.Header 8768} 8769 8770// Copy: Copies a source object to a destination object. Optionally 8771// overrides metadata. 8772func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall { 8773 c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8774 c.sourceBucket = sourceBucket 8775 c.sourceObject = sourceObject 8776 c.destinationBucket = destinationBucket 8777 c.destinationObject = destinationObject 8778 c.object = object 8779 return c 8780} 8781 8782// DestinationKmsKeyName sets the optional parameter 8783// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the 8784// form 8785// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 8786// that will be used to encrypt the object. Overrides the object 8787// metadata's kms_key_name value, if any. 8788func (c *ObjectsCopyCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsCopyCall { 8789 c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName) 8790 return c 8791} 8792 8793// DestinationPredefinedAcl sets the optional parameter 8794// "destinationPredefinedAcl": Apply a predefined set of access controls 8795// to the destination object. 8796// 8797// Possible values: 8798// "authenticatedRead" - Object owner gets OWNER access, and 8799// allAuthenticatedUsers get READER access. 8800// "bucketOwnerFullControl" - Object owner gets OWNER access, and 8801// project team owners get OWNER access. 8802// "bucketOwnerRead" - Object owner gets OWNER access, and project 8803// team owners get READER access. 8804// "private" - Object owner gets OWNER access. 8805// "projectPrivate" - Object owner gets OWNER access, and project team 8806// members get access according to their roles. 8807// "publicRead" - Object owner gets OWNER access, and allUsers get 8808// READER access. 8809func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall { 8810 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) 8811 return c 8812} 8813 8814// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 8815// Makes the operation conditional on whether the destination object's 8816// current generation matches the given value. Setting to 0 makes the 8817// operation succeed only if there are no live versions of the object. 8818func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall { 8819 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 8820 return c 8821} 8822 8823// IfGenerationNotMatch sets the optional parameter 8824// "ifGenerationNotMatch": Makes the operation conditional on whether 8825// the destination object's current generation does not match the given 8826// value. If no live object exists, the precondition fails. Setting to 0 8827// makes the operation succeed only if there is a live version of the 8828// object. 8829func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall { 8830 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 8831 return c 8832} 8833 8834// IfMetagenerationMatch sets the optional parameter 8835// "ifMetagenerationMatch": Makes the operation conditional on whether 8836// the destination object's current metageneration matches the given 8837// value. 8838func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall { 8839 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 8840 return c 8841} 8842 8843// IfMetagenerationNotMatch sets the optional parameter 8844// "ifMetagenerationNotMatch": Makes the operation conditional on 8845// whether the destination object's current metageneration does not 8846// match the given value. 8847func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall { 8848 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 8849 return c 8850} 8851 8852// IfSourceGenerationMatch sets the optional parameter 8853// "ifSourceGenerationMatch": Makes the operation conditional on whether 8854// the source object's current generation matches the given value. 8855func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall { 8856 c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch)) 8857 return c 8858} 8859 8860// IfSourceGenerationNotMatch sets the optional parameter 8861// "ifSourceGenerationNotMatch": Makes the operation conditional on 8862// whether the source object's current generation does not match the 8863// given value. 8864func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall { 8865 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch)) 8866 return c 8867} 8868 8869// IfSourceMetagenerationMatch sets the optional parameter 8870// "ifSourceMetagenerationMatch": Makes the operation conditional on 8871// whether the source object's current metageneration matches the given 8872// value. 8873func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall { 8874 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch)) 8875 return c 8876} 8877 8878// IfSourceMetagenerationNotMatch sets the optional parameter 8879// "ifSourceMetagenerationNotMatch": Makes the operation conditional on 8880// whether the source object's current metageneration does not match the 8881// given value. 8882func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall { 8883 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch)) 8884 return c 8885} 8886 8887// Projection sets the optional parameter "projection": Set of 8888// properties to return. Defaults to noAcl, unless the object resource 8889// specifies the acl property, when it defaults to full. 8890// 8891// Possible values: 8892// "full" - Include all properties. 8893// "noAcl" - Omit the owner, acl property. 8894func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall { 8895 c.urlParams_.Set("projection", projection) 8896 return c 8897} 8898 8899// ProvisionalUserProject sets the optional parameter 8900// "provisionalUserProject": The project to be billed for this request 8901// if the target bucket is requester-pays bucket. 8902func (c *ObjectsCopyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsCopyCall { 8903 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8904 return c 8905} 8906 8907// SourceGeneration sets the optional parameter "sourceGeneration": If 8908// present, selects a specific revision of the source object (as opposed 8909// to the latest version, the default). 8910func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall { 8911 c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration)) 8912 return c 8913} 8914 8915// UserProject sets the optional parameter "userProject": The project to 8916// be billed for this request. Required for Requester Pays buckets. 8917func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall { 8918 c.urlParams_.Set("userProject", userProject) 8919 return c 8920} 8921 8922// Fields allows partial responses to be retrieved. See 8923// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8924// for more information. 8925func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall { 8926 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8927 return c 8928} 8929 8930// Context sets the context to be used in this call's Do method. Any 8931// pending HTTP request will be aborted if the provided context is 8932// canceled. 8933func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall { 8934 c.ctx_ = ctx 8935 return c 8936} 8937 8938// Header returns an http.Header that can be modified by the caller to 8939// add HTTP headers to the request. 8940func (c *ObjectsCopyCall) Header() http.Header { 8941 if c.header_ == nil { 8942 c.header_ = make(http.Header) 8943 } 8944 return c.header_ 8945} 8946 8947func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { 8948 reqHeaders := make(http.Header) 8949 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 8950 for k, v := range c.header_ { 8951 reqHeaders[k] = v 8952 } 8953 reqHeaders.Set("User-Agent", c.s.userAgent()) 8954 var body io.Reader = nil 8955 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) 8956 if err != nil { 8957 return nil, err 8958 } 8959 reqHeaders.Set("Content-Type", "application/json") 8960 c.urlParams_.Set("alt", alt) 8961 c.urlParams_.Set("prettyPrint", "false") 8962 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}") 8963 urls += "?" + c.urlParams_.Encode() 8964 req, err := http.NewRequest("POST", urls, body) 8965 if err != nil { 8966 return nil, err 8967 } 8968 req.Header = reqHeaders 8969 googleapi.Expand(req.URL, map[string]string{ 8970 "sourceBucket": c.sourceBucket, 8971 "sourceObject": c.sourceObject, 8972 "destinationBucket": c.destinationBucket, 8973 "destinationObject": c.destinationObject, 8974 }) 8975 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8976} 8977 8978// Do executes the "storage.objects.copy" call. 8979// Exactly one of *Object or error will be non-nil. Any non-2xx status 8980// code is an error. Response headers are in either 8981// *Object.ServerResponse.Header or (if a response was returned at all) 8982// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8983// check whether the returned error was because http.StatusNotModified 8984// was returned. 8985func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) { 8986 gensupport.SetOptions(c.urlParams_, opts...) 8987 res, err := c.doRequest("json") 8988 if res != nil && res.StatusCode == http.StatusNotModified { 8989 if res.Body != nil { 8990 res.Body.Close() 8991 } 8992 return nil, &googleapi.Error{ 8993 Code: res.StatusCode, 8994 Header: res.Header, 8995 } 8996 } 8997 if err != nil { 8998 return nil, err 8999 } 9000 defer googleapi.CloseBody(res) 9001 if err := googleapi.CheckResponse(res); err != nil { 9002 return nil, err 9003 } 9004 ret := &Object{ 9005 ServerResponse: googleapi.ServerResponse{ 9006 Header: res.Header, 9007 HTTPStatusCode: res.StatusCode, 9008 }, 9009 } 9010 target := &ret 9011 if err := gensupport.DecodeResponse(target, res); err != nil { 9012 return nil, err 9013 } 9014 return ret, nil 9015 // { 9016 // "description": "Copies a source object to a destination object. Optionally overrides metadata.", 9017 // "httpMethod": "POST", 9018 // "id": "storage.objects.copy", 9019 // "parameterOrder": [ 9020 // "sourceBucket", 9021 // "sourceObject", 9022 // "destinationBucket", 9023 // "destinationObject" 9024 // ], 9025 // "parameters": { 9026 // "destinationBucket": { 9027 // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9028 // "location": "path", 9029 // "required": true, 9030 // "type": "string" 9031 // }, 9032 // "destinationKmsKeyName": { 9033 // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", 9034 // "location": "query", 9035 // "type": "string" 9036 // }, 9037 // "destinationObject": { 9038 // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", 9039 // "location": "path", 9040 // "required": true, 9041 // "type": "string" 9042 // }, 9043 // "destinationPredefinedAcl": { 9044 // "description": "Apply a predefined set of access controls to the destination object.", 9045 // "enum": [ 9046 // "authenticatedRead", 9047 // "bucketOwnerFullControl", 9048 // "bucketOwnerRead", 9049 // "private", 9050 // "projectPrivate", 9051 // "publicRead" 9052 // ], 9053 // "enumDescriptions": [ 9054 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 9055 // "Object owner gets OWNER access, and project team owners get OWNER access.", 9056 // "Object owner gets OWNER access, and project team owners get READER access.", 9057 // "Object owner gets OWNER access.", 9058 // "Object owner gets OWNER access, and project team members get access according to their roles.", 9059 // "Object owner gets OWNER access, and allUsers get READER access." 9060 // ], 9061 // "location": "query", 9062 // "type": "string" 9063 // }, 9064 // "ifGenerationMatch": { 9065 // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 9066 // "format": "int64", 9067 // "location": "query", 9068 // "type": "string" 9069 // }, 9070 // "ifGenerationNotMatch": { 9071 // "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", 9072 // "format": "int64", 9073 // "location": "query", 9074 // "type": "string" 9075 // }, 9076 // "ifMetagenerationMatch": { 9077 // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", 9078 // "format": "int64", 9079 // "location": "query", 9080 // "type": "string" 9081 // }, 9082 // "ifMetagenerationNotMatch": { 9083 // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", 9084 // "format": "int64", 9085 // "location": "query", 9086 // "type": "string" 9087 // }, 9088 // "ifSourceGenerationMatch": { 9089 // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", 9090 // "format": "int64", 9091 // "location": "query", 9092 // "type": "string" 9093 // }, 9094 // "ifSourceGenerationNotMatch": { 9095 // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", 9096 // "format": "int64", 9097 // "location": "query", 9098 // "type": "string" 9099 // }, 9100 // "ifSourceMetagenerationMatch": { 9101 // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", 9102 // "format": "int64", 9103 // "location": "query", 9104 // "type": "string" 9105 // }, 9106 // "ifSourceMetagenerationNotMatch": { 9107 // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", 9108 // "format": "int64", 9109 // "location": "query", 9110 // "type": "string" 9111 // }, 9112 // "projection": { 9113 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", 9114 // "enum": [ 9115 // "full", 9116 // "noAcl" 9117 // ], 9118 // "enumDescriptions": [ 9119 // "Include all properties.", 9120 // "Omit the owner, acl property." 9121 // ], 9122 // "location": "query", 9123 // "type": "string" 9124 // }, 9125 // "provisionalUserProject": { 9126 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 9127 // "location": "query", 9128 // "type": "string" 9129 // }, 9130 // "sourceBucket": { 9131 // "description": "Name of the bucket in which to find the source object.", 9132 // "location": "path", 9133 // "required": true, 9134 // "type": "string" 9135 // }, 9136 // "sourceGeneration": { 9137 // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", 9138 // "format": "int64", 9139 // "location": "query", 9140 // "type": "string" 9141 // }, 9142 // "sourceObject": { 9143 // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9144 // "location": "path", 9145 // "required": true, 9146 // "type": "string" 9147 // }, 9148 // "userProject": { 9149 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 9150 // "location": "query", 9151 // "type": "string" 9152 // } 9153 // }, 9154 // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", 9155 // "request": { 9156 // "$ref": "Object" 9157 // }, 9158 // "response": { 9159 // "$ref": "Object" 9160 // }, 9161 // "scopes": [ 9162 // "https://www.googleapis.com/auth/cloud-platform", 9163 // "https://www.googleapis.com/auth/devstorage.full_control", 9164 // "https://www.googleapis.com/auth/devstorage.read_write" 9165 // ] 9166 // } 9167 9168} 9169 9170// method id "storage.objects.delete": 9171 9172type ObjectsDeleteCall struct { 9173 s *Service 9174 bucket string 9175 object string 9176 urlParams_ gensupport.URLParams 9177 ctx_ context.Context 9178 header_ http.Header 9179} 9180 9181// Delete: Deletes an object and its metadata. Deletions are permanent 9182// if versioning is not enabled for the bucket, or if the generation 9183// parameter is used. 9184func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall { 9185 c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9186 c.bucket = bucket 9187 c.object = object 9188 return c 9189} 9190 9191// Generation sets the optional parameter "generation": If present, 9192// permanently deletes a specific revision of this object (as opposed to 9193// the latest version, the default). 9194func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall { 9195 c.urlParams_.Set("generation", fmt.Sprint(generation)) 9196 return c 9197} 9198 9199// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 9200// Makes the operation conditional on whether the object's current 9201// generation matches the given value. Setting to 0 makes the operation 9202// succeed only if there are no live versions of the object. 9203func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall { 9204 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 9205 return c 9206} 9207 9208// IfGenerationNotMatch sets the optional parameter 9209// "ifGenerationNotMatch": Makes the operation conditional on whether 9210// the object's current generation does not match the given value. If no 9211// live object exists, the precondition fails. Setting to 0 makes the 9212// operation succeed only if there is a live version of the object. 9213func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall { 9214 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 9215 return c 9216} 9217 9218// IfMetagenerationMatch sets the optional parameter 9219// "ifMetagenerationMatch": Makes the operation conditional on whether 9220// the object's current metageneration matches the given value. 9221func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall { 9222 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 9223 return c 9224} 9225 9226// IfMetagenerationNotMatch sets the optional parameter 9227// "ifMetagenerationNotMatch": Makes the operation conditional on 9228// whether the object's current metageneration does not match the given 9229// value. 9230func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall { 9231 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 9232 return c 9233} 9234 9235// ProvisionalUserProject sets the optional parameter 9236// "provisionalUserProject": The project to be billed for this request 9237// if the target bucket is requester-pays bucket. 9238func (c *ObjectsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsDeleteCall { 9239 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9240 return c 9241} 9242 9243// UserProject sets the optional parameter "userProject": The project to 9244// be billed for this request. Required for Requester Pays buckets. 9245func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall { 9246 c.urlParams_.Set("userProject", userProject) 9247 return c 9248} 9249 9250// Fields allows partial responses to be retrieved. See 9251// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9252// for more information. 9253func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall { 9254 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9255 return c 9256} 9257 9258// Context sets the context to be used in this call's Do method. Any 9259// pending HTTP request will be aborted if the provided context is 9260// canceled. 9261func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall { 9262 c.ctx_ = ctx 9263 return c 9264} 9265 9266// Header returns an http.Header that can be modified by the caller to 9267// add HTTP headers to the request. 9268func (c *ObjectsDeleteCall) Header() http.Header { 9269 if c.header_ == nil { 9270 c.header_ = make(http.Header) 9271 } 9272 return c.header_ 9273} 9274 9275func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { 9276 reqHeaders := make(http.Header) 9277 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9278 for k, v := range c.header_ { 9279 reqHeaders[k] = v 9280 } 9281 reqHeaders.Set("User-Agent", c.s.userAgent()) 9282 var body io.Reader = nil 9283 c.urlParams_.Set("alt", alt) 9284 c.urlParams_.Set("prettyPrint", "false") 9285 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 9286 urls += "?" + c.urlParams_.Encode() 9287 req, err := http.NewRequest("DELETE", urls, body) 9288 if err != nil { 9289 return nil, err 9290 } 9291 req.Header = reqHeaders 9292 googleapi.Expand(req.URL, map[string]string{ 9293 "bucket": c.bucket, 9294 "object": c.object, 9295 }) 9296 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9297} 9298 9299// Do executes the "storage.objects.delete" call. 9300func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error { 9301 gensupport.SetOptions(c.urlParams_, opts...) 9302 res, err := c.doRequest("json") 9303 if err != nil { 9304 return err 9305 } 9306 defer googleapi.CloseBody(res) 9307 if err := googleapi.CheckResponse(res); err != nil { 9308 return err 9309 } 9310 return nil 9311 // { 9312 // "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", 9313 // "httpMethod": "DELETE", 9314 // "id": "storage.objects.delete", 9315 // "parameterOrder": [ 9316 // "bucket", 9317 // "object" 9318 // ], 9319 // "parameters": { 9320 // "bucket": { 9321 // "description": "Name of the bucket in which the object resides.", 9322 // "location": "path", 9323 // "required": true, 9324 // "type": "string" 9325 // }, 9326 // "generation": { 9327 // "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", 9328 // "format": "int64", 9329 // "location": "query", 9330 // "type": "string" 9331 // }, 9332 // "ifGenerationMatch": { 9333 // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 9334 // "format": "int64", 9335 // "location": "query", 9336 // "type": "string" 9337 // }, 9338 // "ifGenerationNotMatch": { 9339 // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", 9340 // "format": "int64", 9341 // "location": "query", 9342 // "type": "string" 9343 // }, 9344 // "ifMetagenerationMatch": { 9345 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 9346 // "format": "int64", 9347 // "location": "query", 9348 // "type": "string" 9349 // }, 9350 // "ifMetagenerationNotMatch": { 9351 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 9352 // "format": "int64", 9353 // "location": "query", 9354 // "type": "string" 9355 // }, 9356 // "object": { 9357 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9358 // "location": "path", 9359 // "required": true, 9360 // "type": "string" 9361 // }, 9362 // "provisionalUserProject": { 9363 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 9364 // "location": "query", 9365 // "type": "string" 9366 // }, 9367 // "userProject": { 9368 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 9369 // "location": "query", 9370 // "type": "string" 9371 // } 9372 // }, 9373 // "path": "b/{bucket}/o/{object}", 9374 // "scopes": [ 9375 // "https://www.googleapis.com/auth/cloud-platform", 9376 // "https://www.googleapis.com/auth/devstorage.full_control", 9377 // "https://www.googleapis.com/auth/devstorage.read_write" 9378 // ] 9379 // } 9380 9381} 9382 9383// method id "storage.objects.get": 9384 9385type ObjectsGetCall struct { 9386 s *Service 9387 bucket string 9388 object string 9389 urlParams_ gensupport.URLParams 9390 ifNoneMatch_ string 9391 ctx_ context.Context 9392 header_ http.Header 9393} 9394 9395// Get: Retrieves an object or its metadata. 9396func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall { 9397 c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9398 c.bucket = bucket 9399 c.object = object 9400 return c 9401} 9402 9403// Generation sets the optional parameter "generation": If present, 9404// selects a specific revision of this object (as opposed to the latest 9405// version, the default). 9406func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall { 9407 c.urlParams_.Set("generation", fmt.Sprint(generation)) 9408 return c 9409} 9410 9411// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 9412// Makes the operation conditional on whether the object's current 9413// generation matches the given value. Setting to 0 makes the operation 9414// succeed only if there are no live versions of the object. 9415func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall { 9416 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 9417 return c 9418} 9419 9420// IfGenerationNotMatch sets the optional parameter 9421// "ifGenerationNotMatch": Makes the operation conditional on whether 9422// the object's current generation does not match the given value. If no 9423// live object exists, the precondition fails. Setting to 0 makes the 9424// operation succeed only if there is a live version of the object. 9425func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall { 9426 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 9427 return c 9428} 9429 9430// IfMetagenerationMatch sets the optional parameter 9431// "ifMetagenerationMatch": Makes the operation conditional on whether 9432// the object's current metageneration matches the given value. 9433func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall { 9434 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 9435 return c 9436} 9437 9438// IfMetagenerationNotMatch sets the optional parameter 9439// "ifMetagenerationNotMatch": Makes the operation conditional on 9440// whether the object's current metageneration does not match the given 9441// value. 9442func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall { 9443 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 9444 return c 9445} 9446 9447// Projection sets the optional parameter "projection": Set of 9448// properties to return. Defaults to noAcl. 9449// 9450// Possible values: 9451// "full" - Include all properties. 9452// "noAcl" - Omit the owner, acl property. 9453func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { 9454 c.urlParams_.Set("projection", projection) 9455 return c 9456} 9457 9458// ProvisionalUserProject sets the optional parameter 9459// "provisionalUserProject": The project to be billed for this request 9460// if the target bucket is requester-pays bucket. 9461func (c *ObjectsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetCall { 9462 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9463 return c 9464} 9465 9466// UserProject sets the optional parameter "userProject": The project to 9467// be billed for this request. Required for Requester Pays buckets. 9468func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall { 9469 c.urlParams_.Set("userProject", userProject) 9470 return c 9471} 9472 9473// Fields allows partial responses to be retrieved. See 9474// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9475// for more information. 9476func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall { 9477 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9478 return c 9479} 9480 9481// IfNoneMatch sets the optional parameter which makes the operation 9482// fail if the object's ETag matches the given value. This is useful for 9483// getting updates only after the object has changed since the last 9484// request. Use googleapi.IsNotModified to check whether the response 9485// error from Do is the result of In-None-Match. 9486func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall { 9487 c.ifNoneMatch_ = entityTag 9488 return c 9489} 9490 9491// Context sets the context to be used in this call's Do and Download 9492// methods. Any pending HTTP request will be aborted if the provided 9493// context is canceled. 9494func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall { 9495 c.ctx_ = ctx 9496 return c 9497} 9498 9499// Header returns an http.Header that can be modified by the caller to 9500// add HTTP headers to the request. 9501func (c *ObjectsGetCall) Header() http.Header { 9502 if c.header_ == nil { 9503 c.header_ = make(http.Header) 9504 } 9505 return c.header_ 9506} 9507 9508func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { 9509 reqHeaders := make(http.Header) 9510 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9511 for k, v := range c.header_ { 9512 reqHeaders[k] = v 9513 } 9514 reqHeaders.Set("User-Agent", c.s.userAgent()) 9515 if c.ifNoneMatch_ != "" { 9516 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9517 } 9518 var body io.Reader = nil 9519 c.urlParams_.Set("alt", alt) 9520 c.urlParams_.Set("prettyPrint", "false") 9521 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 9522 urls += "?" + c.urlParams_.Encode() 9523 req, err := http.NewRequest("GET", urls, body) 9524 if err != nil { 9525 return nil, err 9526 } 9527 req.Header = reqHeaders 9528 googleapi.Expand(req.URL, map[string]string{ 9529 "bucket": c.bucket, 9530 "object": c.object, 9531 }) 9532 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9533} 9534 9535// Download fetches the API endpoint's "media" value, instead of the normal 9536// API response value. If the returned error is nil, the Response is guaranteed to 9537// have a 2xx status code. Callers must close the Response.Body as usual. 9538func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 9539 gensupport.SetOptions(c.urlParams_, opts...) 9540 res, err := c.doRequest("media") 9541 if err != nil { 9542 return nil, err 9543 } 9544 if err := googleapi.CheckMediaResponse(res); err != nil { 9545 res.Body.Close() 9546 return nil, err 9547 } 9548 return res, nil 9549} 9550 9551// Do executes the "storage.objects.get" call. 9552// Exactly one of *Object or error will be non-nil. Any non-2xx status 9553// code is an error. Response headers are in either 9554// *Object.ServerResponse.Header or (if a response was returned at all) 9555// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9556// check whether the returned error was because http.StatusNotModified 9557// was returned. 9558func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) { 9559 gensupport.SetOptions(c.urlParams_, opts...) 9560 res, err := c.doRequest("json") 9561 if res != nil && res.StatusCode == http.StatusNotModified { 9562 if res.Body != nil { 9563 res.Body.Close() 9564 } 9565 return nil, &googleapi.Error{ 9566 Code: res.StatusCode, 9567 Header: res.Header, 9568 } 9569 } 9570 if err != nil { 9571 return nil, err 9572 } 9573 defer googleapi.CloseBody(res) 9574 if err := googleapi.CheckResponse(res); err != nil { 9575 return nil, err 9576 } 9577 ret := &Object{ 9578 ServerResponse: googleapi.ServerResponse{ 9579 Header: res.Header, 9580 HTTPStatusCode: res.StatusCode, 9581 }, 9582 } 9583 target := &ret 9584 if err := gensupport.DecodeResponse(target, res); err != nil { 9585 return nil, err 9586 } 9587 return ret, nil 9588 // { 9589 // "description": "Retrieves an object or its metadata.", 9590 // "httpMethod": "GET", 9591 // "id": "storage.objects.get", 9592 // "parameterOrder": [ 9593 // "bucket", 9594 // "object" 9595 // ], 9596 // "parameters": { 9597 // "bucket": { 9598 // "description": "Name of the bucket in which the object resides.", 9599 // "location": "path", 9600 // "required": true, 9601 // "type": "string" 9602 // }, 9603 // "generation": { 9604 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 9605 // "format": "int64", 9606 // "location": "query", 9607 // "type": "string" 9608 // }, 9609 // "ifGenerationMatch": { 9610 // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 9611 // "format": "int64", 9612 // "location": "query", 9613 // "type": "string" 9614 // }, 9615 // "ifGenerationNotMatch": { 9616 // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", 9617 // "format": "int64", 9618 // "location": "query", 9619 // "type": "string" 9620 // }, 9621 // "ifMetagenerationMatch": { 9622 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 9623 // "format": "int64", 9624 // "location": "query", 9625 // "type": "string" 9626 // }, 9627 // "ifMetagenerationNotMatch": { 9628 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 9629 // "format": "int64", 9630 // "location": "query", 9631 // "type": "string" 9632 // }, 9633 // "object": { 9634 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9635 // "location": "path", 9636 // "required": true, 9637 // "type": "string" 9638 // }, 9639 // "projection": { 9640 // "description": "Set of properties to return. Defaults to noAcl.", 9641 // "enum": [ 9642 // "full", 9643 // "noAcl" 9644 // ], 9645 // "enumDescriptions": [ 9646 // "Include all properties.", 9647 // "Omit the owner, acl property." 9648 // ], 9649 // "location": "query", 9650 // "type": "string" 9651 // }, 9652 // "provisionalUserProject": { 9653 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 9654 // "location": "query", 9655 // "type": "string" 9656 // }, 9657 // "userProject": { 9658 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 9659 // "location": "query", 9660 // "type": "string" 9661 // } 9662 // }, 9663 // "path": "b/{bucket}/o/{object}", 9664 // "response": { 9665 // "$ref": "Object" 9666 // }, 9667 // "scopes": [ 9668 // "https://www.googleapis.com/auth/cloud-platform", 9669 // "https://www.googleapis.com/auth/cloud-platform.read-only", 9670 // "https://www.googleapis.com/auth/devstorage.full_control", 9671 // "https://www.googleapis.com/auth/devstorage.read_only", 9672 // "https://www.googleapis.com/auth/devstorage.read_write" 9673 // ], 9674 // "supportsMediaDownload": true, 9675 // "useMediaDownloadService": true 9676 // } 9677 9678} 9679 9680// method id "storage.objects.getIamPolicy": 9681 9682type ObjectsGetIamPolicyCall struct { 9683 s *Service 9684 bucket string 9685 object string 9686 urlParams_ gensupport.URLParams 9687 ifNoneMatch_ string 9688 ctx_ context.Context 9689 header_ http.Header 9690} 9691 9692// GetIamPolicy: Returns an IAM policy for the specified object. 9693func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall { 9694 c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9695 c.bucket = bucket 9696 c.object = object 9697 return c 9698} 9699 9700// Generation sets the optional parameter "generation": If present, 9701// selects a specific revision of this object (as opposed to the latest 9702// version, the default). 9703func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall { 9704 c.urlParams_.Set("generation", fmt.Sprint(generation)) 9705 return c 9706} 9707 9708// ProvisionalUserProject sets the optional parameter 9709// "provisionalUserProject": The project to be billed for this request 9710// if the target bucket is requester-pays bucket. 9711func (c *ObjectsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetIamPolicyCall { 9712 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9713 return c 9714} 9715 9716// UserProject sets the optional parameter "userProject": The project to 9717// be billed for this request. Required for Requester Pays buckets. 9718func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall { 9719 c.urlParams_.Set("userProject", userProject) 9720 return c 9721} 9722 9723// Fields allows partial responses to be retrieved. See 9724// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9725// for more information. 9726func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall { 9727 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9728 return c 9729} 9730 9731// IfNoneMatch sets the optional parameter which makes the operation 9732// fail if the object's ETag matches the given value. This is useful for 9733// getting updates only after the object has changed since the last 9734// request. Use googleapi.IsNotModified to check whether the response 9735// error from Do is the result of In-None-Match. 9736func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall { 9737 c.ifNoneMatch_ = entityTag 9738 return c 9739} 9740 9741// Context sets the context to be used in this call's Do method. Any 9742// pending HTTP request will be aborted if the provided context is 9743// canceled. 9744func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall { 9745 c.ctx_ = ctx 9746 return c 9747} 9748 9749// Header returns an http.Header that can be modified by the caller to 9750// add HTTP headers to the request. 9751func (c *ObjectsGetIamPolicyCall) Header() http.Header { 9752 if c.header_ == nil { 9753 c.header_ = make(http.Header) 9754 } 9755 return c.header_ 9756} 9757 9758func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 9759 reqHeaders := make(http.Header) 9760 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 9761 for k, v := range c.header_ { 9762 reqHeaders[k] = v 9763 } 9764 reqHeaders.Set("User-Agent", c.s.userAgent()) 9765 if c.ifNoneMatch_ != "" { 9766 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9767 } 9768 var body io.Reader = nil 9769 c.urlParams_.Set("alt", alt) 9770 c.urlParams_.Set("prettyPrint", "false") 9771 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam") 9772 urls += "?" + c.urlParams_.Encode() 9773 req, err := http.NewRequest("GET", urls, body) 9774 if err != nil { 9775 return nil, err 9776 } 9777 req.Header = reqHeaders 9778 googleapi.Expand(req.URL, map[string]string{ 9779 "bucket": c.bucket, 9780 "object": c.object, 9781 }) 9782 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9783} 9784 9785// Do executes the "storage.objects.getIamPolicy" call. 9786// Exactly one of *Policy or error will be non-nil. Any non-2xx status 9787// code is an error. Response headers are in either 9788// *Policy.ServerResponse.Header or (if a response was returned at all) 9789// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9790// check whether the returned error was because http.StatusNotModified 9791// was returned. 9792func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 9793 gensupport.SetOptions(c.urlParams_, opts...) 9794 res, err := c.doRequest("json") 9795 if res != nil && res.StatusCode == http.StatusNotModified { 9796 if res.Body != nil { 9797 res.Body.Close() 9798 } 9799 return nil, &googleapi.Error{ 9800 Code: res.StatusCode, 9801 Header: res.Header, 9802 } 9803 } 9804 if err != nil { 9805 return nil, err 9806 } 9807 defer googleapi.CloseBody(res) 9808 if err := googleapi.CheckResponse(res); err != nil { 9809 return nil, err 9810 } 9811 ret := &Policy{ 9812 ServerResponse: googleapi.ServerResponse{ 9813 Header: res.Header, 9814 HTTPStatusCode: res.StatusCode, 9815 }, 9816 } 9817 target := &ret 9818 if err := gensupport.DecodeResponse(target, res); err != nil { 9819 return nil, err 9820 } 9821 return ret, nil 9822 // { 9823 // "description": "Returns an IAM policy for the specified object.", 9824 // "httpMethod": "GET", 9825 // "id": "storage.objects.getIamPolicy", 9826 // "parameterOrder": [ 9827 // "bucket", 9828 // "object" 9829 // ], 9830 // "parameters": { 9831 // "bucket": { 9832 // "description": "Name of the bucket in which the object resides.", 9833 // "location": "path", 9834 // "required": true, 9835 // "type": "string" 9836 // }, 9837 // "generation": { 9838 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 9839 // "format": "int64", 9840 // "location": "query", 9841 // "type": "string" 9842 // }, 9843 // "object": { 9844 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9845 // "location": "path", 9846 // "required": true, 9847 // "type": "string" 9848 // }, 9849 // "provisionalUserProject": { 9850 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 9851 // "location": "query", 9852 // "type": "string" 9853 // }, 9854 // "userProject": { 9855 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 9856 // "location": "query", 9857 // "type": "string" 9858 // } 9859 // }, 9860 // "path": "b/{bucket}/o/{object}/iam", 9861 // "response": { 9862 // "$ref": "Policy" 9863 // }, 9864 // "scopes": [ 9865 // "https://www.googleapis.com/auth/cloud-platform", 9866 // "https://www.googleapis.com/auth/cloud-platform.read-only", 9867 // "https://www.googleapis.com/auth/devstorage.full_control", 9868 // "https://www.googleapis.com/auth/devstorage.read_only", 9869 // "https://www.googleapis.com/auth/devstorage.read_write" 9870 // ] 9871 // } 9872 9873} 9874 9875// method id "storage.objects.insert": 9876 9877type ObjectsInsertCall struct { 9878 s *Service 9879 bucket string 9880 object *Object 9881 urlParams_ gensupport.URLParams 9882 mediaInfo_ *gensupport.MediaInfo 9883 ctx_ context.Context 9884 header_ http.Header 9885} 9886 9887// Insert: Stores a new object and metadata. 9888func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall { 9889 c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9890 c.bucket = bucket 9891 c.object = object 9892 return c 9893} 9894 9895// ContentEncoding sets the optional parameter "contentEncoding": If 9896// set, sets the contentEncoding property of the final object to this 9897// value. Setting this parameter is equivalent to setting the 9898// contentEncoding metadata property. This can be useful when uploading 9899// an object with uploadType=media to indicate the encoding of the 9900// content being uploaded. 9901func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall { 9902 c.urlParams_.Set("contentEncoding", contentEncoding) 9903 return c 9904} 9905 9906// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 9907// Makes the operation conditional on whether the object's current 9908// generation matches the given value. Setting to 0 makes the operation 9909// succeed only if there are no live versions of the object. 9910func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall { 9911 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 9912 return c 9913} 9914 9915// IfGenerationNotMatch sets the optional parameter 9916// "ifGenerationNotMatch": Makes the operation conditional on whether 9917// the object's current generation does not match the given value. If no 9918// live object exists, the precondition fails. Setting to 0 makes the 9919// operation succeed only if there is a live version of the object. 9920func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall { 9921 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 9922 return c 9923} 9924 9925// IfMetagenerationMatch sets the optional parameter 9926// "ifMetagenerationMatch": Makes the operation conditional on whether 9927// the object's current metageneration matches the given value. 9928func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall { 9929 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 9930 return c 9931} 9932 9933// IfMetagenerationNotMatch sets the optional parameter 9934// "ifMetagenerationNotMatch": Makes the operation conditional on 9935// whether the object's current metageneration does not match the given 9936// value. 9937func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall { 9938 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 9939 return c 9940} 9941 9942// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of 9943// the Cloud KMS key, of the form 9944// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 9945// that will be used to encrypt the object. Overrides the object 9946// metadata's kms_key_name value, if any. 9947func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall { 9948 c.urlParams_.Set("kmsKeyName", kmsKeyName) 9949 return c 9950} 9951 9952// Name sets the optional parameter "name": Name of the object. Required 9953// when the object metadata is not otherwise provided. Overrides the 9954// object metadata's name value, if any. For information about how to 9955// URL encode object names to be path safe, see Encoding URI Path Parts. 9956func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall { 9957 c.urlParams_.Set("name", name) 9958 return c 9959} 9960 9961// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 9962// predefined set of access controls to this object. 9963// 9964// Possible values: 9965// "authenticatedRead" - Object owner gets OWNER access, and 9966// allAuthenticatedUsers get READER access. 9967// "bucketOwnerFullControl" - Object owner gets OWNER access, and 9968// project team owners get OWNER access. 9969// "bucketOwnerRead" - Object owner gets OWNER access, and project 9970// team owners get READER access. 9971// "private" - Object owner gets OWNER access. 9972// "projectPrivate" - Object owner gets OWNER access, and project team 9973// members get access according to their roles. 9974// "publicRead" - Object owner gets OWNER access, and allUsers get 9975// READER access. 9976func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall { 9977 c.urlParams_.Set("predefinedAcl", predefinedAcl) 9978 return c 9979} 9980 9981// Projection sets the optional parameter "projection": Set of 9982// properties to return. Defaults to noAcl, unless the object resource 9983// specifies the acl property, when it defaults to full. 9984// 9985// Possible values: 9986// "full" - Include all properties. 9987// "noAcl" - Omit the owner, acl property. 9988func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { 9989 c.urlParams_.Set("projection", projection) 9990 return c 9991} 9992 9993// ProvisionalUserProject sets the optional parameter 9994// "provisionalUserProject": The project to be billed for this request 9995// if the target bucket is requester-pays bucket. 9996func (c *ObjectsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsInsertCall { 9997 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9998 return c 9999} 10000 10001// UserProject sets the optional parameter "userProject": The project to 10002// be billed for this request. Required for Requester Pays buckets. 10003func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall { 10004 c.urlParams_.Set("userProject", userProject) 10005 return c 10006} 10007 10008// Media specifies the media to upload in one or more chunks. The chunk 10009// size may be controlled by supplying a MediaOption generated by 10010// googleapi.ChunkSize. The chunk size defaults to 10011// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 10012// upload request will be determined by sniffing the contents of r, 10013// unless a MediaOption generated by googleapi.ContentType is 10014// supplied. 10015// At most one of Media and ResumableMedia may be set. 10016func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall { 10017 if ct := c.object.ContentType; ct != "" { 10018 options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...) 10019 } 10020 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 10021 return c 10022} 10023 10024// ResumableMedia specifies the media to upload in chunks and can be 10025// canceled with ctx. 10026// 10027// Deprecated: use Media instead. 10028// 10029// At most one of Media and ResumableMedia may be set. mediaType 10030// identifies the MIME media type of the upload, such as "image/png". If 10031// mediaType is "", it will be auto-detected. The provided ctx will 10032// supersede any context previously provided to the Context method. 10033func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall { 10034 c.ctx_ = ctx 10035 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 10036 return c 10037} 10038 10039// ProgressUpdater provides a callback function that will be called 10040// after every chunk. It should be a low-latency function in order to 10041// not slow down the upload operation. This should only be called when 10042// using ResumableMedia (as opposed to Media). 10043func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall { 10044 c.mediaInfo_.SetProgressUpdater(pu) 10045 return c 10046} 10047 10048// Fields allows partial responses to be retrieved. See 10049// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10050// for more information. 10051func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall { 10052 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10053 return c 10054} 10055 10056// Context sets the context to be used in this call's Do method. Any 10057// pending HTTP request will be aborted if the provided context is 10058// canceled. 10059// This context will supersede any context previously provided to the 10060// ResumableMedia method. 10061func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall { 10062 c.ctx_ = ctx 10063 return c 10064} 10065 10066// Header returns an http.Header that can be modified by the caller to 10067// add HTTP headers to the request. 10068func (c *ObjectsInsertCall) Header() http.Header { 10069 if c.header_ == nil { 10070 c.header_ = make(http.Header) 10071 } 10072 return c.header_ 10073} 10074 10075func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { 10076 reqHeaders := make(http.Header) 10077 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10078 for k, v := range c.header_ { 10079 reqHeaders[k] = v 10080 } 10081 reqHeaders.Set("User-Agent", c.s.userAgent()) 10082 var body io.Reader = nil 10083 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) 10084 if err != nil { 10085 return nil, err 10086 } 10087 reqHeaders.Set("Content-Type", "application/json") 10088 c.urlParams_.Set("alt", alt) 10089 c.urlParams_.Set("prettyPrint", "false") 10090 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") 10091 if c.mediaInfo_ != nil { 10092 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1/b/{bucket}/o") 10093 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 10094 } 10095 if body == nil { 10096 body = new(bytes.Buffer) 10097 reqHeaders.Set("Content-Type", "application/json") 10098 } 10099 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 10100 defer cleanup() 10101 urls += "?" + c.urlParams_.Encode() 10102 req, err := http.NewRequest("POST", urls, body) 10103 if err != nil { 10104 return nil, err 10105 } 10106 req.Header = reqHeaders 10107 req.GetBody = getBody 10108 googleapi.Expand(req.URL, map[string]string{ 10109 "bucket": c.bucket, 10110 }) 10111 return gensupport.SendRequestWithRetry(c.ctx_, c.s.client, req) 10112} 10113 10114// Do executes the "storage.objects.insert" call. 10115// Exactly one of *Object or error will be non-nil. Any non-2xx status 10116// code is an error. Response headers are in either 10117// *Object.ServerResponse.Header or (if a response was returned at all) 10118// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10119// check whether the returned error was because http.StatusNotModified 10120// was returned. 10121func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) { 10122 gensupport.SetOptions(c.urlParams_, opts...) 10123 res, err := c.doRequest("json") 10124 if res != nil && res.StatusCode == http.StatusNotModified { 10125 if res.Body != nil { 10126 res.Body.Close() 10127 } 10128 return nil, &googleapi.Error{ 10129 Code: res.StatusCode, 10130 Header: res.Header, 10131 } 10132 } 10133 if err != nil { 10134 return nil, err 10135 } 10136 defer googleapi.CloseBody(res) 10137 if err := googleapi.CheckResponse(res); err != nil { 10138 return nil, err 10139 } 10140 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 10141 if rx != nil { 10142 rx.Client = c.s.client 10143 rx.UserAgent = c.s.userAgent() 10144 ctx := c.ctx_ 10145 if ctx == nil { 10146 ctx = context.TODO() 10147 } 10148 res, err = rx.Upload(ctx) 10149 if err != nil { 10150 return nil, err 10151 } 10152 defer res.Body.Close() 10153 if err := googleapi.CheckResponse(res); err != nil { 10154 return nil, err 10155 } 10156 } 10157 ret := &Object{ 10158 ServerResponse: googleapi.ServerResponse{ 10159 Header: res.Header, 10160 HTTPStatusCode: res.StatusCode, 10161 }, 10162 } 10163 target := &ret 10164 if err := gensupport.DecodeResponse(target, res); err != nil { 10165 return nil, err 10166 } 10167 return ret, nil 10168 // { 10169 // "description": "Stores a new object and metadata.", 10170 // "httpMethod": "POST", 10171 // "id": "storage.objects.insert", 10172 // "mediaUpload": { 10173 // "accept": [ 10174 // "*/*" 10175 // ], 10176 // "protocols": { 10177 // "resumable": { 10178 // "multipart": true, 10179 // "path": "/resumable/upload/storage/v1/b/{bucket}/o" 10180 // }, 10181 // "simple": { 10182 // "multipart": true, 10183 // "path": "/upload/storage/v1/b/{bucket}/o" 10184 // } 10185 // } 10186 // }, 10187 // "parameterOrder": [ 10188 // "bucket" 10189 // ], 10190 // "parameters": { 10191 // "bucket": { 10192 // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", 10193 // "location": "path", 10194 // "required": true, 10195 // "type": "string" 10196 // }, 10197 // "contentEncoding": { 10198 // "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", 10199 // "location": "query", 10200 // "type": "string" 10201 // }, 10202 // "ifGenerationMatch": { 10203 // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 10204 // "format": "int64", 10205 // "location": "query", 10206 // "type": "string" 10207 // }, 10208 // "ifGenerationNotMatch": { 10209 // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", 10210 // "format": "int64", 10211 // "location": "query", 10212 // "type": "string" 10213 // }, 10214 // "ifMetagenerationMatch": { 10215 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 10216 // "format": "int64", 10217 // "location": "query", 10218 // "type": "string" 10219 // }, 10220 // "ifMetagenerationNotMatch": { 10221 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 10222 // "format": "int64", 10223 // "location": "query", 10224 // "type": "string" 10225 // }, 10226 // "kmsKeyName": { 10227 // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", 10228 // "location": "query", 10229 // "type": "string" 10230 // }, 10231 // "name": { 10232 // "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 10233 // "location": "query", 10234 // "type": "string" 10235 // }, 10236 // "predefinedAcl": { 10237 // "description": "Apply a predefined set of access controls to this object.", 10238 // "enum": [ 10239 // "authenticatedRead", 10240 // "bucketOwnerFullControl", 10241 // "bucketOwnerRead", 10242 // "private", 10243 // "projectPrivate", 10244 // "publicRead" 10245 // ], 10246 // "enumDescriptions": [ 10247 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 10248 // "Object owner gets OWNER access, and project team owners get OWNER access.", 10249 // "Object owner gets OWNER access, and project team owners get READER access.", 10250 // "Object owner gets OWNER access.", 10251 // "Object owner gets OWNER access, and project team members get access according to their roles.", 10252 // "Object owner gets OWNER access, and allUsers get READER access." 10253 // ], 10254 // "location": "query", 10255 // "type": "string" 10256 // }, 10257 // "projection": { 10258 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", 10259 // "enum": [ 10260 // "full", 10261 // "noAcl" 10262 // ], 10263 // "enumDescriptions": [ 10264 // "Include all properties.", 10265 // "Omit the owner, acl property." 10266 // ], 10267 // "location": "query", 10268 // "type": "string" 10269 // }, 10270 // "provisionalUserProject": { 10271 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 10272 // "location": "query", 10273 // "type": "string" 10274 // }, 10275 // "userProject": { 10276 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 10277 // "location": "query", 10278 // "type": "string" 10279 // } 10280 // }, 10281 // "path": "b/{bucket}/o", 10282 // "request": { 10283 // "$ref": "Object" 10284 // }, 10285 // "response": { 10286 // "$ref": "Object" 10287 // }, 10288 // "scopes": [ 10289 // "https://www.googleapis.com/auth/cloud-platform", 10290 // "https://www.googleapis.com/auth/devstorage.full_control", 10291 // "https://www.googleapis.com/auth/devstorage.read_write" 10292 // ], 10293 // "supportsMediaUpload": true 10294 // } 10295 10296} 10297 10298// method id "storage.objects.list": 10299 10300type ObjectsListCall struct { 10301 s *Service 10302 bucket string 10303 urlParams_ gensupport.URLParams 10304 ifNoneMatch_ string 10305 ctx_ context.Context 10306 header_ http.Header 10307} 10308 10309// List: Retrieves a list of objects matching the criteria. 10310func (r *ObjectsService) List(bucket string) *ObjectsListCall { 10311 c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10312 c.bucket = bucket 10313 return c 10314} 10315 10316// Delimiter sets the optional parameter "delimiter": Returns results in 10317// a directory-like mode. items will contain only objects whose names, 10318// aside from the prefix, do not contain delimiter. Objects whose names, 10319// aside from the prefix, contain delimiter will have their name, 10320// truncated after the delimiter, returned in prefixes. Duplicate 10321// prefixes are omitted. 10322func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall { 10323 c.urlParams_.Set("delimiter", delimiter) 10324 return c 10325} 10326 10327// EndOffset sets the optional parameter "endOffset": Filter results to 10328// objects whose names are lexicographically before endOffset. If 10329// startOffset is also set, the objects listed will have names between 10330// startOffset (inclusive) and endOffset (exclusive). 10331func (c *ObjectsListCall) EndOffset(endOffset string) *ObjectsListCall { 10332 c.urlParams_.Set("endOffset", endOffset) 10333 return c 10334} 10335 10336// IncludeTrailingDelimiter sets the optional parameter 10337// "includeTrailingDelimiter": If true, objects that end in exactly one 10338// instance of delimiter will have their metadata included in items in 10339// addition to prefixes. 10340func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall { 10341 c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter)) 10342 return c 10343} 10344 10345// MaxResults sets the optional parameter "maxResults": Maximum number 10346// of items plus prefixes to return in a single page of responses. As 10347// duplicate prefixes are omitted, fewer total results may be returned 10348// than requested. The service will use this parameter or 1,000 items, 10349// whichever is smaller. 10350func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall { 10351 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10352 return c 10353} 10354 10355// PageToken sets the optional parameter "pageToken": A 10356// previously-returned page token representing part of the larger set of 10357// results to view. 10358func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall { 10359 c.urlParams_.Set("pageToken", pageToken) 10360 return c 10361} 10362 10363// Prefix sets the optional parameter "prefix": Filter results to 10364// objects whose names begin with this prefix. 10365func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall { 10366 c.urlParams_.Set("prefix", prefix) 10367 return c 10368} 10369 10370// Projection sets the optional parameter "projection": Set of 10371// properties to return. Defaults to noAcl. 10372// 10373// Possible values: 10374// "full" - Include all properties. 10375// "noAcl" - Omit the owner, acl property. 10376func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall { 10377 c.urlParams_.Set("projection", projection) 10378 return c 10379} 10380 10381// ProvisionalUserProject sets the optional parameter 10382// "provisionalUserProject": The project to be billed for this request 10383// if the target bucket is requester-pays bucket. 10384func (c *ObjectsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsListCall { 10385 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 10386 return c 10387} 10388 10389// StartOffset sets the optional parameter "startOffset": Filter results 10390// to objects whose names are lexicographically equal to or after 10391// startOffset. If endOffset is also set, the objects listed will have 10392// names between startOffset (inclusive) and endOffset (exclusive). 10393func (c *ObjectsListCall) StartOffset(startOffset string) *ObjectsListCall { 10394 c.urlParams_.Set("startOffset", startOffset) 10395 return c 10396} 10397 10398// UserProject sets the optional parameter "userProject": The project to 10399// be billed for this request. Required for Requester Pays buckets. 10400func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall { 10401 c.urlParams_.Set("userProject", userProject) 10402 return c 10403} 10404 10405// Versions sets the optional parameter "versions": If true, lists all 10406// versions of an object as distinct results. The default is false. For 10407// more information, see Object Versioning. 10408func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall { 10409 c.urlParams_.Set("versions", fmt.Sprint(versions)) 10410 return c 10411} 10412 10413// Fields allows partial responses to be retrieved. See 10414// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10415// for more information. 10416func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall { 10417 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10418 return c 10419} 10420 10421// IfNoneMatch sets the optional parameter which makes the operation 10422// fail if the object's ETag matches the given value. This is useful for 10423// getting updates only after the object has changed since the last 10424// request. Use googleapi.IsNotModified to check whether the response 10425// error from Do is the result of In-None-Match. 10426func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall { 10427 c.ifNoneMatch_ = entityTag 10428 return c 10429} 10430 10431// Context sets the context to be used in this call's Do method. Any 10432// pending HTTP request will be aborted if the provided context is 10433// canceled. 10434func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall { 10435 c.ctx_ = ctx 10436 return c 10437} 10438 10439// Header returns an http.Header that can be modified by the caller to 10440// add HTTP headers to the request. 10441func (c *ObjectsListCall) Header() http.Header { 10442 if c.header_ == nil { 10443 c.header_ = make(http.Header) 10444 } 10445 return c.header_ 10446} 10447 10448func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { 10449 reqHeaders := make(http.Header) 10450 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10451 for k, v := range c.header_ { 10452 reqHeaders[k] = v 10453 } 10454 reqHeaders.Set("User-Agent", c.s.userAgent()) 10455 if c.ifNoneMatch_ != "" { 10456 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10457 } 10458 var body io.Reader = nil 10459 c.urlParams_.Set("alt", alt) 10460 c.urlParams_.Set("prettyPrint", "false") 10461 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") 10462 urls += "?" + c.urlParams_.Encode() 10463 req, err := http.NewRequest("GET", urls, body) 10464 if err != nil { 10465 return nil, err 10466 } 10467 req.Header = reqHeaders 10468 googleapi.Expand(req.URL, map[string]string{ 10469 "bucket": c.bucket, 10470 }) 10471 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10472} 10473 10474// Do executes the "storage.objects.list" call. 10475// Exactly one of *Objects or error will be non-nil. Any non-2xx status 10476// code is an error. Response headers are in either 10477// *Objects.ServerResponse.Header or (if a response was returned at all) 10478// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10479// check whether the returned error was because http.StatusNotModified 10480// was returned. 10481func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) { 10482 gensupport.SetOptions(c.urlParams_, opts...) 10483 res, err := c.doRequest("json") 10484 if res != nil && res.StatusCode == http.StatusNotModified { 10485 if res.Body != nil { 10486 res.Body.Close() 10487 } 10488 return nil, &googleapi.Error{ 10489 Code: res.StatusCode, 10490 Header: res.Header, 10491 } 10492 } 10493 if err != nil { 10494 return nil, err 10495 } 10496 defer googleapi.CloseBody(res) 10497 if err := googleapi.CheckResponse(res); err != nil { 10498 return nil, err 10499 } 10500 ret := &Objects{ 10501 ServerResponse: googleapi.ServerResponse{ 10502 Header: res.Header, 10503 HTTPStatusCode: res.StatusCode, 10504 }, 10505 } 10506 target := &ret 10507 if err := gensupport.DecodeResponse(target, res); err != nil { 10508 return nil, err 10509 } 10510 return ret, nil 10511 // { 10512 // "description": "Retrieves a list of objects matching the criteria.", 10513 // "httpMethod": "GET", 10514 // "id": "storage.objects.list", 10515 // "parameterOrder": [ 10516 // "bucket" 10517 // ], 10518 // "parameters": { 10519 // "bucket": { 10520 // "description": "Name of the bucket in which to look for objects.", 10521 // "location": "path", 10522 // "required": true, 10523 // "type": "string" 10524 // }, 10525 // "delimiter": { 10526 // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", 10527 // "location": "query", 10528 // "type": "string" 10529 // }, 10530 // "endOffset": { 10531 // "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", 10532 // "location": "query", 10533 // "type": "string" 10534 // }, 10535 // "includeTrailingDelimiter": { 10536 // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", 10537 // "location": "query", 10538 // "type": "boolean" 10539 // }, 10540 // "maxResults": { 10541 // "default": "1000", 10542 // "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", 10543 // "format": "uint32", 10544 // "location": "query", 10545 // "minimum": "0", 10546 // "type": "integer" 10547 // }, 10548 // "pageToken": { 10549 // "description": "A previously-returned page token representing part of the larger set of results to view.", 10550 // "location": "query", 10551 // "type": "string" 10552 // }, 10553 // "prefix": { 10554 // "description": "Filter results to objects whose names begin with this prefix.", 10555 // "location": "query", 10556 // "type": "string" 10557 // }, 10558 // "projection": { 10559 // "description": "Set of properties to return. Defaults to noAcl.", 10560 // "enum": [ 10561 // "full", 10562 // "noAcl" 10563 // ], 10564 // "enumDescriptions": [ 10565 // "Include all properties.", 10566 // "Omit the owner, acl property." 10567 // ], 10568 // "location": "query", 10569 // "type": "string" 10570 // }, 10571 // "provisionalUserProject": { 10572 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 10573 // "location": "query", 10574 // "type": "string" 10575 // }, 10576 // "startOffset": { 10577 // "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", 10578 // "location": "query", 10579 // "type": "string" 10580 // }, 10581 // "userProject": { 10582 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 10583 // "location": "query", 10584 // "type": "string" 10585 // }, 10586 // "versions": { 10587 // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", 10588 // "location": "query", 10589 // "type": "boolean" 10590 // } 10591 // }, 10592 // "path": "b/{bucket}/o", 10593 // "response": { 10594 // "$ref": "Objects" 10595 // }, 10596 // "scopes": [ 10597 // "https://www.googleapis.com/auth/cloud-platform", 10598 // "https://www.googleapis.com/auth/cloud-platform.read-only", 10599 // "https://www.googleapis.com/auth/devstorage.full_control", 10600 // "https://www.googleapis.com/auth/devstorage.read_only", 10601 // "https://www.googleapis.com/auth/devstorage.read_write" 10602 // ], 10603 // "supportsSubscription": true 10604 // } 10605 10606} 10607 10608// Pages invokes f for each page of results. 10609// A non-nil error returned from f will halt the iteration. 10610// The provided context supersedes any context provided to the Context method. 10611func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error { 10612 c.ctx_ = ctx 10613 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10614 for { 10615 x, err := c.Do() 10616 if err != nil { 10617 return err 10618 } 10619 if err := f(x); err != nil { 10620 return err 10621 } 10622 if x.NextPageToken == "" { 10623 return nil 10624 } 10625 c.PageToken(x.NextPageToken) 10626 } 10627} 10628 10629// method id "storage.objects.patch": 10630 10631type ObjectsPatchCall struct { 10632 s *Service 10633 bucket string 10634 object string 10635 object2 *Object 10636 urlParams_ gensupport.URLParams 10637 ctx_ context.Context 10638 header_ http.Header 10639} 10640 10641// Patch: Patches an object's metadata. 10642func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall { 10643 c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10644 c.bucket = bucket 10645 c.object = object 10646 c.object2 = object2 10647 return c 10648} 10649 10650// Generation sets the optional parameter "generation": If present, 10651// selects a specific revision of this object (as opposed to the latest 10652// version, the default). 10653func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall { 10654 c.urlParams_.Set("generation", fmt.Sprint(generation)) 10655 return c 10656} 10657 10658// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 10659// Makes the operation conditional on whether the object's current 10660// generation matches the given value. Setting to 0 makes the operation 10661// succeed only if there are no live versions of the object. 10662func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall { 10663 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 10664 return c 10665} 10666 10667// IfGenerationNotMatch sets the optional parameter 10668// "ifGenerationNotMatch": Makes the operation conditional on whether 10669// the object's current generation does not match the given value. If no 10670// live object exists, the precondition fails. Setting to 0 makes the 10671// operation succeed only if there is a live version of the object. 10672func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall { 10673 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 10674 return c 10675} 10676 10677// IfMetagenerationMatch sets the optional parameter 10678// "ifMetagenerationMatch": Makes the operation conditional on whether 10679// the object's current metageneration matches the given value. 10680func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall { 10681 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 10682 return c 10683} 10684 10685// IfMetagenerationNotMatch sets the optional parameter 10686// "ifMetagenerationNotMatch": Makes the operation conditional on 10687// whether the object's current metageneration does not match the given 10688// value. 10689func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall { 10690 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 10691 return c 10692} 10693 10694// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 10695// predefined set of access controls to this object. 10696// 10697// Possible values: 10698// "authenticatedRead" - Object owner gets OWNER access, and 10699// allAuthenticatedUsers get READER access. 10700// "bucketOwnerFullControl" - Object owner gets OWNER access, and 10701// project team owners get OWNER access. 10702// "bucketOwnerRead" - Object owner gets OWNER access, and project 10703// team owners get READER access. 10704// "private" - Object owner gets OWNER access. 10705// "projectPrivate" - Object owner gets OWNER access, and project team 10706// members get access according to their roles. 10707// "publicRead" - Object owner gets OWNER access, and allUsers get 10708// READER access. 10709func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall { 10710 c.urlParams_.Set("predefinedAcl", predefinedAcl) 10711 return c 10712} 10713 10714// Projection sets the optional parameter "projection": Set of 10715// properties to return. Defaults to full. 10716// 10717// Possible values: 10718// "full" - Include all properties. 10719// "noAcl" - Omit the owner, acl property. 10720func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { 10721 c.urlParams_.Set("projection", projection) 10722 return c 10723} 10724 10725// ProvisionalUserProject sets the optional parameter 10726// "provisionalUserProject": The project to be billed for this request 10727// if the target bucket is requester-pays bucket. 10728func (c *ObjectsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsPatchCall { 10729 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 10730 return c 10731} 10732 10733// UserProject sets the optional parameter "userProject": The project to 10734// be billed for this request, for Requester Pays buckets. 10735func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall { 10736 c.urlParams_.Set("userProject", userProject) 10737 return c 10738} 10739 10740// Fields allows partial responses to be retrieved. See 10741// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10742// for more information. 10743func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall { 10744 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10745 return c 10746} 10747 10748// Context sets the context to be used in this call's Do method. Any 10749// pending HTTP request will be aborted if the provided context is 10750// canceled. 10751func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall { 10752 c.ctx_ = ctx 10753 return c 10754} 10755 10756// Header returns an http.Header that can be modified by the caller to 10757// add HTTP headers to the request. 10758func (c *ObjectsPatchCall) Header() http.Header { 10759 if c.header_ == nil { 10760 c.header_ = make(http.Header) 10761 } 10762 return c.header_ 10763} 10764 10765func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { 10766 reqHeaders := make(http.Header) 10767 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 10768 for k, v := range c.header_ { 10769 reqHeaders[k] = v 10770 } 10771 reqHeaders.Set("User-Agent", c.s.userAgent()) 10772 var body io.Reader = nil 10773 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) 10774 if err != nil { 10775 return nil, err 10776 } 10777 reqHeaders.Set("Content-Type", "application/json") 10778 c.urlParams_.Set("alt", alt) 10779 c.urlParams_.Set("prettyPrint", "false") 10780 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 10781 urls += "?" + c.urlParams_.Encode() 10782 req, err := http.NewRequest("PATCH", urls, body) 10783 if err != nil { 10784 return nil, err 10785 } 10786 req.Header = reqHeaders 10787 googleapi.Expand(req.URL, map[string]string{ 10788 "bucket": c.bucket, 10789 "object": c.object, 10790 }) 10791 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10792} 10793 10794// Do executes the "storage.objects.patch" call. 10795// Exactly one of *Object or error will be non-nil. Any non-2xx status 10796// code is an error. Response headers are in either 10797// *Object.ServerResponse.Header or (if a response was returned at all) 10798// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10799// check whether the returned error was because http.StatusNotModified 10800// was returned. 10801func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) { 10802 gensupport.SetOptions(c.urlParams_, opts...) 10803 res, err := c.doRequest("json") 10804 if res != nil && res.StatusCode == http.StatusNotModified { 10805 if res.Body != nil { 10806 res.Body.Close() 10807 } 10808 return nil, &googleapi.Error{ 10809 Code: res.StatusCode, 10810 Header: res.Header, 10811 } 10812 } 10813 if err != nil { 10814 return nil, err 10815 } 10816 defer googleapi.CloseBody(res) 10817 if err := googleapi.CheckResponse(res); err != nil { 10818 return nil, err 10819 } 10820 ret := &Object{ 10821 ServerResponse: googleapi.ServerResponse{ 10822 Header: res.Header, 10823 HTTPStatusCode: res.StatusCode, 10824 }, 10825 } 10826 target := &ret 10827 if err := gensupport.DecodeResponse(target, res); err != nil { 10828 return nil, err 10829 } 10830 return ret, nil 10831 // { 10832 // "description": "Patches an object's metadata.", 10833 // "httpMethod": "PATCH", 10834 // "id": "storage.objects.patch", 10835 // "parameterOrder": [ 10836 // "bucket", 10837 // "object" 10838 // ], 10839 // "parameters": { 10840 // "bucket": { 10841 // "description": "Name of the bucket in which the object resides.", 10842 // "location": "path", 10843 // "required": true, 10844 // "type": "string" 10845 // }, 10846 // "generation": { 10847 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 10848 // "format": "int64", 10849 // "location": "query", 10850 // "type": "string" 10851 // }, 10852 // "ifGenerationMatch": { 10853 // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 10854 // "format": "int64", 10855 // "location": "query", 10856 // "type": "string" 10857 // }, 10858 // "ifGenerationNotMatch": { 10859 // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", 10860 // "format": "int64", 10861 // "location": "query", 10862 // "type": "string" 10863 // }, 10864 // "ifMetagenerationMatch": { 10865 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 10866 // "format": "int64", 10867 // "location": "query", 10868 // "type": "string" 10869 // }, 10870 // "ifMetagenerationNotMatch": { 10871 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 10872 // "format": "int64", 10873 // "location": "query", 10874 // "type": "string" 10875 // }, 10876 // "object": { 10877 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 10878 // "location": "path", 10879 // "required": true, 10880 // "type": "string" 10881 // }, 10882 // "predefinedAcl": { 10883 // "description": "Apply a predefined set of access controls to this object.", 10884 // "enum": [ 10885 // "authenticatedRead", 10886 // "bucketOwnerFullControl", 10887 // "bucketOwnerRead", 10888 // "private", 10889 // "projectPrivate", 10890 // "publicRead" 10891 // ], 10892 // "enumDescriptions": [ 10893 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 10894 // "Object owner gets OWNER access, and project team owners get OWNER access.", 10895 // "Object owner gets OWNER access, and project team owners get READER access.", 10896 // "Object owner gets OWNER access.", 10897 // "Object owner gets OWNER access, and project team members get access according to their roles.", 10898 // "Object owner gets OWNER access, and allUsers get READER access." 10899 // ], 10900 // "location": "query", 10901 // "type": "string" 10902 // }, 10903 // "projection": { 10904 // "description": "Set of properties to return. Defaults to full.", 10905 // "enum": [ 10906 // "full", 10907 // "noAcl" 10908 // ], 10909 // "enumDescriptions": [ 10910 // "Include all properties.", 10911 // "Omit the owner, acl property." 10912 // ], 10913 // "location": "query", 10914 // "type": "string" 10915 // }, 10916 // "provisionalUserProject": { 10917 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 10918 // "location": "query", 10919 // "type": "string" 10920 // }, 10921 // "userProject": { 10922 // "description": "The project to be billed for this request, for Requester Pays buckets.", 10923 // "location": "query", 10924 // "type": "string" 10925 // } 10926 // }, 10927 // "path": "b/{bucket}/o/{object}", 10928 // "request": { 10929 // "$ref": "Object" 10930 // }, 10931 // "response": { 10932 // "$ref": "Object" 10933 // }, 10934 // "scopes": [ 10935 // "https://www.googleapis.com/auth/cloud-platform", 10936 // "https://www.googleapis.com/auth/devstorage.full_control" 10937 // ] 10938 // } 10939 10940} 10941 10942// method id "storage.objects.rewrite": 10943 10944type ObjectsRewriteCall struct { 10945 s *Service 10946 sourceBucket string 10947 sourceObject string 10948 destinationBucket string 10949 destinationObject string 10950 object *Object 10951 urlParams_ gensupport.URLParams 10952 ctx_ context.Context 10953 header_ http.Header 10954} 10955 10956// Rewrite: Rewrites a source object to a destination object. Optionally 10957// overrides metadata. 10958func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall { 10959 c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10960 c.sourceBucket = sourceBucket 10961 c.sourceObject = sourceObject 10962 c.destinationBucket = destinationBucket 10963 c.destinationObject = destinationObject 10964 c.object = object 10965 return c 10966} 10967 10968// DestinationKmsKeyName sets the optional parameter 10969// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the 10970// form 10971// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 10972// that will be used to encrypt the object. Overrides the object 10973// metadata's kms_key_name value, if any. 10974func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall { 10975 c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName) 10976 return c 10977} 10978 10979// DestinationPredefinedAcl sets the optional parameter 10980// "destinationPredefinedAcl": Apply a predefined set of access controls 10981// to the destination object. 10982// 10983// Possible values: 10984// "authenticatedRead" - Object owner gets OWNER access, and 10985// allAuthenticatedUsers get READER access. 10986// "bucketOwnerFullControl" - Object owner gets OWNER access, and 10987// project team owners get OWNER access. 10988// "bucketOwnerRead" - Object owner gets OWNER access, and project 10989// team owners get READER access. 10990// "private" - Object owner gets OWNER access. 10991// "projectPrivate" - Object owner gets OWNER access, and project team 10992// members get access according to their roles. 10993// "publicRead" - Object owner gets OWNER access, and allUsers get 10994// READER access. 10995func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall { 10996 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) 10997 return c 10998} 10999 11000// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 11001// Makes the operation conditional on whether the object's current 11002// generation matches the given value. Setting to 0 makes the operation 11003// succeed only if there are no live versions of the object. 11004func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall { 11005 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 11006 return c 11007} 11008 11009// IfGenerationNotMatch sets the optional parameter 11010// "ifGenerationNotMatch": Makes the operation conditional on whether 11011// the object's current generation does not match the given value. If no 11012// live object exists, the precondition fails. Setting to 0 makes the 11013// operation succeed only if there is a live version of the object. 11014func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall { 11015 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 11016 return c 11017} 11018 11019// IfMetagenerationMatch sets the optional parameter 11020// "ifMetagenerationMatch": Makes the operation conditional on whether 11021// the destination object's current metageneration matches the given 11022// value. 11023func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall { 11024 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 11025 return c 11026} 11027 11028// IfMetagenerationNotMatch sets the optional parameter 11029// "ifMetagenerationNotMatch": Makes the operation conditional on 11030// whether the destination object's current metageneration does not 11031// match the given value. 11032func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall { 11033 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 11034 return c 11035} 11036 11037// IfSourceGenerationMatch sets the optional parameter 11038// "ifSourceGenerationMatch": Makes the operation conditional on whether 11039// the source object's current generation matches the given value. 11040func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall { 11041 c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch)) 11042 return c 11043} 11044 11045// IfSourceGenerationNotMatch sets the optional parameter 11046// "ifSourceGenerationNotMatch": Makes the operation conditional on 11047// whether the source object's current generation does not match the 11048// given value. 11049func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall { 11050 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch)) 11051 return c 11052} 11053 11054// IfSourceMetagenerationMatch sets the optional parameter 11055// "ifSourceMetagenerationMatch": Makes the operation conditional on 11056// whether the source object's current metageneration matches the given 11057// value. 11058func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall { 11059 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch)) 11060 return c 11061} 11062 11063// IfSourceMetagenerationNotMatch sets the optional parameter 11064// "ifSourceMetagenerationNotMatch": Makes the operation conditional on 11065// whether the source object's current metageneration does not match the 11066// given value. 11067func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall { 11068 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch)) 11069 return c 11070} 11071 11072// MaxBytesRewrittenPerCall sets the optional parameter 11073// "maxBytesRewrittenPerCall": The maximum number of bytes that will be 11074// rewritten per rewrite request. Most callers shouldn't need to specify 11075// this parameter - it is primarily in place to support testing. If 11076// specified the value must be an integral multiple of 1 MiB (1048576). 11077// Also, this only applies to requests where the source and destination 11078// span locations and/or storage classes. Finally, this value must not 11079// change across rewrite calls else you'll get an error that the 11080// rewriteToken is invalid. 11081func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall { 11082 c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall)) 11083 return c 11084} 11085 11086// Projection sets the optional parameter "projection": Set of 11087// properties to return. Defaults to noAcl, unless the object resource 11088// specifies the acl property, when it defaults to full. 11089// 11090// Possible values: 11091// "full" - Include all properties. 11092// "noAcl" - Omit the owner, acl property. 11093func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall { 11094 c.urlParams_.Set("projection", projection) 11095 return c 11096} 11097 11098// ProvisionalUserProject sets the optional parameter 11099// "provisionalUserProject": The project to be billed for this request 11100// if the target bucket is requester-pays bucket. 11101func (c *ObjectsRewriteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsRewriteCall { 11102 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 11103 return c 11104} 11105 11106// RewriteToken sets the optional parameter "rewriteToken": Include this 11107// field (from the previous rewrite response) on each rewrite request 11108// after the first one, until the rewrite response 'done' flag is true. 11109// Calls that provide a rewriteToken can omit all other request fields, 11110// but if included those fields must match the values provided in the 11111// first rewrite request. 11112func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall { 11113 c.urlParams_.Set("rewriteToken", rewriteToken) 11114 return c 11115} 11116 11117// SourceGeneration sets the optional parameter "sourceGeneration": If 11118// present, selects a specific revision of the source object (as opposed 11119// to the latest version, the default). 11120func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall { 11121 c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration)) 11122 return c 11123} 11124 11125// UserProject sets the optional parameter "userProject": The project to 11126// be billed for this request. Required for Requester Pays buckets. 11127func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall { 11128 c.urlParams_.Set("userProject", userProject) 11129 return c 11130} 11131 11132// Fields allows partial responses to be retrieved. See 11133// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11134// for more information. 11135func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall { 11136 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11137 return c 11138} 11139 11140// Context sets the context to be used in this call's Do method. Any 11141// pending HTTP request will be aborted if the provided context is 11142// canceled. 11143func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall { 11144 c.ctx_ = ctx 11145 return c 11146} 11147 11148// Header returns an http.Header that can be modified by the caller to 11149// add HTTP headers to the request. 11150func (c *ObjectsRewriteCall) Header() http.Header { 11151 if c.header_ == nil { 11152 c.header_ = make(http.Header) 11153 } 11154 return c.header_ 11155} 11156 11157func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { 11158 reqHeaders := make(http.Header) 11159 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11160 for k, v := range c.header_ { 11161 reqHeaders[k] = v 11162 } 11163 reqHeaders.Set("User-Agent", c.s.userAgent()) 11164 var body io.Reader = nil 11165 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) 11166 if err != nil { 11167 return nil, err 11168 } 11169 reqHeaders.Set("Content-Type", "application/json") 11170 c.urlParams_.Set("alt", alt) 11171 c.urlParams_.Set("prettyPrint", "false") 11172 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}") 11173 urls += "?" + c.urlParams_.Encode() 11174 req, err := http.NewRequest("POST", urls, body) 11175 if err != nil { 11176 return nil, err 11177 } 11178 req.Header = reqHeaders 11179 googleapi.Expand(req.URL, map[string]string{ 11180 "sourceBucket": c.sourceBucket, 11181 "sourceObject": c.sourceObject, 11182 "destinationBucket": c.destinationBucket, 11183 "destinationObject": c.destinationObject, 11184 }) 11185 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11186} 11187 11188// Do executes the "storage.objects.rewrite" call. 11189// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx 11190// status code is an error. Response headers are in either 11191// *RewriteResponse.ServerResponse.Header or (if a response was returned 11192// at all) in error.(*googleapi.Error).Header. Use 11193// googleapi.IsNotModified to check whether the returned error was 11194// because http.StatusNotModified was returned. 11195func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) { 11196 gensupport.SetOptions(c.urlParams_, opts...) 11197 res, err := c.doRequest("json") 11198 if res != nil && res.StatusCode == http.StatusNotModified { 11199 if res.Body != nil { 11200 res.Body.Close() 11201 } 11202 return nil, &googleapi.Error{ 11203 Code: res.StatusCode, 11204 Header: res.Header, 11205 } 11206 } 11207 if err != nil { 11208 return nil, err 11209 } 11210 defer googleapi.CloseBody(res) 11211 if err := googleapi.CheckResponse(res); err != nil { 11212 return nil, err 11213 } 11214 ret := &RewriteResponse{ 11215 ServerResponse: googleapi.ServerResponse{ 11216 Header: res.Header, 11217 HTTPStatusCode: res.StatusCode, 11218 }, 11219 } 11220 target := &ret 11221 if err := gensupport.DecodeResponse(target, res); err != nil { 11222 return nil, err 11223 } 11224 return ret, nil 11225 // { 11226 // "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", 11227 // "httpMethod": "POST", 11228 // "id": "storage.objects.rewrite", 11229 // "parameterOrder": [ 11230 // "sourceBucket", 11231 // "sourceObject", 11232 // "destinationBucket", 11233 // "destinationObject" 11234 // ], 11235 // "parameters": { 11236 // "destinationBucket": { 11237 // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", 11238 // "location": "path", 11239 // "required": true, 11240 // "type": "string" 11241 // }, 11242 // "destinationKmsKeyName": { 11243 // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", 11244 // "location": "query", 11245 // "type": "string" 11246 // }, 11247 // "destinationObject": { 11248 // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11249 // "location": "path", 11250 // "required": true, 11251 // "type": "string" 11252 // }, 11253 // "destinationPredefinedAcl": { 11254 // "description": "Apply a predefined set of access controls to the destination object.", 11255 // "enum": [ 11256 // "authenticatedRead", 11257 // "bucketOwnerFullControl", 11258 // "bucketOwnerRead", 11259 // "private", 11260 // "projectPrivate", 11261 // "publicRead" 11262 // ], 11263 // "enumDescriptions": [ 11264 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 11265 // "Object owner gets OWNER access, and project team owners get OWNER access.", 11266 // "Object owner gets OWNER access, and project team owners get READER access.", 11267 // "Object owner gets OWNER access.", 11268 // "Object owner gets OWNER access, and project team members get access according to their roles.", 11269 // "Object owner gets OWNER access, and allUsers get READER access." 11270 // ], 11271 // "location": "query", 11272 // "type": "string" 11273 // }, 11274 // "ifGenerationMatch": { 11275 // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 11276 // "format": "int64", 11277 // "location": "query", 11278 // "type": "string" 11279 // }, 11280 // "ifGenerationNotMatch": { 11281 // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", 11282 // "format": "int64", 11283 // "location": "query", 11284 // "type": "string" 11285 // }, 11286 // "ifMetagenerationMatch": { 11287 // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", 11288 // "format": "int64", 11289 // "location": "query", 11290 // "type": "string" 11291 // }, 11292 // "ifMetagenerationNotMatch": { 11293 // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", 11294 // "format": "int64", 11295 // "location": "query", 11296 // "type": "string" 11297 // }, 11298 // "ifSourceGenerationMatch": { 11299 // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", 11300 // "format": "int64", 11301 // "location": "query", 11302 // "type": "string" 11303 // }, 11304 // "ifSourceGenerationNotMatch": { 11305 // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", 11306 // "format": "int64", 11307 // "location": "query", 11308 // "type": "string" 11309 // }, 11310 // "ifSourceMetagenerationMatch": { 11311 // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", 11312 // "format": "int64", 11313 // "location": "query", 11314 // "type": "string" 11315 // }, 11316 // "ifSourceMetagenerationNotMatch": { 11317 // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", 11318 // "format": "int64", 11319 // "location": "query", 11320 // "type": "string" 11321 // }, 11322 // "maxBytesRewrittenPerCall": { 11323 // "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", 11324 // "format": "int64", 11325 // "location": "query", 11326 // "type": "string" 11327 // }, 11328 // "projection": { 11329 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", 11330 // "enum": [ 11331 // "full", 11332 // "noAcl" 11333 // ], 11334 // "enumDescriptions": [ 11335 // "Include all properties.", 11336 // "Omit the owner, acl property." 11337 // ], 11338 // "location": "query", 11339 // "type": "string" 11340 // }, 11341 // "provisionalUserProject": { 11342 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 11343 // "location": "query", 11344 // "type": "string" 11345 // }, 11346 // "rewriteToken": { 11347 // "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", 11348 // "location": "query", 11349 // "type": "string" 11350 // }, 11351 // "sourceBucket": { 11352 // "description": "Name of the bucket in which to find the source object.", 11353 // "location": "path", 11354 // "required": true, 11355 // "type": "string" 11356 // }, 11357 // "sourceGeneration": { 11358 // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", 11359 // "format": "int64", 11360 // "location": "query", 11361 // "type": "string" 11362 // }, 11363 // "sourceObject": { 11364 // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11365 // "location": "path", 11366 // "required": true, 11367 // "type": "string" 11368 // }, 11369 // "userProject": { 11370 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 11371 // "location": "query", 11372 // "type": "string" 11373 // } 11374 // }, 11375 // "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", 11376 // "request": { 11377 // "$ref": "Object" 11378 // }, 11379 // "response": { 11380 // "$ref": "RewriteResponse" 11381 // }, 11382 // "scopes": [ 11383 // "https://www.googleapis.com/auth/cloud-platform", 11384 // "https://www.googleapis.com/auth/devstorage.full_control", 11385 // "https://www.googleapis.com/auth/devstorage.read_write" 11386 // ] 11387 // } 11388 11389} 11390 11391// method id "storage.objects.setIamPolicy": 11392 11393type ObjectsSetIamPolicyCall struct { 11394 s *Service 11395 bucket string 11396 object string 11397 policy *Policy 11398 urlParams_ gensupport.URLParams 11399 ctx_ context.Context 11400 header_ http.Header 11401} 11402 11403// SetIamPolicy: Updates an IAM policy for the specified object. 11404func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall { 11405 c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11406 c.bucket = bucket 11407 c.object = object 11408 c.policy = policy 11409 return c 11410} 11411 11412// Generation sets the optional parameter "generation": If present, 11413// selects a specific revision of this object (as opposed to the latest 11414// version, the default). 11415func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall { 11416 c.urlParams_.Set("generation", fmt.Sprint(generation)) 11417 return c 11418} 11419 11420// ProvisionalUserProject sets the optional parameter 11421// "provisionalUserProject": The project to be billed for this request 11422// if the target bucket is requester-pays bucket. 11423func (c *ObjectsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsSetIamPolicyCall { 11424 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 11425 return c 11426} 11427 11428// UserProject sets the optional parameter "userProject": The project to 11429// be billed for this request. Required for Requester Pays buckets. 11430func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall { 11431 c.urlParams_.Set("userProject", userProject) 11432 return c 11433} 11434 11435// Fields allows partial responses to be retrieved. See 11436// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11437// for more information. 11438func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall { 11439 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11440 return c 11441} 11442 11443// Context sets the context to be used in this call's Do method. Any 11444// pending HTTP request will be aborted if the provided context is 11445// canceled. 11446func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall { 11447 c.ctx_ = ctx 11448 return c 11449} 11450 11451// Header returns an http.Header that can be modified by the caller to 11452// add HTTP headers to the request. 11453func (c *ObjectsSetIamPolicyCall) Header() http.Header { 11454 if c.header_ == nil { 11455 c.header_ = make(http.Header) 11456 } 11457 return c.header_ 11458} 11459 11460func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 11461 reqHeaders := make(http.Header) 11462 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11463 for k, v := range c.header_ { 11464 reqHeaders[k] = v 11465 } 11466 reqHeaders.Set("User-Agent", c.s.userAgent()) 11467 var body io.Reader = nil 11468 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) 11469 if err != nil { 11470 return nil, err 11471 } 11472 reqHeaders.Set("Content-Type", "application/json") 11473 c.urlParams_.Set("alt", alt) 11474 c.urlParams_.Set("prettyPrint", "false") 11475 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam") 11476 urls += "?" + c.urlParams_.Encode() 11477 req, err := http.NewRequest("PUT", urls, body) 11478 if err != nil { 11479 return nil, err 11480 } 11481 req.Header = reqHeaders 11482 googleapi.Expand(req.URL, map[string]string{ 11483 "bucket": c.bucket, 11484 "object": c.object, 11485 }) 11486 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11487} 11488 11489// Do executes the "storage.objects.setIamPolicy" call. 11490// Exactly one of *Policy or error will be non-nil. Any non-2xx status 11491// code is an error. Response headers are in either 11492// *Policy.ServerResponse.Header or (if a response was returned at all) 11493// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11494// check whether the returned error was because http.StatusNotModified 11495// was returned. 11496func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 11497 gensupport.SetOptions(c.urlParams_, opts...) 11498 res, err := c.doRequest("json") 11499 if res != nil && res.StatusCode == http.StatusNotModified { 11500 if res.Body != nil { 11501 res.Body.Close() 11502 } 11503 return nil, &googleapi.Error{ 11504 Code: res.StatusCode, 11505 Header: res.Header, 11506 } 11507 } 11508 if err != nil { 11509 return nil, err 11510 } 11511 defer googleapi.CloseBody(res) 11512 if err := googleapi.CheckResponse(res); err != nil { 11513 return nil, err 11514 } 11515 ret := &Policy{ 11516 ServerResponse: googleapi.ServerResponse{ 11517 Header: res.Header, 11518 HTTPStatusCode: res.StatusCode, 11519 }, 11520 } 11521 target := &ret 11522 if err := gensupport.DecodeResponse(target, res); err != nil { 11523 return nil, err 11524 } 11525 return ret, nil 11526 // { 11527 // "description": "Updates an IAM policy for the specified object.", 11528 // "httpMethod": "PUT", 11529 // "id": "storage.objects.setIamPolicy", 11530 // "parameterOrder": [ 11531 // "bucket", 11532 // "object" 11533 // ], 11534 // "parameters": { 11535 // "bucket": { 11536 // "description": "Name of the bucket in which the object resides.", 11537 // "location": "path", 11538 // "required": true, 11539 // "type": "string" 11540 // }, 11541 // "generation": { 11542 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 11543 // "format": "int64", 11544 // "location": "query", 11545 // "type": "string" 11546 // }, 11547 // "object": { 11548 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11549 // "location": "path", 11550 // "required": true, 11551 // "type": "string" 11552 // }, 11553 // "provisionalUserProject": { 11554 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 11555 // "location": "query", 11556 // "type": "string" 11557 // }, 11558 // "userProject": { 11559 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 11560 // "location": "query", 11561 // "type": "string" 11562 // } 11563 // }, 11564 // "path": "b/{bucket}/o/{object}/iam", 11565 // "request": { 11566 // "$ref": "Policy" 11567 // }, 11568 // "response": { 11569 // "$ref": "Policy" 11570 // }, 11571 // "scopes": [ 11572 // "https://www.googleapis.com/auth/cloud-platform", 11573 // "https://www.googleapis.com/auth/devstorage.full_control", 11574 // "https://www.googleapis.com/auth/devstorage.read_write" 11575 // ] 11576 // } 11577 11578} 11579 11580// method id "storage.objects.testIamPermissions": 11581 11582type ObjectsTestIamPermissionsCall struct { 11583 s *Service 11584 bucket string 11585 object string 11586 urlParams_ gensupport.URLParams 11587 ifNoneMatch_ string 11588 ctx_ context.Context 11589 header_ http.Header 11590} 11591 11592// TestIamPermissions: Tests a set of permissions on the given object to 11593// see which, if any, are held by the caller. 11594func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall { 11595 c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11596 c.bucket = bucket 11597 c.object = object 11598 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...)) 11599 return c 11600} 11601 11602// Generation sets the optional parameter "generation": If present, 11603// selects a specific revision of this object (as opposed to the latest 11604// version, the default). 11605func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall { 11606 c.urlParams_.Set("generation", fmt.Sprint(generation)) 11607 return c 11608} 11609 11610// ProvisionalUserProject sets the optional parameter 11611// "provisionalUserProject": The project to be billed for this request 11612// if the target bucket is requester-pays bucket. 11613func (c *ObjectsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsTestIamPermissionsCall { 11614 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 11615 return c 11616} 11617 11618// UserProject sets the optional parameter "userProject": The project to 11619// be billed for this request. Required for Requester Pays buckets. 11620func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall { 11621 c.urlParams_.Set("userProject", userProject) 11622 return c 11623} 11624 11625// Fields allows partial responses to be retrieved. See 11626// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11627// for more information. 11628func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall { 11629 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11630 return c 11631} 11632 11633// IfNoneMatch sets the optional parameter which makes the operation 11634// fail if the object's ETag matches the given value. This is useful for 11635// getting updates only after the object has changed since the last 11636// request. Use googleapi.IsNotModified to check whether the response 11637// error from Do is the result of In-None-Match. 11638func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall { 11639 c.ifNoneMatch_ = entityTag 11640 return c 11641} 11642 11643// Context sets the context to be used in this call's Do method. Any 11644// pending HTTP request will be aborted if the provided context is 11645// canceled. 11646func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall { 11647 c.ctx_ = ctx 11648 return c 11649} 11650 11651// Header returns an http.Header that can be modified by the caller to 11652// add HTTP headers to the request. 11653func (c *ObjectsTestIamPermissionsCall) Header() http.Header { 11654 if c.header_ == nil { 11655 c.header_ = make(http.Header) 11656 } 11657 return c.header_ 11658} 11659 11660func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 11661 reqHeaders := make(http.Header) 11662 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11663 for k, v := range c.header_ { 11664 reqHeaders[k] = v 11665 } 11666 reqHeaders.Set("User-Agent", c.s.userAgent()) 11667 if c.ifNoneMatch_ != "" { 11668 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11669 } 11670 var body io.Reader = nil 11671 c.urlParams_.Set("alt", alt) 11672 c.urlParams_.Set("prettyPrint", "false") 11673 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions") 11674 urls += "?" + c.urlParams_.Encode() 11675 req, err := http.NewRequest("GET", urls, body) 11676 if err != nil { 11677 return nil, err 11678 } 11679 req.Header = reqHeaders 11680 googleapi.Expand(req.URL, map[string]string{ 11681 "bucket": c.bucket, 11682 "object": c.object, 11683 }) 11684 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11685} 11686 11687// Do executes the "storage.objects.testIamPermissions" call. 11688// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 11689// Any non-2xx status code is an error. Response headers are in either 11690// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 11691// was returned at all) in error.(*googleapi.Error).Header. Use 11692// googleapi.IsNotModified to check whether the returned error was 11693// because http.StatusNotModified was returned. 11694func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 11695 gensupport.SetOptions(c.urlParams_, opts...) 11696 res, err := c.doRequest("json") 11697 if res != nil && res.StatusCode == http.StatusNotModified { 11698 if res.Body != nil { 11699 res.Body.Close() 11700 } 11701 return nil, &googleapi.Error{ 11702 Code: res.StatusCode, 11703 Header: res.Header, 11704 } 11705 } 11706 if err != nil { 11707 return nil, err 11708 } 11709 defer googleapi.CloseBody(res) 11710 if err := googleapi.CheckResponse(res); err != nil { 11711 return nil, err 11712 } 11713 ret := &TestIamPermissionsResponse{ 11714 ServerResponse: googleapi.ServerResponse{ 11715 Header: res.Header, 11716 HTTPStatusCode: res.StatusCode, 11717 }, 11718 } 11719 target := &ret 11720 if err := gensupport.DecodeResponse(target, res); err != nil { 11721 return nil, err 11722 } 11723 return ret, nil 11724 // { 11725 // "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", 11726 // "httpMethod": "GET", 11727 // "id": "storage.objects.testIamPermissions", 11728 // "parameterOrder": [ 11729 // "bucket", 11730 // "object", 11731 // "permissions" 11732 // ], 11733 // "parameters": { 11734 // "bucket": { 11735 // "description": "Name of the bucket in which the object resides.", 11736 // "location": "path", 11737 // "required": true, 11738 // "type": "string" 11739 // }, 11740 // "generation": { 11741 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 11742 // "format": "int64", 11743 // "location": "query", 11744 // "type": "string" 11745 // }, 11746 // "object": { 11747 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11748 // "location": "path", 11749 // "required": true, 11750 // "type": "string" 11751 // }, 11752 // "permissions": { 11753 // "description": "Permissions to test.", 11754 // "location": "query", 11755 // "repeated": true, 11756 // "required": true, 11757 // "type": "string" 11758 // }, 11759 // "provisionalUserProject": { 11760 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 11761 // "location": "query", 11762 // "type": "string" 11763 // }, 11764 // "userProject": { 11765 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 11766 // "location": "query", 11767 // "type": "string" 11768 // } 11769 // }, 11770 // "path": "b/{bucket}/o/{object}/iam/testPermissions", 11771 // "response": { 11772 // "$ref": "TestIamPermissionsResponse" 11773 // }, 11774 // "scopes": [ 11775 // "https://www.googleapis.com/auth/cloud-platform", 11776 // "https://www.googleapis.com/auth/cloud-platform.read-only", 11777 // "https://www.googleapis.com/auth/devstorage.full_control", 11778 // "https://www.googleapis.com/auth/devstorage.read_only", 11779 // "https://www.googleapis.com/auth/devstorage.read_write" 11780 // ] 11781 // } 11782 11783} 11784 11785// method id "storage.objects.update": 11786 11787type ObjectsUpdateCall struct { 11788 s *Service 11789 bucket string 11790 object string 11791 object2 *Object 11792 urlParams_ gensupport.URLParams 11793 ctx_ context.Context 11794 header_ http.Header 11795} 11796 11797// Update: Updates an object's metadata. 11798func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall { 11799 c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11800 c.bucket = bucket 11801 c.object = object 11802 c.object2 = object2 11803 return c 11804} 11805 11806// Generation sets the optional parameter "generation": If present, 11807// selects a specific revision of this object (as opposed to the latest 11808// version, the default). 11809func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall { 11810 c.urlParams_.Set("generation", fmt.Sprint(generation)) 11811 return c 11812} 11813 11814// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 11815// Makes the operation conditional on whether the object's current 11816// generation matches the given value. Setting to 0 makes the operation 11817// succeed only if there are no live versions of the object. 11818func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall { 11819 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 11820 return c 11821} 11822 11823// IfGenerationNotMatch sets the optional parameter 11824// "ifGenerationNotMatch": Makes the operation conditional on whether 11825// the object's current generation does not match the given value. If no 11826// live object exists, the precondition fails. Setting to 0 makes the 11827// operation succeed only if there is a live version of the object. 11828func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall { 11829 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 11830 return c 11831} 11832 11833// IfMetagenerationMatch sets the optional parameter 11834// "ifMetagenerationMatch": Makes the operation conditional on whether 11835// the object's current metageneration matches the given value. 11836func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall { 11837 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 11838 return c 11839} 11840 11841// IfMetagenerationNotMatch sets the optional parameter 11842// "ifMetagenerationNotMatch": Makes the operation conditional on 11843// whether the object's current metageneration does not match the given 11844// value. 11845func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall { 11846 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 11847 return c 11848} 11849 11850// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 11851// predefined set of access controls to this object. 11852// 11853// Possible values: 11854// "authenticatedRead" - Object owner gets OWNER access, and 11855// allAuthenticatedUsers get READER access. 11856// "bucketOwnerFullControl" - Object owner gets OWNER access, and 11857// project team owners get OWNER access. 11858// "bucketOwnerRead" - Object owner gets OWNER access, and project 11859// team owners get READER access. 11860// "private" - Object owner gets OWNER access. 11861// "projectPrivate" - Object owner gets OWNER access, and project team 11862// members get access according to their roles. 11863// "publicRead" - Object owner gets OWNER access, and allUsers get 11864// READER access. 11865func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall { 11866 c.urlParams_.Set("predefinedAcl", predefinedAcl) 11867 return c 11868} 11869 11870// Projection sets the optional parameter "projection": Set of 11871// properties to return. Defaults to full. 11872// 11873// Possible values: 11874// "full" - Include all properties. 11875// "noAcl" - Omit the owner, acl property. 11876func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { 11877 c.urlParams_.Set("projection", projection) 11878 return c 11879} 11880 11881// ProvisionalUserProject sets the optional parameter 11882// "provisionalUserProject": The project to be billed for this request 11883// if the target bucket is requester-pays bucket. 11884func (c *ObjectsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsUpdateCall { 11885 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 11886 return c 11887} 11888 11889// UserProject sets the optional parameter "userProject": The project to 11890// be billed for this request. Required for Requester Pays buckets. 11891func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall { 11892 c.urlParams_.Set("userProject", userProject) 11893 return c 11894} 11895 11896// Fields allows partial responses to be retrieved. See 11897// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11898// for more information. 11899func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall { 11900 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11901 return c 11902} 11903 11904// Context sets the context to be used in this call's Do method. Any 11905// pending HTTP request will be aborted if the provided context is 11906// canceled. 11907func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall { 11908 c.ctx_ = ctx 11909 return c 11910} 11911 11912// Header returns an http.Header that can be modified by the caller to 11913// add HTTP headers to the request. 11914func (c *ObjectsUpdateCall) Header() http.Header { 11915 if c.header_ == nil { 11916 c.header_ = make(http.Header) 11917 } 11918 return c.header_ 11919} 11920 11921func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { 11922 reqHeaders := make(http.Header) 11923 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 11924 for k, v := range c.header_ { 11925 reqHeaders[k] = v 11926 } 11927 reqHeaders.Set("User-Agent", c.s.userAgent()) 11928 var body io.Reader = nil 11929 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) 11930 if err != nil { 11931 return nil, err 11932 } 11933 reqHeaders.Set("Content-Type", "application/json") 11934 c.urlParams_.Set("alt", alt) 11935 c.urlParams_.Set("prettyPrint", "false") 11936 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 11937 urls += "?" + c.urlParams_.Encode() 11938 req, err := http.NewRequest("PUT", urls, body) 11939 if err != nil { 11940 return nil, err 11941 } 11942 req.Header = reqHeaders 11943 googleapi.Expand(req.URL, map[string]string{ 11944 "bucket": c.bucket, 11945 "object": c.object, 11946 }) 11947 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11948} 11949 11950// Do executes the "storage.objects.update" call. 11951// Exactly one of *Object or error will be non-nil. Any non-2xx status 11952// code is an error. Response headers are in either 11953// *Object.ServerResponse.Header or (if a response was returned at all) 11954// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11955// check whether the returned error was because http.StatusNotModified 11956// was returned. 11957func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) { 11958 gensupport.SetOptions(c.urlParams_, opts...) 11959 res, err := c.doRequest("json") 11960 if res != nil && res.StatusCode == http.StatusNotModified { 11961 if res.Body != nil { 11962 res.Body.Close() 11963 } 11964 return nil, &googleapi.Error{ 11965 Code: res.StatusCode, 11966 Header: res.Header, 11967 } 11968 } 11969 if err != nil { 11970 return nil, err 11971 } 11972 defer googleapi.CloseBody(res) 11973 if err := googleapi.CheckResponse(res); err != nil { 11974 return nil, err 11975 } 11976 ret := &Object{ 11977 ServerResponse: googleapi.ServerResponse{ 11978 Header: res.Header, 11979 HTTPStatusCode: res.StatusCode, 11980 }, 11981 } 11982 target := &ret 11983 if err := gensupport.DecodeResponse(target, res); err != nil { 11984 return nil, err 11985 } 11986 return ret, nil 11987 // { 11988 // "description": "Updates an object's metadata.", 11989 // "httpMethod": "PUT", 11990 // "id": "storage.objects.update", 11991 // "parameterOrder": [ 11992 // "bucket", 11993 // "object" 11994 // ], 11995 // "parameters": { 11996 // "bucket": { 11997 // "description": "Name of the bucket in which the object resides.", 11998 // "location": "path", 11999 // "required": true, 12000 // "type": "string" 12001 // }, 12002 // "generation": { 12003 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 12004 // "format": "int64", 12005 // "location": "query", 12006 // "type": "string" 12007 // }, 12008 // "ifGenerationMatch": { 12009 // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", 12010 // "format": "int64", 12011 // "location": "query", 12012 // "type": "string" 12013 // }, 12014 // "ifGenerationNotMatch": { 12015 // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", 12016 // "format": "int64", 12017 // "location": "query", 12018 // "type": "string" 12019 // }, 12020 // "ifMetagenerationMatch": { 12021 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 12022 // "format": "int64", 12023 // "location": "query", 12024 // "type": "string" 12025 // }, 12026 // "ifMetagenerationNotMatch": { 12027 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 12028 // "format": "int64", 12029 // "location": "query", 12030 // "type": "string" 12031 // }, 12032 // "object": { 12033 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 12034 // "location": "path", 12035 // "required": true, 12036 // "type": "string" 12037 // }, 12038 // "predefinedAcl": { 12039 // "description": "Apply a predefined set of access controls to this object.", 12040 // "enum": [ 12041 // "authenticatedRead", 12042 // "bucketOwnerFullControl", 12043 // "bucketOwnerRead", 12044 // "private", 12045 // "projectPrivate", 12046 // "publicRead" 12047 // ], 12048 // "enumDescriptions": [ 12049 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 12050 // "Object owner gets OWNER access, and project team owners get OWNER access.", 12051 // "Object owner gets OWNER access, and project team owners get READER access.", 12052 // "Object owner gets OWNER access.", 12053 // "Object owner gets OWNER access, and project team members get access according to their roles.", 12054 // "Object owner gets OWNER access, and allUsers get READER access." 12055 // ], 12056 // "location": "query", 12057 // "type": "string" 12058 // }, 12059 // "projection": { 12060 // "description": "Set of properties to return. Defaults to full.", 12061 // "enum": [ 12062 // "full", 12063 // "noAcl" 12064 // ], 12065 // "enumDescriptions": [ 12066 // "Include all properties.", 12067 // "Omit the owner, acl property." 12068 // ], 12069 // "location": "query", 12070 // "type": "string" 12071 // }, 12072 // "provisionalUserProject": { 12073 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 12074 // "location": "query", 12075 // "type": "string" 12076 // }, 12077 // "userProject": { 12078 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 12079 // "location": "query", 12080 // "type": "string" 12081 // } 12082 // }, 12083 // "path": "b/{bucket}/o/{object}", 12084 // "request": { 12085 // "$ref": "Object" 12086 // }, 12087 // "response": { 12088 // "$ref": "Object" 12089 // }, 12090 // "scopes": [ 12091 // "https://www.googleapis.com/auth/cloud-platform", 12092 // "https://www.googleapis.com/auth/devstorage.full_control" 12093 // ] 12094 // } 12095 12096} 12097 12098// method id "storage.objects.watchAll": 12099 12100type ObjectsWatchAllCall struct { 12101 s *Service 12102 bucket string 12103 channel *Channel 12104 urlParams_ gensupport.URLParams 12105 ctx_ context.Context 12106 header_ http.Header 12107} 12108 12109// WatchAll: Watch for changes on all objects in a bucket. 12110func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall { 12111 c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12112 c.bucket = bucket 12113 c.channel = channel 12114 return c 12115} 12116 12117// Delimiter sets the optional parameter "delimiter": Returns results in 12118// a directory-like mode. items will contain only objects whose names, 12119// aside from the prefix, do not contain delimiter. Objects whose names, 12120// aside from the prefix, contain delimiter will have their name, 12121// truncated after the delimiter, returned in prefixes. Duplicate 12122// prefixes are omitted. 12123func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall { 12124 c.urlParams_.Set("delimiter", delimiter) 12125 return c 12126} 12127 12128// EndOffset sets the optional parameter "endOffset": Filter results to 12129// objects whose names are lexicographically before endOffset. If 12130// startOffset is also set, the objects listed will have names between 12131// startOffset (inclusive) and endOffset (exclusive). 12132func (c *ObjectsWatchAllCall) EndOffset(endOffset string) *ObjectsWatchAllCall { 12133 c.urlParams_.Set("endOffset", endOffset) 12134 return c 12135} 12136 12137// IncludeTrailingDelimiter sets the optional parameter 12138// "includeTrailingDelimiter": If true, objects that end in exactly one 12139// instance of delimiter will have their metadata included in items in 12140// addition to prefixes. 12141func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall { 12142 c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter)) 12143 return c 12144} 12145 12146// MaxResults sets the optional parameter "maxResults": Maximum number 12147// of items plus prefixes to return in a single page of responses. As 12148// duplicate prefixes are omitted, fewer total results may be returned 12149// than requested. The service will use this parameter or 1,000 items, 12150// whichever is smaller. 12151func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall { 12152 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12153 return c 12154} 12155 12156// PageToken sets the optional parameter "pageToken": A 12157// previously-returned page token representing part of the larger set of 12158// results to view. 12159func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall { 12160 c.urlParams_.Set("pageToken", pageToken) 12161 return c 12162} 12163 12164// Prefix sets the optional parameter "prefix": Filter results to 12165// objects whose names begin with this prefix. 12166func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall { 12167 c.urlParams_.Set("prefix", prefix) 12168 return c 12169} 12170 12171// Projection sets the optional parameter "projection": Set of 12172// properties to return. Defaults to noAcl. 12173// 12174// Possible values: 12175// "full" - Include all properties. 12176// "noAcl" - Omit the owner, acl property. 12177func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall { 12178 c.urlParams_.Set("projection", projection) 12179 return c 12180} 12181 12182// ProvisionalUserProject sets the optional parameter 12183// "provisionalUserProject": The project to be billed for this request 12184// if the target bucket is requester-pays bucket. 12185func (c *ObjectsWatchAllCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsWatchAllCall { 12186 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 12187 return c 12188} 12189 12190// StartOffset sets the optional parameter "startOffset": Filter results 12191// to objects whose names are lexicographically equal to or after 12192// startOffset. If endOffset is also set, the objects listed will have 12193// names between startOffset (inclusive) and endOffset (exclusive). 12194func (c *ObjectsWatchAllCall) StartOffset(startOffset string) *ObjectsWatchAllCall { 12195 c.urlParams_.Set("startOffset", startOffset) 12196 return c 12197} 12198 12199// UserProject sets the optional parameter "userProject": The project to 12200// be billed for this request. Required for Requester Pays buckets. 12201func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall { 12202 c.urlParams_.Set("userProject", userProject) 12203 return c 12204} 12205 12206// Versions sets the optional parameter "versions": If true, lists all 12207// versions of an object as distinct results. The default is false. For 12208// more information, see Object Versioning. 12209func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall { 12210 c.urlParams_.Set("versions", fmt.Sprint(versions)) 12211 return c 12212} 12213 12214// Fields allows partial responses to be retrieved. See 12215// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12216// for more information. 12217func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall { 12218 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12219 return c 12220} 12221 12222// Context sets the context to be used in this call's Do method. Any 12223// pending HTTP request will be aborted if the provided context is 12224// canceled. 12225func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall { 12226 c.ctx_ = ctx 12227 return c 12228} 12229 12230// Header returns an http.Header that can be modified by the caller to 12231// add HTTP headers to the request. 12232func (c *ObjectsWatchAllCall) Header() http.Header { 12233 if c.header_ == nil { 12234 c.header_ = make(http.Header) 12235 } 12236 return c.header_ 12237} 12238 12239func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { 12240 reqHeaders := make(http.Header) 12241 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12242 for k, v := range c.header_ { 12243 reqHeaders[k] = v 12244 } 12245 reqHeaders.Set("User-Agent", c.s.userAgent()) 12246 var body io.Reader = nil 12247 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 12248 if err != nil { 12249 return nil, err 12250 } 12251 reqHeaders.Set("Content-Type", "application/json") 12252 c.urlParams_.Set("alt", alt) 12253 c.urlParams_.Set("prettyPrint", "false") 12254 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch") 12255 urls += "?" + c.urlParams_.Encode() 12256 req, err := http.NewRequest("POST", urls, body) 12257 if err != nil { 12258 return nil, err 12259 } 12260 req.Header = reqHeaders 12261 googleapi.Expand(req.URL, map[string]string{ 12262 "bucket": c.bucket, 12263 }) 12264 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12265} 12266 12267// Do executes the "storage.objects.watchAll" call. 12268// Exactly one of *Channel or error will be non-nil. Any non-2xx status 12269// code is an error. Response headers are in either 12270// *Channel.ServerResponse.Header or (if a response was returned at all) 12271// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12272// check whether the returned error was because http.StatusNotModified 12273// was returned. 12274func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 12275 gensupport.SetOptions(c.urlParams_, opts...) 12276 res, err := c.doRequest("json") 12277 if res != nil && res.StatusCode == http.StatusNotModified { 12278 if res.Body != nil { 12279 res.Body.Close() 12280 } 12281 return nil, &googleapi.Error{ 12282 Code: res.StatusCode, 12283 Header: res.Header, 12284 } 12285 } 12286 if err != nil { 12287 return nil, err 12288 } 12289 defer googleapi.CloseBody(res) 12290 if err := googleapi.CheckResponse(res); err != nil { 12291 return nil, err 12292 } 12293 ret := &Channel{ 12294 ServerResponse: googleapi.ServerResponse{ 12295 Header: res.Header, 12296 HTTPStatusCode: res.StatusCode, 12297 }, 12298 } 12299 target := &ret 12300 if err := gensupport.DecodeResponse(target, res); err != nil { 12301 return nil, err 12302 } 12303 return ret, nil 12304 // { 12305 // "description": "Watch for changes on all objects in a bucket.", 12306 // "httpMethod": "POST", 12307 // "id": "storage.objects.watchAll", 12308 // "parameterOrder": [ 12309 // "bucket" 12310 // ], 12311 // "parameters": { 12312 // "bucket": { 12313 // "description": "Name of the bucket in which to look for objects.", 12314 // "location": "path", 12315 // "required": true, 12316 // "type": "string" 12317 // }, 12318 // "delimiter": { 12319 // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", 12320 // "location": "query", 12321 // "type": "string" 12322 // }, 12323 // "endOffset": { 12324 // "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", 12325 // "location": "query", 12326 // "type": "string" 12327 // }, 12328 // "includeTrailingDelimiter": { 12329 // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", 12330 // "location": "query", 12331 // "type": "boolean" 12332 // }, 12333 // "maxResults": { 12334 // "default": "1000", 12335 // "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", 12336 // "format": "uint32", 12337 // "location": "query", 12338 // "minimum": "0", 12339 // "type": "integer" 12340 // }, 12341 // "pageToken": { 12342 // "description": "A previously-returned page token representing part of the larger set of results to view.", 12343 // "location": "query", 12344 // "type": "string" 12345 // }, 12346 // "prefix": { 12347 // "description": "Filter results to objects whose names begin with this prefix.", 12348 // "location": "query", 12349 // "type": "string" 12350 // }, 12351 // "projection": { 12352 // "description": "Set of properties to return. Defaults to noAcl.", 12353 // "enum": [ 12354 // "full", 12355 // "noAcl" 12356 // ], 12357 // "enumDescriptions": [ 12358 // "Include all properties.", 12359 // "Omit the owner, acl property." 12360 // ], 12361 // "location": "query", 12362 // "type": "string" 12363 // }, 12364 // "provisionalUserProject": { 12365 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 12366 // "location": "query", 12367 // "type": "string" 12368 // }, 12369 // "startOffset": { 12370 // "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", 12371 // "location": "query", 12372 // "type": "string" 12373 // }, 12374 // "userProject": { 12375 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 12376 // "location": "query", 12377 // "type": "string" 12378 // }, 12379 // "versions": { 12380 // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", 12381 // "location": "query", 12382 // "type": "boolean" 12383 // } 12384 // }, 12385 // "path": "b/{bucket}/o/watch", 12386 // "request": { 12387 // "$ref": "Channel", 12388 // "parameterName": "resource" 12389 // }, 12390 // "response": { 12391 // "$ref": "Channel" 12392 // }, 12393 // "scopes": [ 12394 // "https://www.googleapis.com/auth/cloud-platform", 12395 // "https://www.googleapis.com/auth/cloud-platform.read-only", 12396 // "https://www.googleapis.com/auth/devstorage.full_control", 12397 // "https://www.googleapis.com/auth/devstorage.read_only", 12398 // "https://www.googleapis.com/auth/devstorage.read_write" 12399 // ], 12400 // "supportsSubscription": true 12401 // } 12402 12403} 12404 12405// method id "storage.projects.hmacKeys.create": 12406 12407type ProjectsHmacKeysCreateCall struct { 12408 s *Service 12409 projectId string 12410 urlParams_ gensupport.URLParams 12411 ctx_ context.Context 12412 header_ http.Header 12413} 12414 12415// Create: Creates a new HMAC key for the specified service account. 12416func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall { 12417 c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12418 c.projectId = projectId 12419 c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail) 12420 return c 12421} 12422 12423// UserProject sets the optional parameter "userProject": The project to 12424// be billed for this request. 12425func (c *ProjectsHmacKeysCreateCall) UserProject(userProject string) *ProjectsHmacKeysCreateCall { 12426 c.urlParams_.Set("userProject", userProject) 12427 return c 12428} 12429 12430// Fields allows partial responses to be retrieved. See 12431// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12432// for more information. 12433func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall { 12434 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12435 return c 12436} 12437 12438// Context sets the context to be used in this call's Do method. Any 12439// pending HTTP request will be aborted if the provided context is 12440// canceled. 12441func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall { 12442 c.ctx_ = ctx 12443 return c 12444} 12445 12446// Header returns an http.Header that can be modified by the caller to 12447// add HTTP headers to the request. 12448func (c *ProjectsHmacKeysCreateCall) Header() http.Header { 12449 if c.header_ == nil { 12450 c.header_ = make(http.Header) 12451 } 12452 return c.header_ 12453} 12454 12455func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) { 12456 reqHeaders := make(http.Header) 12457 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12458 for k, v := range c.header_ { 12459 reqHeaders[k] = v 12460 } 12461 reqHeaders.Set("User-Agent", c.s.userAgent()) 12462 var body io.Reader = nil 12463 c.urlParams_.Set("alt", alt) 12464 c.urlParams_.Set("prettyPrint", "false") 12465 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") 12466 urls += "?" + c.urlParams_.Encode() 12467 req, err := http.NewRequest("POST", urls, body) 12468 if err != nil { 12469 return nil, err 12470 } 12471 req.Header = reqHeaders 12472 googleapi.Expand(req.URL, map[string]string{ 12473 "projectId": c.projectId, 12474 }) 12475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12476} 12477 12478// Do executes the "storage.projects.hmacKeys.create" call. 12479// Exactly one of *HmacKey or error will be non-nil. Any non-2xx status 12480// code is an error. Response headers are in either 12481// *HmacKey.ServerResponse.Header or (if a response was returned at all) 12482// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12483// check whether the returned error was because http.StatusNotModified 12484// was returned. 12485func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) { 12486 gensupport.SetOptions(c.urlParams_, opts...) 12487 res, err := c.doRequest("json") 12488 if res != nil && res.StatusCode == http.StatusNotModified { 12489 if res.Body != nil { 12490 res.Body.Close() 12491 } 12492 return nil, &googleapi.Error{ 12493 Code: res.StatusCode, 12494 Header: res.Header, 12495 } 12496 } 12497 if err != nil { 12498 return nil, err 12499 } 12500 defer googleapi.CloseBody(res) 12501 if err := googleapi.CheckResponse(res); err != nil { 12502 return nil, err 12503 } 12504 ret := &HmacKey{ 12505 ServerResponse: googleapi.ServerResponse{ 12506 Header: res.Header, 12507 HTTPStatusCode: res.StatusCode, 12508 }, 12509 } 12510 target := &ret 12511 if err := gensupport.DecodeResponse(target, res); err != nil { 12512 return nil, err 12513 } 12514 return ret, nil 12515 // { 12516 // "description": "Creates a new HMAC key for the specified service account.", 12517 // "httpMethod": "POST", 12518 // "id": "storage.projects.hmacKeys.create", 12519 // "parameterOrder": [ 12520 // "projectId", 12521 // "serviceAccountEmail" 12522 // ], 12523 // "parameters": { 12524 // "projectId": { 12525 // "description": "Project ID owning the service account.", 12526 // "location": "path", 12527 // "required": true, 12528 // "type": "string" 12529 // }, 12530 // "serviceAccountEmail": { 12531 // "description": "Email address of the service account.", 12532 // "location": "query", 12533 // "required": true, 12534 // "type": "string" 12535 // }, 12536 // "userProject": { 12537 // "description": "The project to be billed for this request.", 12538 // "location": "query", 12539 // "type": "string" 12540 // } 12541 // }, 12542 // "path": "projects/{projectId}/hmacKeys", 12543 // "response": { 12544 // "$ref": "HmacKey" 12545 // }, 12546 // "scopes": [ 12547 // "https://www.googleapis.com/auth/cloud-platform", 12548 // "https://www.googleapis.com/auth/devstorage.full_control" 12549 // ] 12550 // } 12551 12552} 12553 12554// method id "storage.projects.hmacKeys.delete": 12555 12556type ProjectsHmacKeysDeleteCall struct { 12557 s *Service 12558 projectId string 12559 accessId string 12560 urlParams_ gensupport.URLParams 12561 ctx_ context.Context 12562 header_ http.Header 12563} 12564 12565// Delete: Deletes an HMAC key. 12566func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall { 12567 c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12568 c.projectId = projectId 12569 c.accessId = accessId 12570 return c 12571} 12572 12573// UserProject sets the optional parameter "userProject": The project to 12574// be billed for this request. 12575func (c *ProjectsHmacKeysDeleteCall) UserProject(userProject string) *ProjectsHmacKeysDeleteCall { 12576 c.urlParams_.Set("userProject", userProject) 12577 return c 12578} 12579 12580// Fields allows partial responses to be retrieved. See 12581// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12582// for more information. 12583func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall { 12584 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12585 return c 12586} 12587 12588// Context sets the context to be used in this call's Do method. Any 12589// pending HTTP request will be aborted if the provided context is 12590// canceled. 12591func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall { 12592 c.ctx_ = ctx 12593 return c 12594} 12595 12596// Header returns an http.Header that can be modified by the caller to 12597// add HTTP headers to the request. 12598func (c *ProjectsHmacKeysDeleteCall) Header() http.Header { 12599 if c.header_ == nil { 12600 c.header_ = make(http.Header) 12601 } 12602 return c.header_ 12603} 12604 12605func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) { 12606 reqHeaders := make(http.Header) 12607 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12608 for k, v := range c.header_ { 12609 reqHeaders[k] = v 12610 } 12611 reqHeaders.Set("User-Agent", c.s.userAgent()) 12612 var body io.Reader = nil 12613 c.urlParams_.Set("alt", alt) 12614 c.urlParams_.Set("prettyPrint", "false") 12615 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") 12616 urls += "?" + c.urlParams_.Encode() 12617 req, err := http.NewRequest("DELETE", urls, body) 12618 if err != nil { 12619 return nil, err 12620 } 12621 req.Header = reqHeaders 12622 googleapi.Expand(req.URL, map[string]string{ 12623 "projectId": c.projectId, 12624 "accessId": c.accessId, 12625 }) 12626 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12627} 12628 12629// Do executes the "storage.projects.hmacKeys.delete" call. 12630func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error { 12631 gensupport.SetOptions(c.urlParams_, opts...) 12632 res, err := c.doRequest("json") 12633 if err != nil { 12634 return err 12635 } 12636 defer googleapi.CloseBody(res) 12637 if err := googleapi.CheckResponse(res); err != nil { 12638 return err 12639 } 12640 return nil 12641 // { 12642 // "description": "Deletes an HMAC key.", 12643 // "httpMethod": "DELETE", 12644 // "id": "storage.projects.hmacKeys.delete", 12645 // "parameterOrder": [ 12646 // "projectId", 12647 // "accessId" 12648 // ], 12649 // "parameters": { 12650 // "accessId": { 12651 // "description": "Name of the HMAC key to be deleted.", 12652 // "location": "path", 12653 // "required": true, 12654 // "type": "string" 12655 // }, 12656 // "projectId": { 12657 // "description": "Project ID owning the requested key", 12658 // "location": "path", 12659 // "required": true, 12660 // "type": "string" 12661 // }, 12662 // "userProject": { 12663 // "description": "The project to be billed for this request.", 12664 // "location": "query", 12665 // "type": "string" 12666 // } 12667 // }, 12668 // "path": "projects/{projectId}/hmacKeys/{accessId}", 12669 // "scopes": [ 12670 // "https://www.googleapis.com/auth/cloud-platform", 12671 // "https://www.googleapis.com/auth/devstorage.full_control", 12672 // "https://www.googleapis.com/auth/devstorage.read_write" 12673 // ] 12674 // } 12675 12676} 12677 12678// method id "storage.projects.hmacKeys.get": 12679 12680type ProjectsHmacKeysGetCall struct { 12681 s *Service 12682 projectId string 12683 accessId string 12684 urlParams_ gensupport.URLParams 12685 ifNoneMatch_ string 12686 ctx_ context.Context 12687 header_ http.Header 12688} 12689 12690// Get: Retrieves an HMAC key's metadata 12691func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall { 12692 c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12693 c.projectId = projectId 12694 c.accessId = accessId 12695 return c 12696} 12697 12698// UserProject sets the optional parameter "userProject": The project to 12699// be billed for this request. 12700func (c *ProjectsHmacKeysGetCall) UserProject(userProject string) *ProjectsHmacKeysGetCall { 12701 c.urlParams_.Set("userProject", userProject) 12702 return c 12703} 12704 12705// Fields allows partial responses to be retrieved. See 12706// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12707// for more information. 12708func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall { 12709 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12710 return c 12711} 12712 12713// IfNoneMatch sets the optional parameter which makes the operation 12714// fail if the object's ETag matches the given value. This is useful for 12715// getting updates only after the object has changed since the last 12716// request. Use googleapi.IsNotModified to check whether the response 12717// error from Do is the result of In-None-Match. 12718func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall { 12719 c.ifNoneMatch_ = entityTag 12720 return c 12721} 12722 12723// Context sets the context to be used in this call's Do method. Any 12724// pending HTTP request will be aborted if the provided context is 12725// canceled. 12726func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall { 12727 c.ctx_ = ctx 12728 return c 12729} 12730 12731// Header returns an http.Header that can be modified by the caller to 12732// add HTTP headers to the request. 12733func (c *ProjectsHmacKeysGetCall) Header() http.Header { 12734 if c.header_ == nil { 12735 c.header_ = make(http.Header) 12736 } 12737 return c.header_ 12738} 12739 12740func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) { 12741 reqHeaders := make(http.Header) 12742 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12743 for k, v := range c.header_ { 12744 reqHeaders[k] = v 12745 } 12746 reqHeaders.Set("User-Agent", c.s.userAgent()) 12747 if c.ifNoneMatch_ != "" { 12748 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12749 } 12750 var body io.Reader = nil 12751 c.urlParams_.Set("alt", alt) 12752 c.urlParams_.Set("prettyPrint", "false") 12753 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") 12754 urls += "?" + c.urlParams_.Encode() 12755 req, err := http.NewRequest("GET", urls, body) 12756 if err != nil { 12757 return nil, err 12758 } 12759 req.Header = reqHeaders 12760 googleapi.Expand(req.URL, map[string]string{ 12761 "projectId": c.projectId, 12762 "accessId": c.accessId, 12763 }) 12764 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12765} 12766 12767// Do executes the "storage.projects.hmacKeys.get" call. 12768// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx 12769// status code is an error. Response headers are in either 12770// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned 12771// at all) in error.(*googleapi.Error).Header. Use 12772// googleapi.IsNotModified to check whether the returned error was 12773// because http.StatusNotModified was returned. 12774func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) { 12775 gensupport.SetOptions(c.urlParams_, opts...) 12776 res, err := c.doRequest("json") 12777 if res != nil && res.StatusCode == http.StatusNotModified { 12778 if res.Body != nil { 12779 res.Body.Close() 12780 } 12781 return nil, &googleapi.Error{ 12782 Code: res.StatusCode, 12783 Header: res.Header, 12784 } 12785 } 12786 if err != nil { 12787 return nil, err 12788 } 12789 defer googleapi.CloseBody(res) 12790 if err := googleapi.CheckResponse(res); err != nil { 12791 return nil, err 12792 } 12793 ret := &HmacKeyMetadata{ 12794 ServerResponse: googleapi.ServerResponse{ 12795 Header: res.Header, 12796 HTTPStatusCode: res.StatusCode, 12797 }, 12798 } 12799 target := &ret 12800 if err := gensupport.DecodeResponse(target, res); err != nil { 12801 return nil, err 12802 } 12803 return ret, nil 12804 // { 12805 // "description": "Retrieves an HMAC key's metadata", 12806 // "httpMethod": "GET", 12807 // "id": "storage.projects.hmacKeys.get", 12808 // "parameterOrder": [ 12809 // "projectId", 12810 // "accessId" 12811 // ], 12812 // "parameters": { 12813 // "accessId": { 12814 // "description": "Name of the HMAC key.", 12815 // "location": "path", 12816 // "required": true, 12817 // "type": "string" 12818 // }, 12819 // "projectId": { 12820 // "description": "Project ID owning the service account of the requested key.", 12821 // "location": "path", 12822 // "required": true, 12823 // "type": "string" 12824 // }, 12825 // "userProject": { 12826 // "description": "The project to be billed for this request.", 12827 // "location": "query", 12828 // "type": "string" 12829 // } 12830 // }, 12831 // "path": "projects/{projectId}/hmacKeys/{accessId}", 12832 // "response": { 12833 // "$ref": "HmacKeyMetadata" 12834 // }, 12835 // "scopes": [ 12836 // "https://www.googleapis.com/auth/cloud-platform", 12837 // "https://www.googleapis.com/auth/cloud-platform.read-only", 12838 // "https://www.googleapis.com/auth/devstorage.full_control", 12839 // "https://www.googleapis.com/auth/devstorage.read_only" 12840 // ] 12841 // } 12842 12843} 12844 12845// method id "storage.projects.hmacKeys.list": 12846 12847type ProjectsHmacKeysListCall struct { 12848 s *Service 12849 projectId string 12850 urlParams_ gensupport.URLParams 12851 ifNoneMatch_ string 12852 ctx_ context.Context 12853 header_ http.Header 12854} 12855 12856// List: Retrieves a list of HMAC keys matching the criteria. 12857func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall { 12858 c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12859 c.projectId = projectId 12860 return c 12861} 12862 12863// MaxResults sets the optional parameter "maxResults": Maximum number 12864// of items to return in a single page of responses. The service uses 12865// this parameter or 250 items, whichever is smaller. The max number of 12866// items per page will also be limited by the number of distinct service 12867// accounts in the response. If the number of service accounts in a 12868// single response is too high, the page will truncated and a next page 12869// token will be returned. 12870func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall { 12871 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12872 return c 12873} 12874 12875// PageToken sets the optional parameter "pageToken": A 12876// previously-returned page token representing part of the larger set of 12877// results to view. 12878func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall { 12879 c.urlParams_.Set("pageToken", pageToken) 12880 return c 12881} 12882 12883// ServiceAccountEmail sets the optional parameter 12884// "serviceAccountEmail": If present, only keys for the given service 12885// account are returned. 12886func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall { 12887 c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail) 12888 return c 12889} 12890 12891// ShowDeletedKeys sets the optional parameter "showDeletedKeys": 12892// Whether or not to show keys in the DELETED state. 12893func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall { 12894 c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys)) 12895 return c 12896} 12897 12898// UserProject sets the optional parameter "userProject": The project to 12899// be billed for this request. 12900func (c *ProjectsHmacKeysListCall) UserProject(userProject string) *ProjectsHmacKeysListCall { 12901 c.urlParams_.Set("userProject", userProject) 12902 return c 12903} 12904 12905// Fields allows partial responses to be retrieved. See 12906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12907// for more information. 12908func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall { 12909 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12910 return c 12911} 12912 12913// IfNoneMatch sets the optional parameter which makes the operation 12914// fail if the object's ETag matches the given value. This is useful for 12915// getting updates only after the object has changed since the last 12916// request. Use googleapi.IsNotModified to check whether the response 12917// error from Do is the result of In-None-Match. 12918func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall { 12919 c.ifNoneMatch_ = entityTag 12920 return c 12921} 12922 12923// Context sets the context to be used in this call's Do method. Any 12924// pending HTTP request will be aborted if the provided context is 12925// canceled. 12926func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall { 12927 c.ctx_ = ctx 12928 return c 12929} 12930 12931// Header returns an http.Header that can be modified by the caller to 12932// add HTTP headers to the request. 12933func (c *ProjectsHmacKeysListCall) Header() http.Header { 12934 if c.header_ == nil { 12935 c.header_ = make(http.Header) 12936 } 12937 return c.header_ 12938} 12939 12940func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) { 12941 reqHeaders := make(http.Header) 12942 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 12943 for k, v := range c.header_ { 12944 reqHeaders[k] = v 12945 } 12946 reqHeaders.Set("User-Agent", c.s.userAgent()) 12947 if c.ifNoneMatch_ != "" { 12948 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12949 } 12950 var body io.Reader = nil 12951 c.urlParams_.Set("alt", alt) 12952 c.urlParams_.Set("prettyPrint", "false") 12953 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") 12954 urls += "?" + c.urlParams_.Encode() 12955 req, err := http.NewRequest("GET", urls, body) 12956 if err != nil { 12957 return nil, err 12958 } 12959 req.Header = reqHeaders 12960 googleapi.Expand(req.URL, map[string]string{ 12961 "projectId": c.projectId, 12962 }) 12963 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12964} 12965 12966// Do executes the "storage.projects.hmacKeys.list" call. 12967// Exactly one of *HmacKeysMetadata or error will be non-nil. Any 12968// non-2xx status code is an error. Response headers are in either 12969// *HmacKeysMetadata.ServerResponse.Header or (if a response was 12970// returned at all) in error.(*googleapi.Error).Header. Use 12971// googleapi.IsNotModified to check whether the returned error was 12972// because http.StatusNotModified was returned. 12973func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) { 12974 gensupport.SetOptions(c.urlParams_, opts...) 12975 res, err := c.doRequest("json") 12976 if res != nil && res.StatusCode == http.StatusNotModified { 12977 if res.Body != nil { 12978 res.Body.Close() 12979 } 12980 return nil, &googleapi.Error{ 12981 Code: res.StatusCode, 12982 Header: res.Header, 12983 } 12984 } 12985 if err != nil { 12986 return nil, err 12987 } 12988 defer googleapi.CloseBody(res) 12989 if err := googleapi.CheckResponse(res); err != nil { 12990 return nil, err 12991 } 12992 ret := &HmacKeysMetadata{ 12993 ServerResponse: googleapi.ServerResponse{ 12994 Header: res.Header, 12995 HTTPStatusCode: res.StatusCode, 12996 }, 12997 } 12998 target := &ret 12999 if err := gensupport.DecodeResponse(target, res); err != nil { 13000 return nil, err 13001 } 13002 return ret, nil 13003 // { 13004 // "description": "Retrieves a list of HMAC keys matching the criteria.", 13005 // "httpMethod": "GET", 13006 // "id": "storage.projects.hmacKeys.list", 13007 // "parameterOrder": [ 13008 // "projectId" 13009 // ], 13010 // "parameters": { 13011 // "maxResults": { 13012 // "default": "250", 13013 // "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.", 13014 // "format": "uint32", 13015 // "location": "query", 13016 // "minimum": "0", 13017 // "type": "integer" 13018 // }, 13019 // "pageToken": { 13020 // "description": "A previously-returned page token representing part of the larger set of results to view.", 13021 // "location": "query", 13022 // "type": "string" 13023 // }, 13024 // "projectId": { 13025 // "description": "Name of the project in which to look for HMAC keys.", 13026 // "location": "path", 13027 // "required": true, 13028 // "type": "string" 13029 // }, 13030 // "serviceAccountEmail": { 13031 // "description": "If present, only keys for the given service account are returned.", 13032 // "location": "query", 13033 // "type": "string" 13034 // }, 13035 // "showDeletedKeys": { 13036 // "description": "Whether or not to show keys in the DELETED state.", 13037 // "location": "query", 13038 // "type": "boolean" 13039 // }, 13040 // "userProject": { 13041 // "description": "The project to be billed for this request.", 13042 // "location": "query", 13043 // "type": "string" 13044 // } 13045 // }, 13046 // "path": "projects/{projectId}/hmacKeys", 13047 // "response": { 13048 // "$ref": "HmacKeysMetadata" 13049 // }, 13050 // "scopes": [ 13051 // "https://www.googleapis.com/auth/cloud-platform", 13052 // "https://www.googleapis.com/auth/cloud-platform.read-only", 13053 // "https://www.googleapis.com/auth/devstorage.full_control", 13054 // "https://www.googleapis.com/auth/devstorage.read_only" 13055 // ] 13056 // } 13057 13058} 13059 13060// Pages invokes f for each page of results. 13061// A non-nil error returned from f will halt the iteration. 13062// The provided context supersedes any context provided to the Context method. 13063func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error { 13064 c.ctx_ = ctx 13065 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13066 for { 13067 x, err := c.Do() 13068 if err != nil { 13069 return err 13070 } 13071 if err := f(x); err != nil { 13072 return err 13073 } 13074 if x.NextPageToken == "" { 13075 return nil 13076 } 13077 c.PageToken(x.NextPageToken) 13078 } 13079} 13080 13081// method id "storage.projects.hmacKeys.update": 13082 13083type ProjectsHmacKeysUpdateCall struct { 13084 s *Service 13085 projectId string 13086 accessId string 13087 hmackeymetadata *HmacKeyMetadata 13088 urlParams_ gensupport.URLParams 13089 ctx_ context.Context 13090 header_ http.Header 13091} 13092 13093// Update: Updates the state of an HMAC key. See the HMAC Key resource 13094// descriptor for valid states. 13095func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall { 13096 c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13097 c.projectId = projectId 13098 c.accessId = accessId 13099 c.hmackeymetadata = hmackeymetadata 13100 return c 13101} 13102 13103// UserProject sets the optional parameter "userProject": The project to 13104// be billed for this request. 13105func (c *ProjectsHmacKeysUpdateCall) UserProject(userProject string) *ProjectsHmacKeysUpdateCall { 13106 c.urlParams_.Set("userProject", userProject) 13107 return c 13108} 13109 13110// Fields allows partial responses to be retrieved. See 13111// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13112// for more information. 13113func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall { 13114 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13115 return c 13116} 13117 13118// Context sets the context to be used in this call's Do method. Any 13119// pending HTTP request will be aborted if the provided context is 13120// canceled. 13121func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall { 13122 c.ctx_ = ctx 13123 return c 13124} 13125 13126// Header returns an http.Header that can be modified by the caller to 13127// add HTTP headers to the request. 13128func (c *ProjectsHmacKeysUpdateCall) Header() http.Header { 13129 if c.header_ == nil { 13130 c.header_ = make(http.Header) 13131 } 13132 return c.header_ 13133} 13134 13135func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) { 13136 reqHeaders := make(http.Header) 13137 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13138 for k, v := range c.header_ { 13139 reqHeaders[k] = v 13140 } 13141 reqHeaders.Set("User-Agent", c.s.userAgent()) 13142 var body io.Reader = nil 13143 body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata) 13144 if err != nil { 13145 return nil, err 13146 } 13147 reqHeaders.Set("Content-Type", "application/json") 13148 c.urlParams_.Set("alt", alt) 13149 c.urlParams_.Set("prettyPrint", "false") 13150 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") 13151 urls += "?" + c.urlParams_.Encode() 13152 req, err := http.NewRequest("PUT", urls, body) 13153 if err != nil { 13154 return nil, err 13155 } 13156 req.Header = reqHeaders 13157 googleapi.Expand(req.URL, map[string]string{ 13158 "projectId": c.projectId, 13159 "accessId": c.accessId, 13160 }) 13161 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13162} 13163 13164// Do executes the "storage.projects.hmacKeys.update" call. 13165// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx 13166// status code is an error. Response headers are in either 13167// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned 13168// at all) in error.(*googleapi.Error).Header. Use 13169// googleapi.IsNotModified to check whether the returned error was 13170// because http.StatusNotModified was returned. 13171func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) { 13172 gensupport.SetOptions(c.urlParams_, opts...) 13173 res, err := c.doRequest("json") 13174 if res != nil && res.StatusCode == http.StatusNotModified { 13175 if res.Body != nil { 13176 res.Body.Close() 13177 } 13178 return nil, &googleapi.Error{ 13179 Code: res.StatusCode, 13180 Header: res.Header, 13181 } 13182 } 13183 if err != nil { 13184 return nil, err 13185 } 13186 defer googleapi.CloseBody(res) 13187 if err := googleapi.CheckResponse(res); err != nil { 13188 return nil, err 13189 } 13190 ret := &HmacKeyMetadata{ 13191 ServerResponse: googleapi.ServerResponse{ 13192 Header: res.Header, 13193 HTTPStatusCode: res.StatusCode, 13194 }, 13195 } 13196 target := &ret 13197 if err := gensupport.DecodeResponse(target, res); err != nil { 13198 return nil, err 13199 } 13200 return ret, nil 13201 // { 13202 // "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", 13203 // "httpMethod": "PUT", 13204 // "id": "storage.projects.hmacKeys.update", 13205 // "parameterOrder": [ 13206 // "projectId", 13207 // "accessId" 13208 // ], 13209 // "parameters": { 13210 // "accessId": { 13211 // "description": "Name of the HMAC key being updated.", 13212 // "location": "path", 13213 // "required": true, 13214 // "type": "string" 13215 // }, 13216 // "projectId": { 13217 // "description": "Project ID owning the service account of the updated key.", 13218 // "location": "path", 13219 // "required": true, 13220 // "type": "string" 13221 // }, 13222 // "userProject": { 13223 // "description": "The project to be billed for this request.", 13224 // "location": "query", 13225 // "type": "string" 13226 // } 13227 // }, 13228 // "path": "projects/{projectId}/hmacKeys/{accessId}", 13229 // "request": { 13230 // "$ref": "HmacKeyMetadata" 13231 // }, 13232 // "response": { 13233 // "$ref": "HmacKeyMetadata" 13234 // }, 13235 // "scopes": [ 13236 // "https://www.googleapis.com/auth/cloud-platform", 13237 // "https://www.googleapis.com/auth/devstorage.full_control" 13238 // ] 13239 // } 13240 13241} 13242 13243// method id "storage.projects.serviceAccount.get": 13244 13245type ProjectsServiceAccountGetCall struct { 13246 s *Service 13247 projectId string 13248 urlParams_ gensupport.URLParams 13249 ifNoneMatch_ string 13250 ctx_ context.Context 13251 header_ http.Header 13252} 13253 13254// Get: Get the email address of this project's Google Cloud Storage 13255// service account. 13256func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall { 13257 c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13258 c.projectId = projectId 13259 return c 13260} 13261 13262// ProvisionalUserProject sets the optional parameter 13263// "provisionalUserProject": The project to be billed for this request 13264// if the target bucket is requester-pays bucket. 13265func (c *ProjectsServiceAccountGetCall) ProvisionalUserProject(provisionalUserProject string) *ProjectsServiceAccountGetCall { 13266 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 13267 return c 13268} 13269 13270// UserProject sets the optional parameter "userProject": The project to 13271// be billed for this request. 13272func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall { 13273 c.urlParams_.Set("userProject", userProject) 13274 return c 13275} 13276 13277// Fields allows partial responses to be retrieved. See 13278// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13279// for more information. 13280func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall { 13281 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13282 return c 13283} 13284 13285// IfNoneMatch sets the optional parameter which makes the operation 13286// fail if the object's ETag matches the given value. This is useful for 13287// getting updates only after the object has changed since the last 13288// request. Use googleapi.IsNotModified to check whether the response 13289// error from Do is the result of In-None-Match. 13290func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall { 13291 c.ifNoneMatch_ = entityTag 13292 return c 13293} 13294 13295// Context sets the context to be used in this call's Do method. Any 13296// pending HTTP request will be aborted if the provided context is 13297// canceled. 13298func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall { 13299 c.ctx_ = ctx 13300 return c 13301} 13302 13303// Header returns an http.Header that can be modified by the caller to 13304// add HTTP headers to the request. 13305func (c *ProjectsServiceAccountGetCall) Header() http.Header { 13306 if c.header_ == nil { 13307 c.header_ = make(http.Header) 13308 } 13309 return c.header_ 13310} 13311 13312func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) { 13313 reqHeaders := make(http.Header) 13314 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 13315 for k, v := range c.header_ { 13316 reqHeaders[k] = v 13317 } 13318 reqHeaders.Set("User-Agent", c.s.userAgent()) 13319 if c.ifNoneMatch_ != "" { 13320 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13321 } 13322 var body io.Reader = nil 13323 c.urlParams_.Set("alt", alt) 13324 c.urlParams_.Set("prettyPrint", "false") 13325 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount") 13326 urls += "?" + c.urlParams_.Encode() 13327 req, err := http.NewRequest("GET", urls, body) 13328 if err != nil { 13329 return nil, err 13330 } 13331 req.Header = reqHeaders 13332 googleapi.Expand(req.URL, map[string]string{ 13333 "projectId": c.projectId, 13334 }) 13335 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13336} 13337 13338// Do executes the "storage.projects.serviceAccount.get" call. 13339// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx 13340// status code is an error. Response headers are in either 13341// *ServiceAccount.ServerResponse.Header or (if a response was returned 13342// at all) in error.(*googleapi.Error).Header. Use 13343// googleapi.IsNotModified to check whether the returned error was 13344// because http.StatusNotModified was returned. 13345func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) { 13346 gensupport.SetOptions(c.urlParams_, opts...) 13347 res, err := c.doRequest("json") 13348 if res != nil && res.StatusCode == http.StatusNotModified { 13349 if res.Body != nil { 13350 res.Body.Close() 13351 } 13352 return nil, &googleapi.Error{ 13353 Code: res.StatusCode, 13354 Header: res.Header, 13355 } 13356 } 13357 if err != nil { 13358 return nil, err 13359 } 13360 defer googleapi.CloseBody(res) 13361 if err := googleapi.CheckResponse(res); err != nil { 13362 return nil, err 13363 } 13364 ret := &ServiceAccount{ 13365 ServerResponse: googleapi.ServerResponse{ 13366 Header: res.Header, 13367 HTTPStatusCode: res.StatusCode, 13368 }, 13369 } 13370 target := &ret 13371 if err := gensupport.DecodeResponse(target, res); err != nil { 13372 return nil, err 13373 } 13374 return ret, nil 13375 // { 13376 // "description": "Get the email address of this project's Google Cloud Storage service account.", 13377 // "httpMethod": "GET", 13378 // "id": "storage.projects.serviceAccount.get", 13379 // "parameterOrder": [ 13380 // "projectId" 13381 // ], 13382 // "parameters": { 13383 // "projectId": { 13384 // "description": "Project ID", 13385 // "location": "path", 13386 // "required": true, 13387 // "type": "string" 13388 // }, 13389 // "provisionalUserProject": { 13390 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 13391 // "location": "query", 13392 // "type": "string" 13393 // }, 13394 // "userProject": { 13395 // "description": "The project to be billed for this request.", 13396 // "location": "query", 13397 // "type": "string" 13398 // } 13399 // }, 13400 // "path": "projects/{projectId}/serviceAccount", 13401 // "response": { 13402 // "$ref": "ServiceAccount" 13403 // }, 13404 // "scopes": [ 13405 // "https://www.googleapis.com/auth/cloud-platform", 13406 // "https://www.googleapis.com/auth/cloud-platform.read-only", 13407 // "https://www.googleapis.com/auth/devstorage.full_control", 13408 // "https://www.googleapis.com/auth/devstorage.read_only", 13409 // "https://www.googleapis.com/auth/devstorage.read_write" 13410 // ] 13411 // } 13412 13413} 13414