1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package 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 // Autoclass: The bucket's Autoclass configuration. 283 Autoclass *BucketAutoclass `json:"autoclass,omitempty"` 284 285 // Billing: The bucket's billing configuration. 286 Billing *BucketBilling `json:"billing,omitempty"` 287 288 // Cors: The bucket's Cross-Origin Resource Sharing (CORS) 289 // configuration. 290 Cors []*BucketCors `json:"cors,omitempty"` 291 292 // CustomPlacementConfig: The bucket's custom placement configuration 293 // for Custom Dual Regions. 294 CustomPlacementConfig *BucketCustomPlacementConfig `json:"customPlacementConfig,omitempty"` 295 296 // DefaultEventBasedHold: The default value for event-based hold on 297 // newly created objects in this bucket. Event-based hold is a way to 298 // retain objects indefinitely until an event occurs, signified by the 299 // hold's release. After being released, such objects will be subject to 300 // bucket-level retention (if any). One sample use case of this flag is 301 // for banks to hold loan documents for at least 3 years after loan is 302 // paid in full. Here, bucket-level retention is 3 years and the event 303 // is loan being paid in full. In this example, these objects will be 304 // held intact for any number of years until the event has occurred 305 // (event-based hold on the object is released) and then 3 more years 306 // after that. That means retention duration of the objects begins from 307 // the moment event-based hold transitioned from true to false. Objects 308 // under event-based hold cannot be deleted, overwritten or archived 309 // until the hold is removed. 310 DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"` 311 312 // DefaultObjectAcl: Default access controls to apply to new objects 313 // when no ACL is provided. 314 DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"` 315 316 // Encryption: Encryption configuration for a bucket. 317 Encryption *BucketEncryption `json:"encryption,omitempty"` 318 319 // Etag: HTTP 1.1 Entity tag for the bucket. 320 Etag string `json:"etag,omitempty"` 321 322 // IamConfiguration: The bucket's IAM configuration. 323 IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"` 324 325 // Id: The ID of the bucket. For buckets, the id and name properties are 326 // the same. 327 Id string `json:"id,omitempty"` 328 329 // Kind: The kind of item this is. For buckets, this is always 330 // storage#bucket. 331 Kind string `json:"kind,omitempty"` 332 333 // Labels: User-provided labels, in key/value pairs. 334 Labels map[string]string `json:"labels,omitempty"` 335 336 // Lifecycle: The bucket's lifecycle configuration. See lifecycle 337 // management for more information. 338 Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"` 339 340 // Location: The location of the bucket. Object data for objects in the 341 // bucket resides in physical storage within this region. Defaults to 342 // US. See the developer's guide for the authoritative list. 343 Location string `json:"location,omitempty"` 344 345 // LocationType: The type of the bucket location. 346 LocationType string `json:"locationType,omitempty"` 347 348 // Logging: The bucket's logging configuration, which defines the 349 // destination bucket and optional name prefix for the current bucket's 350 // logs. 351 Logging *BucketLogging `json:"logging,omitempty"` 352 353 // Metageneration: The metadata generation of this bucket. 354 Metageneration int64 `json:"metageneration,omitempty,string"` 355 356 // Name: The name of the bucket. 357 Name string `json:"name,omitempty"` 358 359 // Owner: The owner of the bucket. This is always the project team's 360 // owner group. 361 Owner *BucketOwner `json:"owner,omitempty"` 362 363 // ProjectNumber: The project number of the project the bucket belongs 364 // to. 365 ProjectNumber uint64 `json:"projectNumber,omitempty,string"` 366 367 // RetentionPolicy: The bucket's retention policy. The retention policy 368 // enforces a minimum retention time for all objects contained in the 369 // bucket, based on their creation time. Any attempt to overwrite or 370 // delete objects younger than the retention period will result in a 371 // PERMISSION_DENIED error. An unlocked retention policy can be modified 372 // or removed from the bucket via a storage.buckets.update operation. A 373 // locked retention policy cannot be removed or shortened in duration 374 // for the lifetime of the bucket. Attempting to remove or decrease 375 // period of a locked retention policy will result in a 376 // PERMISSION_DENIED error. 377 RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"` 378 379 // Rpo: The Recovery Point Objective (RPO) of this bucket. Set to 380 // ASYNC_TURBO to turn on Turbo Replication on a bucket. 381 Rpo string `json:"rpo,omitempty"` 382 383 // SatisfiesPZS: Reserved for future use. 384 SatisfiesPZS bool `json:"satisfiesPZS,omitempty"` 385 386 // SelfLink: The URI of this bucket. 387 SelfLink string `json:"selfLink,omitempty"` 388 389 // StorageClass: The bucket's default storage class, used whenever no 390 // storageClass is specified for a newly-created object. This defines 391 // how objects in the bucket are stored and determines the SLA and the 392 // cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, 393 // NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If 394 // this value is not specified when the bucket is created, it will 395 // default to STANDARD. For more information, see storage classes. 396 StorageClass string `json:"storageClass,omitempty"` 397 398 // TimeCreated: The creation time of the bucket in RFC 3339 format. 399 TimeCreated string `json:"timeCreated,omitempty"` 400 401 // Updated: The modification time of the bucket in RFC 3339 format. 402 Updated string `json:"updated,omitempty"` 403 404 // Versioning: The bucket's versioning configuration. 405 Versioning *BucketVersioning `json:"versioning,omitempty"` 406 407 // Website: The bucket's website configuration, controlling how the 408 // service behaves when accessing bucket contents as a web site. See the 409 // Static Website Examples for more information. 410 Website *BucketWebsite `json:"website,omitempty"` 411 412 // ServerResponse contains the HTTP response code and headers from the 413 // server. 414 googleapi.ServerResponse `json:"-"` 415 416 // ForceSendFields is a list of field names (e.g. "Acl") to 417 // unconditionally include in API requests. By default, fields with 418 // empty or default values are omitted from API requests. However, any 419 // non-pointer, non-interface field appearing in ForceSendFields will be 420 // sent to the server regardless of whether the field is empty or not. 421 // This may be used to include empty fields in Patch requests. 422 ForceSendFields []string `json:"-"` 423 424 // NullFields is a list of field names (e.g. "Acl") to include in API 425 // requests with the JSON null value. By default, fields with empty 426 // values are omitted from API requests. However, any field with an 427 // empty value appearing in NullFields will be sent to the server as 428 // null. It is an error if a field in this list has a non-empty value. 429 // This may be used to include null fields in Patch requests. 430 NullFields []string `json:"-"` 431} 432 433func (s *Bucket) MarshalJSON() ([]byte, error) { 434 type NoMethod Bucket 435 raw := NoMethod(*s) 436 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 437} 438 439// BucketAutoclass: The bucket's Autoclass configuration. 440type BucketAutoclass struct { 441 // Enabled: Whether or not Autoclass is enabled on this bucket 442 Enabled bool `json:"enabled,omitempty"` 443 444 // ToggleTime: A date and time in RFC 3339 format representing the 445 // instant at which "enabled" was last toggled. 446 ToggleTime string `json:"toggleTime,omitempty"` 447 448 // ForceSendFields is a list of field names (e.g. "Enabled") to 449 // unconditionally include in API requests. By default, fields with 450 // empty or default values are omitted from API requests. However, any 451 // non-pointer, non-interface field appearing in ForceSendFields will be 452 // sent to the server regardless of whether the field is empty or not. 453 // This may be used to include empty fields in Patch requests. 454 ForceSendFields []string `json:"-"` 455 456 // NullFields is a list of field names (e.g. "Enabled") to include in 457 // API requests with the JSON null value. By default, fields with empty 458 // values are omitted from API requests. However, any field with an 459 // empty value appearing in NullFields will be sent to the server as 460 // null. It is an error if a field in this list has a non-empty value. 461 // This may be used to include null fields in Patch requests. 462 NullFields []string `json:"-"` 463} 464 465func (s *BucketAutoclass) MarshalJSON() ([]byte, error) { 466 type NoMethod BucketAutoclass 467 raw := NoMethod(*s) 468 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 469} 470 471// BucketBilling: The bucket's billing configuration. 472type BucketBilling struct { 473 // RequesterPays: When set to true, Requester Pays is enabled for this 474 // bucket. 475 RequesterPays bool `json:"requesterPays,omitempty"` 476 477 // ForceSendFields is a list of field names (e.g. "RequesterPays") to 478 // unconditionally include in API requests. By default, fields with 479 // empty or default values are omitted from API requests. However, any 480 // non-pointer, non-interface field appearing in ForceSendFields will be 481 // sent to the server regardless of whether the field is empty or not. 482 // This may be used to include empty fields in Patch requests. 483 ForceSendFields []string `json:"-"` 484 485 // NullFields is a list of field names (e.g. "RequesterPays") to include 486 // in API requests with the JSON null value. By default, fields with 487 // empty values are omitted from API requests. However, any field with 488 // an empty value appearing in NullFields will be sent to the server as 489 // null. It is an error if a field in this list has a non-empty value. 490 // This may be used to include null fields in Patch requests. 491 NullFields []string `json:"-"` 492} 493 494func (s *BucketBilling) MarshalJSON() ([]byte, error) { 495 type NoMethod BucketBilling 496 raw := NoMethod(*s) 497 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 498} 499 500type BucketCors struct { 501 // MaxAgeSeconds: The value, in seconds, to return in the 502 // Access-Control-Max-Age header used in preflight responses. 503 MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"` 504 505 // Method: The list of HTTP methods on which to include CORS response 506 // headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list 507 // of methods, and means "any method". 508 Method []string `json:"method,omitempty"` 509 510 // Origin: The list of Origins eligible to receive CORS response 511 // headers. Note: "*" is permitted in the list of origins, and means 512 // "any Origin". 513 Origin []string `json:"origin,omitempty"` 514 515 // ResponseHeader: The list of HTTP headers other than the simple 516 // response headers to give permission for the user-agent to share 517 // across domains. 518 ResponseHeader []string `json:"responseHeader,omitempty"` 519 520 // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to 521 // unconditionally include in API requests. By default, fields with 522 // empty or default values are omitted from API requests. However, any 523 // non-pointer, non-interface field appearing in ForceSendFields will be 524 // sent to the server regardless of whether the field is empty or not. 525 // This may be used to include empty fields in Patch requests. 526 ForceSendFields []string `json:"-"` 527 528 // NullFields is a list of field names (e.g. "MaxAgeSeconds") to include 529 // in API requests with the JSON null value. By default, fields with 530 // empty values are omitted from API requests. However, any field with 531 // an empty value appearing in NullFields will be sent to the server as 532 // null. It is an error if a field in this list has a non-empty value. 533 // This may be used to include null fields in Patch requests. 534 NullFields []string `json:"-"` 535} 536 537func (s *BucketCors) MarshalJSON() ([]byte, error) { 538 type NoMethod BucketCors 539 raw := NoMethod(*s) 540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 541} 542 543// BucketCustomPlacementConfig: The bucket's custom placement 544// configuration for Custom Dual Regions. 545type BucketCustomPlacementConfig struct { 546 // DataLocations: The list of regional locations in which data is 547 // placed. 548 DataLocations []string `json:"dataLocations,omitempty"` 549 550 // ForceSendFields is a list of field names (e.g. "DataLocations") to 551 // unconditionally include in API requests. By default, fields with 552 // empty or default values are omitted from API requests. However, any 553 // non-pointer, non-interface field appearing in ForceSendFields will be 554 // sent to the server regardless of whether the field is empty or not. 555 // This may be used to include empty fields in Patch requests. 556 ForceSendFields []string `json:"-"` 557 558 // NullFields is a list of field names (e.g. "DataLocations") to include 559 // in API requests with the JSON null value. By default, fields with 560 // empty values are omitted from API requests. However, any field with 561 // an empty value appearing in NullFields will be sent to the server as 562 // null. It is an error if a field in this list has a non-empty value. 563 // This may be used to include null fields in Patch requests. 564 NullFields []string `json:"-"` 565} 566 567func (s *BucketCustomPlacementConfig) MarshalJSON() ([]byte, error) { 568 type NoMethod BucketCustomPlacementConfig 569 raw := NoMethod(*s) 570 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 571} 572 573// BucketEncryption: Encryption configuration for a bucket. 574type BucketEncryption struct { 575 // DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt 576 // objects inserted into this bucket, if no encryption method is 577 // specified. 578 DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"` 579 580 // ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName") 581 // to unconditionally include in API requests. By default, fields with 582 // empty or default values are omitted from API requests. However, any 583 // non-pointer, non-interface field appearing in ForceSendFields will be 584 // sent to the server regardless of whether the field is empty or not. 585 // This may be used to include empty fields in Patch requests. 586 ForceSendFields []string `json:"-"` 587 588 // NullFields is a list of field names (e.g. "DefaultKmsKeyName") to 589 // include in API requests with the JSON null value. By default, fields 590 // with empty values are omitted from API requests. However, any field 591 // with an empty value appearing in NullFields will be sent to the 592 // server as null. It is an error if a field in this list has a 593 // non-empty value. This may be used to include null fields in Patch 594 // requests. 595 NullFields []string `json:"-"` 596} 597 598func (s *BucketEncryption) MarshalJSON() ([]byte, error) { 599 type NoMethod BucketEncryption 600 raw := NoMethod(*s) 601 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 602} 603 604// BucketIamConfiguration: The bucket's IAM configuration. 605type BucketIamConfiguration struct { 606 // BucketPolicyOnly: The bucket's uniform bucket-level access 607 // configuration. The feature was formerly known as Bucket Policy Only. 608 // For backward compatibility, this field will be populated with 609 // identical information as the uniformBucketLevelAccess field. We 610 // recommend using the uniformBucketLevelAccess field to enable and 611 // disable the feature. 612 BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"` 613 614 // PublicAccessPrevention: The bucket's Public Access Prevention 615 // configuration. Currently, 'unspecified' and 'enforced' are supported. 616 PublicAccessPrevention string `json:"publicAccessPrevention,omitempty"` 617 618 // UniformBucketLevelAccess: The bucket's uniform bucket-level access 619 // configuration. 620 UniformBucketLevelAccess *BucketIamConfigurationUniformBucketLevelAccess `json:"uniformBucketLevelAccess,omitempty"` 621 622 // ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to 623 // unconditionally include in API requests. By default, fields with 624 // empty or default values are omitted from API requests. However, any 625 // non-pointer, non-interface field appearing in ForceSendFields will be 626 // sent to the server regardless of whether the field is empty or not. 627 // This may be used to include empty fields in Patch requests. 628 ForceSendFields []string `json:"-"` 629 630 // NullFields is a list of field names (e.g. "BucketPolicyOnly") to 631 // include in API requests with the JSON null value. By default, fields 632 // with empty values are omitted from API requests. However, any field 633 // with an empty value appearing in NullFields will be sent to the 634 // server as null. It is an error if a field in this list has a 635 // non-empty value. This may be used to include null fields in Patch 636 // requests. 637 NullFields []string `json:"-"` 638} 639 640func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) { 641 type NoMethod BucketIamConfiguration 642 raw := NoMethod(*s) 643 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 644} 645 646// BucketIamConfigurationBucketPolicyOnly: The bucket's uniform 647// bucket-level access configuration. The feature was formerly known as 648// Bucket Policy Only. For backward compatibility, this field will be 649// populated with identical information as the uniformBucketLevelAccess 650// field. We recommend using the uniformBucketLevelAccess field to 651// enable and disable the feature. 652type BucketIamConfigurationBucketPolicyOnly struct { 653 // Enabled: If set, access is controlled only by bucket-level or above 654 // IAM policies. 655 Enabled bool `json:"enabled,omitempty"` 656 657 // LockedTime: The deadline for changing 658 // iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 659 // 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed 660 // from true to false until the locked time, after which the field is 661 // immutable. 662 LockedTime string `json:"lockedTime,omitempty"` 663 664 // ForceSendFields is a list of field names (e.g. "Enabled") to 665 // unconditionally include in API requests. By default, fields with 666 // empty or default values are omitted from API requests. However, any 667 // non-pointer, non-interface field appearing in ForceSendFields will be 668 // sent to the server regardless of whether the field is empty or not. 669 // This may be used to include empty fields in Patch requests. 670 ForceSendFields []string `json:"-"` 671 672 // NullFields is a list of field names (e.g. "Enabled") to include in 673 // API requests with the JSON null value. By default, fields with empty 674 // values are omitted from API requests. However, any field with an 675 // empty value appearing in NullFields will be sent to the server as 676 // null. It is an error if a field in this list has a non-empty value. 677 // This may be used to include null fields in Patch requests. 678 NullFields []string `json:"-"` 679} 680 681func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) { 682 type NoMethod BucketIamConfigurationBucketPolicyOnly 683 raw := NoMethod(*s) 684 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 685} 686 687// BucketIamConfigurationUniformBucketLevelAccess: The bucket's uniform 688// bucket-level access configuration. 689type BucketIamConfigurationUniformBucketLevelAccess struct { 690 // Enabled: If set, access is controlled only by bucket-level or above 691 // IAM policies. 692 Enabled bool `json:"enabled,omitempty"` 693 694 // LockedTime: The deadline for changing 695 // iamConfiguration.uniformBucketLevelAccess.enabled from true to false 696 // in RFC 3339 format. 697 // iamConfiguration.uniformBucketLevelAccess.enabled may be changed from 698 // true to false until the locked time, after which the field is 699 // immutable. 700 LockedTime string `json:"lockedTime,omitempty"` 701 702 // ForceSendFields is a list of field names (e.g. "Enabled") to 703 // unconditionally include in API requests. By default, fields with 704 // empty or default values are omitted from API requests. However, any 705 // non-pointer, non-interface field appearing in ForceSendFields will be 706 // sent to the server regardless of whether the field is empty or not. 707 // This may be used to include empty fields in Patch requests. 708 ForceSendFields []string `json:"-"` 709 710 // NullFields is a list of field names (e.g. "Enabled") to include in 711 // API requests with the JSON null value. By default, fields with empty 712 // values are omitted from API requests. However, any field with an 713 // empty value appearing in NullFields will be sent to the server as 714 // null. It is an error if a field in this list has a non-empty value. 715 // This may be used to include null fields in Patch requests. 716 NullFields []string `json:"-"` 717} 718 719func (s *BucketIamConfigurationUniformBucketLevelAccess) MarshalJSON() ([]byte, error) { 720 type NoMethod BucketIamConfigurationUniformBucketLevelAccess 721 raw := NoMethod(*s) 722 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 723} 724 725// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle 726// management for more information. 727type BucketLifecycle struct { 728 // Rule: A lifecycle management rule, which is made of an action to take 729 // and the condition(s) under which the action will be taken. 730 Rule []*BucketLifecycleRule `json:"rule,omitempty"` 731 732 // ForceSendFields is a list of field names (e.g. "Rule") to 733 // unconditionally include in API requests. By default, fields with 734 // empty or default values are omitted from API requests. However, any 735 // non-pointer, non-interface field appearing in ForceSendFields will be 736 // sent to the server regardless of whether the field is empty or not. 737 // This may be used to include empty fields in Patch requests. 738 ForceSendFields []string `json:"-"` 739 740 // NullFields is a list of field names (e.g. "Rule") to include in API 741 // requests with the JSON null value. By default, fields with empty 742 // values are omitted from API requests. However, any field with an 743 // empty value appearing in NullFields will be sent to the server as 744 // null. It is an error if a field in this list has a non-empty value. 745 // This may be used to include null fields in Patch requests. 746 NullFields []string `json:"-"` 747} 748 749func (s *BucketLifecycle) MarshalJSON() ([]byte, error) { 750 type NoMethod BucketLifecycle 751 raw := NoMethod(*s) 752 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 753} 754 755type BucketLifecycleRule struct { 756 // Action: The action to take. 757 Action *BucketLifecycleRuleAction `json:"action,omitempty"` 758 759 // Condition: The condition(s) under which the action will be taken. 760 Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"` 761 762 // ForceSendFields is a list of field names (e.g. "Action") to 763 // unconditionally include in API requests. By default, fields with 764 // empty or default values are omitted from API requests. However, any 765 // non-pointer, non-interface field appearing in ForceSendFields will be 766 // sent to the server regardless of whether the field is empty or not. 767 // This may be used to include empty fields in Patch requests. 768 ForceSendFields []string `json:"-"` 769 770 // NullFields is a list of field names (e.g. "Action") to include in API 771 // requests with the JSON null value. By default, fields with empty 772 // values are omitted from API requests. However, any field with an 773 // empty value appearing in NullFields will be sent to the server as 774 // null. It is an error if a field in this list has a non-empty value. 775 // This may be used to include null fields in Patch requests. 776 NullFields []string `json:"-"` 777} 778 779func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) { 780 type NoMethod BucketLifecycleRule 781 raw := NoMethod(*s) 782 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 783} 784 785// BucketLifecycleRuleAction: The action to take. 786type BucketLifecycleRuleAction struct { 787 // StorageClass: Target storage class. Required iff the type of the 788 // action is SetStorageClass. 789 StorageClass string `json:"storageClass,omitempty"` 790 791 // Type: Type of the action. Currently, only Delete and SetStorageClass 792 // are supported. 793 Type string `json:"type,omitempty"` 794 795 // ForceSendFields is a list of field names (e.g. "StorageClass") to 796 // unconditionally include in API requests. By default, fields with 797 // empty or default values are omitted from API requests. However, any 798 // non-pointer, non-interface field appearing in ForceSendFields will be 799 // sent to the server regardless of whether the field is empty or not. 800 // This may be used to include empty fields in Patch requests. 801 ForceSendFields []string `json:"-"` 802 803 // NullFields is a list of field names (e.g. "StorageClass") to include 804 // in API requests with the JSON null value. By default, fields with 805 // empty values are omitted from API requests. However, any field with 806 // an empty value appearing in NullFields will be sent to the server as 807 // null. It is an error if a field in this list has a non-empty value. 808 // This may be used to include null fields in Patch requests. 809 NullFields []string `json:"-"` 810} 811 812func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) { 813 type NoMethod BucketLifecycleRuleAction 814 raw := NoMethod(*s) 815 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 816} 817 818// BucketLifecycleRuleCondition: The condition(s) under which the action 819// will be taken. 820type BucketLifecycleRuleCondition struct { 821 // Age: Age of an object (in days). This condition is satisfied when an 822 // object reaches the specified age. 823 Age int64 `json:"age,omitempty"` 824 825 // CreatedBefore: A date in RFC 3339 format with only the date part (for 826 // instance, "2013-01-15"). This condition is satisfied when an object 827 // is created before midnight of the specified date in UTC. 828 CreatedBefore string `json:"createdBefore,omitempty"` 829 830 // CustomTimeBefore: A date in RFC 3339 format with only the date part 831 // (for instance, "2013-01-15"). This condition is satisfied when the 832 // custom time on an object is before this date in UTC. 833 CustomTimeBefore string `json:"customTimeBefore,omitempty"` 834 835 // DaysSinceCustomTime: Number of days elapsed since the user-specified 836 // timestamp set on an object. The condition is satisfied if the days 837 // elapsed is at least this number. If no custom timestamp is specified 838 // on an object, the condition does not apply. 839 DaysSinceCustomTime int64 `json:"daysSinceCustomTime,omitempty"` 840 841 // DaysSinceNoncurrentTime: Number of days elapsed since the noncurrent 842 // timestamp of an object. The condition is satisfied if the days 843 // elapsed is at least this number. This condition is relevant only for 844 // versioned objects. The value of the field must be a nonnegative 845 // integer. If it's zero, the object version will become eligible for 846 // Lifecycle action as soon as it becomes noncurrent. 847 DaysSinceNoncurrentTime int64 `json:"daysSinceNoncurrentTime,omitempty"` 848 849 // IsLive: Relevant only for versioned objects. If the value is true, 850 // this condition matches live objects; if the value is false, it 851 // matches archived objects. 852 IsLive *bool `json:"isLive,omitempty"` 853 854 // MatchesPattern: A regular expression that satisfies the RE2 syntax. 855 // This condition is satisfied when the name of the object matches the 856 // RE2 pattern. Note: This feature is currently in the "Early Access" 857 // launch stage and is only available to a whitelisted set of users; 858 // that means that this feature may be changed in backward-incompatible 859 // ways and that it is not guaranteed to be released. 860 MatchesPattern string `json:"matchesPattern,omitempty"` 861 862 // MatchesStorageClass: Objects having any of the storage classes 863 // specified by this condition will be matched. Values include 864 // MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and 865 // DURABLE_REDUCED_AVAILABILITY. 866 MatchesStorageClass []string `json:"matchesStorageClass,omitempty"` 867 868 // NoncurrentTimeBefore: A date in RFC 3339 format with only the date 869 // part (for instance, "2013-01-15"). This condition is satisfied when 870 // the noncurrent time on an object is before this date in UTC. This 871 // condition is relevant only for versioned objects. 872 NoncurrentTimeBefore string `json:"noncurrentTimeBefore,omitempty"` 873 874 // NumNewerVersions: Relevant only for versioned objects. If the value 875 // is N, this condition is satisfied when there are at least N versions 876 // (including the live version) newer than this version of the object. 877 NumNewerVersions int64 `json:"numNewerVersions,omitempty"` 878 879 // ForceSendFields is a list of field names (e.g. "Age") to 880 // unconditionally include in API requests. By default, fields with 881 // empty or default values are omitted from API requests. However, any 882 // non-pointer, non-interface field appearing in ForceSendFields will be 883 // sent to the server regardless of whether the field is empty or not. 884 // This may be used to include empty fields in Patch requests. 885 ForceSendFields []string `json:"-"` 886 887 // NullFields is a list of field names (e.g. "Age") to include in API 888 // requests with the JSON null value. By default, fields with empty 889 // values are omitted from API requests. However, any field with an 890 // empty value appearing in NullFields will be sent to the server as 891 // null. It is an error if a field in this list has a non-empty value. 892 // This may be used to include null fields in Patch requests. 893 NullFields []string `json:"-"` 894} 895 896func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) { 897 type NoMethod BucketLifecycleRuleCondition 898 raw := NoMethod(*s) 899 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 900} 901 902// BucketLogging: The bucket's logging configuration, which defines the 903// destination bucket and optional name prefix for the current bucket's 904// logs. 905type BucketLogging struct { 906 // LogBucket: The destination bucket where the current bucket's logs 907 // should be placed. 908 LogBucket string `json:"logBucket,omitempty"` 909 910 // LogObjectPrefix: A prefix for log object names. 911 LogObjectPrefix string `json:"logObjectPrefix,omitempty"` 912 913 // ForceSendFields is a list of field names (e.g. "LogBucket") to 914 // unconditionally include in API requests. By default, fields with 915 // empty or default values are omitted from API requests. However, any 916 // non-pointer, non-interface field appearing in ForceSendFields will be 917 // sent to the server regardless of whether the field is empty or not. 918 // This may be used to include empty fields in Patch requests. 919 ForceSendFields []string `json:"-"` 920 921 // NullFields is a list of field names (e.g. "LogBucket") to include in 922 // API requests with the JSON null value. By default, fields with empty 923 // values are omitted from API requests. However, any field with an 924 // empty value appearing in NullFields will be sent to the server as 925 // null. It is an error if a field in this list has a non-empty value. 926 // This may be used to include null fields in Patch requests. 927 NullFields []string `json:"-"` 928} 929 930func (s *BucketLogging) MarshalJSON() ([]byte, error) { 931 type NoMethod BucketLogging 932 raw := NoMethod(*s) 933 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 934} 935 936// BucketOwner: The owner of the bucket. This is always the project 937// team's owner group. 938type BucketOwner struct { 939 // Entity: The entity, in the form project-owner-projectId. 940 Entity string `json:"entity,omitempty"` 941 942 // EntityId: The ID for the entity. 943 EntityId string `json:"entityId,omitempty"` 944 945 // ForceSendFields is a list of field names (e.g. "Entity") to 946 // unconditionally include in API requests. By default, fields with 947 // empty or default values are omitted from API requests. However, any 948 // non-pointer, non-interface field appearing in ForceSendFields will be 949 // sent to the server regardless of whether the field is empty or not. 950 // This may be used to include empty fields in Patch requests. 951 ForceSendFields []string `json:"-"` 952 953 // NullFields is a list of field names (e.g. "Entity") to include in API 954 // requests with the JSON null value. By default, fields with empty 955 // values are omitted from API requests. However, any field with an 956 // empty value appearing in NullFields will be sent to the server as 957 // null. It is an error if a field in this list has a non-empty value. 958 // This may be used to include null fields in Patch requests. 959 NullFields []string `json:"-"` 960} 961 962func (s *BucketOwner) MarshalJSON() ([]byte, error) { 963 type NoMethod BucketOwner 964 raw := NoMethod(*s) 965 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 966} 967 968// BucketRetentionPolicy: The bucket's retention policy. The retention 969// policy enforces a minimum retention time for all objects contained in 970// the bucket, based on their creation time. Any attempt to overwrite or 971// delete objects younger than the retention period will result in a 972// PERMISSION_DENIED error. An unlocked retention policy can be modified 973// or removed from the bucket via a storage.buckets.update operation. A 974// locked retention policy cannot be removed or shortened in duration 975// for the lifetime of the bucket. Attempting to remove or decrease 976// period of a locked retention policy will result in a 977// PERMISSION_DENIED error. 978type BucketRetentionPolicy struct { 979 // EffectiveTime: Server-determined value that indicates the time from 980 // which policy was enforced and effective. This value is in RFC 3339 981 // format. 982 EffectiveTime string `json:"effectiveTime,omitempty"` 983 984 // IsLocked: Once locked, an object retention policy cannot be modified. 985 IsLocked bool `json:"isLocked,omitempty"` 986 987 // RetentionPeriod: The duration in seconds that objects need to be 988 // retained. Retention duration must be greater than zero and less than 989 // 100 years. Note that enforcement of retention periods less than a day 990 // is not guaranteed. Such periods should only be used for testing 991 // purposes. 992 RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"` 993 994 // ForceSendFields is a list of field names (e.g. "EffectiveTime") to 995 // unconditionally include in API requests. By default, fields with 996 // empty or default values are omitted from API requests. However, any 997 // non-pointer, non-interface field appearing in ForceSendFields will be 998 // sent to the server regardless of whether the field is empty or not. 999 // This may be used to include empty fields in Patch requests. 1000 ForceSendFields []string `json:"-"` 1001 1002 // NullFields is a list of field names (e.g. "EffectiveTime") to include 1003 // in API requests with the JSON null value. By default, fields with 1004 // empty values are omitted from API requests. However, any field with 1005 // an empty value appearing in NullFields will be sent to the server as 1006 // null. It is an error if a field in this list has a non-empty value. 1007 // This may be used to include null fields in Patch requests. 1008 NullFields []string `json:"-"` 1009} 1010 1011func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) { 1012 type NoMethod BucketRetentionPolicy 1013 raw := NoMethod(*s) 1014 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1015} 1016 1017// BucketVersioning: The bucket's versioning configuration. 1018type BucketVersioning struct { 1019 // Enabled: While set to true, versioning is fully enabled for this 1020 // bucket. 1021 Enabled bool `json:"enabled,omitempty"` 1022 1023 // ForceSendFields is a list of field names (e.g. "Enabled") to 1024 // unconditionally include in API requests. By default, fields with 1025 // empty or default values are omitted from API requests. However, any 1026 // non-pointer, non-interface field appearing in ForceSendFields will be 1027 // sent to the server regardless of whether the field is empty or not. 1028 // This may be used to include empty fields in Patch requests. 1029 ForceSendFields []string `json:"-"` 1030 1031 // NullFields is a list of field names (e.g. "Enabled") to include in 1032 // API requests with the JSON null value. By default, fields with empty 1033 // values are omitted from API requests. However, any field with an 1034 // empty value appearing in NullFields will be sent to the server as 1035 // null. It is an error if a field in this list has a non-empty value. 1036 // This may be used to include null fields in Patch requests. 1037 NullFields []string `json:"-"` 1038} 1039 1040func (s *BucketVersioning) MarshalJSON() ([]byte, error) { 1041 type NoMethod BucketVersioning 1042 raw := NoMethod(*s) 1043 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1044} 1045 1046// BucketWebsite: The bucket's website configuration, controlling how 1047// the service behaves when accessing bucket contents as a web site. See 1048// the Static Website Examples for more information. 1049type BucketWebsite struct { 1050 // MainPageSuffix: If the requested object path is missing, the service 1051 // will ensure the path has a trailing '/', append this suffix, and 1052 // attempt to retrieve the resulting object. This allows the creation of 1053 // index.html objects to represent directory pages. 1054 MainPageSuffix string `json:"mainPageSuffix,omitempty"` 1055 1056 // NotFoundPage: If the requested object path is missing, and any 1057 // mainPageSuffix object is missing, if applicable, the service will 1058 // return the named object from this bucket as the content for a 404 Not 1059 // Found result. 1060 NotFoundPage string `json:"notFoundPage,omitempty"` 1061 1062 // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to 1063 // unconditionally include in API requests. By default, fields with 1064 // empty or default values are omitted from API requests. However, any 1065 // non-pointer, non-interface field appearing in ForceSendFields will be 1066 // sent to the server regardless of whether the field is empty or not. 1067 // This may be used to include empty fields in Patch requests. 1068 ForceSendFields []string `json:"-"` 1069 1070 // NullFields is a list of field names (e.g. "MainPageSuffix") to 1071 // include in API requests with the JSON null value. By default, fields 1072 // with empty values are omitted from API requests. However, any field 1073 // with an empty value appearing in NullFields will be sent to the 1074 // server as null. It is an error if a field in this list has a 1075 // non-empty value. This may be used to include null fields in Patch 1076 // requests. 1077 NullFields []string `json:"-"` 1078} 1079 1080func (s *BucketWebsite) MarshalJSON() ([]byte, error) { 1081 type NoMethod BucketWebsite 1082 raw := NoMethod(*s) 1083 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1084} 1085 1086// BucketAccessControl: An access-control entry. 1087type BucketAccessControl struct { 1088 // Bucket: The name of the bucket. 1089 Bucket string `json:"bucket,omitempty"` 1090 1091 // Domain: The domain associated with the entity, if any. 1092 Domain string `json:"domain,omitempty"` 1093 1094 // Email: The email address associated with the entity, if any. 1095 Email string `json:"email,omitempty"` 1096 1097 // Entity: The entity holding the permission, in one of the following 1098 // forms: 1099 // - user-userId 1100 // - user-email 1101 // - group-groupId 1102 // - group-email 1103 // - domain-domain 1104 // - project-team-projectId 1105 // - allUsers 1106 // - allAuthenticatedUsers Examples: 1107 // - The user liz@example.com would be user-liz@example.com. 1108 // - The group example@googlegroups.com would be 1109 // group-example@googlegroups.com. 1110 // - To refer to all members of the Google Apps for Business domain 1111 // example.com, the entity would be domain-example.com. 1112 Entity string `json:"entity,omitempty"` 1113 1114 // EntityId: The ID for the entity, if any. 1115 EntityId string `json:"entityId,omitempty"` 1116 1117 // Etag: HTTP 1.1 Entity tag for the access-control entry. 1118 Etag string `json:"etag,omitempty"` 1119 1120 // Id: The ID of the access-control entry. 1121 Id string `json:"id,omitempty"` 1122 1123 // Kind: The kind of item this is. For bucket access control entries, 1124 // this is always storage#bucketAccessControl. 1125 Kind string `json:"kind,omitempty"` 1126 1127 // ProjectTeam: The project team associated with the entity, if any. 1128 ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"` 1129 1130 // Role: The access permission for the entity. 1131 Role string `json:"role,omitempty"` 1132 1133 // SelfLink: The link to this access-control entry. 1134 SelfLink string `json:"selfLink,omitempty"` 1135 1136 // ServerResponse contains the HTTP response code and headers from the 1137 // server. 1138 googleapi.ServerResponse `json:"-"` 1139 1140 // ForceSendFields is a list of field names (e.g. "Bucket") to 1141 // unconditionally include in API requests. By default, fields with 1142 // empty or default values are omitted from API requests. However, any 1143 // non-pointer, non-interface field appearing in ForceSendFields will be 1144 // sent to the server regardless of whether the field is empty or not. 1145 // This may be used to include empty fields in Patch requests. 1146 ForceSendFields []string `json:"-"` 1147 1148 // NullFields is a list of field names (e.g. "Bucket") to include in API 1149 // requests with the JSON null value. By default, fields with empty 1150 // values are omitted from API requests. However, any field with an 1151 // empty value appearing in NullFields will be sent to the server as 1152 // null. It is an error if a field in this list has a non-empty value. 1153 // This may be used to include null fields in Patch requests. 1154 NullFields []string `json:"-"` 1155} 1156 1157func (s *BucketAccessControl) MarshalJSON() ([]byte, error) { 1158 type NoMethod BucketAccessControl 1159 raw := NoMethod(*s) 1160 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1161} 1162 1163// BucketAccessControlProjectTeam: The project team associated with the 1164// entity, if any. 1165type BucketAccessControlProjectTeam struct { 1166 // ProjectNumber: The project number. 1167 ProjectNumber string `json:"projectNumber,omitempty"` 1168 1169 // Team: The team. 1170 Team string `json:"team,omitempty"` 1171 1172 // ForceSendFields is a list of field names (e.g. "ProjectNumber") to 1173 // unconditionally include in API requests. By default, fields with 1174 // empty or default values are omitted from API requests. However, any 1175 // non-pointer, non-interface field appearing in ForceSendFields will be 1176 // sent to the server regardless of whether the field is empty or not. 1177 // This may be used to include empty fields in Patch requests. 1178 ForceSendFields []string `json:"-"` 1179 1180 // NullFields is a list of field names (e.g. "ProjectNumber") to include 1181 // in API requests with the JSON null value. By default, fields with 1182 // empty values are omitted from API requests. However, any field with 1183 // an empty value appearing in NullFields will be sent to the server as 1184 // null. It is an error if a field in this list has a non-empty value. 1185 // This may be used to include null fields in Patch requests. 1186 NullFields []string `json:"-"` 1187} 1188 1189func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) { 1190 type NoMethod BucketAccessControlProjectTeam 1191 raw := NoMethod(*s) 1192 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1193} 1194 1195// BucketAccessControls: An access-control list. 1196type BucketAccessControls struct { 1197 // Items: The list of items. 1198 Items []*BucketAccessControl `json:"items,omitempty"` 1199 1200 // Kind: The kind of item this is. For lists of bucket access control 1201 // entries, this is always storage#bucketAccessControls. 1202 Kind string `json:"kind,omitempty"` 1203 1204 // ServerResponse contains the HTTP response code and headers from the 1205 // server. 1206 googleapi.ServerResponse `json:"-"` 1207 1208 // ForceSendFields is a list of field names (e.g. "Items") to 1209 // unconditionally include in API requests. By default, fields with 1210 // empty or default values are omitted from API requests. However, any 1211 // non-pointer, non-interface field appearing in ForceSendFields will be 1212 // sent to the server regardless of whether the field is empty or not. 1213 // This may be used to include empty fields in Patch requests. 1214 ForceSendFields []string `json:"-"` 1215 1216 // NullFields is a list of field names (e.g. "Items") to include in API 1217 // requests with the JSON null value. By default, fields with empty 1218 // values are omitted from API requests. However, any field with an 1219 // empty value appearing in NullFields will be sent to the server as 1220 // null. It is an error if a field in this list has a non-empty value. 1221 // This may be used to include null fields in Patch requests. 1222 NullFields []string `json:"-"` 1223} 1224 1225func (s *BucketAccessControls) MarshalJSON() ([]byte, error) { 1226 type NoMethod BucketAccessControls 1227 raw := NoMethod(*s) 1228 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1229} 1230 1231// Buckets: A list of buckets. 1232type Buckets struct { 1233 // Items: The list of items. 1234 Items []*Bucket `json:"items,omitempty"` 1235 1236 // Kind: The kind of item this is. For lists of buckets, this is always 1237 // storage#buckets. 1238 Kind string `json:"kind,omitempty"` 1239 1240 // NextPageToken: The continuation token, used to page through large 1241 // result sets. Provide this value in a subsequent request to return the 1242 // next page of results. 1243 NextPageToken string `json:"nextPageToken,omitempty"` 1244 1245 // ServerResponse contains the HTTP response code and headers from the 1246 // server. 1247 googleapi.ServerResponse `json:"-"` 1248 1249 // ForceSendFields is a list of field names (e.g. "Items") to 1250 // unconditionally include in API requests. By default, fields with 1251 // empty or default values are omitted from API requests. However, any 1252 // non-pointer, non-interface field appearing in ForceSendFields will be 1253 // sent to the server regardless of whether the field is empty or not. 1254 // This may be used to include empty fields in Patch requests. 1255 ForceSendFields []string `json:"-"` 1256 1257 // NullFields is a list of field names (e.g. "Items") to include in API 1258 // requests with the JSON null value. By default, fields with empty 1259 // values are omitted from API requests. However, any field with an 1260 // empty value appearing in NullFields will be sent to the server as 1261 // null. It is an error if a field in this list has a non-empty value. 1262 // This may be used to include null fields in Patch requests. 1263 NullFields []string `json:"-"` 1264} 1265 1266func (s *Buckets) MarshalJSON() ([]byte, error) { 1267 type NoMethod Buckets 1268 raw := NoMethod(*s) 1269 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1270} 1271 1272// Channel: An notification channel used to watch for resource changes. 1273type Channel struct { 1274 // Address: The address where notifications are delivered for this 1275 // channel. 1276 Address string `json:"address,omitempty"` 1277 1278 // Expiration: Date and time of notification channel expiration, 1279 // expressed as a Unix timestamp, in milliseconds. Optional. 1280 Expiration int64 `json:"expiration,omitempty,string"` 1281 1282 // Id: A UUID or similar unique string that identifies this channel. 1283 Id string `json:"id,omitempty"` 1284 1285 // Kind: Identifies this as a notification channel used to watch for 1286 // changes to a resource, which is "api#channel". 1287 Kind string `json:"kind,omitempty"` 1288 1289 // Params: Additional parameters controlling delivery channel behavior. 1290 // Optional. 1291 Params map[string]string `json:"params,omitempty"` 1292 1293 // Payload: A Boolean value to indicate whether payload is wanted. 1294 // Optional. 1295 Payload bool `json:"payload,omitempty"` 1296 1297 // ResourceId: An opaque ID that identifies the resource being watched 1298 // on this channel. Stable across different API versions. 1299 ResourceId string `json:"resourceId,omitempty"` 1300 1301 // ResourceUri: A version-specific identifier for the watched resource. 1302 ResourceUri string `json:"resourceUri,omitempty"` 1303 1304 // Token: An arbitrary string delivered to the target address with each 1305 // notification delivered over this channel. Optional. 1306 Token string `json:"token,omitempty"` 1307 1308 // Type: The type of delivery mechanism used for this channel. 1309 Type string `json:"type,omitempty"` 1310 1311 // ServerResponse contains the HTTP response code and headers from the 1312 // server. 1313 googleapi.ServerResponse `json:"-"` 1314 1315 // ForceSendFields is a list of field names (e.g. "Address") to 1316 // unconditionally include in API requests. By default, fields with 1317 // empty or default values are omitted from API requests. However, any 1318 // non-pointer, non-interface field appearing in ForceSendFields will be 1319 // sent to the server regardless of whether the field is empty or not. 1320 // This may be used to include empty fields in Patch requests. 1321 ForceSendFields []string `json:"-"` 1322 1323 // NullFields is a list of field names (e.g. "Address") to include in 1324 // API requests with the JSON null value. By default, fields with empty 1325 // values are omitted from API requests. However, any field with an 1326 // empty value appearing in NullFields will be sent to the server as 1327 // null. It is an error if a field in this list has a non-empty value. 1328 // This may be used to include null fields in Patch requests. 1329 NullFields []string `json:"-"` 1330} 1331 1332func (s *Channel) MarshalJSON() ([]byte, error) { 1333 type NoMethod Channel 1334 raw := NoMethod(*s) 1335 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1336} 1337 1338// ComposeRequest: A Compose request. 1339type ComposeRequest struct { 1340 // Destination: Properties of the resulting object. 1341 Destination *Object `json:"destination,omitempty"` 1342 1343 // Kind: The kind of item this is. 1344 Kind string `json:"kind,omitempty"` 1345 1346 // SourceObjects: The list of source objects that will be concatenated 1347 // into a single object. 1348 SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"` 1349 1350 // ForceSendFields is a list of field names (e.g. "Destination") to 1351 // unconditionally include in API requests. By default, fields with 1352 // empty or default values are omitted from API requests. However, any 1353 // non-pointer, non-interface field appearing in ForceSendFields will be 1354 // sent to the server regardless of whether the field is empty or not. 1355 // This may be used to include empty fields in Patch requests. 1356 ForceSendFields []string `json:"-"` 1357 1358 // NullFields is a list of field names (e.g. "Destination") to include 1359 // in API requests with the JSON null value. By default, fields with 1360 // empty values are omitted from API requests. However, any field with 1361 // an empty value appearing in NullFields will be sent to the server as 1362 // null. It is an error if a field in this list has a non-empty value. 1363 // This may be used to include null fields in Patch requests. 1364 NullFields []string `json:"-"` 1365} 1366 1367func (s *ComposeRequest) MarshalJSON() ([]byte, error) { 1368 type NoMethod ComposeRequest 1369 raw := NoMethod(*s) 1370 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1371} 1372 1373type ComposeRequestSourceObjects struct { 1374 // Generation: The generation of this object to use as the source. 1375 Generation int64 `json:"generation,omitempty,string"` 1376 1377 // Name: The source object's name. All source objects must reside in the 1378 // same bucket. 1379 Name string `json:"name,omitempty"` 1380 1381 // ObjectPreconditions: Conditions that must be met for this operation 1382 // to execute. 1383 ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"` 1384 1385 // ForceSendFields is a list of field names (e.g. "Generation") to 1386 // unconditionally include in API requests. By default, fields with 1387 // empty or default values are omitted from API requests. However, any 1388 // non-pointer, non-interface field appearing in ForceSendFields will be 1389 // sent to the server regardless of whether the field is empty or not. 1390 // This may be used to include empty fields in Patch requests. 1391 ForceSendFields []string `json:"-"` 1392 1393 // NullFields is a list of field names (e.g. "Generation") to include in 1394 // API requests with the JSON null value. By default, fields with empty 1395 // values are omitted from API requests. However, any field with an 1396 // empty value appearing in NullFields will be sent to the server as 1397 // null. It is an error if a field in this list has a non-empty value. 1398 // This may be used to include null fields in Patch requests. 1399 NullFields []string `json:"-"` 1400} 1401 1402func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) { 1403 type NoMethod ComposeRequestSourceObjects 1404 raw := NoMethod(*s) 1405 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1406} 1407 1408// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must 1409// be met for this operation to execute. 1410type ComposeRequestSourceObjectsObjectPreconditions struct { 1411 // IfGenerationMatch: Only perform the composition if the generation of 1412 // the source object that would be used matches this value. If this 1413 // value and a generation are both specified, they must be the same 1414 // value or the call will fail. 1415 IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"` 1416 1417 // ForceSendFields is a list of field names (e.g. "IfGenerationMatch") 1418 // to unconditionally include in API requests. By default, fields with 1419 // empty or default values are omitted from API requests. However, any 1420 // non-pointer, non-interface field appearing in ForceSendFields will be 1421 // sent to the server regardless of whether the field is empty or not. 1422 // This may be used to include empty fields in Patch requests. 1423 ForceSendFields []string `json:"-"` 1424 1425 // NullFields is a list of field names (e.g. "IfGenerationMatch") to 1426 // include in API requests with the JSON null value. By default, fields 1427 // with empty values are omitted from API requests. However, any field 1428 // with an empty value appearing in NullFields will be sent to the 1429 // server as null. It is an error if a field in this list has a 1430 // non-empty value. This may be used to include null fields in Patch 1431 // requests. 1432 NullFields []string `json:"-"` 1433} 1434 1435func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) { 1436 type NoMethod ComposeRequestSourceObjectsObjectPreconditions 1437 raw := NoMethod(*s) 1438 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1439} 1440 1441// Expr: Represents an expression text. Example: title: "User account 1442// presence" description: "Determines whether the request has a user 1443// account" expression: "size(request.user) > 0" 1444type Expr struct { 1445 // Description: An optional description of the expression. This is a 1446 // longer text which describes the expression, e.g. when hovered over it 1447 // in a UI. 1448 Description string `json:"description,omitempty"` 1449 1450 // Expression: Textual representation of an expression in Common 1451 // Expression Language syntax. The application context of the containing 1452 // message determines which well-known feature set of CEL is supported. 1453 Expression string `json:"expression,omitempty"` 1454 1455 // Location: An optional string indicating the location of the 1456 // expression for error reporting, e.g. a file name and a position in 1457 // the file. 1458 Location string `json:"location,omitempty"` 1459 1460 // Title: An optional title for the expression, i.e. a short string 1461 // describing its purpose. This can be used e.g. in UIs which allow to 1462 // enter the expression. 1463 Title string `json:"title,omitempty"` 1464 1465 // ForceSendFields is a list of field names (e.g. "Description") to 1466 // unconditionally include in API requests. By default, fields with 1467 // empty or default values are omitted from API requests. However, any 1468 // non-pointer, non-interface field appearing in ForceSendFields will be 1469 // sent to the server regardless of whether the field is empty or not. 1470 // This may be used to include empty fields in Patch requests. 1471 ForceSendFields []string `json:"-"` 1472 1473 // NullFields is a list of field names (e.g. "Description") to include 1474 // in API requests with the JSON null value. By default, fields with 1475 // empty values are omitted from API requests. However, any field with 1476 // an empty value appearing in NullFields will be sent to the server as 1477 // null. It is an error if a field in this list has a non-empty value. 1478 // This may be used to include null fields in Patch requests. 1479 NullFields []string `json:"-"` 1480} 1481 1482func (s *Expr) MarshalJSON() ([]byte, error) { 1483 type NoMethod Expr 1484 raw := NoMethod(*s) 1485 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1486} 1487 1488// HmacKey: JSON template to produce a JSON-style HMAC Key resource for 1489// Create responses. 1490type HmacKey struct { 1491 // Kind: The kind of item this is. For HMAC keys, this is always 1492 // storage#hmacKey. 1493 Kind string `json:"kind,omitempty"` 1494 1495 // Metadata: Key metadata. 1496 Metadata *HmacKeyMetadata `json:"metadata,omitempty"` 1497 1498 // Secret: HMAC secret key material. 1499 Secret string `json:"secret,omitempty"` 1500 1501 // ServerResponse contains the HTTP response code and headers from the 1502 // server. 1503 googleapi.ServerResponse `json:"-"` 1504 1505 // ForceSendFields is a list of field names (e.g. "Kind") to 1506 // unconditionally include in API requests. By default, fields with 1507 // empty or default values are omitted from API requests. However, any 1508 // non-pointer, non-interface field appearing in ForceSendFields will be 1509 // sent to the server regardless of whether the field is empty or not. 1510 // This may be used to include empty fields in Patch requests. 1511 ForceSendFields []string `json:"-"` 1512 1513 // NullFields is a list of field names (e.g. "Kind") to include in API 1514 // requests with the JSON null value. By default, fields with empty 1515 // values are omitted from API requests. However, any field with an 1516 // empty value appearing in NullFields will be sent to the server as 1517 // null. It is an error if a field in this list has a non-empty value. 1518 // This may be used to include null fields in Patch requests. 1519 NullFields []string `json:"-"` 1520} 1521 1522func (s *HmacKey) MarshalJSON() ([]byte, error) { 1523 type NoMethod HmacKey 1524 raw := NoMethod(*s) 1525 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1526} 1527 1528// HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key 1529// metadata resource. 1530type HmacKeyMetadata struct { 1531 // AccessId: The ID of the HMAC Key. 1532 AccessId string `json:"accessId,omitempty"` 1533 1534 // Etag: HTTP 1.1 Entity tag for the HMAC key. 1535 Etag string `json:"etag,omitempty"` 1536 1537 // Id: The ID of the HMAC key, including the Project ID and the Access 1538 // ID. 1539 Id string `json:"id,omitempty"` 1540 1541 // Kind: The kind of item this is. For HMAC Key metadata, this is always 1542 // storage#hmacKeyMetadata. 1543 Kind string `json:"kind,omitempty"` 1544 1545 // ProjectId: Project ID owning the service account to which the key 1546 // authenticates. 1547 ProjectId string `json:"projectId,omitempty"` 1548 1549 // SelfLink: The link to this resource. 1550 SelfLink string `json:"selfLink,omitempty"` 1551 1552 // ServiceAccountEmail: The email address of the key's associated 1553 // service account. 1554 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 1555 1556 // State: The state of the key. Can be one of ACTIVE, INACTIVE, or 1557 // DELETED. 1558 State string `json:"state,omitempty"` 1559 1560 // TimeCreated: The creation time of the HMAC key in RFC 3339 format. 1561 TimeCreated string `json:"timeCreated,omitempty"` 1562 1563 // Updated: The last modification time of the HMAC key metadata in RFC 1564 // 3339 format. 1565 Updated string `json:"updated,omitempty"` 1566 1567 // ServerResponse contains the HTTP response code and headers from the 1568 // server. 1569 googleapi.ServerResponse `json:"-"` 1570 1571 // ForceSendFields is a list of field names (e.g. "AccessId") to 1572 // unconditionally include in API requests. By default, fields with 1573 // empty or default values are omitted from API requests. However, any 1574 // non-pointer, non-interface field appearing in ForceSendFields will be 1575 // sent to the server regardless of whether the field is empty or not. 1576 // This may be used to include empty fields in Patch requests. 1577 ForceSendFields []string `json:"-"` 1578 1579 // NullFields is a list of field names (e.g. "AccessId") to include in 1580 // API requests with the JSON null value. By default, fields with empty 1581 // values are omitted from API requests. However, any field with an 1582 // empty value appearing in NullFields will be sent to the server as 1583 // null. It is an error if a field in this list has a non-empty value. 1584 // This may be used to include null fields in Patch requests. 1585 NullFields []string `json:"-"` 1586} 1587 1588func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) { 1589 type NoMethod HmacKeyMetadata 1590 raw := NoMethod(*s) 1591 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1592} 1593 1594// HmacKeysMetadata: A list of hmacKeys. 1595type HmacKeysMetadata struct { 1596 // Items: The list of items. 1597 Items []*HmacKeyMetadata `json:"items,omitempty"` 1598 1599 // Kind: The kind of item this is. For lists of hmacKeys, this is always 1600 // storage#hmacKeysMetadata. 1601 Kind string `json:"kind,omitempty"` 1602 1603 // NextPageToken: The continuation token, used to page through large 1604 // result sets. Provide this value in a subsequent request to return the 1605 // next page of results. 1606 NextPageToken string `json:"nextPageToken,omitempty"` 1607 1608 // ServerResponse contains the HTTP response code and headers from the 1609 // server. 1610 googleapi.ServerResponse `json:"-"` 1611 1612 // ForceSendFields is a list of field names (e.g. "Items") to 1613 // unconditionally include in API requests. By default, fields with 1614 // empty or default values are omitted from API requests. However, any 1615 // non-pointer, non-interface field appearing in ForceSendFields will be 1616 // sent to the server regardless of whether the field is empty or not. 1617 // This may be used to include empty fields in Patch requests. 1618 ForceSendFields []string `json:"-"` 1619 1620 // NullFields is a list of field names (e.g. "Items") to include in API 1621 // requests with the JSON null value. By default, fields with empty 1622 // values are omitted from API requests. However, any field with an 1623 // empty value appearing in NullFields will be sent to the server as 1624 // null. It is an error if a field in this list has a non-empty value. 1625 // This may be used to include null fields in Patch requests. 1626 NullFields []string `json:"-"` 1627} 1628 1629func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) { 1630 type NoMethod HmacKeysMetadata 1631 raw := NoMethod(*s) 1632 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1633} 1634 1635// Notification: A subscription to receive Google PubSub notifications. 1636type Notification struct { 1637 // CustomAttributes: An optional list of additional attributes to attach 1638 // to each Cloud PubSub message published for this notification 1639 // subscription. 1640 CustomAttributes map[string]string `json:"custom_attributes,omitempty"` 1641 1642 // Etag: HTTP 1.1 Entity tag for this subscription notification. 1643 Etag string `json:"etag,omitempty"` 1644 1645 // EventTypes: If present, only send notifications about listed event 1646 // types. If empty, sent notifications for all event types. 1647 EventTypes []string `json:"event_types,omitempty"` 1648 1649 // Id: The ID of the notification. 1650 Id string `json:"id,omitempty"` 1651 1652 // Kind: The kind of item this is. For notifications, this is always 1653 // storage#notification. 1654 Kind string `json:"kind,omitempty"` 1655 1656 // ObjectNamePrefix: If present, only apply this notification 1657 // configuration to object names that begin with this prefix. 1658 ObjectNamePrefix string `json:"object_name_prefix,omitempty"` 1659 1660 // PayloadFormat: The desired content of the Payload. 1661 PayloadFormat string `json:"payload_format,omitempty"` 1662 1663 // SelfLink: The canonical URL of this notification. 1664 SelfLink string `json:"selfLink,omitempty"` 1665 1666 // Topic: The Cloud PubSub topic to which this subscription publishes. 1667 // Formatted as: 1668 // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi 1669 // c}' 1670 Topic string `json:"topic,omitempty"` 1671 1672 // ServerResponse contains the HTTP response code and headers from the 1673 // server. 1674 googleapi.ServerResponse `json:"-"` 1675 1676 // ForceSendFields is a list of field names (e.g. "CustomAttributes") to 1677 // unconditionally include in API requests. By default, fields with 1678 // empty or default values are omitted from API requests. However, any 1679 // non-pointer, non-interface field appearing in ForceSendFields will be 1680 // sent to the server regardless of whether the field is empty or not. 1681 // This may be used to include empty fields in Patch requests. 1682 ForceSendFields []string `json:"-"` 1683 1684 // NullFields is a list of field names (e.g. "CustomAttributes") to 1685 // include in API requests with the JSON null value. By default, fields 1686 // with empty values are omitted from API requests. However, any field 1687 // with an empty value appearing in NullFields will be sent to the 1688 // server as null. It is an error if a field in this list has a 1689 // non-empty value. This may be used to include null fields in Patch 1690 // requests. 1691 NullFields []string `json:"-"` 1692} 1693 1694func (s *Notification) MarshalJSON() ([]byte, error) { 1695 type NoMethod Notification 1696 raw := NoMethod(*s) 1697 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1698} 1699 1700// Notifications: A list of notification subscriptions. 1701type Notifications struct { 1702 // Items: The list of items. 1703 Items []*Notification `json:"items,omitempty"` 1704 1705 // Kind: The kind of item this is. For lists of notifications, this is 1706 // always storage#notifications. 1707 Kind string `json:"kind,omitempty"` 1708 1709 // ServerResponse contains the HTTP response code and headers from the 1710 // server. 1711 googleapi.ServerResponse `json:"-"` 1712 1713 // ForceSendFields is a list of field names (e.g. "Items") to 1714 // unconditionally include in API requests. By default, fields with 1715 // empty or default values are omitted from API requests. However, any 1716 // non-pointer, non-interface field appearing in ForceSendFields will be 1717 // sent to the server regardless of whether the field is empty or not. 1718 // This may be used to include empty fields in Patch requests. 1719 ForceSendFields []string `json:"-"` 1720 1721 // NullFields is a list of field names (e.g. "Items") to include in API 1722 // requests with the JSON null value. By default, fields with empty 1723 // values are omitted from API requests. However, any field with an 1724 // empty value appearing in NullFields will be sent to the server as 1725 // null. It is an error if a field in this list has a non-empty value. 1726 // This may be used to include null fields in Patch requests. 1727 NullFields []string `json:"-"` 1728} 1729 1730func (s *Notifications) MarshalJSON() ([]byte, error) { 1731 type NoMethod Notifications 1732 raw := NoMethod(*s) 1733 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1734} 1735 1736// Object: An object. 1737type Object struct { 1738 // Acl: Access controls on the object. 1739 Acl []*ObjectAccessControl `json:"acl,omitempty"` 1740 1741 // Bucket: The name of the bucket containing this object. 1742 Bucket string `json:"bucket,omitempty"` 1743 1744 // CacheControl: Cache-Control directive for the object data. If 1745 // omitted, and the object is accessible to all anonymous users, the 1746 // default will be public, max-age=3600. 1747 CacheControl string `json:"cacheControl,omitempty"` 1748 1749 // ComponentCount: Number of underlying components that make up this 1750 // object. Components are accumulated by compose operations. 1751 ComponentCount int64 `json:"componentCount,omitempty"` 1752 1753 // ContentDisposition: Content-Disposition of the object data. 1754 ContentDisposition string `json:"contentDisposition,omitempty"` 1755 1756 // ContentEncoding: Content-Encoding of the object data. 1757 ContentEncoding string `json:"contentEncoding,omitempty"` 1758 1759 // ContentLanguage: Content-Language of the object data. 1760 ContentLanguage string `json:"contentLanguage,omitempty"` 1761 1762 // ContentType: Content-Type of the object data. If an object is stored 1763 // without a Content-Type, it is served as application/octet-stream. 1764 ContentType string `json:"contentType,omitempty"` 1765 1766 // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B; 1767 // encoded using base64 in big-endian byte order. For more information 1768 // about using the CRC32c checksum, see Hashes and ETags: Best 1769 // Practices. 1770 Crc32c string `json:"crc32c,omitempty"` 1771 1772 // CustomTime: A timestamp in RFC 3339 format specified by the user for 1773 // an object. 1774 CustomTime string `json:"customTime,omitempty"` 1775 1776 // CustomerEncryption: Metadata of customer-supplied encryption key, if 1777 // the object is encrypted by such a key. 1778 CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"` 1779 1780 // Etag: HTTP 1.1 Entity tag for the object. 1781 Etag string `json:"etag,omitempty"` 1782 1783 // EventBasedHold: Whether an object is under event-based hold. 1784 // Event-based hold is a way to retain objects until an event occurs, 1785 // which is signified by the hold's release (i.e. this value is set to 1786 // false). After being released (set to false), such objects will be 1787 // subject to bucket-level retention (if any). One sample use case of 1788 // this flag is for banks to hold loan documents for at least 3 years 1789 // after loan is paid in full. Here, bucket-level retention is 3 years 1790 // and the event is the loan being paid in full. In this example, these 1791 // objects will be held intact for any number of years until the event 1792 // has occurred (event-based hold on the object is released) and then 3 1793 // more years after that. That means retention duration of the objects 1794 // begins from the moment event-based hold transitioned from true to 1795 // false. 1796 EventBasedHold bool `json:"eventBasedHold,omitempty"` 1797 1798 // Generation: The content generation of this object. Used for object 1799 // versioning. 1800 Generation int64 `json:"generation,omitempty,string"` 1801 1802 // Id: The ID of the object, including the bucket name, object name, and 1803 // generation number. 1804 Id string `json:"id,omitempty"` 1805 1806 // Kind: The kind of item this is. For objects, this is always 1807 // storage#object. 1808 Kind string `json:"kind,omitempty"` 1809 1810 // KmsKeyName: Not currently supported. Specifying the parameter causes 1811 // the request to fail with status code 400 - Bad Request. 1812 KmsKeyName string `json:"kmsKeyName,omitempty"` 1813 1814 // Md5Hash: MD5 hash of the data; encoded using base64. For more 1815 // information about using the MD5 hash, see Hashes and ETags: Best 1816 // Practices. 1817 Md5Hash string `json:"md5Hash,omitempty"` 1818 1819 // MediaLink: Media download link. 1820 MediaLink string `json:"mediaLink,omitempty"` 1821 1822 // Metadata: User-provided metadata, in key/value pairs. 1823 Metadata map[string]string `json:"metadata,omitempty"` 1824 1825 // Metageneration: The version of the metadata for this object at this 1826 // generation. Used for preconditions and for detecting changes in 1827 // metadata. A metageneration number is only meaningful in the context 1828 // of a particular generation of a particular object. 1829 Metageneration int64 `json:"metageneration,omitempty,string"` 1830 1831 // Name: The name of the object. Required if not specified by URL 1832 // parameter. 1833 Name string `json:"name,omitempty"` 1834 1835 // Owner: The owner of the object. This will always be the uploader of 1836 // the object. 1837 Owner *ObjectOwner `json:"owner,omitempty"` 1838 1839 // RetentionExpirationTime: A server-determined value that specifies the 1840 // earliest time that the object's retention period expires. This value 1841 // is in RFC 3339 format. Note 1: This field is not provided for objects 1842 // with an active event-based hold, since retention expiration is 1843 // unknown until the hold is removed. Note 2: This value can be provided 1844 // even when temporary hold is set (so that the user can reason about 1845 // policy without having to first unset the temporary hold). 1846 RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"` 1847 1848 // SelfLink: The link to this object. 1849 SelfLink string `json:"selfLink,omitempty"` 1850 1851 // Size: Content-Length of the data in bytes. 1852 Size uint64 `json:"size,omitempty,string"` 1853 1854 // StorageClass: Storage class of the object. 1855 StorageClass string `json:"storageClass,omitempty"` 1856 1857 // TemporaryHold: Whether an object is under temporary hold. While this 1858 // flag is set to true, the object is protected against deletion and 1859 // overwrites. A common use case of this flag is regulatory 1860 // investigations where objects need to be retained while the 1861 // investigation is ongoing. Note that unlike event-based hold, 1862 // temporary hold does not impact retention expiration time of an 1863 // object. 1864 TemporaryHold bool `json:"temporaryHold,omitempty"` 1865 1866 // TimeCreated: The creation time of the object in RFC 3339 format. 1867 TimeCreated string `json:"timeCreated,omitempty"` 1868 1869 // TimeDeleted: The deletion time of the object in RFC 3339 format. Will 1870 // be returned if and only if this version of the object has been 1871 // deleted. 1872 TimeDeleted string `json:"timeDeleted,omitempty"` 1873 1874 // TimeStorageClassUpdated: The time at which the object's storage class 1875 // was last changed. When the object is initially created, it will be 1876 // set to timeCreated. 1877 TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"` 1878 1879 // Updated: The modification time of the object metadata in RFC 3339 1880 // format. 1881 Updated string `json:"updated,omitempty"` 1882 1883 // ServerResponse contains the HTTP response code and headers from the 1884 // server. 1885 googleapi.ServerResponse `json:"-"` 1886 1887 // ForceSendFields is a list of field names (e.g. "Acl") to 1888 // unconditionally include in API requests. By default, fields with 1889 // empty or default values are omitted from API requests. However, any 1890 // non-pointer, non-interface field appearing in ForceSendFields will be 1891 // sent to the server regardless of whether the field is empty or not. 1892 // This may be used to include empty fields in Patch requests. 1893 ForceSendFields []string `json:"-"` 1894 1895 // NullFields is a list of field names (e.g. "Acl") to include in API 1896 // requests with the JSON null value. By default, fields with empty 1897 // values are omitted from API requests. However, any field with an 1898 // empty value appearing in NullFields will be sent to the server as 1899 // null. It is an error if a field in this list has a non-empty value. 1900 // This may be used to include null fields in Patch requests. 1901 NullFields []string `json:"-"` 1902} 1903 1904func (s *Object) MarshalJSON() ([]byte, error) { 1905 type NoMethod Object 1906 raw := NoMethod(*s) 1907 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1908} 1909 1910// ObjectCustomerEncryption: Metadata of customer-supplied encryption 1911// key, if the object is encrypted by such a key. 1912type ObjectCustomerEncryption struct { 1913 // EncryptionAlgorithm: The encryption algorithm. 1914 EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"` 1915 1916 // KeySha256: SHA256 hash value of the encryption key. 1917 KeySha256 string `json:"keySha256,omitempty"` 1918 1919 // ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm") 1920 // to unconditionally include in API requests. By default, fields with 1921 // empty or default values are omitted from API requests. However, any 1922 // non-pointer, non-interface field appearing in ForceSendFields will be 1923 // sent to the server regardless of whether the field is empty or not. 1924 // This may be used to include empty fields in Patch requests. 1925 ForceSendFields []string `json:"-"` 1926 1927 // NullFields is a list of field names (e.g. "EncryptionAlgorithm") to 1928 // include in API requests with the JSON null value. By default, fields 1929 // with empty values are omitted from API requests. However, any field 1930 // with an empty value appearing in NullFields will be sent to the 1931 // server as null. It is an error if a field in this list has a 1932 // non-empty value. This may be used to include null fields in Patch 1933 // requests. 1934 NullFields []string `json:"-"` 1935} 1936 1937func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) { 1938 type NoMethod ObjectCustomerEncryption 1939 raw := NoMethod(*s) 1940 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1941} 1942 1943// ObjectOwner: The owner of the object. This will always be the 1944// uploader of the object. 1945type ObjectOwner struct { 1946 // Entity: The entity, in the form user-userId. 1947 Entity string `json:"entity,omitempty"` 1948 1949 // EntityId: The ID for the entity. 1950 EntityId string `json:"entityId,omitempty"` 1951 1952 // ForceSendFields is a list of field names (e.g. "Entity") to 1953 // unconditionally include in API requests. By default, fields with 1954 // empty or default values are omitted from API requests. However, any 1955 // non-pointer, non-interface field appearing in ForceSendFields will be 1956 // sent to the server regardless of whether the field is empty or not. 1957 // This may be used to include empty fields in Patch requests. 1958 ForceSendFields []string `json:"-"` 1959 1960 // NullFields is a list of field names (e.g. "Entity") to include in API 1961 // requests with the JSON null value. By default, fields with empty 1962 // values are omitted from API requests. However, any field with an 1963 // empty value appearing in NullFields will be sent to the server as 1964 // null. It is an error if a field in this list has a non-empty value. 1965 // This may be used to include null fields in Patch requests. 1966 NullFields []string `json:"-"` 1967} 1968 1969func (s *ObjectOwner) MarshalJSON() ([]byte, error) { 1970 type NoMethod ObjectOwner 1971 raw := NoMethod(*s) 1972 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1973} 1974 1975// ObjectAccessControl: An access-control entry. 1976type ObjectAccessControl struct { 1977 // Bucket: The name of the bucket. 1978 Bucket string `json:"bucket,omitempty"` 1979 1980 // Domain: The domain associated with the entity, if any. 1981 Domain string `json:"domain,omitempty"` 1982 1983 // Email: The email address associated with the entity, if any. 1984 Email string `json:"email,omitempty"` 1985 1986 // Entity: The entity holding the permission, in one of the following 1987 // forms: 1988 // - user-userId 1989 // - user-email 1990 // - group-groupId 1991 // - group-email 1992 // - domain-domain 1993 // - project-team-projectId 1994 // - allUsers 1995 // - allAuthenticatedUsers Examples: 1996 // - The user liz@example.com would be user-liz@example.com. 1997 // - The group example@googlegroups.com would be 1998 // group-example@googlegroups.com. 1999 // - To refer to all members of the Google Apps for Business domain 2000 // example.com, the entity would be domain-example.com. 2001 Entity string `json:"entity,omitempty"` 2002 2003 // EntityId: The ID for the entity, if any. 2004 EntityId string `json:"entityId,omitempty"` 2005 2006 // Etag: HTTP 1.1 Entity tag for the access-control entry. 2007 Etag string `json:"etag,omitempty"` 2008 2009 // Generation: The content generation of the object, if applied to an 2010 // object. 2011 Generation int64 `json:"generation,omitempty,string"` 2012 2013 // Id: The ID of the access-control entry. 2014 Id string `json:"id,omitempty"` 2015 2016 // Kind: The kind of item this is. For object access control entries, 2017 // this is always storage#objectAccessControl. 2018 Kind string `json:"kind,omitempty"` 2019 2020 // Object: The name of the object, if applied to an object. 2021 Object string `json:"object,omitempty"` 2022 2023 // ProjectTeam: The project team associated with the entity, if any. 2024 ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"` 2025 2026 // Role: The access permission for the entity. 2027 Role string `json:"role,omitempty"` 2028 2029 // SelfLink: The link to this access-control entry. 2030 SelfLink string `json:"selfLink,omitempty"` 2031 2032 // ServerResponse contains the HTTP response code and headers from the 2033 // server. 2034 googleapi.ServerResponse `json:"-"` 2035 2036 // ForceSendFields is a list of field names (e.g. "Bucket") to 2037 // unconditionally include in API requests. By default, fields with 2038 // empty or default values are omitted from API requests. However, any 2039 // non-pointer, non-interface field appearing in ForceSendFields will be 2040 // sent to the server regardless of whether the field is empty or not. 2041 // This may be used to include empty fields in Patch requests. 2042 ForceSendFields []string `json:"-"` 2043 2044 // NullFields is a list of field names (e.g. "Bucket") to include in API 2045 // requests with the JSON null value. By default, fields with empty 2046 // values are omitted from API requests. However, any field with an 2047 // empty value appearing in NullFields will be sent to the server as 2048 // null. It is an error if a field in this list has a non-empty value. 2049 // This may be used to include null fields in Patch requests. 2050 NullFields []string `json:"-"` 2051} 2052 2053func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) { 2054 type NoMethod ObjectAccessControl 2055 raw := NoMethod(*s) 2056 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2057} 2058 2059// ObjectAccessControlProjectTeam: The project team associated with the 2060// entity, if any. 2061type ObjectAccessControlProjectTeam struct { 2062 // ProjectNumber: The project number. 2063 ProjectNumber string `json:"projectNumber,omitempty"` 2064 2065 // Team: The team. 2066 Team string `json:"team,omitempty"` 2067 2068 // ForceSendFields is a list of field names (e.g. "ProjectNumber") to 2069 // unconditionally include in API requests. By default, fields with 2070 // empty or default values are omitted from API requests. However, any 2071 // non-pointer, non-interface field appearing in ForceSendFields will be 2072 // sent to the server regardless of whether the field is empty or not. 2073 // This may be used to include empty fields in Patch requests. 2074 ForceSendFields []string `json:"-"` 2075 2076 // NullFields is a list of field names (e.g. "ProjectNumber") to include 2077 // in API requests with the JSON null value. By default, fields with 2078 // empty values are omitted from API requests. However, any field with 2079 // an empty value appearing in NullFields will be sent to the server as 2080 // null. It is an error if a field in this list has a non-empty value. 2081 // This may be used to include null fields in Patch requests. 2082 NullFields []string `json:"-"` 2083} 2084 2085func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) { 2086 type NoMethod ObjectAccessControlProjectTeam 2087 raw := NoMethod(*s) 2088 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2089} 2090 2091// ObjectAccessControls: An access-control list. 2092type ObjectAccessControls struct { 2093 // Items: The list of items. 2094 Items []*ObjectAccessControl `json:"items,omitempty"` 2095 2096 // Kind: The kind of item this is. For lists of object access control 2097 // entries, this is always storage#objectAccessControls. 2098 Kind string `json:"kind,omitempty"` 2099 2100 // ServerResponse contains the HTTP response code and headers from the 2101 // server. 2102 googleapi.ServerResponse `json:"-"` 2103 2104 // ForceSendFields is a list of field names (e.g. "Items") to 2105 // unconditionally include in API requests. By default, fields with 2106 // empty or default values are omitted from API requests. However, any 2107 // non-pointer, non-interface field appearing in ForceSendFields will be 2108 // sent to the server regardless of whether the field is empty or not. 2109 // This may be used to include empty fields in Patch requests. 2110 ForceSendFields []string `json:"-"` 2111 2112 // NullFields is a list of field names (e.g. "Items") to include in API 2113 // requests with the JSON null value. By default, fields with empty 2114 // values are omitted from API requests. However, any field with an 2115 // empty value appearing in NullFields will be sent to the server as 2116 // null. It is an error if a field in this list has a non-empty value. 2117 // This may be used to include null fields in Patch requests. 2118 NullFields []string `json:"-"` 2119} 2120 2121func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) { 2122 type NoMethod ObjectAccessControls 2123 raw := NoMethod(*s) 2124 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2125} 2126 2127// Objects: A list of objects. 2128type Objects struct { 2129 // Items: The list of items. 2130 Items []*Object `json:"items,omitempty"` 2131 2132 // Kind: The kind of item this is. For lists of objects, this is always 2133 // storage#objects. 2134 Kind string `json:"kind,omitempty"` 2135 2136 // NextPageToken: The continuation token, used to page through large 2137 // result sets. Provide this value in a subsequent request to return the 2138 // next page of results. 2139 NextPageToken string `json:"nextPageToken,omitempty"` 2140 2141 // Prefixes: The list of prefixes of objects matching-but-not-listed up 2142 // to and including the requested delimiter. 2143 Prefixes []string `json:"prefixes,omitempty"` 2144 2145 // ServerResponse contains the HTTP response code and headers from the 2146 // server. 2147 googleapi.ServerResponse `json:"-"` 2148 2149 // ForceSendFields is a list of field names (e.g. "Items") to 2150 // unconditionally include in API requests. By default, fields with 2151 // empty or default values are omitted from API requests. However, any 2152 // non-pointer, non-interface field appearing in ForceSendFields will be 2153 // sent to the server regardless of whether the field is empty or not. 2154 // This may be used to include empty fields in Patch requests. 2155 ForceSendFields []string `json:"-"` 2156 2157 // NullFields is a list of field names (e.g. "Items") to include in API 2158 // requests with the JSON null value. By default, fields with empty 2159 // values are omitted from API requests. However, any field with an 2160 // empty value appearing in NullFields will be sent to the server as 2161 // null. It is an error if a field in this list has a non-empty value. 2162 // This may be used to include null fields in Patch requests. 2163 NullFields []string `json:"-"` 2164} 2165 2166func (s *Objects) MarshalJSON() ([]byte, error) { 2167 type NoMethod Objects 2168 raw := NoMethod(*s) 2169 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2170} 2171 2172// Policy: A bucket/object IAM policy. 2173type Policy struct { 2174 // Bindings: An association between a role, which comes with a set of 2175 // permissions, and members who may assume that role. 2176 Bindings []*PolicyBindings `json:"bindings,omitempty"` 2177 2178 // Etag: HTTP 1.1 Entity tag for the policy. 2179 Etag string `json:"etag,omitempty"` 2180 2181 // Kind: The kind of item this is. For policies, this is always 2182 // storage#policy. This field is ignored on input. 2183 Kind string `json:"kind,omitempty"` 2184 2185 // ResourceId: The ID of the resource to which this policy belongs. Will 2186 // be of the form projects/_/buckets/bucket for buckets, and 2187 // projects/_/buckets/bucket/objects/object for objects. A specific 2188 // generation may be specified by appending #generationNumber to the end 2189 // of the object name, e.g. 2190 // projects/_/buckets/my-bucket/objects/data.txt#17. The current 2191 // generation can be denoted with #0. This field is ignored on input. 2192 ResourceId string `json:"resourceId,omitempty"` 2193 2194 // Version: The IAM policy format version. 2195 Version int64 `json:"version,omitempty"` 2196 2197 // ServerResponse contains the HTTP response code and headers from the 2198 // server. 2199 googleapi.ServerResponse `json:"-"` 2200 2201 // ForceSendFields is a list of field names (e.g. "Bindings") to 2202 // unconditionally include in API requests. By default, fields with 2203 // empty or default values are omitted from API requests. However, any 2204 // non-pointer, non-interface field appearing in ForceSendFields will be 2205 // sent to the server regardless of whether the field is empty or not. 2206 // This may be used to include empty fields in Patch requests. 2207 ForceSendFields []string `json:"-"` 2208 2209 // NullFields is a list of field names (e.g. "Bindings") to include in 2210 // API requests with the JSON null value. By default, fields with empty 2211 // values are omitted from API requests. However, any field with an 2212 // empty value appearing in NullFields will be sent to the server as 2213 // null. It is an error if a field in this list has a non-empty value. 2214 // This may be used to include null fields in Patch requests. 2215 NullFields []string `json:"-"` 2216} 2217 2218func (s *Policy) MarshalJSON() ([]byte, error) { 2219 type NoMethod Policy 2220 raw := NoMethod(*s) 2221 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2222} 2223 2224type PolicyBindings struct { 2225 // Condition: The condition that is associated with this binding. NOTE: 2226 // an unsatisfied condition will not allow user access via current 2227 // binding. Different bindings, including their conditions, are examined 2228 // independently. 2229 Condition *Expr `json:"condition,omitempty"` 2230 2231 // Members: A collection of identifiers for members who may assume the 2232 // provided role. Recognized identifiers are as follows: 2233 // - allUsers — A special identifier that represents anyone on the 2234 // internet; with or without a Google account. 2235 // - allAuthenticatedUsers — A special identifier that represents 2236 // anyone who is authenticated with a Google account or a service 2237 // account. 2238 // - user:emailid — An email address that represents a specific 2239 // account. For example, user:alice@gmail.com or user:joe@example.com. 2240 // 2241 // - serviceAccount:emailid — An email address that represents a 2242 // service account. For example, 2243 // serviceAccount:my-other-app@appspot.gserviceaccount.com . 2244 // - group:emailid — An email address that represents a Google group. 2245 // For example, group:admins@example.com. 2246 // - domain:domain — A Google Apps domain name that represents all the 2247 // users of that domain. For example, domain:google.com or 2248 // domain:example.com. 2249 // - projectOwner:projectid — Owners of the given project. For 2250 // example, projectOwner:my-example-project 2251 // - projectEditor:projectid — Editors of the given project. For 2252 // example, projectEditor:my-example-project 2253 // - projectViewer:projectid — Viewers of the given project. For 2254 // example, projectViewer:my-example-project 2255 Members []string `json:"members,omitempty"` 2256 2257 // Role: The role to which members belong. Two types of roles are 2258 // supported: new IAM roles, which grant permissions that do not map 2259 // directly to those provided by ACLs, and legacy IAM roles, which do 2260 // map directly to ACL permissions. All roles are of the format 2261 // roles/storage.specificRole. 2262 // The new IAM roles are: 2263 // - roles/storage.admin — Full control of Google Cloud Storage 2264 // resources. 2265 // - roles/storage.objectViewer — Read-Only access to Google Cloud 2266 // Storage objects. 2267 // - roles/storage.objectCreator — Access to create objects in Google 2268 // Cloud Storage. 2269 // - roles/storage.objectAdmin — Full control of Google Cloud Storage 2270 // objects. The legacy IAM roles are: 2271 // - roles/storage.legacyObjectReader — Read-only access to objects 2272 // without listing. Equivalent to an ACL entry on an object with the 2273 // READER role. 2274 // - roles/storage.legacyObjectOwner — Read/write access to existing 2275 // objects without listing. Equivalent to an ACL entry on an object with 2276 // the OWNER role. 2277 // - roles/storage.legacyBucketReader — Read access to buckets with 2278 // object listing. Equivalent to an ACL entry on a bucket with the 2279 // READER role. 2280 // - roles/storage.legacyBucketWriter — Read access to buckets with 2281 // object listing/creation/deletion. Equivalent to an ACL entry on a 2282 // bucket with the WRITER role. 2283 // - roles/storage.legacyBucketOwner — Read and write access to 2284 // existing buckets with object listing/creation/deletion. Equivalent to 2285 // an ACL entry on a bucket with the OWNER role. 2286 Role string `json:"role,omitempty"` 2287 2288 // ForceSendFields is a list of field names (e.g. "Condition") to 2289 // unconditionally include in API requests. By default, fields with 2290 // empty or default values are omitted from API requests. However, any 2291 // non-pointer, non-interface field appearing in ForceSendFields will be 2292 // sent to the server regardless of whether the field is empty or not. 2293 // This may be used to include empty fields in Patch requests. 2294 ForceSendFields []string `json:"-"` 2295 2296 // NullFields is a list of field names (e.g. "Condition") to include in 2297 // API requests with the JSON null value. By default, fields with empty 2298 // values are omitted from API requests. However, any field with an 2299 // empty value appearing in NullFields will be sent to the server as 2300 // null. It is an error if a field in this list has a non-empty value. 2301 // This may be used to include null fields in Patch requests. 2302 NullFields []string `json:"-"` 2303} 2304 2305func (s *PolicyBindings) MarshalJSON() ([]byte, error) { 2306 type NoMethod PolicyBindings 2307 raw := NoMethod(*s) 2308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2309} 2310 2311// RewriteResponse: A rewrite response. 2312type RewriteResponse struct { 2313 // Done: true if the copy is finished; otherwise, false if the copy is 2314 // in progress. This property is always present in the response. 2315 Done bool `json:"done,omitempty"` 2316 2317 // Kind: The kind of item this is. 2318 Kind string `json:"kind,omitempty"` 2319 2320 // ObjectSize: The total size of the object being copied in bytes. This 2321 // property is always present in the response. 2322 ObjectSize int64 `json:"objectSize,omitempty,string"` 2323 2324 // Resource: A resource containing the metadata for the copied-to 2325 // object. This property is present in the response only when copying 2326 // completes. 2327 Resource *Object `json:"resource,omitempty"` 2328 2329 // RewriteToken: A token to use in subsequent requests to continue 2330 // copying data. This token is present in the response only when there 2331 // is more data to copy. 2332 RewriteToken string `json:"rewriteToken,omitempty"` 2333 2334 // TotalBytesRewritten: The total bytes written so far, which can be 2335 // used to provide a waiting user with a progress indicator. This 2336 // property is always present in the response. 2337 TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"` 2338 2339 // ServerResponse contains the HTTP response code and headers from the 2340 // server. 2341 googleapi.ServerResponse `json:"-"` 2342 2343 // ForceSendFields is a list of field names (e.g. "Done") to 2344 // unconditionally include in API requests. By default, fields with 2345 // empty or default values are omitted from API requests. However, any 2346 // non-pointer, non-interface field appearing in ForceSendFields will be 2347 // sent to the server regardless of whether the field is empty or not. 2348 // This may be used to include empty fields in Patch requests. 2349 ForceSendFields []string `json:"-"` 2350 2351 // NullFields is a list of field names (e.g. "Done") to include in API 2352 // requests with the JSON null value. By default, fields with empty 2353 // values are omitted from API requests. However, any field with an 2354 // empty value appearing in NullFields will be sent to the server as 2355 // null. It is an error if a field in this list has a non-empty value. 2356 // This may be used to include null fields in Patch requests. 2357 NullFields []string `json:"-"` 2358} 2359 2360func (s *RewriteResponse) MarshalJSON() ([]byte, error) { 2361 type NoMethod RewriteResponse 2362 raw := NoMethod(*s) 2363 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2364} 2365 2366// ServiceAccount: A subscription to receive Google PubSub 2367// notifications. 2368type ServiceAccount struct { 2369 // EmailAddress: The ID of the notification. 2370 EmailAddress string `json:"email_address,omitempty"` 2371 2372 // Kind: The kind of item this is. For notifications, this is always 2373 // storage#notification. 2374 Kind string `json:"kind,omitempty"` 2375 2376 // ServerResponse contains the HTTP response code and headers from the 2377 // server. 2378 googleapi.ServerResponse `json:"-"` 2379 2380 // ForceSendFields is a list of field names (e.g. "EmailAddress") to 2381 // unconditionally include in API requests. By default, fields with 2382 // empty or default values are omitted from API requests. However, any 2383 // non-pointer, non-interface field appearing in ForceSendFields will be 2384 // sent to the server regardless of whether the field is empty or not. 2385 // This may be used to include empty fields in Patch requests. 2386 ForceSendFields []string `json:"-"` 2387 2388 // NullFields is a list of field names (e.g. "EmailAddress") to include 2389 // in API requests with the JSON null value. By default, fields with 2390 // empty values are omitted from API requests. However, any field with 2391 // an empty value appearing in NullFields will be sent to the server as 2392 // null. It is an error if a field in this list has a non-empty value. 2393 // This may be used to include null fields in Patch requests. 2394 NullFields []string `json:"-"` 2395} 2396 2397func (s *ServiceAccount) MarshalJSON() ([]byte, error) { 2398 type NoMethod ServiceAccount 2399 raw := NoMethod(*s) 2400 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2401} 2402 2403// TestIamPermissionsResponse: A 2404// storage.(buckets|objects).testIamPermissions response. 2405type TestIamPermissionsResponse struct { 2406 // Kind: The kind of item this is. 2407 Kind string `json:"kind,omitempty"` 2408 2409 // Permissions: The permissions held by the caller. Permissions are 2410 // always of the format storage.resource.capability, where resource is 2411 // one of buckets or objects. The supported permissions are as follows: 2412 // 2413 // - storage.buckets.delete — Delete bucket. 2414 // - storage.buckets.get — Read bucket metadata. 2415 // - storage.buckets.getIamPolicy — Read bucket IAM policy. 2416 // - storage.buckets.create — Create bucket. 2417 // - storage.buckets.list — List buckets. 2418 // - storage.buckets.setIamPolicy — Update bucket IAM policy. 2419 // - storage.buckets.update — Update bucket metadata. 2420 // - storage.objects.delete — Delete object. 2421 // - storage.objects.get — Read object data and metadata. 2422 // - storage.objects.getIamPolicy — Read object IAM policy. 2423 // - storage.objects.create — Create object. 2424 // - storage.objects.list — List objects. 2425 // - storage.objects.setIamPolicy — Update object IAM policy. 2426 // - storage.objects.update — Update object metadata. 2427 Permissions []string `json:"permissions,omitempty"` 2428 2429 // ServerResponse contains the HTTP response code and headers from the 2430 // server. 2431 googleapi.ServerResponse `json:"-"` 2432 2433 // ForceSendFields is a list of field names (e.g. "Kind") to 2434 // unconditionally include in API requests. By default, fields with 2435 // empty or default values are omitted from API requests. However, any 2436 // non-pointer, non-interface field appearing in ForceSendFields will be 2437 // sent to the server regardless of whether the field is empty or not. 2438 // This may be used to include empty fields in Patch requests. 2439 ForceSendFields []string `json:"-"` 2440 2441 // NullFields is a list of field names (e.g. "Kind") to include in API 2442 // requests with the JSON null value. By default, fields with empty 2443 // values are omitted from API requests. However, any field with an 2444 // empty value appearing in NullFields will be sent to the server as 2445 // null. It is an error if a field in this list has a non-empty value. 2446 // This may be used to include null fields in Patch requests. 2447 NullFields []string `json:"-"` 2448} 2449 2450func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2451 type NoMethod TestIamPermissionsResponse 2452 raw := NoMethod(*s) 2453 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2454} 2455 2456// method id "storage.bucketAccessControls.delete": 2457 2458type BucketAccessControlsDeleteCall struct { 2459 s *Service 2460 bucket string 2461 entity string 2462 urlParams_ gensupport.URLParams 2463 ctx_ context.Context 2464 header_ http.Header 2465} 2466 2467// Delete: Permanently deletes the ACL entry for the specified entity on 2468// the specified bucket. 2469// 2470// - bucket: Name of a bucket. 2471// - entity: The entity holding the permission. Can be user-userId, 2472// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 2473// allAuthenticatedUsers. 2474func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall { 2475 c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2476 c.bucket = bucket 2477 c.entity = entity 2478 return c 2479} 2480 2481// ProvisionalUserProject sets the optional parameter 2482// "provisionalUserProject": The project to be billed for this request 2483// if the target bucket is requester-pays bucket. 2484func (c *BucketAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsDeleteCall { 2485 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2486 return c 2487} 2488 2489// UserProject sets the optional parameter "userProject": The project to 2490// be billed for this request. Required for Requester Pays buckets. 2491func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall { 2492 c.urlParams_.Set("userProject", userProject) 2493 return c 2494} 2495 2496// Fields allows partial responses to be retrieved. See 2497// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2498// for more information. 2499func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall { 2500 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2501 return c 2502} 2503 2504// Context sets the context to be used in this call's Do method. Any 2505// pending HTTP request will be aborted if the provided context is 2506// canceled. 2507func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall { 2508 c.ctx_ = ctx 2509 return c 2510} 2511 2512// Header returns an http.Header that can be modified by the caller to 2513// add HTTP headers to the request. 2514func (c *BucketAccessControlsDeleteCall) Header() http.Header { 2515 if c.header_ == nil { 2516 c.header_ = make(http.Header) 2517 } 2518 return c.header_ 2519} 2520 2521func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 2522 reqHeaders := make(http.Header) 2523 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2524 for k, v := range c.header_ { 2525 reqHeaders[k] = v 2526 } 2527 reqHeaders.Set("User-Agent", c.s.userAgent()) 2528 var body io.Reader = nil 2529 c.urlParams_.Set("alt", alt) 2530 c.urlParams_.Set("prettyPrint", "false") 2531 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 2532 urls += "?" + c.urlParams_.Encode() 2533 req, err := http.NewRequest("DELETE", urls, body) 2534 if err != nil { 2535 return nil, err 2536 } 2537 req.Header = reqHeaders 2538 googleapi.Expand(req.URL, map[string]string{ 2539 "bucket": c.bucket, 2540 "entity": c.entity, 2541 }) 2542 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2543} 2544 2545// Do executes the "storage.bucketAccessControls.delete" call. 2546func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { 2547 gensupport.SetOptions(c.urlParams_, opts...) 2548 res, err := c.doRequest("json") 2549 if err != nil { 2550 return err 2551 } 2552 defer googleapi.CloseBody(res) 2553 if err := googleapi.CheckResponse(res); err != nil { 2554 return err 2555 } 2556 return nil 2557 // { 2558 // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", 2559 // "httpMethod": "DELETE", 2560 // "id": "storage.bucketAccessControls.delete", 2561 // "parameterOrder": [ 2562 // "bucket", 2563 // "entity" 2564 // ], 2565 // "parameters": { 2566 // "bucket": { 2567 // "description": "Name of a bucket.", 2568 // "location": "path", 2569 // "required": true, 2570 // "type": "string" 2571 // }, 2572 // "entity": { 2573 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 2574 // "location": "path", 2575 // "required": true, 2576 // "type": "string" 2577 // }, 2578 // "provisionalUserProject": { 2579 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 2580 // "location": "query", 2581 // "type": "string" 2582 // }, 2583 // "userProject": { 2584 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 2585 // "location": "query", 2586 // "type": "string" 2587 // } 2588 // }, 2589 // "path": "b/{bucket}/acl/{entity}", 2590 // "scopes": [ 2591 // "https://www.googleapis.com/auth/cloud-platform", 2592 // "https://www.googleapis.com/auth/devstorage.full_control" 2593 // ] 2594 // } 2595 2596} 2597 2598// method id "storage.bucketAccessControls.get": 2599 2600type BucketAccessControlsGetCall struct { 2601 s *Service 2602 bucket string 2603 entity string 2604 urlParams_ gensupport.URLParams 2605 ifNoneMatch_ string 2606 ctx_ context.Context 2607 header_ http.Header 2608} 2609 2610// Get: Returns the ACL entry for the specified entity on the specified 2611// bucket. 2612// 2613// - bucket: Name of a bucket. 2614// - entity: The entity holding the permission. Can be user-userId, 2615// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 2616// allAuthenticatedUsers. 2617func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall { 2618 c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2619 c.bucket = bucket 2620 c.entity = entity 2621 return c 2622} 2623 2624// ProvisionalUserProject sets the optional parameter 2625// "provisionalUserProject": The project to be billed for this request 2626// if the target bucket is requester-pays bucket. 2627func (c *BucketAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsGetCall { 2628 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2629 return c 2630} 2631 2632// UserProject sets the optional parameter "userProject": The project to 2633// be billed for this request. Required for Requester Pays buckets. 2634func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall { 2635 c.urlParams_.Set("userProject", userProject) 2636 return c 2637} 2638 2639// Fields allows partial responses to be retrieved. See 2640// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2641// for more information. 2642func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall { 2643 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2644 return c 2645} 2646 2647// IfNoneMatch sets the optional parameter which makes the operation 2648// fail if the object's ETag matches the given value. This is useful for 2649// getting updates only after the object has changed since the last 2650// request. Use googleapi.IsNotModified to check whether the response 2651// error from Do is the result of In-None-Match. 2652func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall { 2653 c.ifNoneMatch_ = entityTag 2654 return c 2655} 2656 2657// Context sets the context to be used in this call's Do method. Any 2658// pending HTTP request will be aborted if the provided context is 2659// canceled. 2660func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall { 2661 c.ctx_ = ctx 2662 return c 2663} 2664 2665// Header returns an http.Header that can be modified by the caller to 2666// add HTTP headers to the request. 2667func (c *BucketAccessControlsGetCall) Header() http.Header { 2668 if c.header_ == nil { 2669 c.header_ = make(http.Header) 2670 } 2671 return c.header_ 2672} 2673 2674func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { 2675 reqHeaders := make(http.Header) 2676 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2677 for k, v := range c.header_ { 2678 reqHeaders[k] = v 2679 } 2680 reqHeaders.Set("User-Agent", c.s.userAgent()) 2681 if c.ifNoneMatch_ != "" { 2682 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2683 } 2684 var body io.Reader = nil 2685 c.urlParams_.Set("alt", alt) 2686 c.urlParams_.Set("prettyPrint", "false") 2687 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 2688 urls += "?" + c.urlParams_.Encode() 2689 req, err := http.NewRequest("GET", urls, body) 2690 if err != nil { 2691 return nil, err 2692 } 2693 req.Header = reqHeaders 2694 googleapi.Expand(req.URL, map[string]string{ 2695 "bucket": c.bucket, 2696 "entity": c.entity, 2697 }) 2698 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2699} 2700 2701// Do executes the "storage.bucketAccessControls.get" call. 2702// Exactly one of *BucketAccessControl or error will be non-nil. Any 2703// non-2xx status code is an error. Response headers are in either 2704// *BucketAccessControl.ServerResponse.Header or (if a response was 2705// returned at all) in error.(*googleapi.Error).Header. Use 2706// googleapi.IsNotModified to check whether the returned error was 2707// because http.StatusNotModified was returned. 2708func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 2709 gensupport.SetOptions(c.urlParams_, opts...) 2710 res, err := c.doRequest("json") 2711 if res != nil && res.StatusCode == http.StatusNotModified { 2712 if res.Body != nil { 2713 res.Body.Close() 2714 } 2715 return nil, &googleapi.Error{ 2716 Code: res.StatusCode, 2717 Header: res.Header, 2718 } 2719 } 2720 if err != nil { 2721 return nil, err 2722 } 2723 defer googleapi.CloseBody(res) 2724 if err := googleapi.CheckResponse(res); err != nil { 2725 return nil, err 2726 } 2727 ret := &BucketAccessControl{ 2728 ServerResponse: googleapi.ServerResponse{ 2729 Header: res.Header, 2730 HTTPStatusCode: res.StatusCode, 2731 }, 2732 } 2733 target := &ret 2734 if err := gensupport.DecodeResponse(target, res); err != nil { 2735 return nil, err 2736 } 2737 return ret, nil 2738 // { 2739 // "description": "Returns the ACL entry for the specified entity on the specified bucket.", 2740 // "httpMethod": "GET", 2741 // "id": "storage.bucketAccessControls.get", 2742 // "parameterOrder": [ 2743 // "bucket", 2744 // "entity" 2745 // ], 2746 // "parameters": { 2747 // "bucket": { 2748 // "description": "Name of a bucket.", 2749 // "location": "path", 2750 // "required": true, 2751 // "type": "string" 2752 // }, 2753 // "entity": { 2754 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 2755 // "location": "path", 2756 // "required": true, 2757 // "type": "string" 2758 // }, 2759 // "provisionalUserProject": { 2760 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 2761 // "location": "query", 2762 // "type": "string" 2763 // }, 2764 // "userProject": { 2765 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 2766 // "location": "query", 2767 // "type": "string" 2768 // } 2769 // }, 2770 // "path": "b/{bucket}/acl/{entity}", 2771 // "response": { 2772 // "$ref": "BucketAccessControl" 2773 // }, 2774 // "scopes": [ 2775 // "https://www.googleapis.com/auth/cloud-platform", 2776 // "https://www.googleapis.com/auth/devstorage.full_control" 2777 // ] 2778 // } 2779 2780} 2781 2782// method id "storage.bucketAccessControls.insert": 2783 2784type BucketAccessControlsInsertCall struct { 2785 s *Service 2786 bucket string 2787 bucketaccesscontrol *BucketAccessControl 2788 urlParams_ gensupport.URLParams 2789 ctx_ context.Context 2790 header_ http.Header 2791} 2792 2793// Insert: Creates a new ACL entry on the specified bucket. 2794// 2795// - bucket: Name of a bucket. 2796func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall { 2797 c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2798 c.bucket = bucket 2799 c.bucketaccesscontrol = bucketaccesscontrol 2800 return c 2801} 2802 2803// ProvisionalUserProject sets the optional parameter 2804// "provisionalUserProject": The project to be billed for this request 2805// if the target bucket is requester-pays bucket. 2806func (c *BucketAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsInsertCall { 2807 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2808 return c 2809} 2810 2811// UserProject sets the optional parameter "userProject": The project to 2812// be billed for this request. Required for Requester Pays buckets. 2813func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall { 2814 c.urlParams_.Set("userProject", userProject) 2815 return c 2816} 2817 2818// Fields allows partial responses to be retrieved. See 2819// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2820// for more information. 2821func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall { 2822 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2823 return c 2824} 2825 2826// Context sets the context to be used in this call's Do method. Any 2827// pending HTTP request will be aborted if the provided context is 2828// canceled. 2829func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall { 2830 c.ctx_ = ctx 2831 return c 2832} 2833 2834// Header returns an http.Header that can be modified by the caller to 2835// add HTTP headers to the request. 2836func (c *BucketAccessControlsInsertCall) Header() http.Header { 2837 if c.header_ == nil { 2838 c.header_ = make(http.Header) 2839 } 2840 return c.header_ 2841} 2842 2843func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { 2844 reqHeaders := make(http.Header) 2845 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 2846 for k, v := range c.header_ { 2847 reqHeaders[k] = v 2848 } 2849 reqHeaders.Set("User-Agent", c.s.userAgent()) 2850 var body io.Reader = nil 2851 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) 2852 if err != nil { 2853 return nil, err 2854 } 2855 reqHeaders.Set("Content-Type", "application/json") 2856 c.urlParams_.Set("alt", alt) 2857 c.urlParams_.Set("prettyPrint", "false") 2858 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") 2859 urls += "?" + c.urlParams_.Encode() 2860 req, err := http.NewRequest("POST", urls, body) 2861 if err != nil { 2862 return nil, err 2863 } 2864 req.Header = reqHeaders 2865 googleapi.Expand(req.URL, map[string]string{ 2866 "bucket": c.bucket, 2867 }) 2868 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2869} 2870 2871// Do executes the "storage.bucketAccessControls.insert" call. 2872// Exactly one of *BucketAccessControl or error will be non-nil. Any 2873// non-2xx status code is an error. Response headers are in either 2874// *BucketAccessControl.ServerResponse.Header or (if a response was 2875// returned at all) in error.(*googleapi.Error).Header. Use 2876// googleapi.IsNotModified to check whether the returned error was 2877// because http.StatusNotModified was returned. 2878func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 2879 gensupport.SetOptions(c.urlParams_, opts...) 2880 res, err := c.doRequest("json") 2881 if res != nil && res.StatusCode == http.StatusNotModified { 2882 if res.Body != nil { 2883 res.Body.Close() 2884 } 2885 return nil, &googleapi.Error{ 2886 Code: res.StatusCode, 2887 Header: res.Header, 2888 } 2889 } 2890 if err != nil { 2891 return nil, err 2892 } 2893 defer googleapi.CloseBody(res) 2894 if err := googleapi.CheckResponse(res); err != nil { 2895 return nil, err 2896 } 2897 ret := &BucketAccessControl{ 2898 ServerResponse: googleapi.ServerResponse{ 2899 Header: res.Header, 2900 HTTPStatusCode: res.StatusCode, 2901 }, 2902 } 2903 target := &ret 2904 if err := gensupport.DecodeResponse(target, res); err != nil { 2905 return nil, err 2906 } 2907 return ret, nil 2908 // { 2909 // "description": "Creates a new ACL entry on the specified bucket.", 2910 // "httpMethod": "POST", 2911 // "id": "storage.bucketAccessControls.insert", 2912 // "parameterOrder": [ 2913 // "bucket" 2914 // ], 2915 // "parameters": { 2916 // "bucket": { 2917 // "description": "Name of a bucket.", 2918 // "location": "path", 2919 // "required": true, 2920 // "type": "string" 2921 // }, 2922 // "provisionalUserProject": { 2923 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 2924 // "location": "query", 2925 // "type": "string" 2926 // }, 2927 // "userProject": { 2928 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 2929 // "location": "query", 2930 // "type": "string" 2931 // } 2932 // }, 2933 // "path": "b/{bucket}/acl", 2934 // "request": { 2935 // "$ref": "BucketAccessControl" 2936 // }, 2937 // "response": { 2938 // "$ref": "BucketAccessControl" 2939 // }, 2940 // "scopes": [ 2941 // "https://www.googleapis.com/auth/cloud-platform", 2942 // "https://www.googleapis.com/auth/devstorage.full_control" 2943 // ] 2944 // } 2945 2946} 2947 2948// method id "storage.bucketAccessControls.list": 2949 2950type BucketAccessControlsListCall struct { 2951 s *Service 2952 bucket string 2953 urlParams_ gensupport.URLParams 2954 ifNoneMatch_ string 2955 ctx_ context.Context 2956 header_ http.Header 2957} 2958 2959// List: Retrieves ACL entries on the specified bucket. 2960// 2961// - bucket: Name of a bucket. 2962func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall { 2963 c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2964 c.bucket = bucket 2965 return c 2966} 2967 2968// ProvisionalUserProject sets the optional parameter 2969// "provisionalUserProject": The project to be billed for this request 2970// if the target bucket is requester-pays bucket. 2971func (c *BucketAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsListCall { 2972 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 2973 return c 2974} 2975 2976// UserProject sets the optional parameter "userProject": The project to 2977// be billed for this request. Required for Requester Pays buckets. 2978func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall { 2979 c.urlParams_.Set("userProject", userProject) 2980 return c 2981} 2982 2983// Fields allows partial responses to be retrieved. See 2984// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2985// for more information. 2986func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall { 2987 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2988 return c 2989} 2990 2991// IfNoneMatch sets the optional parameter which makes the operation 2992// fail if the object's ETag matches the given value. This is useful for 2993// getting updates only after the object has changed since the last 2994// request. Use googleapi.IsNotModified to check whether the response 2995// error from Do is the result of In-None-Match. 2996func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall { 2997 c.ifNoneMatch_ = entityTag 2998 return c 2999} 3000 3001// Context sets the context to be used in this call's Do method. Any 3002// pending HTTP request will be aborted if the provided context is 3003// canceled. 3004func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall { 3005 c.ctx_ = ctx 3006 return c 3007} 3008 3009// Header returns an http.Header that can be modified by the caller to 3010// add HTTP headers to the request. 3011func (c *BucketAccessControlsListCall) Header() http.Header { 3012 if c.header_ == nil { 3013 c.header_ = make(http.Header) 3014 } 3015 return c.header_ 3016} 3017 3018func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { 3019 reqHeaders := make(http.Header) 3020 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3021 for k, v := range c.header_ { 3022 reqHeaders[k] = v 3023 } 3024 reqHeaders.Set("User-Agent", c.s.userAgent()) 3025 if c.ifNoneMatch_ != "" { 3026 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3027 } 3028 var body io.Reader = nil 3029 c.urlParams_.Set("alt", alt) 3030 c.urlParams_.Set("prettyPrint", "false") 3031 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") 3032 urls += "?" + c.urlParams_.Encode() 3033 req, err := http.NewRequest("GET", urls, body) 3034 if err != nil { 3035 return nil, err 3036 } 3037 req.Header = reqHeaders 3038 googleapi.Expand(req.URL, map[string]string{ 3039 "bucket": c.bucket, 3040 }) 3041 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3042} 3043 3044// Do executes the "storage.bucketAccessControls.list" call. 3045// Exactly one of *BucketAccessControls or error will be non-nil. Any 3046// non-2xx status code is an error. Response headers are in either 3047// *BucketAccessControls.ServerResponse.Header or (if a response was 3048// returned at all) in error.(*googleapi.Error).Header. Use 3049// googleapi.IsNotModified to check whether the returned error was 3050// because http.StatusNotModified was returned. 3051func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) { 3052 gensupport.SetOptions(c.urlParams_, opts...) 3053 res, err := c.doRequest("json") 3054 if res != nil && res.StatusCode == http.StatusNotModified { 3055 if res.Body != nil { 3056 res.Body.Close() 3057 } 3058 return nil, &googleapi.Error{ 3059 Code: res.StatusCode, 3060 Header: res.Header, 3061 } 3062 } 3063 if err != nil { 3064 return nil, err 3065 } 3066 defer googleapi.CloseBody(res) 3067 if err := googleapi.CheckResponse(res); err != nil { 3068 return nil, err 3069 } 3070 ret := &BucketAccessControls{ 3071 ServerResponse: googleapi.ServerResponse{ 3072 Header: res.Header, 3073 HTTPStatusCode: res.StatusCode, 3074 }, 3075 } 3076 target := &ret 3077 if err := gensupport.DecodeResponse(target, res); err != nil { 3078 return nil, err 3079 } 3080 return ret, nil 3081 // { 3082 // "description": "Retrieves ACL entries on the specified bucket.", 3083 // "httpMethod": "GET", 3084 // "id": "storage.bucketAccessControls.list", 3085 // "parameterOrder": [ 3086 // "bucket" 3087 // ], 3088 // "parameters": { 3089 // "bucket": { 3090 // "description": "Name of a bucket.", 3091 // "location": "path", 3092 // "required": true, 3093 // "type": "string" 3094 // }, 3095 // "provisionalUserProject": { 3096 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3097 // "location": "query", 3098 // "type": "string" 3099 // }, 3100 // "userProject": { 3101 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3102 // "location": "query", 3103 // "type": "string" 3104 // } 3105 // }, 3106 // "path": "b/{bucket}/acl", 3107 // "response": { 3108 // "$ref": "BucketAccessControls" 3109 // }, 3110 // "scopes": [ 3111 // "https://www.googleapis.com/auth/cloud-platform", 3112 // "https://www.googleapis.com/auth/devstorage.full_control" 3113 // ] 3114 // } 3115 3116} 3117 3118// method id "storage.bucketAccessControls.patch": 3119 3120type BucketAccessControlsPatchCall struct { 3121 s *Service 3122 bucket string 3123 entity string 3124 bucketaccesscontrol *BucketAccessControl 3125 urlParams_ gensupport.URLParams 3126 ctx_ context.Context 3127 header_ http.Header 3128} 3129 3130// Patch: Patches an ACL entry on the specified bucket. 3131// 3132// - bucket: Name of a bucket. 3133// - entity: The entity holding the permission. Can be user-userId, 3134// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 3135// allAuthenticatedUsers. 3136func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall { 3137 c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3138 c.bucket = bucket 3139 c.entity = entity 3140 c.bucketaccesscontrol = bucketaccesscontrol 3141 return c 3142} 3143 3144// ProvisionalUserProject sets the optional parameter 3145// "provisionalUserProject": The project to be billed for this request 3146// if the target bucket is requester-pays bucket. 3147func (c *BucketAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsPatchCall { 3148 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3149 return c 3150} 3151 3152// UserProject sets the optional parameter "userProject": The project to 3153// be billed for this request. Required for Requester Pays buckets. 3154func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall { 3155 c.urlParams_.Set("userProject", userProject) 3156 return c 3157} 3158 3159// Fields allows partial responses to be retrieved. See 3160// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3161// for more information. 3162func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall { 3163 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3164 return c 3165} 3166 3167// Context sets the context to be used in this call's Do method. Any 3168// pending HTTP request will be aborted if the provided context is 3169// canceled. 3170func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall { 3171 c.ctx_ = ctx 3172 return c 3173} 3174 3175// Header returns an http.Header that can be modified by the caller to 3176// add HTTP headers to the request. 3177func (c *BucketAccessControlsPatchCall) Header() http.Header { 3178 if c.header_ == nil { 3179 c.header_ = make(http.Header) 3180 } 3181 return c.header_ 3182} 3183 3184func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { 3185 reqHeaders := make(http.Header) 3186 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3187 for k, v := range c.header_ { 3188 reqHeaders[k] = v 3189 } 3190 reqHeaders.Set("User-Agent", c.s.userAgent()) 3191 var body io.Reader = nil 3192 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) 3193 if err != nil { 3194 return nil, err 3195 } 3196 reqHeaders.Set("Content-Type", "application/json") 3197 c.urlParams_.Set("alt", alt) 3198 c.urlParams_.Set("prettyPrint", "false") 3199 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 3200 urls += "?" + c.urlParams_.Encode() 3201 req, err := http.NewRequest("PATCH", urls, body) 3202 if err != nil { 3203 return nil, err 3204 } 3205 req.Header = reqHeaders 3206 googleapi.Expand(req.URL, map[string]string{ 3207 "bucket": c.bucket, 3208 "entity": c.entity, 3209 }) 3210 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3211} 3212 3213// Do executes the "storage.bucketAccessControls.patch" call. 3214// Exactly one of *BucketAccessControl or error will be non-nil. Any 3215// non-2xx status code is an error. Response headers are in either 3216// *BucketAccessControl.ServerResponse.Header or (if a response was 3217// returned at all) in error.(*googleapi.Error).Header. Use 3218// googleapi.IsNotModified to check whether the returned error was 3219// because http.StatusNotModified was returned. 3220func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 3221 gensupport.SetOptions(c.urlParams_, opts...) 3222 res, err := c.doRequest("json") 3223 if res != nil && res.StatusCode == http.StatusNotModified { 3224 if res.Body != nil { 3225 res.Body.Close() 3226 } 3227 return nil, &googleapi.Error{ 3228 Code: res.StatusCode, 3229 Header: res.Header, 3230 } 3231 } 3232 if err != nil { 3233 return nil, err 3234 } 3235 defer googleapi.CloseBody(res) 3236 if err := googleapi.CheckResponse(res); err != nil { 3237 return nil, err 3238 } 3239 ret := &BucketAccessControl{ 3240 ServerResponse: googleapi.ServerResponse{ 3241 Header: res.Header, 3242 HTTPStatusCode: res.StatusCode, 3243 }, 3244 } 3245 target := &ret 3246 if err := gensupport.DecodeResponse(target, res); err != nil { 3247 return nil, err 3248 } 3249 return ret, nil 3250 // { 3251 // "description": "Patches an ACL entry on the specified bucket.", 3252 // "httpMethod": "PATCH", 3253 // "id": "storage.bucketAccessControls.patch", 3254 // "parameterOrder": [ 3255 // "bucket", 3256 // "entity" 3257 // ], 3258 // "parameters": { 3259 // "bucket": { 3260 // "description": "Name of a bucket.", 3261 // "location": "path", 3262 // "required": true, 3263 // "type": "string" 3264 // }, 3265 // "entity": { 3266 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 3267 // "location": "path", 3268 // "required": true, 3269 // "type": "string" 3270 // }, 3271 // "provisionalUserProject": { 3272 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3273 // "location": "query", 3274 // "type": "string" 3275 // }, 3276 // "userProject": { 3277 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3278 // "location": "query", 3279 // "type": "string" 3280 // } 3281 // }, 3282 // "path": "b/{bucket}/acl/{entity}", 3283 // "request": { 3284 // "$ref": "BucketAccessControl" 3285 // }, 3286 // "response": { 3287 // "$ref": "BucketAccessControl" 3288 // }, 3289 // "scopes": [ 3290 // "https://www.googleapis.com/auth/cloud-platform", 3291 // "https://www.googleapis.com/auth/devstorage.full_control" 3292 // ] 3293 // } 3294 3295} 3296 3297// method id "storage.bucketAccessControls.update": 3298 3299type BucketAccessControlsUpdateCall struct { 3300 s *Service 3301 bucket string 3302 entity string 3303 bucketaccesscontrol *BucketAccessControl 3304 urlParams_ gensupport.URLParams 3305 ctx_ context.Context 3306 header_ http.Header 3307} 3308 3309// Update: Updates an ACL entry on the specified bucket. 3310// 3311// - bucket: Name of a bucket. 3312// - entity: The entity holding the permission. Can be user-userId, 3313// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 3314// allAuthenticatedUsers. 3315func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall { 3316 c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3317 c.bucket = bucket 3318 c.entity = entity 3319 c.bucketaccesscontrol = bucketaccesscontrol 3320 return c 3321} 3322 3323// ProvisionalUserProject sets the optional parameter 3324// "provisionalUserProject": The project to be billed for this request 3325// if the target bucket is requester-pays bucket. 3326func (c *BucketAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsUpdateCall { 3327 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3328 return c 3329} 3330 3331// UserProject sets the optional parameter "userProject": The project to 3332// be billed for this request. Required for Requester Pays buckets. 3333func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall { 3334 c.urlParams_.Set("userProject", userProject) 3335 return c 3336} 3337 3338// Fields allows partial responses to be retrieved. See 3339// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3340// for more information. 3341func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall { 3342 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3343 return c 3344} 3345 3346// Context sets the context to be used in this call's Do method. Any 3347// pending HTTP request will be aborted if the provided context is 3348// canceled. 3349func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall { 3350 c.ctx_ = ctx 3351 return c 3352} 3353 3354// Header returns an http.Header that can be modified by the caller to 3355// add HTTP headers to the request. 3356func (c *BucketAccessControlsUpdateCall) Header() http.Header { 3357 if c.header_ == nil { 3358 c.header_ = make(http.Header) 3359 } 3360 return c.header_ 3361} 3362 3363func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { 3364 reqHeaders := make(http.Header) 3365 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3366 for k, v := range c.header_ { 3367 reqHeaders[k] = v 3368 } 3369 reqHeaders.Set("User-Agent", c.s.userAgent()) 3370 var body io.Reader = nil 3371 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) 3372 if err != nil { 3373 return nil, err 3374 } 3375 reqHeaders.Set("Content-Type", "application/json") 3376 c.urlParams_.Set("alt", alt) 3377 c.urlParams_.Set("prettyPrint", "false") 3378 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") 3379 urls += "?" + c.urlParams_.Encode() 3380 req, err := http.NewRequest("PUT", urls, body) 3381 if err != nil { 3382 return nil, err 3383 } 3384 req.Header = reqHeaders 3385 googleapi.Expand(req.URL, map[string]string{ 3386 "bucket": c.bucket, 3387 "entity": c.entity, 3388 }) 3389 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3390} 3391 3392// Do executes the "storage.bucketAccessControls.update" call. 3393// Exactly one of *BucketAccessControl or error will be non-nil. Any 3394// non-2xx status code is an error. Response headers are in either 3395// *BucketAccessControl.ServerResponse.Header or (if a response was 3396// returned at all) in error.(*googleapi.Error).Header. Use 3397// googleapi.IsNotModified to check whether the returned error was 3398// because http.StatusNotModified was returned. 3399func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { 3400 gensupport.SetOptions(c.urlParams_, opts...) 3401 res, err := c.doRequest("json") 3402 if res != nil && res.StatusCode == http.StatusNotModified { 3403 if res.Body != nil { 3404 res.Body.Close() 3405 } 3406 return nil, &googleapi.Error{ 3407 Code: res.StatusCode, 3408 Header: res.Header, 3409 } 3410 } 3411 if err != nil { 3412 return nil, err 3413 } 3414 defer googleapi.CloseBody(res) 3415 if err := googleapi.CheckResponse(res); err != nil { 3416 return nil, err 3417 } 3418 ret := &BucketAccessControl{ 3419 ServerResponse: googleapi.ServerResponse{ 3420 Header: res.Header, 3421 HTTPStatusCode: res.StatusCode, 3422 }, 3423 } 3424 target := &ret 3425 if err := gensupport.DecodeResponse(target, res); err != nil { 3426 return nil, err 3427 } 3428 return ret, nil 3429 // { 3430 // "description": "Updates an ACL entry on the specified bucket.", 3431 // "httpMethod": "PUT", 3432 // "id": "storage.bucketAccessControls.update", 3433 // "parameterOrder": [ 3434 // "bucket", 3435 // "entity" 3436 // ], 3437 // "parameters": { 3438 // "bucket": { 3439 // "description": "Name of a bucket.", 3440 // "location": "path", 3441 // "required": true, 3442 // "type": "string" 3443 // }, 3444 // "entity": { 3445 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 3446 // "location": "path", 3447 // "required": true, 3448 // "type": "string" 3449 // }, 3450 // "provisionalUserProject": { 3451 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3452 // "location": "query", 3453 // "type": "string" 3454 // }, 3455 // "userProject": { 3456 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3457 // "location": "query", 3458 // "type": "string" 3459 // } 3460 // }, 3461 // "path": "b/{bucket}/acl/{entity}", 3462 // "request": { 3463 // "$ref": "BucketAccessControl" 3464 // }, 3465 // "response": { 3466 // "$ref": "BucketAccessControl" 3467 // }, 3468 // "scopes": [ 3469 // "https://www.googleapis.com/auth/cloud-platform", 3470 // "https://www.googleapis.com/auth/devstorage.full_control" 3471 // ] 3472 // } 3473 3474} 3475 3476// method id "storage.buckets.delete": 3477 3478type BucketsDeleteCall struct { 3479 s *Service 3480 bucket string 3481 urlParams_ gensupport.URLParams 3482 ctx_ context.Context 3483 header_ http.Header 3484} 3485 3486// Delete: Permanently deletes an empty bucket. 3487// 3488// - bucket: Name of a bucket. 3489func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall { 3490 c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3491 c.bucket = bucket 3492 return c 3493} 3494 3495// IfMetagenerationMatch sets the optional parameter 3496// "ifMetagenerationMatch": If set, only deletes the bucket if its 3497// metageneration matches this value. 3498func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall { 3499 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 3500 return c 3501} 3502 3503// IfMetagenerationNotMatch sets the optional parameter 3504// "ifMetagenerationNotMatch": If set, only deletes the bucket if its 3505// metageneration does not match this value. 3506func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall { 3507 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 3508 return c 3509} 3510 3511// ProvisionalUserProject sets the optional parameter 3512// "provisionalUserProject": The project to be billed for this request 3513// if the target bucket is requester-pays bucket. 3514func (c *BucketsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketsDeleteCall { 3515 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3516 return c 3517} 3518 3519// UserProject sets the optional parameter "userProject": The project to 3520// be billed for this request. Required for Requester Pays buckets. 3521func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall { 3522 c.urlParams_.Set("userProject", userProject) 3523 return c 3524} 3525 3526// Fields allows partial responses to be retrieved. See 3527// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3528// for more information. 3529func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall { 3530 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3531 return c 3532} 3533 3534// Context sets the context to be used in this call's Do method. Any 3535// pending HTTP request will be aborted if the provided context is 3536// canceled. 3537func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall { 3538 c.ctx_ = ctx 3539 return c 3540} 3541 3542// Header returns an http.Header that can be modified by the caller to 3543// add HTTP headers to the request. 3544func (c *BucketsDeleteCall) Header() http.Header { 3545 if c.header_ == nil { 3546 c.header_ = make(http.Header) 3547 } 3548 return c.header_ 3549} 3550 3551func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { 3552 reqHeaders := make(http.Header) 3553 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3554 for k, v := range c.header_ { 3555 reqHeaders[k] = v 3556 } 3557 reqHeaders.Set("User-Agent", c.s.userAgent()) 3558 var body io.Reader = nil 3559 c.urlParams_.Set("alt", alt) 3560 c.urlParams_.Set("prettyPrint", "false") 3561 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 3562 urls += "?" + c.urlParams_.Encode() 3563 req, err := http.NewRequest("DELETE", urls, body) 3564 if err != nil { 3565 return nil, err 3566 } 3567 req.Header = reqHeaders 3568 googleapi.Expand(req.URL, map[string]string{ 3569 "bucket": c.bucket, 3570 }) 3571 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3572} 3573 3574// Do executes the "storage.buckets.delete" call. 3575func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error { 3576 gensupport.SetOptions(c.urlParams_, opts...) 3577 res, err := c.doRequest("json") 3578 if err != nil { 3579 return err 3580 } 3581 defer googleapi.CloseBody(res) 3582 if err := googleapi.CheckResponse(res); err != nil { 3583 return err 3584 } 3585 return nil 3586 // { 3587 // "description": "Permanently deletes an empty bucket.", 3588 // "httpMethod": "DELETE", 3589 // "id": "storage.buckets.delete", 3590 // "parameterOrder": [ 3591 // "bucket" 3592 // ], 3593 // "parameters": { 3594 // "bucket": { 3595 // "description": "Name of a bucket.", 3596 // "location": "path", 3597 // "required": true, 3598 // "type": "string" 3599 // }, 3600 // "ifMetagenerationMatch": { 3601 // "description": "If set, only deletes the bucket if its metageneration matches this value.", 3602 // "format": "int64", 3603 // "location": "query", 3604 // "type": "string" 3605 // }, 3606 // "ifMetagenerationNotMatch": { 3607 // "description": "If set, only deletes the bucket if its metageneration does not match this value.", 3608 // "format": "int64", 3609 // "location": "query", 3610 // "type": "string" 3611 // }, 3612 // "provisionalUserProject": { 3613 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3614 // "location": "query", 3615 // "type": "string" 3616 // }, 3617 // "userProject": { 3618 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3619 // "location": "query", 3620 // "type": "string" 3621 // } 3622 // }, 3623 // "path": "b/{bucket}", 3624 // "scopes": [ 3625 // "https://www.googleapis.com/auth/cloud-platform", 3626 // "https://www.googleapis.com/auth/devstorage.full_control", 3627 // "https://www.googleapis.com/auth/devstorage.read_write" 3628 // ] 3629 // } 3630 3631} 3632 3633// method id "storage.buckets.get": 3634 3635type BucketsGetCall struct { 3636 s *Service 3637 bucket string 3638 urlParams_ gensupport.URLParams 3639 ifNoneMatch_ string 3640 ctx_ context.Context 3641 header_ http.Header 3642} 3643 3644// Get: Returns metadata for the specified bucket. 3645// 3646// - bucket: Name of a bucket. 3647func (r *BucketsService) Get(bucket string) *BucketsGetCall { 3648 c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3649 c.bucket = bucket 3650 return c 3651} 3652 3653// IfMetagenerationMatch sets the optional parameter 3654// "ifMetagenerationMatch": Makes the return of the bucket metadata 3655// conditional on whether the bucket's current metageneration matches 3656// the given value. 3657func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall { 3658 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 3659 return c 3660} 3661 3662// IfMetagenerationNotMatch sets the optional parameter 3663// "ifMetagenerationNotMatch": Makes the return of the bucket metadata 3664// conditional on whether the bucket's current metageneration does not 3665// match the given value. 3666func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall { 3667 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 3668 return c 3669} 3670 3671// Projection sets the optional parameter "projection": Set of 3672// properties to return. Defaults to noAcl. 3673// 3674// Possible values: 3675// "full" - Include all properties. 3676// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 3677func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { 3678 c.urlParams_.Set("projection", projection) 3679 return c 3680} 3681 3682// ProvisionalUserProject sets the optional parameter 3683// "provisionalUserProject": The project to be billed for this request 3684// if the target bucket is requester-pays bucket. 3685func (c *BucketsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetCall { 3686 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3687 return c 3688} 3689 3690// UserProject sets the optional parameter "userProject": The project to 3691// be billed for this request. Required for Requester Pays buckets. 3692func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall { 3693 c.urlParams_.Set("userProject", userProject) 3694 return c 3695} 3696 3697// Fields allows partial responses to be retrieved. See 3698// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3699// for more information. 3700func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall { 3701 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3702 return c 3703} 3704 3705// IfNoneMatch sets the optional parameter which makes the operation 3706// fail if the object's ETag matches the given value. This is useful for 3707// getting updates only after the object has changed since the last 3708// request. Use googleapi.IsNotModified to check whether the response 3709// error from Do is the result of In-None-Match. 3710func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall { 3711 c.ifNoneMatch_ = entityTag 3712 return c 3713} 3714 3715// Context sets the context to be used in this call's Do method. Any 3716// pending HTTP request will be aborted if the provided context is 3717// canceled. 3718func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall { 3719 c.ctx_ = ctx 3720 return c 3721} 3722 3723// Header returns an http.Header that can be modified by the caller to 3724// add HTTP headers to the request. 3725func (c *BucketsGetCall) Header() http.Header { 3726 if c.header_ == nil { 3727 c.header_ = make(http.Header) 3728 } 3729 return c.header_ 3730} 3731 3732func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { 3733 reqHeaders := make(http.Header) 3734 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3735 for k, v := range c.header_ { 3736 reqHeaders[k] = v 3737 } 3738 reqHeaders.Set("User-Agent", c.s.userAgent()) 3739 if c.ifNoneMatch_ != "" { 3740 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3741 } 3742 var body io.Reader = nil 3743 c.urlParams_.Set("alt", alt) 3744 c.urlParams_.Set("prettyPrint", "false") 3745 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 3746 urls += "?" + c.urlParams_.Encode() 3747 req, err := http.NewRequest("GET", urls, body) 3748 if err != nil { 3749 return nil, err 3750 } 3751 req.Header = reqHeaders 3752 googleapi.Expand(req.URL, map[string]string{ 3753 "bucket": c.bucket, 3754 }) 3755 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3756} 3757 3758// Do executes the "storage.buckets.get" call. 3759// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 3760// code is an error. Response headers are in either 3761// *Bucket.ServerResponse.Header or (if a response was returned at all) 3762// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3763// check whether the returned error was because http.StatusNotModified 3764// was returned. 3765func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 3766 gensupport.SetOptions(c.urlParams_, opts...) 3767 res, err := c.doRequest("json") 3768 if res != nil && res.StatusCode == http.StatusNotModified { 3769 if res.Body != nil { 3770 res.Body.Close() 3771 } 3772 return nil, &googleapi.Error{ 3773 Code: res.StatusCode, 3774 Header: res.Header, 3775 } 3776 } 3777 if err != nil { 3778 return nil, err 3779 } 3780 defer googleapi.CloseBody(res) 3781 if err := googleapi.CheckResponse(res); err != nil { 3782 return nil, err 3783 } 3784 ret := &Bucket{ 3785 ServerResponse: googleapi.ServerResponse{ 3786 Header: res.Header, 3787 HTTPStatusCode: res.StatusCode, 3788 }, 3789 } 3790 target := &ret 3791 if err := gensupport.DecodeResponse(target, res); err != nil { 3792 return nil, err 3793 } 3794 return ret, nil 3795 // { 3796 // "description": "Returns metadata for the specified bucket.", 3797 // "httpMethod": "GET", 3798 // "id": "storage.buckets.get", 3799 // "parameterOrder": [ 3800 // "bucket" 3801 // ], 3802 // "parameters": { 3803 // "bucket": { 3804 // "description": "Name of a bucket.", 3805 // "location": "path", 3806 // "required": true, 3807 // "type": "string" 3808 // }, 3809 // "ifMetagenerationMatch": { 3810 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", 3811 // "format": "int64", 3812 // "location": "query", 3813 // "type": "string" 3814 // }, 3815 // "ifMetagenerationNotMatch": { 3816 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", 3817 // "format": "int64", 3818 // "location": "query", 3819 // "type": "string" 3820 // }, 3821 // "projection": { 3822 // "description": "Set of properties to return. Defaults to noAcl.", 3823 // "enum": [ 3824 // "full", 3825 // "noAcl" 3826 // ], 3827 // "enumDescriptions": [ 3828 // "Include all properties.", 3829 // "Omit owner, acl and defaultObjectAcl properties." 3830 // ], 3831 // "location": "query", 3832 // "type": "string" 3833 // }, 3834 // "provisionalUserProject": { 3835 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 3836 // "location": "query", 3837 // "type": "string" 3838 // }, 3839 // "userProject": { 3840 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 3841 // "location": "query", 3842 // "type": "string" 3843 // } 3844 // }, 3845 // "path": "b/{bucket}", 3846 // "response": { 3847 // "$ref": "Bucket" 3848 // }, 3849 // "scopes": [ 3850 // "https://www.googleapis.com/auth/cloud-platform", 3851 // "https://www.googleapis.com/auth/cloud-platform.read-only", 3852 // "https://www.googleapis.com/auth/devstorage.full_control", 3853 // "https://www.googleapis.com/auth/devstorage.read_only", 3854 // "https://www.googleapis.com/auth/devstorage.read_write" 3855 // ] 3856 // } 3857 3858} 3859 3860// method id "storage.buckets.getIamPolicy": 3861 3862type BucketsGetIamPolicyCall struct { 3863 s *Service 3864 bucket string 3865 urlParams_ gensupport.URLParams 3866 ifNoneMatch_ string 3867 ctx_ context.Context 3868 header_ http.Header 3869} 3870 3871// GetIamPolicy: Returns an IAM policy for the specified bucket. 3872// 3873// - bucket: Name of a bucket. 3874func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall { 3875 c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3876 c.bucket = bucket 3877 return c 3878} 3879 3880// OptionsRequestedPolicyVersion sets the optional parameter 3881// "optionsRequestedPolicyVersion": The IAM policy format version to be 3882// returned. If the optionsRequestedPolicyVersion is for an older 3883// version that doesn't support part of the requested IAM policy, the 3884// request fails. 3885func (c *BucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BucketsGetIamPolicyCall { 3886 c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 3887 return c 3888} 3889 3890// ProvisionalUserProject sets the optional parameter 3891// "provisionalUserProject": The project to be billed for this request 3892// if the target bucket is requester-pays bucket. 3893func (c *BucketsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetIamPolicyCall { 3894 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 3895 return c 3896} 3897 3898// UserProject sets the optional parameter "userProject": The project to 3899// be billed for this request. Required for Requester Pays buckets. 3900func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall { 3901 c.urlParams_.Set("userProject", userProject) 3902 return c 3903} 3904 3905// Fields allows partial responses to be retrieved. See 3906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3907// for more information. 3908func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall { 3909 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3910 return c 3911} 3912 3913// IfNoneMatch sets the optional parameter which makes the operation 3914// fail if the object's ETag matches the given value. This is useful for 3915// getting updates only after the object has changed since the last 3916// request. Use googleapi.IsNotModified to check whether the response 3917// error from Do is the result of In-None-Match. 3918func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall { 3919 c.ifNoneMatch_ = entityTag 3920 return c 3921} 3922 3923// Context sets the context to be used in this call's Do method. Any 3924// pending HTTP request will be aborted if the provided context is 3925// canceled. 3926func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall { 3927 c.ctx_ = ctx 3928 return c 3929} 3930 3931// Header returns an http.Header that can be modified by the caller to 3932// add HTTP headers to the request. 3933func (c *BucketsGetIamPolicyCall) Header() http.Header { 3934 if c.header_ == nil { 3935 c.header_ = make(http.Header) 3936 } 3937 return c.header_ 3938} 3939 3940func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3941 reqHeaders := make(http.Header) 3942 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 3943 for k, v := range c.header_ { 3944 reqHeaders[k] = v 3945 } 3946 reqHeaders.Set("User-Agent", c.s.userAgent()) 3947 if c.ifNoneMatch_ != "" { 3948 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3949 } 3950 var body io.Reader = nil 3951 c.urlParams_.Set("alt", alt) 3952 c.urlParams_.Set("prettyPrint", "false") 3953 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam") 3954 urls += "?" + c.urlParams_.Encode() 3955 req, err := http.NewRequest("GET", urls, body) 3956 if err != nil { 3957 return nil, err 3958 } 3959 req.Header = reqHeaders 3960 googleapi.Expand(req.URL, map[string]string{ 3961 "bucket": c.bucket, 3962 }) 3963 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3964} 3965 3966// Do executes the "storage.buckets.getIamPolicy" call. 3967// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3968// code is an error. Response headers are in either 3969// *Policy.ServerResponse.Header or (if a response was returned at all) 3970// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3971// check whether the returned error was because http.StatusNotModified 3972// was returned. 3973func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3974 gensupport.SetOptions(c.urlParams_, opts...) 3975 res, err := c.doRequest("json") 3976 if res != nil && res.StatusCode == http.StatusNotModified { 3977 if res.Body != nil { 3978 res.Body.Close() 3979 } 3980 return nil, &googleapi.Error{ 3981 Code: res.StatusCode, 3982 Header: res.Header, 3983 } 3984 } 3985 if err != nil { 3986 return nil, err 3987 } 3988 defer googleapi.CloseBody(res) 3989 if err := googleapi.CheckResponse(res); err != nil { 3990 return nil, err 3991 } 3992 ret := &Policy{ 3993 ServerResponse: googleapi.ServerResponse{ 3994 Header: res.Header, 3995 HTTPStatusCode: res.StatusCode, 3996 }, 3997 } 3998 target := &ret 3999 if err := gensupport.DecodeResponse(target, res); err != nil { 4000 return nil, err 4001 } 4002 return ret, nil 4003 // { 4004 // "description": "Returns an IAM policy for the specified bucket.", 4005 // "httpMethod": "GET", 4006 // "id": "storage.buckets.getIamPolicy", 4007 // "parameterOrder": [ 4008 // "bucket" 4009 // ], 4010 // "parameters": { 4011 // "bucket": { 4012 // "description": "Name of a bucket.", 4013 // "location": "path", 4014 // "required": true, 4015 // "type": "string" 4016 // }, 4017 // "optionsRequestedPolicyVersion": { 4018 // "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.", 4019 // "format": "int32", 4020 // "location": "query", 4021 // "minimum": "1", 4022 // "type": "integer" 4023 // }, 4024 // "provisionalUserProject": { 4025 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4026 // "location": "query", 4027 // "type": "string" 4028 // }, 4029 // "userProject": { 4030 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 4031 // "location": "query", 4032 // "type": "string" 4033 // } 4034 // }, 4035 // "path": "b/{bucket}/iam", 4036 // "response": { 4037 // "$ref": "Policy" 4038 // }, 4039 // "scopes": [ 4040 // "https://www.googleapis.com/auth/cloud-platform", 4041 // "https://www.googleapis.com/auth/devstorage.full_control" 4042 // ] 4043 // } 4044 4045} 4046 4047// method id "storage.buckets.insert": 4048 4049type BucketsInsertCall struct { 4050 s *Service 4051 bucket *Bucket 4052 urlParams_ gensupport.URLParams 4053 ctx_ context.Context 4054 header_ http.Header 4055} 4056 4057// Insert: Creates a new bucket. 4058// 4059// - project: A valid API project identifier. 4060func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall { 4061 c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4062 c.urlParams_.Set("project", projectid) 4063 c.bucket = bucket 4064 return c 4065} 4066 4067// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 4068// predefined set of access controls to this bucket. 4069// 4070// Possible values: 4071// "authenticatedRead" - Project team owners get OWNER access, and 4072// allAuthenticatedUsers get READER access. 4073// "private" - Project team owners get OWNER access. 4074// "projectPrivate" - Project team members get access according to 4075// their roles. 4076// "publicRead" - Project team owners get OWNER access, and allUsers 4077// get READER access. 4078// "publicReadWrite" - Project team owners get OWNER access, and 4079// allUsers get WRITER access. 4080func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall { 4081 c.urlParams_.Set("predefinedAcl", predefinedAcl) 4082 return c 4083} 4084 4085// PredefinedDefaultObjectAcl sets the optional parameter 4086// "predefinedDefaultObjectAcl": Apply a predefined set of default 4087// object access controls to this bucket. 4088// 4089// Possible values: 4090// "authenticatedRead" - Object owner gets OWNER access, and 4091// allAuthenticatedUsers get READER access. 4092// "bucketOwnerFullControl" - Object owner gets OWNER access, and 4093// project team owners get OWNER access. 4094// "bucketOwnerRead" - Object owner gets OWNER access, and project 4095// team owners get READER access. 4096// "private" - Object owner gets OWNER access. 4097// "projectPrivate" - Object owner gets OWNER access, and project team 4098// members get access according to their roles. 4099// "publicRead" - Object owner gets OWNER access, and allUsers get 4100// READER access. 4101func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall { 4102 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) 4103 return c 4104} 4105 4106// Projection sets the optional parameter "projection": Set of 4107// properties to return. Defaults to noAcl, unless the bucket resource 4108// specifies acl or defaultObjectAcl properties, when it defaults to 4109// full. 4110// 4111// Possible values: 4112// "full" - Include all properties. 4113// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 4114func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { 4115 c.urlParams_.Set("projection", projection) 4116 return c 4117} 4118 4119// ProvisionalUserProject sets the optional parameter 4120// "provisionalUserProject": The project to be billed for this request 4121// if the target bucket is requester-pays bucket. 4122func (c *BucketsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketsInsertCall { 4123 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4124 return c 4125} 4126 4127// UserProject sets the optional parameter "userProject": The project to 4128// be billed for this request. 4129func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall { 4130 c.urlParams_.Set("userProject", userProject) 4131 return c 4132} 4133 4134// Fields allows partial responses to be retrieved. See 4135// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4136// for more information. 4137func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall { 4138 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4139 return c 4140} 4141 4142// Context sets the context to be used in this call's Do method. Any 4143// pending HTTP request will be aborted if the provided context is 4144// canceled. 4145func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall { 4146 c.ctx_ = ctx 4147 return c 4148} 4149 4150// Header returns an http.Header that can be modified by the caller to 4151// add HTTP headers to the request. 4152func (c *BucketsInsertCall) Header() http.Header { 4153 if c.header_ == nil { 4154 c.header_ = make(http.Header) 4155 } 4156 return c.header_ 4157} 4158 4159func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { 4160 reqHeaders := make(http.Header) 4161 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4162 for k, v := range c.header_ { 4163 reqHeaders[k] = v 4164 } 4165 reqHeaders.Set("User-Agent", c.s.userAgent()) 4166 var body io.Reader = nil 4167 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) 4168 if err != nil { 4169 return nil, err 4170 } 4171 reqHeaders.Set("Content-Type", "application/json") 4172 c.urlParams_.Set("alt", alt) 4173 c.urlParams_.Set("prettyPrint", "false") 4174 urls := googleapi.ResolveRelative(c.s.BasePath, "b") 4175 urls += "?" + c.urlParams_.Encode() 4176 req, err := http.NewRequest("POST", urls, body) 4177 if err != nil { 4178 return nil, err 4179 } 4180 req.Header = reqHeaders 4181 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4182} 4183 4184// Do executes the "storage.buckets.insert" call. 4185// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 4186// code is an error. Response headers are in either 4187// *Bucket.ServerResponse.Header or (if a response was returned at all) 4188// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4189// check whether the returned error was because http.StatusNotModified 4190// was returned. 4191func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 4192 gensupport.SetOptions(c.urlParams_, opts...) 4193 res, err := c.doRequest("json") 4194 if res != nil && res.StatusCode == http.StatusNotModified { 4195 if res.Body != nil { 4196 res.Body.Close() 4197 } 4198 return nil, &googleapi.Error{ 4199 Code: res.StatusCode, 4200 Header: res.Header, 4201 } 4202 } 4203 if err != nil { 4204 return nil, err 4205 } 4206 defer googleapi.CloseBody(res) 4207 if err := googleapi.CheckResponse(res); err != nil { 4208 return nil, err 4209 } 4210 ret := &Bucket{ 4211 ServerResponse: googleapi.ServerResponse{ 4212 Header: res.Header, 4213 HTTPStatusCode: res.StatusCode, 4214 }, 4215 } 4216 target := &ret 4217 if err := gensupport.DecodeResponse(target, res); err != nil { 4218 return nil, err 4219 } 4220 return ret, nil 4221 // { 4222 // "description": "Creates a new bucket.", 4223 // "httpMethod": "POST", 4224 // "id": "storage.buckets.insert", 4225 // "parameterOrder": [ 4226 // "project" 4227 // ], 4228 // "parameters": { 4229 // "predefinedAcl": { 4230 // "description": "Apply a predefined set of access controls to this bucket.", 4231 // "enum": [ 4232 // "authenticatedRead", 4233 // "private", 4234 // "projectPrivate", 4235 // "publicRead", 4236 // "publicReadWrite" 4237 // ], 4238 // "enumDescriptions": [ 4239 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", 4240 // "Project team owners get OWNER access.", 4241 // "Project team members get access according to their roles.", 4242 // "Project team owners get OWNER access, and allUsers get READER access.", 4243 // "Project team owners get OWNER access, and allUsers get WRITER access." 4244 // ], 4245 // "location": "query", 4246 // "type": "string" 4247 // }, 4248 // "predefinedDefaultObjectAcl": { 4249 // "description": "Apply a predefined set of default object access controls to this bucket.", 4250 // "enum": [ 4251 // "authenticatedRead", 4252 // "bucketOwnerFullControl", 4253 // "bucketOwnerRead", 4254 // "private", 4255 // "projectPrivate", 4256 // "publicRead" 4257 // ], 4258 // "enumDescriptions": [ 4259 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 4260 // "Object owner gets OWNER access, and project team owners get OWNER access.", 4261 // "Object owner gets OWNER access, and project team owners get READER access.", 4262 // "Object owner gets OWNER access.", 4263 // "Object owner gets OWNER access, and project team members get access according to their roles.", 4264 // "Object owner gets OWNER access, and allUsers get READER access." 4265 // ], 4266 // "location": "query", 4267 // "type": "string" 4268 // }, 4269 // "project": { 4270 // "description": "A valid API project identifier.", 4271 // "location": "query", 4272 // "required": true, 4273 // "type": "string" 4274 // }, 4275 // "projection": { 4276 // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", 4277 // "enum": [ 4278 // "full", 4279 // "noAcl" 4280 // ], 4281 // "enumDescriptions": [ 4282 // "Include all properties.", 4283 // "Omit owner, acl and defaultObjectAcl properties." 4284 // ], 4285 // "location": "query", 4286 // "type": "string" 4287 // }, 4288 // "provisionalUserProject": { 4289 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4290 // "location": "query", 4291 // "type": "string" 4292 // }, 4293 // "userProject": { 4294 // "description": "The project to be billed for this request.", 4295 // "location": "query", 4296 // "type": "string" 4297 // } 4298 // }, 4299 // "path": "b", 4300 // "request": { 4301 // "$ref": "Bucket" 4302 // }, 4303 // "response": { 4304 // "$ref": "Bucket" 4305 // }, 4306 // "scopes": [ 4307 // "https://www.googleapis.com/auth/cloud-platform", 4308 // "https://www.googleapis.com/auth/devstorage.full_control", 4309 // "https://www.googleapis.com/auth/devstorage.read_write" 4310 // ] 4311 // } 4312 4313} 4314 4315// method id "storage.buckets.list": 4316 4317type BucketsListCall struct { 4318 s *Service 4319 urlParams_ gensupport.URLParams 4320 ifNoneMatch_ string 4321 ctx_ context.Context 4322 header_ http.Header 4323} 4324 4325// List: Retrieves a list of buckets for a given project. 4326// 4327// - project: A valid API project identifier. 4328func (r *BucketsService) List(projectid string) *BucketsListCall { 4329 c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4330 c.urlParams_.Set("project", projectid) 4331 return c 4332} 4333 4334// MaxResults sets the optional parameter "maxResults": Maximum number 4335// of buckets to return in a single response. The service will use this 4336// parameter or 1,000 items, whichever is smaller. 4337func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall { 4338 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4339 return c 4340} 4341 4342// PageToken sets the optional parameter "pageToken": A 4343// previously-returned page token representing part of the larger set of 4344// results to view. 4345func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall { 4346 c.urlParams_.Set("pageToken", pageToken) 4347 return c 4348} 4349 4350// Prefix sets the optional parameter "prefix": Filter results to 4351// buckets whose names begin with this prefix. 4352func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall { 4353 c.urlParams_.Set("prefix", prefix) 4354 return c 4355} 4356 4357// Projection sets the optional parameter "projection": Set of 4358// properties to return. Defaults to noAcl. 4359// 4360// Possible values: 4361// "full" - Include all properties. 4362// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 4363func (c *BucketsListCall) Projection(projection string) *BucketsListCall { 4364 c.urlParams_.Set("projection", projection) 4365 return c 4366} 4367 4368// ProvisionalUserProject sets the optional parameter 4369// "provisionalUserProject": The project to be billed for this request 4370// if the target bucket is requester-pays bucket. 4371func (c *BucketsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketsListCall { 4372 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4373 return c 4374} 4375 4376// UserProject sets the optional parameter "userProject": The project to 4377// be billed for this request. 4378func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall { 4379 c.urlParams_.Set("userProject", userProject) 4380 return c 4381} 4382 4383// Fields allows partial responses to be retrieved. See 4384// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4385// for more information. 4386func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall { 4387 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4388 return c 4389} 4390 4391// IfNoneMatch sets the optional parameter which makes the operation 4392// fail if the object's ETag matches the given value. This is useful for 4393// getting updates only after the object has changed since the last 4394// request. Use googleapi.IsNotModified to check whether the response 4395// error from Do is the result of In-None-Match. 4396func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall { 4397 c.ifNoneMatch_ = entityTag 4398 return c 4399} 4400 4401// Context sets the context to be used in this call's Do method. Any 4402// pending HTTP request will be aborted if the provided context is 4403// canceled. 4404func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall { 4405 c.ctx_ = ctx 4406 return c 4407} 4408 4409// Header returns an http.Header that can be modified by the caller to 4410// add HTTP headers to the request. 4411func (c *BucketsListCall) Header() http.Header { 4412 if c.header_ == nil { 4413 c.header_ = make(http.Header) 4414 } 4415 return c.header_ 4416} 4417 4418func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { 4419 reqHeaders := make(http.Header) 4420 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4421 for k, v := range c.header_ { 4422 reqHeaders[k] = v 4423 } 4424 reqHeaders.Set("User-Agent", c.s.userAgent()) 4425 if c.ifNoneMatch_ != "" { 4426 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4427 } 4428 var body io.Reader = nil 4429 c.urlParams_.Set("alt", alt) 4430 c.urlParams_.Set("prettyPrint", "false") 4431 urls := googleapi.ResolveRelative(c.s.BasePath, "b") 4432 urls += "?" + c.urlParams_.Encode() 4433 req, err := http.NewRequest("GET", urls, body) 4434 if err != nil { 4435 return nil, err 4436 } 4437 req.Header = reqHeaders 4438 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4439} 4440 4441// Do executes the "storage.buckets.list" call. 4442// Exactly one of *Buckets or error will be non-nil. Any non-2xx status 4443// code is an error. Response headers are in either 4444// *Buckets.ServerResponse.Header or (if a response was returned at all) 4445// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4446// check whether the returned error was because http.StatusNotModified 4447// was returned. 4448func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) { 4449 gensupport.SetOptions(c.urlParams_, opts...) 4450 res, err := c.doRequest("json") 4451 if res != nil && res.StatusCode == http.StatusNotModified { 4452 if res.Body != nil { 4453 res.Body.Close() 4454 } 4455 return nil, &googleapi.Error{ 4456 Code: res.StatusCode, 4457 Header: res.Header, 4458 } 4459 } 4460 if err != nil { 4461 return nil, err 4462 } 4463 defer googleapi.CloseBody(res) 4464 if err := googleapi.CheckResponse(res); err != nil { 4465 return nil, err 4466 } 4467 ret := &Buckets{ 4468 ServerResponse: googleapi.ServerResponse{ 4469 Header: res.Header, 4470 HTTPStatusCode: res.StatusCode, 4471 }, 4472 } 4473 target := &ret 4474 if err := gensupport.DecodeResponse(target, res); err != nil { 4475 return nil, err 4476 } 4477 return ret, nil 4478 // { 4479 // "description": "Retrieves a list of buckets for a given project.", 4480 // "httpMethod": "GET", 4481 // "id": "storage.buckets.list", 4482 // "parameterOrder": [ 4483 // "project" 4484 // ], 4485 // "parameters": { 4486 // "maxResults": { 4487 // "default": "1000", 4488 // "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", 4489 // "format": "uint32", 4490 // "location": "query", 4491 // "minimum": "0", 4492 // "type": "integer" 4493 // }, 4494 // "pageToken": { 4495 // "description": "A previously-returned page token representing part of the larger set of results to view.", 4496 // "location": "query", 4497 // "type": "string" 4498 // }, 4499 // "prefix": { 4500 // "description": "Filter results to buckets whose names begin with this prefix.", 4501 // "location": "query", 4502 // "type": "string" 4503 // }, 4504 // "project": { 4505 // "description": "A valid API project identifier.", 4506 // "location": "query", 4507 // "required": true, 4508 // "type": "string" 4509 // }, 4510 // "projection": { 4511 // "description": "Set of properties to return. Defaults to noAcl.", 4512 // "enum": [ 4513 // "full", 4514 // "noAcl" 4515 // ], 4516 // "enumDescriptions": [ 4517 // "Include all properties.", 4518 // "Omit owner, acl and defaultObjectAcl properties." 4519 // ], 4520 // "location": "query", 4521 // "type": "string" 4522 // }, 4523 // "provisionalUserProject": { 4524 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4525 // "location": "query", 4526 // "type": "string" 4527 // }, 4528 // "userProject": { 4529 // "description": "The project to be billed for this request.", 4530 // "location": "query", 4531 // "type": "string" 4532 // } 4533 // }, 4534 // "path": "b", 4535 // "response": { 4536 // "$ref": "Buckets" 4537 // }, 4538 // "scopes": [ 4539 // "https://www.googleapis.com/auth/cloud-platform", 4540 // "https://www.googleapis.com/auth/cloud-platform.read-only", 4541 // "https://www.googleapis.com/auth/devstorage.full_control", 4542 // "https://www.googleapis.com/auth/devstorage.read_only", 4543 // "https://www.googleapis.com/auth/devstorage.read_write" 4544 // ] 4545 // } 4546 4547} 4548 4549// Pages invokes f for each page of results. 4550// A non-nil error returned from f will halt the iteration. 4551// The provided context supersedes any context provided to the Context method. 4552func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error { 4553 c.ctx_ = ctx 4554 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4555 for { 4556 x, err := c.Do() 4557 if err != nil { 4558 return err 4559 } 4560 if err := f(x); err != nil { 4561 return err 4562 } 4563 if x.NextPageToken == "" { 4564 return nil 4565 } 4566 c.PageToken(x.NextPageToken) 4567 } 4568} 4569 4570// method id "storage.buckets.lockRetentionPolicy": 4571 4572type BucketsLockRetentionPolicyCall struct { 4573 s *Service 4574 bucket string 4575 urlParams_ gensupport.URLParams 4576 ctx_ context.Context 4577 header_ http.Header 4578} 4579 4580// LockRetentionPolicy: Locks retention policy on a bucket. 4581// 4582// - bucket: Name of a bucket. 4583// - ifMetagenerationMatch: Makes the operation conditional on whether 4584// bucket's current metageneration matches the given value. 4585func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall { 4586 c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4587 c.bucket = bucket 4588 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 4589 return c 4590} 4591 4592// ProvisionalUserProject sets the optional parameter 4593// "provisionalUserProject": The project to be billed for this request 4594// if the target bucket is requester-pays bucket. 4595func (c *BucketsLockRetentionPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsLockRetentionPolicyCall { 4596 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4597 return c 4598} 4599 4600// UserProject sets the optional parameter "userProject": The project to 4601// be billed for this request. Required for Requester Pays buckets. 4602func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall { 4603 c.urlParams_.Set("userProject", userProject) 4604 return c 4605} 4606 4607// Fields allows partial responses to be retrieved. See 4608// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4609// for more information. 4610func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall { 4611 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4612 return c 4613} 4614 4615// Context sets the context to be used in this call's Do method. Any 4616// pending HTTP request will be aborted if the provided context is 4617// canceled. 4618func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall { 4619 c.ctx_ = ctx 4620 return c 4621} 4622 4623// Header returns an http.Header that can be modified by the caller to 4624// add HTTP headers to the request. 4625func (c *BucketsLockRetentionPolicyCall) Header() http.Header { 4626 if c.header_ == nil { 4627 c.header_ = make(http.Header) 4628 } 4629 return c.header_ 4630} 4631 4632func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) { 4633 reqHeaders := make(http.Header) 4634 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4635 for k, v := range c.header_ { 4636 reqHeaders[k] = v 4637 } 4638 reqHeaders.Set("User-Agent", c.s.userAgent()) 4639 var body io.Reader = nil 4640 c.urlParams_.Set("alt", alt) 4641 c.urlParams_.Set("prettyPrint", "false") 4642 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy") 4643 urls += "?" + c.urlParams_.Encode() 4644 req, err := http.NewRequest("POST", urls, body) 4645 if err != nil { 4646 return nil, err 4647 } 4648 req.Header = reqHeaders 4649 googleapi.Expand(req.URL, map[string]string{ 4650 "bucket": c.bucket, 4651 }) 4652 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4653} 4654 4655// Do executes the "storage.buckets.lockRetentionPolicy" call. 4656// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 4657// code is an error. Response headers are in either 4658// *Bucket.ServerResponse.Header or (if a response was returned at all) 4659// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4660// check whether the returned error was because http.StatusNotModified 4661// was returned. 4662func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 4663 gensupport.SetOptions(c.urlParams_, opts...) 4664 res, err := c.doRequest("json") 4665 if res != nil && res.StatusCode == http.StatusNotModified { 4666 if res.Body != nil { 4667 res.Body.Close() 4668 } 4669 return nil, &googleapi.Error{ 4670 Code: res.StatusCode, 4671 Header: res.Header, 4672 } 4673 } 4674 if err != nil { 4675 return nil, err 4676 } 4677 defer googleapi.CloseBody(res) 4678 if err := googleapi.CheckResponse(res); err != nil { 4679 return nil, err 4680 } 4681 ret := &Bucket{ 4682 ServerResponse: googleapi.ServerResponse{ 4683 Header: res.Header, 4684 HTTPStatusCode: res.StatusCode, 4685 }, 4686 } 4687 target := &ret 4688 if err := gensupport.DecodeResponse(target, res); err != nil { 4689 return nil, err 4690 } 4691 return ret, nil 4692 // { 4693 // "description": "Locks retention policy on a bucket.", 4694 // "httpMethod": "POST", 4695 // "id": "storage.buckets.lockRetentionPolicy", 4696 // "parameterOrder": [ 4697 // "bucket", 4698 // "ifMetagenerationMatch" 4699 // ], 4700 // "parameters": { 4701 // "bucket": { 4702 // "description": "Name of a bucket.", 4703 // "location": "path", 4704 // "required": true, 4705 // "type": "string" 4706 // }, 4707 // "ifMetagenerationMatch": { 4708 // "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", 4709 // "format": "int64", 4710 // "location": "query", 4711 // "required": true, 4712 // "type": "string" 4713 // }, 4714 // "provisionalUserProject": { 4715 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 4716 // "location": "query", 4717 // "type": "string" 4718 // }, 4719 // "userProject": { 4720 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 4721 // "location": "query", 4722 // "type": "string" 4723 // } 4724 // }, 4725 // "path": "b/{bucket}/lockRetentionPolicy", 4726 // "response": { 4727 // "$ref": "Bucket" 4728 // }, 4729 // "scopes": [ 4730 // "https://www.googleapis.com/auth/cloud-platform", 4731 // "https://www.googleapis.com/auth/devstorage.full_control", 4732 // "https://www.googleapis.com/auth/devstorage.read_write" 4733 // ] 4734 // } 4735 4736} 4737 4738// method id "storage.buckets.patch": 4739 4740type BucketsPatchCall struct { 4741 s *Service 4742 bucket string 4743 bucket2 *Bucket 4744 urlParams_ gensupport.URLParams 4745 ctx_ context.Context 4746 header_ http.Header 4747} 4748 4749// Patch: Patches a bucket. Changes to the bucket will be readable 4750// immediately after writing, but configuration changes may take time to 4751// propagate. 4752// 4753// - bucket: Name of a bucket. 4754func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall { 4755 c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4756 c.bucket = bucket 4757 c.bucket2 = bucket2 4758 return c 4759} 4760 4761// IfMetagenerationMatch sets the optional parameter 4762// "ifMetagenerationMatch": Makes the return of the bucket metadata 4763// conditional on whether the bucket's current metageneration matches 4764// the given value. 4765func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall { 4766 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 4767 return c 4768} 4769 4770// IfMetagenerationNotMatch sets the optional parameter 4771// "ifMetagenerationNotMatch": Makes the return of the bucket metadata 4772// conditional on whether the bucket's current metageneration does not 4773// match the given value. 4774func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall { 4775 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 4776 return c 4777} 4778 4779// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 4780// predefined set of access controls to this bucket. 4781// 4782// Possible values: 4783// "authenticatedRead" - Project team owners get OWNER access, and 4784// allAuthenticatedUsers get READER access. 4785// "private" - Project team owners get OWNER access. 4786// "projectPrivate" - Project team members get access according to 4787// their roles. 4788// "publicRead" - Project team owners get OWNER access, and allUsers 4789// get READER access. 4790// "publicReadWrite" - Project team owners get OWNER access, and 4791// allUsers get WRITER access. 4792func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall { 4793 c.urlParams_.Set("predefinedAcl", predefinedAcl) 4794 return c 4795} 4796 4797// PredefinedDefaultObjectAcl sets the optional parameter 4798// "predefinedDefaultObjectAcl": Apply a predefined set of default 4799// object access controls to this bucket. 4800// 4801// Possible values: 4802// "authenticatedRead" - Object owner gets OWNER access, and 4803// allAuthenticatedUsers get READER access. 4804// "bucketOwnerFullControl" - Object owner gets OWNER access, and 4805// project team owners get OWNER access. 4806// "bucketOwnerRead" - Object owner gets OWNER access, and project 4807// team owners get READER access. 4808// "private" - Object owner gets OWNER access. 4809// "projectPrivate" - Object owner gets OWNER access, and project team 4810// members get access according to their roles. 4811// "publicRead" - Object owner gets OWNER access, and allUsers get 4812// READER access. 4813func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall { 4814 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) 4815 return c 4816} 4817 4818// Projection sets the optional parameter "projection": Set of 4819// properties to return. Defaults to full. 4820// 4821// Possible values: 4822// "full" - Include all properties. 4823// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 4824func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { 4825 c.urlParams_.Set("projection", projection) 4826 return c 4827} 4828 4829// ProvisionalUserProject sets the optional parameter 4830// "provisionalUserProject": The project to be billed for this request 4831// if the target bucket is requester-pays bucket. 4832func (c *BucketsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketsPatchCall { 4833 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 4834 return c 4835} 4836 4837// UserProject sets the optional parameter "userProject": The project to 4838// be billed for this request. Required for Requester Pays buckets. 4839func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall { 4840 c.urlParams_.Set("userProject", userProject) 4841 return c 4842} 4843 4844// Fields allows partial responses to be retrieved. See 4845// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4846// for more information. 4847func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall { 4848 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4849 return c 4850} 4851 4852// Context sets the context to be used in this call's Do method. Any 4853// pending HTTP request will be aborted if the provided context is 4854// canceled. 4855func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall { 4856 c.ctx_ = ctx 4857 return c 4858} 4859 4860// Header returns an http.Header that can be modified by the caller to 4861// add HTTP headers to the request. 4862func (c *BucketsPatchCall) Header() http.Header { 4863 if c.header_ == nil { 4864 c.header_ = make(http.Header) 4865 } 4866 return c.header_ 4867} 4868 4869func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { 4870 reqHeaders := make(http.Header) 4871 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4872 for k, v := range c.header_ { 4873 reqHeaders[k] = v 4874 } 4875 reqHeaders.Set("User-Agent", c.s.userAgent()) 4876 var body io.Reader = nil 4877 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) 4878 if err != nil { 4879 return nil, err 4880 } 4881 reqHeaders.Set("Content-Type", "application/json") 4882 c.urlParams_.Set("alt", alt) 4883 c.urlParams_.Set("prettyPrint", "false") 4884 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 4885 urls += "?" + c.urlParams_.Encode() 4886 req, err := http.NewRequest("PATCH", urls, body) 4887 if err != nil { 4888 return nil, err 4889 } 4890 req.Header = reqHeaders 4891 googleapi.Expand(req.URL, map[string]string{ 4892 "bucket": c.bucket, 4893 }) 4894 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4895} 4896 4897// Do executes the "storage.buckets.patch" call. 4898// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 4899// code is an error. Response headers are in either 4900// *Bucket.ServerResponse.Header or (if a response was returned at all) 4901// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4902// check whether the returned error was because http.StatusNotModified 4903// was returned. 4904func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 4905 gensupport.SetOptions(c.urlParams_, opts...) 4906 res, err := c.doRequest("json") 4907 if res != nil && res.StatusCode == http.StatusNotModified { 4908 if res.Body != nil { 4909 res.Body.Close() 4910 } 4911 return nil, &googleapi.Error{ 4912 Code: res.StatusCode, 4913 Header: res.Header, 4914 } 4915 } 4916 if err != nil { 4917 return nil, err 4918 } 4919 defer googleapi.CloseBody(res) 4920 if err := googleapi.CheckResponse(res); err != nil { 4921 return nil, err 4922 } 4923 ret := &Bucket{ 4924 ServerResponse: googleapi.ServerResponse{ 4925 Header: res.Header, 4926 HTTPStatusCode: res.StatusCode, 4927 }, 4928 } 4929 target := &ret 4930 if err := gensupport.DecodeResponse(target, res); err != nil { 4931 return nil, err 4932 } 4933 return ret, nil 4934 // { 4935 // "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", 4936 // "httpMethod": "PATCH", 4937 // "id": "storage.buckets.patch", 4938 // "parameterOrder": [ 4939 // "bucket" 4940 // ], 4941 // "parameters": { 4942 // "bucket": { 4943 // "description": "Name of a bucket.", 4944 // "location": "path", 4945 // "required": true, 4946 // "type": "string" 4947 // }, 4948 // "ifMetagenerationMatch": { 4949 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", 4950 // "format": "int64", 4951 // "location": "query", 4952 // "type": "string" 4953 // }, 4954 // "ifMetagenerationNotMatch": { 4955 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", 4956 // "format": "int64", 4957 // "location": "query", 4958 // "type": "string" 4959 // }, 4960 // "predefinedAcl": { 4961 // "description": "Apply a predefined set of access controls to this bucket.", 4962 // "enum": [ 4963 // "authenticatedRead", 4964 // "private", 4965 // "projectPrivate", 4966 // "publicRead", 4967 // "publicReadWrite" 4968 // ], 4969 // "enumDescriptions": [ 4970 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", 4971 // "Project team owners get OWNER access.", 4972 // "Project team members get access according to their roles.", 4973 // "Project team owners get OWNER access, and allUsers get READER access.", 4974 // "Project team owners get OWNER access, and allUsers get WRITER access." 4975 // ], 4976 // "location": "query", 4977 // "type": "string" 4978 // }, 4979 // "predefinedDefaultObjectAcl": { 4980 // "description": "Apply a predefined set of default object access controls to this bucket.", 4981 // "enum": [ 4982 // "authenticatedRead", 4983 // "bucketOwnerFullControl", 4984 // "bucketOwnerRead", 4985 // "private", 4986 // "projectPrivate", 4987 // "publicRead" 4988 // ], 4989 // "enumDescriptions": [ 4990 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 4991 // "Object owner gets OWNER access, and project team owners get OWNER access.", 4992 // "Object owner gets OWNER access, and project team owners get READER access.", 4993 // "Object owner gets OWNER access.", 4994 // "Object owner gets OWNER access, and project team members get access according to their roles.", 4995 // "Object owner gets OWNER access, and allUsers get READER access." 4996 // ], 4997 // "location": "query", 4998 // "type": "string" 4999 // }, 5000 // "projection": { 5001 // "description": "Set of properties to return. Defaults to full.", 5002 // "enum": [ 5003 // "full", 5004 // "noAcl" 5005 // ], 5006 // "enumDescriptions": [ 5007 // "Include all properties.", 5008 // "Omit owner, acl and defaultObjectAcl properties." 5009 // ], 5010 // "location": "query", 5011 // "type": "string" 5012 // }, 5013 // "provisionalUserProject": { 5014 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5015 // "location": "query", 5016 // "type": "string" 5017 // }, 5018 // "userProject": { 5019 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5020 // "location": "query", 5021 // "type": "string" 5022 // } 5023 // }, 5024 // "path": "b/{bucket}", 5025 // "request": { 5026 // "$ref": "Bucket" 5027 // }, 5028 // "response": { 5029 // "$ref": "Bucket" 5030 // }, 5031 // "scopes": [ 5032 // "https://www.googleapis.com/auth/cloud-platform", 5033 // "https://www.googleapis.com/auth/devstorage.full_control" 5034 // ] 5035 // } 5036 5037} 5038 5039// method id "storage.buckets.setIamPolicy": 5040 5041type BucketsSetIamPolicyCall struct { 5042 s *Service 5043 bucket string 5044 policy *Policy 5045 urlParams_ gensupport.URLParams 5046 ctx_ context.Context 5047 header_ http.Header 5048} 5049 5050// SetIamPolicy: Updates an IAM policy for the specified bucket. 5051// 5052// - bucket: Name of a bucket. 5053func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall { 5054 c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5055 c.bucket = bucket 5056 c.policy = policy 5057 return c 5058} 5059 5060// ProvisionalUserProject sets the optional parameter 5061// "provisionalUserProject": The project to be billed for this request 5062// if the target bucket is requester-pays bucket. 5063func (c *BucketsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsSetIamPolicyCall { 5064 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5065 return c 5066} 5067 5068// UserProject sets the optional parameter "userProject": The project to 5069// be billed for this request. Required for Requester Pays buckets. 5070func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall { 5071 c.urlParams_.Set("userProject", userProject) 5072 return c 5073} 5074 5075// Fields allows partial responses to be retrieved. See 5076// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5077// for more information. 5078func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall { 5079 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5080 return c 5081} 5082 5083// Context sets the context to be used in this call's Do method. Any 5084// pending HTTP request will be aborted if the provided context is 5085// canceled. 5086func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall { 5087 c.ctx_ = ctx 5088 return c 5089} 5090 5091// Header returns an http.Header that can be modified by the caller to 5092// add HTTP headers to the request. 5093func (c *BucketsSetIamPolicyCall) Header() http.Header { 5094 if c.header_ == nil { 5095 c.header_ = make(http.Header) 5096 } 5097 return c.header_ 5098} 5099 5100func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5101 reqHeaders := make(http.Header) 5102 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5103 for k, v := range c.header_ { 5104 reqHeaders[k] = v 5105 } 5106 reqHeaders.Set("User-Agent", c.s.userAgent()) 5107 var body io.Reader = nil 5108 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) 5109 if err != nil { 5110 return nil, err 5111 } 5112 reqHeaders.Set("Content-Type", "application/json") 5113 c.urlParams_.Set("alt", alt) 5114 c.urlParams_.Set("prettyPrint", "false") 5115 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam") 5116 urls += "?" + c.urlParams_.Encode() 5117 req, err := http.NewRequest("PUT", urls, body) 5118 if err != nil { 5119 return nil, err 5120 } 5121 req.Header = reqHeaders 5122 googleapi.Expand(req.URL, map[string]string{ 5123 "bucket": c.bucket, 5124 }) 5125 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5126} 5127 5128// Do executes the "storage.buckets.setIamPolicy" call. 5129// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5130// code is an error. Response headers are in either 5131// *Policy.ServerResponse.Header or (if a response was returned at all) 5132// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5133// check whether the returned error was because http.StatusNotModified 5134// was returned. 5135func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5136 gensupport.SetOptions(c.urlParams_, opts...) 5137 res, err := c.doRequest("json") 5138 if res != nil && res.StatusCode == http.StatusNotModified { 5139 if res.Body != nil { 5140 res.Body.Close() 5141 } 5142 return nil, &googleapi.Error{ 5143 Code: res.StatusCode, 5144 Header: res.Header, 5145 } 5146 } 5147 if err != nil { 5148 return nil, err 5149 } 5150 defer googleapi.CloseBody(res) 5151 if err := googleapi.CheckResponse(res); err != nil { 5152 return nil, err 5153 } 5154 ret := &Policy{ 5155 ServerResponse: googleapi.ServerResponse{ 5156 Header: res.Header, 5157 HTTPStatusCode: res.StatusCode, 5158 }, 5159 } 5160 target := &ret 5161 if err := gensupport.DecodeResponse(target, res); err != nil { 5162 return nil, err 5163 } 5164 return ret, nil 5165 // { 5166 // "description": "Updates an IAM policy for the specified bucket.", 5167 // "httpMethod": "PUT", 5168 // "id": "storage.buckets.setIamPolicy", 5169 // "parameterOrder": [ 5170 // "bucket" 5171 // ], 5172 // "parameters": { 5173 // "bucket": { 5174 // "description": "Name of a bucket.", 5175 // "location": "path", 5176 // "required": true, 5177 // "type": "string" 5178 // }, 5179 // "provisionalUserProject": { 5180 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5181 // "location": "query", 5182 // "type": "string" 5183 // }, 5184 // "userProject": { 5185 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5186 // "location": "query", 5187 // "type": "string" 5188 // } 5189 // }, 5190 // "path": "b/{bucket}/iam", 5191 // "request": { 5192 // "$ref": "Policy" 5193 // }, 5194 // "response": { 5195 // "$ref": "Policy" 5196 // }, 5197 // "scopes": [ 5198 // "https://www.googleapis.com/auth/cloud-platform", 5199 // "https://www.googleapis.com/auth/devstorage.full_control" 5200 // ] 5201 // } 5202 5203} 5204 5205// method id "storage.buckets.testIamPermissions": 5206 5207type BucketsTestIamPermissionsCall struct { 5208 s *Service 5209 bucket string 5210 urlParams_ gensupport.URLParams 5211 ifNoneMatch_ string 5212 ctx_ context.Context 5213 header_ http.Header 5214} 5215 5216// TestIamPermissions: Tests a set of permissions on the given bucket to 5217// see which, if any, are held by the caller. 5218// 5219// - bucket: Name of a bucket. 5220// - permissions: Permissions to test. 5221func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall { 5222 c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5223 c.bucket = bucket 5224 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...)) 5225 return c 5226} 5227 5228// ProvisionalUserProject sets the optional parameter 5229// "provisionalUserProject": The project to be billed for this request 5230// if the target bucket is requester-pays bucket. 5231func (c *BucketsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *BucketsTestIamPermissionsCall { 5232 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5233 return c 5234} 5235 5236// UserProject sets the optional parameter "userProject": The project to 5237// be billed for this request. Required for Requester Pays buckets. 5238func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall { 5239 c.urlParams_.Set("userProject", userProject) 5240 return c 5241} 5242 5243// Fields allows partial responses to be retrieved. See 5244// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5245// for more information. 5246func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall { 5247 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5248 return c 5249} 5250 5251// IfNoneMatch sets the optional parameter which makes the operation 5252// fail if the object's ETag matches the given value. This is useful for 5253// getting updates only after the object has changed since the last 5254// request. Use googleapi.IsNotModified to check whether the response 5255// error from Do is the result of In-None-Match. 5256func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall { 5257 c.ifNoneMatch_ = entityTag 5258 return c 5259} 5260 5261// Context sets the context to be used in this call's Do method. Any 5262// pending HTTP request will be aborted if the provided context is 5263// canceled. 5264func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall { 5265 c.ctx_ = ctx 5266 return c 5267} 5268 5269// Header returns an http.Header that can be modified by the caller to 5270// add HTTP headers to the request. 5271func (c *BucketsTestIamPermissionsCall) Header() http.Header { 5272 if c.header_ == nil { 5273 c.header_ = make(http.Header) 5274 } 5275 return c.header_ 5276} 5277 5278func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 5279 reqHeaders := make(http.Header) 5280 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5281 for k, v := range c.header_ { 5282 reqHeaders[k] = v 5283 } 5284 reqHeaders.Set("User-Agent", c.s.userAgent()) 5285 if c.ifNoneMatch_ != "" { 5286 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5287 } 5288 var body io.Reader = nil 5289 c.urlParams_.Set("alt", alt) 5290 c.urlParams_.Set("prettyPrint", "false") 5291 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions") 5292 urls += "?" + c.urlParams_.Encode() 5293 req, err := http.NewRequest("GET", urls, body) 5294 if err != nil { 5295 return nil, err 5296 } 5297 req.Header = reqHeaders 5298 googleapi.Expand(req.URL, map[string]string{ 5299 "bucket": c.bucket, 5300 }) 5301 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5302} 5303 5304// Do executes the "storage.buckets.testIamPermissions" call. 5305// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 5306// Any non-2xx status code is an error. Response headers are in either 5307// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 5308// was returned at all) in error.(*googleapi.Error).Header. Use 5309// googleapi.IsNotModified to check whether the returned error was 5310// because http.StatusNotModified was returned. 5311func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 5312 gensupport.SetOptions(c.urlParams_, opts...) 5313 res, err := c.doRequest("json") 5314 if res != nil && res.StatusCode == http.StatusNotModified { 5315 if res.Body != nil { 5316 res.Body.Close() 5317 } 5318 return nil, &googleapi.Error{ 5319 Code: res.StatusCode, 5320 Header: res.Header, 5321 } 5322 } 5323 if err != nil { 5324 return nil, err 5325 } 5326 defer googleapi.CloseBody(res) 5327 if err := googleapi.CheckResponse(res); err != nil { 5328 return nil, err 5329 } 5330 ret := &TestIamPermissionsResponse{ 5331 ServerResponse: googleapi.ServerResponse{ 5332 Header: res.Header, 5333 HTTPStatusCode: res.StatusCode, 5334 }, 5335 } 5336 target := &ret 5337 if err := gensupport.DecodeResponse(target, res); err != nil { 5338 return nil, err 5339 } 5340 return ret, nil 5341 // { 5342 // "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", 5343 // "httpMethod": "GET", 5344 // "id": "storage.buckets.testIamPermissions", 5345 // "parameterOrder": [ 5346 // "bucket", 5347 // "permissions" 5348 // ], 5349 // "parameters": { 5350 // "bucket": { 5351 // "description": "Name of a bucket.", 5352 // "location": "path", 5353 // "required": true, 5354 // "type": "string" 5355 // }, 5356 // "permissions": { 5357 // "description": "Permissions to test.", 5358 // "location": "query", 5359 // "repeated": true, 5360 // "required": true, 5361 // "type": "string" 5362 // }, 5363 // "provisionalUserProject": { 5364 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5365 // "location": "query", 5366 // "type": "string" 5367 // }, 5368 // "userProject": { 5369 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5370 // "location": "query", 5371 // "type": "string" 5372 // } 5373 // }, 5374 // "path": "b/{bucket}/iam/testPermissions", 5375 // "response": { 5376 // "$ref": "TestIamPermissionsResponse" 5377 // }, 5378 // "scopes": [ 5379 // "https://www.googleapis.com/auth/cloud-platform", 5380 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5381 // "https://www.googleapis.com/auth/devstorage.full_control", 5382 // "https://www.googleapis.com/auth/devstorage.read_only", 5383 // "https://www.googleapis.com/auth/devstorage.read_write" 5384 // ] 5385 // } 5386 5387} 5388 5389// method id "storage.buckets.update": 5390 5391type BucketsUpdateCall struct { 5392 s *Service 5393 bucket string 5394 bucket2 *Bucket 5395 urlParams_ gensupport.URLParams 5396 ctx_ context.Context 5397 header_ http.Header 5398} 5399 5400// Update: Updates a bucket. Changes to the bucket will be readable 5401// immediately after writing, but configuration changes may take time to 5402// propagate. 5403// 5404// - bucket: Name of a bucket. 5405func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall { 5406 c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5407 c.bucket = bucket 5408 c.bucket2 = bucket2 5409 return c 5410} 5411 5412// IfMetagenerationMatch sets the optional parameter 5413// "ifMetagenerationMatch": Makes the return of the bucket metadata 5414// conditional on whether the bucket's current metageneration matches 5415// the given value. 5416func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall { 5417 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 5418 return c 5419} 5420 5421// IfMetagenerationNotMatch sets the optional parameter 5422// "ifMetagenerationNotMatch": Makes the return of the bucket metadata 5423// conditional on whether the bucket's current metageneration does not 5424// match the given value. 5425func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall { 5426 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 5427 return c 5428} 5429 5430// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 5431// predefined set of access controls to this bucket. 5432// 5433// Possible values: 5434// "authenticatedRead" - Project team owners get OWNER access, and 5435// allAuthenticatedUsers get READER access. 5436// "private" - Project team owners get OWNER access. 5437// "projectPrivate" - Project team members get access according to 5438// their roles. 5439// "publicRead" - Project team owners get OWNER access, and allUsers 5440// get READER access. 5441// "publicReadWrite" - Project team owners get OWNER access, and 5442// allUsers get WRITER access. 5443func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall { 5444 c.urlParams_.Set("predefinedAcl", predefinedAcl) 5445 return c 5446} 5447 5448// PredefinedDefaultObjectAcl sets the optional parameter 5449// "predefinedDefaultObjectAcl": Apply a predefined set of default 5450// object access controls to this bucket. 5451// 5452// Possible values: 5453// "authenticatedRead" - Object owner gets OWNER access, and 5454// allAuthenticatedUsers get READER access. 5455// "bucketOwnerFullControl" - Object owner gets OWNER access, and 5456// project team owners get OWNER access. 5457// "bucketOwnerRead" - Object owner gets OWNER access, and project 5458// team owners get READER access. 5459// "private" - Object owner gets OWNER access. 5460// "projectPrivate" - Object owner gets OWNER access, and project team 5461// members get access according to their roles. 5462// "publicRead" - Object owner gets OWNER access, and allUsers get 5463// READER access. 5464func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall { 5465 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl) 5466 return c 5467} 5468 5469// Projection sets the optional parameter "projection": Set of 5470// properties to return. Defaults to full. 5471// 5472// Possible values: 5473// "full" - Include all properties. 5474// "noAcl" - Omit owner, acl and defaultObjectAcl properties. 5475func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { 5476 c.urlParams_.Set("projection", projection) 5477 return c 5478} 5479 5480// ProvisionalUserProject sets the optional parameter 5481// "provisionalUserProject": The project to be billed for this request 5482// if the target bucket is requester-pays bucket. 5483func (c *BucketsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketsUpdateCall { 5484 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5485 return c 5486} 5487 5488// UserProject sets the optional parameter "userProject": The project to 5489// be billed for this request. Required for Requester Pays buckets. 5490func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall { 5491 c.urlParams_.Set("userProject", userProject) 5492 return c 5493} 5494 5495// Fields allows partial responses to be retrieved. See 5496// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5497// for more information. 5498func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall { 5499 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5500 return c 5501} 5502 5503// Context sets the context to be used in this call's Do method. Any 5504// pending HTTP request will be aborted if the provided context is 5505// canceled. 5506func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall { 5507 c.ctx_ = ctx 5508 return c 5509} 5510 5511// Header returns an http.Header that can be modified by the caller to 5512// add HTTP headers to the request. 5513func (c *BucketsUpdateCall) Header() http.Header { 5514 if c.header_ == nil { 5515 c.header_ = make(http.Header) 5516 } 5517 return c.header_ 5518} 5519 5520func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { 5521 reqHeaders := make(http.Header) 5522 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5523 for k, v := range c.header_ { 5524 reqHeaders[k] = v 5525 } 5526 reqHeaders.Set("User-Agent", c.s.userAgent()) 5527 var body io.Reader = nil 5528 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) 5529 if err != nil { 5530 return nil, err 5531 } 5532 reqHeaders.Set("Content-Type", "application/json") 5533 c.urlParams_.Set("alt", alt) 5534 c.urlParams_.Set("prettyPrint", "false") 5535 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") 5536 urls += "?" + c.urlParams_.Encode() 5537 req, err := http.NewRequest("PUT", urls, body) 5538 if err != nil { 5539 return nil, err 5540 } 5541 req.Header = reqHeaders 5542 googleapi.Expand(req.URL, map[string]string{ 5543 "bucket": c.bucket, 5544 }) 5545 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5546} 5547 5548// Do executes the "storage.buckets.update" call. 5549// Exactly one of *Bucket or error will be non-nil. Any non-2xx status 5550// code is an error. Response headers are in either 5551// *Bucket.ServerResponse.Header or (if a response was returned at all) 5552// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5553// check whether the returned error was because http.StatusNotModified 5554// was returned. 5555func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { 5556 gensupport.SetOptions(c.urlParams_, opts...) 5557 res, err := c.doRequest("json") 5558 if res != nil && res.StatusCode == http.StatusNotModified { 5559 if res.Body != nil { 5560 res.Body.Close() 5561 } 5562 return nil, &googleapi.Error{ 5563 Code: res.StatusCode, 5564 Header: res.Header, 5565 } 5566 } 5567 if err != nil { 5568 return nil, err 5569 } 5570 defer googleapi.CloseBody(res) 5571 if err := googleapi.CheckResponse(res); err != nil { 5572 return nil, err 5573 } 5574 ret := &Bucket{ 5575 ServerResponse: googleapi.ServerResponse{ 5576 Header: res.Header, 5577 HTTPStatusCode: res.StatusCode, 5578 }, 5579 } 5580 target := &ret 5581 if err := gensupport.DecodeResponse(target, res); err != nil { 5582 return nil, err 5583 } 5584 return ret, nil 5585 // { 5586 // "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", 5587 // "httpMethod": "PUT", 5588 // "id": "storage.buckets.update", 5589 // "parameterOrder": [ 5590 // "bucket" 5591 // ], 5592 // "parameters": { 5593 // "bucket": { 5594 // "description": "Name of a bucket.", 5595 // "location": "path", 5596 // "required": true, 5597 // "type": "string" 5598 // }, 5599 // "ifMetagenerationMatch": { 5600 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", 5601 // "format": "int64", 5602 // "location": "query", 5603 // "type": "string" 5604 // }, 5605 // "ifMetagenerationNotMatch": { 5606 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", 5607 // "format": "int64", 5608 // "location": "query", 5609 // "type": "string" 5610 // }, 5611 // "predefinedAcl": { 5612 // "description": "Apply a predefined set of access controls to this bucket.", 5613 // "enum": [ 5614 // "authenticatedRead", 5615 // "private", 5616 // "projectPrivate", 5617 // "publicRead", 5618 // "publicReadWrite" 5619 // ], 5620 // "enumDescriptions": [ 5621 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", 5622 // "Project team owners get OWNER access.", 5623 // "Project team members get access according to their roles.", 5624 // "Project team owners get OWNER access, and allUsers get READER access.", 5625 // "Project team owners get OWNER access, and allUsers get WRITER access." 5626 // ], 5627 // "location": "query", 5628 // "type": "string" 5629 // }, 5630 // "predefinedDefaultObjectAcl": { 5631 // "description": "Apply a predefined set of default object access controls to this bucket.", 5632 // "enum": [ 5633 // "authenticatedRead", 5634 // "bucketOwnerFullControl", 5635 // "bucketOwnerRead", 5636 // "private", 5637 // "projectPrivate", 5638 // "publicRead" 5639 // ], 5640 // "enumDescriptions": [ 5641 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 5642 // "Object owner gets OWNER access, and project team owners get OWNER access.", 5643 // "Object owner gets OWNER access, and project team owners get READER access.", 5644 // "Object owner gets OWNER access.", 5645 // "Object owner gets OWNER access, and project team members get access according to their roles.", 5646 // "Object owner gets OWNER access, and allUsers get READER access." 5647 // ], 5648 // "location": "query", 5649 // "type": "string" 5650 // }, 5651 // "projection": { 5652 // "description": "Set of properties to return. Defaults to full.", 5653 // "enum": [ 5654 // "full", 5655 // "noAcl" 5656 // ], 5657 // "enumDescriptions": [ 5658 // "Include all properties.", 5659 // "Omit owner, acl and defaultObjectAcl properties." 5660 // ], 5661 // "location": "query", 5662 // "type": "string" 5663 // }, 5664 // "provisionalUserProject": { 5665 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5666 // "location": "query", 5667 // "type": "string" 5668 // }, 5669 // "userProject": { 5670 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5671 // "location": "query", 5672 // "type": "string" 5673 // } 5674 // }, 5675 // "path": "b/{bucket}", 5676 // "request": { 5677 // "$ref": "Bucket" 5678 // }, 5679 // "response": { 5680 // "$ref": "Bucket" 5681 // }, 5682 // "scopes": [ 5683 // "https://www.googleapis.com/auth/cloud-platform", 5684 // "https://www.googleapis.com/auth/devstorage.full_control" 5685 // ] 5686 // } 5687 5688} 5689 5690// method id "storage.channels.stop": 5691 5692type ChannelsStopCall struct { 5693 s *Service 5694 channel *Channel 5695 urlParams_ gensupport.URLParams 5696 ctx_ context.Context 5697 header_ http.Header 5698} 5699 5700// Stop: Stop watching resources through this channel 5701func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 5702 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5703 c.channel = channel 5704 return c 5705} 5706 5707// Fields allows partial responses to be retrieved. See 5708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5709// for more information. 5710func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 5711 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5712 return c 5713} 5714 5715// Context sets the context to be used in this call's Do method. Any 5716// pending HTTP request will be aborted if the provided context is 5717// canceled. 5718func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 5719 c.ctx_ = ctx 5720 return c 5721} 5722 5723// Header returns an http.Header that can be modified by the caller to 5724// add HTTP headers to the request. 5725func (c *ChannelsStopCall) Header() http.Header { 5726 if c.header_ == nil { 5727 c.header_ = make(http.Header) 5728 } 5729 return c.header_ 5730} 5731 5732func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 5733 reqHeaders := make(http.Header) 5734 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5735 for k, v := range c.header_ { 5736 reqHeaders[k] = v 5737 } 5738 reqHeaders.Set("User-Agent", c.s.userAgent()) 5739 var body io.Reader = nil 5740 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 5741 if err != nil { 5742 return nil, err 5743 } 5744 reqHeaders.Set("Content-Type", "application/json") 5745 c.urlParams_.Set("alt", alt) 5746 c.urlParams_.Set("prettyPrint", "false") 5747 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") 5748 urls += "?" + c.urlParams_.Encode() 5749 req, err := http.NewRequest("POST", urls, body) 5750 if err != nil { 5751 return nil, err 5752 } 5753 req.Header = reqHeaders 5754 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5755} 5756 5757// Do executes the "storage.channels.stop" call. 5758func (c *ChannelsStopCall) 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": "Stop watching resources through this channel", 5771 // "httpMethod": "POST", 5772 // "id": "storage.channels.stop", 5773 // "path": "channels/stop", 5774 // "request": { 5775 // "$ref": "Channel", 5776 // "parameterName": "resource" 5777 // }, 5778 // "scopes": [ 5779 // "https://www.googleapis.com/auth/cloud-platform", 5780 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5781 // "https://www.googleapis.com/auth/devstorage.full_control", 5782 // "https://www.googleapis.com/auth/devstorage.read_only", 5783 // "https://www.googleapis.com/auth/devstorage.read_write" 5784 // ] 5785 // } 5786 5787} 5788 5789// method id "storage.defaultObjectAccessControls.delete": 5790 5791type DefaultObjectAccessControlsDeleteCall struct { 5792 s *Service 5793 bucket string 5794 entity string 5795 urlParams_ gensupport.URLParams 5796 ctx_ context.Context 5797 header_ http.Header 5798} 5799 5800// Delete: Permanently deletes the default object ACL entry for the 5801// specified entity on the specified bucket. 5802// 5803// - bucket: Name of a bucket. 5804// - entity: The entity holding the permission. Can be user-userId, 5805// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 5806// allAuthenticatedUsers. 5807func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall { 5808 c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5809 c.bucket = bucket 5810 c.entity = entity 5811 return c 5812} 5813 5814// ProvisionalUserProject sets the optional parameter 5815// "provisionalUserProject": The project to be billed for this request 5816// if the target bucket is requester-pays bucket. 5817func (c *DefaultObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsDeleteCall { 5818 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5819 return c 5820} 5821 5822// UserProject sets the optional parameter "userProject": The project to 5823// be billed for this request. Required for Requester Pays buckets. 5824func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall { 5825 c.urlParams_.Set("userProject", userProject) 5826 return c 5827} 5828 5829// Fields allows partial responses to be retrieved. See 5830// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5831// for more information. 5832func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall { 5833 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5834 return c 5835} 5836 5837// Context sets the context to be used in this call's Do method. Any 5838// pending HTTP request will be aborted if the provided context is 5839// canceled. 5840func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall { 5841 c.ctx_ = ctx 5842 return c 5843} 5844 5845// Header returns an http.Header that can be modified by the caller to 5846// add HTTP headers to the request. 5847func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header { 5848 if c.header_ == nil { 5849 c.header_ = make(http.Header) 5850 } 5851 return c.header_ 5852} 5853 5854func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 5855 reqHeaders := make(http.Header) 5856 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5857 for k, v := range c.header_ { 5858 reqHeaders[k] = v 5859 } 5860 reqHeaders.Set("User-Agent", c.s.userAgent()) 5861 var body io.Reader = nil 5862 c.urlParams_.Set("alt", alt) 5863 c.urlParams_.Set("prettyPrint", "false") 5864 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 5865 urls += "?" + c.urlParams_.Encode() 5866 req, err := http.NewRequest("DELETE", urls, body) 5867 if err != nil { 5868 return nil, err 5869 } 5870 req.Header = reqHeaders 5871 googleapi.Expand(req.URL, map[string]string{ 5872 "bucket": c.bucket, 5873 "entity": c.entity, 5874 }) 5875 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5876} 5877 5878// Do executes the "storage.defaultObjectAccessControls.delete" call. 5879func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { 5880 gensupport.SetOptions(c.urlParams_, opts...) 5881 res, err := c.doRequest("json") 5882 if err != nil { 5883 return err 5884 } 5885 defer googleapi.CloseBody(res) 5886 if err := googleapi.CheckResponse(res); err != nil { 5887 return err 5888 } 5889 return nil 5890 // { 5891 // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", 5892 // "httpMethod": "DELETE", 5893 // "id": "storage.defaultObjectAccessControls.delete", 5894 // "parameterOrder": [ 5895 // "bucket", 5896 // "entity" 5897 // ], 5898 // "parameters": { 5899 // "bucket": { 5900 // "description": "Name of a bucket.", 5901 // "location": "path", 5902 // "required": true, 5903 // "type": "string" 5904 // }, 5905 // "entity": { 5906 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 5907 // "location": "path", 5908 // "required": true, 5909 // "type": "string" 5910 // }, 5911 // "provisionalUserProject": { 5912 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 5913 // "location": "query", 5914 // "type": "string" 5915 // }, 5916 // "userProject": { 5917 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 5918 // "location": "query", 5919 // "type": "string" 5920 // } 5921 // }, 5922 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 5923 // "scopes": [ 5924 // "https://www.googleapis.com/auth/cloud-platform", 5925 // "https://www.googleapis.com/auth/devstorage.full_control" 5926 // ] 5927 // } 5928 5929} 5930 5931// method id "storage.defaultObjectAccessControls.get": 5932 5933type DefaultObjectAccessControlsGetCall struct { 5934 s *Service 5935 bucket string 5936 entity string 5937 urlParams_ gensupport.URLParams 5938 ifNoneMatch_ string 5939 ctx_ context.Context 5940 header_ http.Header 5941} 5942 5943// Get: Returns the default object ACL entry for the specified entity on 5944// the specified bucket. 5945// 5946// - bucket: Name of a bucket. 5947// - entity: The entity holding the permission. Can be user-userId, 5948// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 5949// allAuthenticatedUsers. 5950func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall { 5951 c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5952 c.bucket = bucket 5953 c.entity = entity 5954 return c 5955} 5956 5957// ProvisionalUserProject sets the optional parameter 5958// "provisionalUserProject": The project to be billed for this request 5959// if the target bucket is requester-pays bucket. 5960func (c *DefaultObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsGetCall { 5961 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 5962 return c 5963} 5964 5965// UserProject sets the optional parameter "userProject": The project to 5966// be billed for this request. Required for Requester Pays buckets. 5967func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall { 5968 c.urlParams_.Set("userProject", userProject) 5969 return c 5970} 5971 5972// Fields allows partial responses to be retrieved. See 5973// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5974// for more information. 5975func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall { 5976 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5977 return c 5978} 5979 5980// IfNoneMatch sets the optional parameter which makes the operation 5981// fail if the object's ETag matches the given value. This is useful for 5982// getting updates only after the object has changed since the last 5983// request. Use googleapi.IsNotModified to check whether the response 5984// error from Do is the result of In-None-Match. 5985func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall { 5986 c.ifNoneMatch_ = entityTag 5987 return c 5988} 5989 5990// Context sets the context to be used in this call's Do method. Any 5991// pending HTTP request will be aborted if the provided context is 5992// canceled. 5993func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall { 5994 c.ctx_ = ctx 5995 return c 5996} 5997 5998// Header returns an http.Header that can be modified by the caller to 5999// add HTTP headers to the request. 6000func (c *DefaultObjectAccessControlsGetCall) Header() http.Header { 6001 if c.header_ == nil { 6002 c.header_ = make(http.Header) 6003 } 6004 return c.header_ 6005} 6006 6007func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { 6008 reqHeaders := make(http.Header) 6009 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6010 for k, v := range c.header_ { 6011 reqHeaders[k] = v 6012 } 6013 reqHeaders.Set("User-Agent", c.s.userAgent()) 6014 if c.ifNoneMatch_ != "" { 6015 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6016 } 6017 var body io.Reader = nil 6018 c.urlParams_.Set("alt", alt) 6019 c.urlParams_.Set("prettyPrint", "false") 6020 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 6021 urls += "?" + c.urlParams_.Encode() 6022 req, err := http.NewRequest("GET", urls, body) 6023 if err != nil { 6024 return nil, err 6025 } 6026 req.Header = reqHeaders 6027 googleapi.Expand(req.URL, map[string]string{ 6028 "bucket": c.bucket, 6029 "entity": c.entity, 6030 }) 6031 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6032} 6033 6034// Do executes the "storage.defaultObjectAccessControls.get" call. 6035// Exactly one of *ObjectAccessControl or error will be non-nil. Any 6036// non-2xx status code is an error. Response headers are in either 6037// *ObjectAccessControl.ServerResponse.Header or (if a response was 6038// returned at all) in error.(*googleapi.Error).Header. Use 6039// googleapi.IsNotModified to check whether the returned error was 6040// because http.StatusNotModified was returned. 6041func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 6042 gensupport.SetOptions(c.urlParams_, opts...) 6043 res, err := c.doRequest("json") 6044 if res != nil && res.StatusCode == http.StatusNotModified { 6045 if res.Body != nil { 6046 res.Body.Close() 6047 } 6048 return nil, &googleapi.Error{ 6049 Code: res.StatusCode, 6050 Header: res.Header, 6051 } 6052 } 6053 if err != nil { 6054 return nil, err 6055 } 6056 defer googleapi.CloseBody(res) 6057 if err := googleapi.CheckResponse(res); err != nil { 6058 return nil, err 6059 } 6060 ret := &ObjectAccessControl{ 6061 ServerResponse: googleapi.ServerResponse{ 6062 Header: res.Header, 6063 HTTPStatusCode: res.StatusCode, 6064 }, 6065 } 6066 target := &ret 6067 if err := gensupport.DecodeResponse(target, res); err != nil { 6068 return nil, err 6069 } 6070 return ret, nil 6071 // { 6072 // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", 6073 // "httpMethod": "GET", 6074 // "id": "storage.defaultObjectAccessControls.get", 6075 // "parameterOrder": [ 6076 // "bucket", 6077 // "entity" 6078 // ], 6079 // "parameters": { 6080 // "bucket": { 6081 // "description": "Name of a bucket.", 6082 // "location": "path", 6083 // "required": true, 6084 // "type": "string" 6085 // }, 6086 // "entity": { 6087 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 6088 // "location": "path", 6089 // "required": true, 6090 // "type": "string" 6091 // }, 6092 // "provisionalUserProject": { 6093 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6094 // "location": "query", 6095 // "type": "string" 6096 // }, 6097 // "userProject": { 6098 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6099 // "location": "query", 6100 // "type": "string" 6101 // } 6102 // }, 6103 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 6104 // "response": { 6105 // "$ref": "ObjectAccessControl" 6106 // }, 6107 // "scopes": [ 6108 // "https://www.googleapis.com/auth/cloud-platform", 6109 // "https://www.googleapis.com/auth/devstorage.full_control" 6110 // ] 6111 // } 6112 6113} 6114 6115// method id "storage.defaultObjectAccessControls.insert": 6116 6117type DefaultObjectAccessControlsInsertCall struct { 6118 s *Service 6119 bucket string 6120 objectaccesscontrol *ObjectAccessControl 6121 urlParams_ gensupport.URLParams 6122 ctx_ context.Context 6123 header_ http.Header 6124} 6125 6126// Insert: Creates a new default object ACL entry on the specified 6127// bucket. 6128// 6129// - bucket: Name of a bucket. 6130func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall { 6131 c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6132 c.bucket = bucket 6133 c.objectaccesscontrol = objectaccesscontrol 6134 return c 6135} 6136 6137// ProvisionalUserProject sets the optional parameter 6138// "provisionalUserProject": The project to be billed for this request 6139// if the target bucket is requester-pays bucket. 6140func (c *DefaultObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsInsertCall { 6141 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6142 return c 6143} 6144 6145// UserProject sets the optional parameter "userProject": The project to 6146// be billed for this request. Required for Requester Pays buckets. 6147func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall { 6148 c.urlParams_.Set("userProject", userProject) 6149 return c 6150} 6151 6152// Fields allows partial responses to be retrieved. See 6153// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6154// for more information. 6155func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall { 6156 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6157 return c 6158} 6159 6160// Context sets the context to be used in this call's Do method. Any 6161// pending HTTP request will be aborted if the provided context is 6162// canceled. 6163func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall { 6164 c.ctx_ = ctx 6165 return c 6166} 6167 6168// Header returns an http.Header that can be modified by the caller to 6169// add HTTP headers to the request. 6170func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header { 6171 if c.header_ == nil { 6172 c.header_ = make(http.Header) 6173 } 6174 return c.header_ 6175} 6176 6177func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { 6178 reqHeaders := make(http.Header) 6179 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6180 for k, v := range c.header_ { 6181 reqHeaders[k] = v 6182 } 6183 reqHeaders.Set("User-Agent", c.s.userAgent()) 6184 var body io.Reader = nil 6185 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 6186 if err != nil { 6187 return nil, err 6188 } 6189 reqHeaders.Set("Content-Type", "application/json") 6190 c.urlParams_.Set("alt", alt) 6191 c.urlParams_.Set("prettyPrint", "false") 6192 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") 6193 urls += "?" + c.urlParams_.Encode() 6194 req, err := http.NewRequest("POST", urls, body) 6195 if err != nil { 6196 return nil, err 6197 } 6198 req.Header = reqHeaders 6199 googleapi.Expand(req.URL, map[string]string{ 6200 "bucket": c.bucket, 6201 }) 6202 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6203} 6204 6205// Do executes the "storage.defaultObjectAccessControls.insert" call. 6206// Exactly one of *ObjectAccessControl or error will be non-nil. Any 6207// non-2xx status code is an error. Response headers are in either 6208// *ObjectAccessControl.ServerResponse.Header or (if a response was 6209// returned at all) in error.(*googleapi.Error).Header. Use 6210// googleapi.IsNotModified to check whether the returned error was 6211// because http.StatusNotModified was returned. 6212func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 6213 gensupport.SetOptions(c.urlParams_, opts...) 6214 res, err := c.doRequest("json") 6215 if res != nil && res.StatusCode == http.StatusNotModified { 6216 if res.Body != nil { 6217 res.Body.Close() 6218 } 6219 return nil, &googleapi.Error{ 6220 Code: res.StatusCode, 6221 Header: res.Header, 6222 } 6223 } 6224 if err != nil { 6225 return nil, err 6226 } 6227 defer googleapi.CloseBody(res) 6228 if err := googleapi.CheckResponse(res); err != nil { 6229 return nil, err 6230 } 6231 ret := &ObjectAccessControl{ 6232 ServerResponse: googleapi.ServerResponse{ 6233 Header: res.Header, 6234 HTTPStatusCode: res.StatusCode, 6235 }, 6236 } 6237 target := &ret 6238 if err := gensupport.DecodeResponse(target, res); err != nil { 6239 return nil, err 6240 } 6241 return ret, nil 6242 // { 6243 // "description": "Creates a new default object ACL entry on the specified bucket.", 6244 // "httpMethod": "POST", 6245 // "id": "storage.defaultObjectAccessControls.insert", 6246 // "parameterOrder": [ 6247 // "bucket" 6248 // ], 6249 // "parameters": { 6250 // "bucket": { 6251 // "description": "Name of a bucket.", 6252 // "location": "path", 6253 // "required": true, 6254 // "type": "string" 6255 // }, 6256 // "provisionalUserProject": { 6257 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6258 // "location": "query", 6259 // "type": "string" 6260 // }, 6261 // "userProject": { 6262 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6263 // "location": "query", 6264 // "type": "string" 6265 // } 6266 // }, 6267 // "path": "b/{bucket}/defaultObjectAcl", 6268 // "request": { 6269 // "$ref": "ObjectAccessControl" 6270 // }, 6271 // "response": { 6272 // "$ref": "ObjectAccessControl" 6273 // }, 6274 // "scopes": [ 6275 // "https://www.googleapis.com/auth/cloud-platform", 6276 // "https://www.googleapis.com/auth/devstorage.full_control" 6277 // ] 6278 // } 6279 6280} 6281 6282// method id "storage.defaultObjectAccessControls.list": 6283 6284type DefaultObjectAccessControlsListCall struct { 6285 s *Service 6286 bucket string 6287 urlParams_ gensupport.URLParams 6288 ifNoneMatch_ string 6289 ctx_ context.Context 6290 header_ http.Header 6291} 6292 6293// List: Retrieves default object ACL entries on the specified bucket. 6294// 6295// - bucket: Name of a bucket. 6296func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall { 6297 c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6298 c.bucket = bucket 6299 return c 6300} 6301 6302// IfMetagenerationMatch sets the optional parameter 6303// "ifMetagenerationMatch": If present, only return default ACL listing 6304// if the bucket's current metageneration matches this value. 6305func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall { 6306 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 6307 return c 6308} 6309 6310// IfMetagenerationNotMatch sets the optional parameter 6311// "ifMetagenerationNotMatch": If present, only return default ACL 6312// listing if the bucket's current metageneration does not match the 6313// given value. 6314func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall { 6315 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 6316 return c 6317} 6318 6319// ProvisionalUserProject sets the optional parameter 6320// "provisionalUserProject": The project to be billed for this request 6321// if the target bucket is requester-pays bucket. 6322func (c *DefaultObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsListCall { 6323 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6324 return c 6325} 6326 6327// UserProject sets the optional parameter "userProject": The project to 6328// be billed for this request. Required for Requester Pays buckets. 6329func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall { 6330 c.urlParams_.Set("userProject", userProject) 6331 return c 6332} 6333 6334// Fields allows partial responses to be retrieved. See 6335// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6336// for more information. 6337func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall { 6338 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6339 return c 6340} 6341 6342// IfNoneMatch sets the optional parameter which makes the operation 6343// fail if the object's ETag matches the given value. This is useful for 6344// getting updates only after the object has changed since the last 6345// request. Use googleapi.IsNotModified to check whether the response 6346// error from Do is the result of In-None-Match. 6347func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall { 6348 c.ifNoneMatch_ = entityTag 6349 return c 6350} 6351 6352// Context sets the context to be used in this call's Do method. Any 6353// pending HTTP request will be aborted if the provided context is 6354// canceled. 6355func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall { 6356 c.ctx_ = ctx 6357 return c 6358} 6359 6360// Header returns an http.Header that can be modified by the caller to 6361// add HTTP headers to the request. 6362func (c *DefaultObjectAccessControlsListCall) Header() http.Header { 6363 if c.header_ == nil { 6364 c.header_ = make(http.Header) 6365 } 6366 return c.header_ 6367} 6368 6369func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { 6370 reqHeaders := make(http.Header) 6371 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6372 for k, v := range c.header_ { 6373 reqHeaders[k] = v 6374 } 6375 reqHeaders.Set("User-Agent", c.s.userAgent()) 6376 if c.ifNoneMatch_ != "" { 6377 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6378 } 6379 var body io.Reader = nil 6380 c.urlParams_.Set("alt", alt) 6381 c.urlParams_.Set("prettyPrint", "false") 6382 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl") 6383 urls += "?" + c.urlParams_.Encode() 6384 req, err := http.NewRequest("GET", urls, body) 6385 if err != nil { 6386 return nil, err 6387 } 6388 req.Header = reqHeaders 6389 googleapi.Expand(req.URL, map[string]string{ 6390 "bucket": c.bucket, 6391 }) 6392 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6393} 6394 6395// Do executes the "storage.defaultObjectAccessControls.list" call. 6396// Exactly one of *ObjectAccessControls or error will be non-nil. Any 6397// non-2xx status code is an error. Response headers are in either 6398// *ObjectAccessControls.ServerResponse.Header or (if a response was 6399// returned at all) in error.(*googleapi.Error).Header. Use 6400// googleapi.IsNotModified to check whether the returned error was 6401// because http.StatusNotModified was returned. 6402func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) { 6403 gensupport.SetOptions(c.urlParams_, opts...) 6404 res, err := c.doRequest("json") 6405 if res != nil && res.StatusCode == http.StatusNotModified { 6406 if res.Body != nil { 6407 res.Body.Close() 6408 } 6409 return nil, &googleapi.Error{ 6410 Code: res.StatusCode, 6411 Header: res.Header, 6412 } 6413 } 6414 if err != nil { 6415 return nil, err 6416 } 6417 defer googleapi.CloseBody(res) 6418 if err := googleapi.CheckResponse(res); err != nil { 6419 return nil, err 6420 } 6421 ret := &ObjectAccessControls{ 6422 ServerResponse: googleapi.ServerResponse{ 6423 Header: res.Header, 6424 HTTPStatusCode: res.StatusCode, 6425 }, 6426 } 6427 target := &ret 6428 if err := gensupport.DecodeResponse(target, res); err != nil { 6429 return nil, err 6430 } 6431 return ret, nil 6432 // { 6433 // "description": "Retrieves default object ACL entries on the specified bucket.", 6434 // "httpMethod": "GET", 6435 // "id": "storage.defaultObjectAccessControls.list", 6436 // "parameterOrder": [ 6437 // "bucket" 6438 // ], 6439 // "parameters": { 6440 // "bucket": { 6441 // "description": "Name of a bucket.", 6442 // "location": "path", 6443 // "required": true, 6444 // "type": "string" 6445 // }, 6446 // "ifMetagenerationMatch": { 6447 // "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", 6448 // "format": "int64", 6449 // "location": "query", 6450 // "type": "string" 6451 // }, 6452 // "ifMetagenerationNotMatch": { 6453 // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", 6454 // "format": "int64", 6455 // "location": "query", 6456 // "type": "string" 6457 // }, 6458 // "provisionalUserProject": { 6459 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6460 // "location": "query", 6461 // "type": "string" 6462 // }, 6463 // "userProject": { 6464 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6465 // "location": "query", 6466 // "type": "string" 6467 // } 6468 // }, 6469 // "path": "b/{bucket}/defaultObjectAcl", 6470 // "response": { 6471 // "$ref": "ObjectAccessControls" 6472 // }, 6473 // "scopes": [ 6474 // "https://www.googleapis.com/auth/cloud-platform", 6475 // "https://www.googleapis.com/auth/devstorage.full_control" 6476 // ] 6477 // } 6478 6479} 6480 6481// method id "storage.defaultObjectAccessControls.patch": 6482 6483type DefaultObjectAccessControlsPatchCall struct { 6484 s *Service 6485 bucket string 6486 entity string 6487 objectaccesscontrol *ObjectAccessControl 6488 urlParams_ gensupport.URLParams 6489 ctx_ context.Context 6490 header_ http.Header 6491} 6492 6493// Patch: Patches a default object ACL entry on the specified bucket. 6494// 6495// - bucket: Name of a bucket. 6496// - entity: The entity holding the permission. Can be user-userId, 6497// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 6498// allAuthenticatedUsers. 6499func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall { 6500 c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6501 c.bucket = bucket 6502 c.entity = entity 6503 c.objectaccesscontrol = objectaccesscontrol 6504 return c 6505} 6506 6507// ProvisionalUserProject sets the optional parameter 6508// "provisionalUserProject": The project to be billed for this request 6509// if the target bucket is requester-pays bucket. 6510func (c *DefaultObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsPatchCall { 6511 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6512 return c 6513} 6514 6515// UserProject sets the optional parameter "userProject": The project to 6516// be billed for this request. Required for Requester Pays buckets. 6517func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall { 6518 c.urlParams_.Set("userProject", userProject) 6519 return c 6520} 6521 6522// Fields allows partial responses to be retrieved. See 6523// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6524// for more information. 6525func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall { 6526 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6527 return c 6528} 6529 6530// Context sets the context to be used in this call's Do method. Any 6531// pending HTTP request will be aborted if the provided context is 6532// canceled. 6533func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall { 6534 c.ctx_ = ctx 6535 return c 6536} 6537 6538// Header returns an http.Header that can be modified by the caller to 6539// add HTTP headers to the request. 6540func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header { 6541 if c.header_ == nil { 6542 c.header_ = make(http.Header) 6543 } 6544 return c.header_ 6545} 6546 6547func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { 6548 reqHeaders := make(http.Header) 6549 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6550 for k, v := range c.header_ { 6551 reqHeaders[k] = v 6552 } 6553 reqHeaders.Set("User-Agent", c.s.userAgent()) 6554 var body io.Reader = nil 6555 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 6556 if err != nil { 6557 return nil, err 6558 } 6559 reqHeaders.Set("Content-Type", "application/json") 6560 c.urlParams_.Set("alt", alt) 6561 c.urlParams_.Set("prettyPrint", "false") 6562 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 6563 urls += "?" + c.urlParams_.Encode() 6564 req, err := http.NewRequest("PATCH", urls, body) 6565 if err != nil { 6566 return nil, err 6567 } 6568 req.Header = reqHeaders 6569 googleapi.Expand(req.URL, map[string]string{ 6570 "bucket": c.bucket, 6571 "entity": c.entity, 6572 }) 6573 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6574} 6575 6576// Do executes the "storage.defaultObjectAccessControls.patch" call. 6577// Exactly one of *ObjectAccessControl or error will be non-nil. Any 6578// non-2xx status code is an error. Response headers are in either 6579// *ObjectAccessControl.ServerResponse.Header or (if a response was 6580// returned at all) in error.(*googleapi.Error).Header. Use 6581// googleapi.IsNotModified to check whether the returned error was 6582// because http.StatusNotModified was returned. 6583func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 6584 gensupport.SetOptions(c.urlParams_, opts...) 6585 res, err := c.doRequest("json") 6586 if res != nil && res.StatusCode == http.StatusNotModified { 6587 if res.Body != nil { 6588 res.Body.Close() 6589 } 6590 return nil, &googleapi.Error{ 6591 Code: res.StatusCode, 6592 Header: res.Header, 6593 } 6594 } 6595 if err != nil { 6596 return nil, err 6597 } 6598 defer googleapi.CloseBody(res) 6599 if err := googleapi.CheckResponse(res); err != nil { 6600 return nil, err 6601 } 6602 ret := &ObjectAccessControl{ 6603 ServerResponse: googleapi.ServerResponse{ 6604 Header: res.Header, 6605 HTTPStatusCode: res.StatusCode, 6606 }, 6607 } 6608 target := &ret 6609 if err := gensupport.DecodeResponse(target, res); err != nil { 6610 return nil, err 6611 } 6612 return ret, nil 6613 // { 6614 // "description": "Patches a default object ACL entry on the specified bucket.", 6615 // "httpMethod": "PATCH", 6616 // "id": "storage.defaultObjectAccessControls.patch", 6617 // "parameterOrder": [ 6618 // "bucket", 6619 // "entity" 6620 // ], 6621 // "parameters": { 6622 // "bucket": { 6623 // "description": "Name of a bucket.", 6624 // "location": "path", 6625 // "required": true, 6626 // "type": "string" 6627 // }, 6628 // "entity": { 6629 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 6630 // "location": "path", 6631 // "required": true, 6632 // "type": "string" 6633 // }, 6634 // "provisionalUserProject": { 6635 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6636 // "location": "query", 6637 // "type": "string" 6638 // }, 6639 // "userProject": { 6640 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6641 // "location": "query", 6642 // "type": "string" 6643 // } 6644 // }, 6645 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 6646 // "request": { 6647 // "$ref": "ObjectAccessControl" 6648 // }, 6649 // "response": { 6650 // "$ref": "ObjectAccessControl" 6651 // }, 6652 // "scopes": [ 6653 // "https://www.googleapis.com/auth/cloud-platform", 6654 // "https://www.googleapis.com/auth/devstorage.full_control" 6655 // ] 6656 // } 6657 6658} 6659 6660// method id "storage.defaultObjectAccessControls.update": 6661 6662type DefaultObjectAccessControlsUpdateCall struct { 6663 s *Service 6664 bucket string 6665 entity string 6666 objectaccesscontrol *ObjectAccessControl 6667 urlParams_ gensupport.URLParams 6668 ctx_ context.Context 6669 header_ http.Header 6670} 6671 6672// Update: Updates a default object ACL entry on the specified bucket. 6673// 6674// - bucket: Name of a bucket. 6675// - entity: The entity holding the permission. Can be user-userId, 6676// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 6677// allAuthenticatedUsers. 6678func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall { 6679 c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6680 c.bucket = bucket 6681 c.entity = entity 6682 c.objectaccesscontrol = objectaccesscontrol 6683 return c 6684} 6685 6686// ProvisionalUserProject sets the optional parameter 6687// "provisionalUserProject": The project to be billed for this request 6688// if the target bucket is requester-pays bucket. 6689func (c *DefaultObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsUpdateCall { 6690 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6691 return c 6692} 6693 6694// UserProject sets the optional parameter "userProject": The project to 6695// be billed for this request. Required for Requester Pays buckets. 6696func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall { 6697 c.urlParams_.Set("userProject", userProject) 6698 return c 6699} 6700 6701// Fields allows partial responses to be retrieved. See 6702// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6703// for more information. 6704func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall { 6705 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6706 return c 6707} 6708 6709// Context sets the context to be used in this call's Do method. Any 6710// pending HTTP request will be aborted if the provided context is 6711// canceled. 6712func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall { 6713 c.ctx_ = ctx 6714 return c 6715} 6716 6717// Header returns an http.Header that can be modified by the caller to 6718// add HTTP headers to the request. 6719func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header { 6720 if c.header_ == nil { 6721 c.header_ = make(http.Header) 6722 } 6723 return c.header_ 6724} 6725 6726func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { 6727 reqHeaders := make(http.Header) 6728 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6729 for k, v := range c.header_ { 6730 reqHeaders[k] = v 6731 } 6732 reqHeaders.Set("User-Agent", c.s.userAgent()) 6733 var body io.Reader = nil 6734 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 6735 if err != nil { 6736 return nil, err 6737 } 6738 reqHeaders.Set("Content-Type", "application/json") 6739 c.urlParams_.Set("alt", alt) 6740 c.urlParams_.Set("prettyPrint", "false") 6741 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") 6742 urls += "?" + c.urlParams_.Encode() 6743 req, err := http.NewRequest("PUT", urls, body) 6744 if err != nil { 6745 return nil, err 6746 } 6747 req.Header = reqHeaders 6748 googleapi.Expand(req.URL, map[string]string{ 6749 "bucket": c.bucket, 6750 "entity": c.entity, 6751 }) 6752 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6753} 6754 6755// Do executes the "storage.defaultObjectAccessControls.update" call. 6756// Exactly one of *ObjectAccessControl or error will be non-nil. Any 6757// non-2xx status code is an error. Response headers are in either 6758// *ObjectAccessControl.ServerResponse.Header or (if a response was 6759// returned at all) in error.(*googleapi.Error).Header. Use 6760// googleapi.IsNotModified to check whether the returned error was 6761// because http.StatusNotModified was returned. 6762func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 6763 gensupport.SetOptions(c.urlParams_, opts...) 6764 res, err := c.doRequest("json") 6765 if res != nil && res.StatusCode == http.StatusNotModified { 6766 if res.Body != nil { 6767 res.Body.Close() 6768 } 6769 return nil, &googleapi.Error{ 6770 Code: res.StatusCode, 6771 Header: res.Header, 6772 } 6773 } 6774 if err != nil { 6775 return nil, err 6776 } 6777 defer googleapi.CloseBody(res) 6778 if err := googleapi.CheckResponse(res); err != nil { 6779 return nil, err 6780 } 6781 ret := &ObjectAccessControl{ 6782 ServerResponse: googleapi.ServerResponse{ 6783 Header: res.Header, 6784 HTTPStatusCode: res.StatusCode, 6785 }, 6786 } 6787 target := &ret 6788 if err := gensupport.DecodeResponse(target, res); err != nil { 6789 return nil, err 6790 } 6791 return ret, nil 6792 // { 6793 // "description": "Updates a default object ACL entry on the specified bucket.", 6794 // "httpMethod": "PUT", 6795 // "id": "storage.defaultObjectAccessControls.update", 6796 // "parameterOrder": [ 6797 // "bucket", 6798 // "entity" 6799 // ], 6800 // "parameters": { 6801 // "bucket": { 6802 // "description": "Name of a bucket.", 6803 // "location": "path", 6804 // "required": true, 6805 // "type": "string" 6806 // }, 6807 // "entity": { 6808 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 6809 // "location": "path", 6810 // "required": true, 6811 // "type": "string" 6812 // }, 6813 // "provisionalUserProject": { 6814 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6815 // "location": "query", 6816 // "type": "string" 6817 // }, 6818 // "userProject": { 6819 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6820 // "location": "query", 6821 // "type": "string" 6822 // } 6823 // }, 6824 // "path": "b/{bucket}/defaultObjectAcl/{entity}", 6825 // "request": { 6826 // "$ref": "ObjectAccessControl" 6827 // }, 6828 // "response": { 6829 // "$ref": "ObjectAccessControl" 6830 // }, 6831 // "scopes": [ 6832 // "https://www.googleapis.com/auth/cloud-platform", 6833 // "https://www.googleapis.com/auth/devstorage.full_control" 6834 // ] 6835 // } 6836 6837} 6838 6839// method id "storage.notifications.delete": 6840 6841type NotificationsDeleteCall struct { 6842 s *Service 6843 bucket string 6844 notification string 6845 urlParams_ gensupport.URLParams 6846 ctx_ context.Context 6847 header_ http.Header 6848} 6849 6850// Delete: Permanently deletes a notification subscription. 6851// 6852// - bucket: The parent bucket of the notification. 6853// - notification: ID of the notification to delete. 6854func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall { 6855 c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6856 c.bucket = bucket 6857 c.notification = notification 6858 return c 6859} 6860 6861// ProvisionalUserProject sets the optional parameter 6862// "provisionalUserProject": The project to be billed for this request 6863// if the target bucket is requester-pays bucket. 6864func (c *NotificationsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsDeleteCall { 6865 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 6866 return c 6867} 6868 6869// UserProject sets the optional parameter "userProject": The project to 6870// be billed for this request. Required for Requester Pays buckets. 6871func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall { 6872 c.urlParams_.Set("userProject", userProject) 6873 return c 6874} 6875 6876// Fields allows partial responses to be retrieved. See 6877// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6878// for more information. 6879func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall { 6880 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6881 return c 6882} 6883 6884// Context sets the context to be used in this call's Do method. Any 6885// pending HTTP request will be aborted if the provided context is 6886// canceled. 6887func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall { 6888 c.ctx_ = ctx 6889 return c 6890} 6891 6892// Header returns an http.Header that can be modified by the caller to 6893// add HTTP headers to the request. 6894func (c *NotificationsDeleteCall) Header() http.Header { 6895 if c.header_ == nil { 6896 c.header_ = make(http.Header) 6897 } 6898 return c.header_ 6899} 6900 6901func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) { 6902 reqHeaders := make(http.Header) 6903 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6904 for k, v := range c.header_ { 6905 reqHeaders[k] = v 6906 } 6907 reqHeaders.Set("User-Agent", c.s.userAgent()) 6908 var body io.Reader = nil 6909 c.urlParams_.Set("alt", alt) 6910 c.urlParams_.Set("prettyPrint", "false") 6911 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") 6912 urls += "?" + c.urlParams_.Encode() 6913 req, err := http.NewRequest("DELETE", urls, body) 6914 if err != nil { 6915 return nil, err 6916 } 6917 req.Header = reqHeaders 6918 googleapi.Expand(req.URL, map[string]string{ 6919 "bucket": c.bucket, 6920 "notification": c.notification, 6921 }) 6922 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6923} 6924 6925// Do executes the "storage.notifications.delete" call. 6926func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error { 6927 gensupport.SetOptions(c.urlParams_, opts...) 6928 res, err := c.doRequest("json") 6929 if err != nil { 6930 return err 6931 } 6932 defer googleapi.CloseBody(res) 6933 if err := googleapi.CheckResponse(res); err != nil { 6934 return err 6935 } 6936 return nil 6937 // { 6938 // "description": "Permanently deletes a notification subscription.", 6939 // "httpMethod": "DELETE", 6940 // "id": "storage.notifications.delete", 6941 // "parameterOrder": [ 6942 // "bucket", 6943 // "notification" 6944 // ], 6945 // "parameters": { 6946 // "bucket": { 6947 // "description": "The parent bucket of the notification.", 6948 // "location": "path", 6949 // "required": true, 6950 // "type": "string" 6951 // }, 6952 // "notification": { 6953 // "description": "ID of the notification to delete.", 6954 // "location": "path", 6955 // "required": true, 6956 // "type": "string" 6957 // }, 6958 // "provisionalUserProject": { 6959 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 6960 // "location": "query", 6961 // "type": "string" 6962 // }, 6963 // "userProject": { 6964 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 6965 // "location": "query", 6966 // "type": "string" 6967 // } 6968 // }, 6969 // "path": "b/{bucket}/notificationConfigs/{notification}", 6970 // "scopes": [ 6971 // "https://www.googleapis.com/auth/cloud-platform", 6972 // "https://www.googleapis.com/auth/devstorage.full_control", 6973 // "https://www.googleapis.com/auth/devstorage.read_write" 6974 // ] 6975 // } 6976 6977} 6978 6979// method id "storage.notifications.get": 6980 6981type NotificationsGetCall struct { 6982 s *Service 6983 bucket string 6984 notification string 6985 urlParams_ gensupport.URLParams 6986 ifNoneMatch_ string 6987 ctx_ context.Context 6988 header_ http.Header 6989} 6990 6991// Get: View a notification configuration. 6992// 6993// - bucket: The parent bucket of the notification. 6994// - notification: Notification ID. 6995func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall { 6996 c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6997 c.bucket = bucket 6998 c.notification = notification 6999 return c 7000} 7001 7002// ProvisionalUserProject sets the optional parameter 7003// "provisionalUserProject": The project to be billed for this request 7004// if the target bucket is requester-pays bucket. 7005func (c *NotificationsGetCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsGetCall { 7006 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7007 return c 7008} 7009 7010// UserProject sets the optional parameter "userProject": The project to 7011// be billed for this request. Required for Requester Pays buckets. 7012func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall { 7013 c.urlParams_.Set("userProject", userProject) 7014 return c 7015} 7016 7017// Fields allows partial responses to be retrieved. See 7018// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7019// for more information. 7020func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall { 7021 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7022 return c 7023} 7024 7025// IfNoneMatch sets the optional parameter which makes the operation 7026// fail if the object's ETag matches the given value. This is useful for 7027// getting updates only after the object has changed since the last 7028// request. Use googleapi.IsNotModified to check whether the response 7029// error from Do is the result of In-None-Match. 7030func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall { 7031 c.ifNoneMatch_ = entityTag 7032 return c 7033} 7034 7035// Context sets the context to be used in this call's Do method. Any 7036// pending HTTP request will be aborted if the provided context is 7037// canceled. 7038func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall { 7039 c.ctx_ = ctx 7040 return c 7041} 7042 7043// Header returns an http.Header that can be modified by the caller to 7044// add HTTP headers to the request. 7045func (c *NotificationsGetCall) Header() http.Header { 7046 if c.header_ == nil { 7047 c.header_ = make(http.Header) 7048 } 7049 return c.header_ 7050} 7051 7052func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) { 7053 reqHeaders := make(http.Header) 7054 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7055 for k, v := range c.header_ { 7056 reqHeaders[k] = v 7057 } 7058 reqHeaders.Set("User-Agent", c.s.userAgent()) 7059 if c.ifNoneMatch_ != "" { 7060 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7061 } 7062 var body io.Reader = nil 7063 c.urlParams_.Set("alt", alt) 7064 c.urlParams_.Set("prettyPrint", "false") 7065 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}") 7066 urls += "?" + c.urlParams_.Encode() 7067 req, err := http.NewRequest("GET", urls, body) 7068 if err != nil { 7069 return nil, err 7070 } 7071 req.Header = reqHeaders 7072 googleapi.Expand(req.URL, map[string]string{ 7073 "bucket": c.bucket, 7074 "notification": c.notification, 7075 }) 7076 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7077} 7078 7079// Do executes the "storage.notifications.get" call. 7080// Exactly one of *Notification or error will be non-nil. Any non-2xx 7081// status code is an error. Response headers are in either 7082// *Notification.ServerResponse.Header or (if a response was returned at 7083// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7084// to check whether the returned error was because 7085// http.StatusNotModified was returned. 7086func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) { 7087 gensupport.SetOptions(c.urlParams_, opts...) 7088 res, err := c.doRequest("json") 7089 if res != nil && res.StatusCode == http.StatusNotModified { 7090 if res.Body != nil { 7091 res.Body.Close() 7092 } 7093 return nil, &googleapi.Error{ 7094 Code: res.StatusCode, 7095 Header: res.Header, 7096 } 7097 } 7098 if err != nil { 7099 return nil, err 7100 } 7101 defer googleapi.CloseBody(res) 7102 if err := googleapi.CheckResponse(res); err != nil { 7103 return nil, err 7104 } 7105 ret := &Notification{ 7106 ServerResponse: googleapi.ServerResponse{ 7107 Header: res.Header, 7108 HTTPStatusCode: res.StatusCode, 7109 }, 7110 } 7111 target := &ret 7112 if err := gensupport.DecodeResponse(target, res); err != nil { 7113 return nil, err 7114 } 7115 return ret, nil 7116 // { 7117 // "description": "View a notification configuration.", 7118 // "httpMethod": "GET", 7119 // "id": "storage.notifications.get", 7120 // "parameterOrder": [ 7121 // "bucket", 7122 // "notification" 7123 // ], 7124 // "parameters": { 7125 // "bucket": { 7126 // "description": "The parent bucket of the notification.", 7127 // "location": "path", 7128 // "required": true, 7129 // "type": "string" 7130 // }, 7131 // "notification": { 7132 // "description": "Notification ID", 7133 // "location": "path", 7134 // "required": true, 7135 // "type": "string" 7136 // }, 7137 // "provisionalUserProject": { 7138 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7139 // "location": "query", 7140 // "type": "string" 7141 // }, 7142 // "userProject": { 7143 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7144 // "location": "query", 7145 // "type": "string" 7146 // } 7147 // }, 7148 // "path": "b/{bucket}/notificationConfigs/{notification}", 7149 // "response": { 7150 // "$ref": "Notification" 7151 // }, 7152 // "scopes": [ 7153 // "https://www.googleapis.com/auth/cloud-platform", 7154 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7155 // "https://www.googleapis.com/auth/devstorage.full_control", 7156 // "https://www.googleapis.com/auth/devstorage.read_only", 7157 // "https://www.googleapis.com/auth/devstorage.read_write" 7158 // ] 7159 // } 7160 7161} 7162 7163// method id "storage.notifications.insert": 7164 7165type NotificationsInsertCall struct { 7166 s *Service 7167 bucket string 7168 notification *Notification 7169 urlParams_ gensupport.URLParams 7170 ctx_ context.Context 7171 header_ http.Header 7172} 7173 7174// Insert: Creates a notification subscription for a given bucket. 7175// 7176// - bucket: The parent bucket of the notification. 7177func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall { 7178 c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7179 c.bucket = bucket 7180 c.notification = notification 7181 return c 7182} 7183 7184// ProvisionalUserProject sets the optional parameter 7185// "provisionalUserProject": The project to be billed for this request 7186// if the target bucket is requester-pays bucket. 7187func (c *NotificationsInsertCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsInsertCall { 7188 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7189 return c 7190} 7191 7192// UserProject sets the optional parameter "userProject": The project to 7193// be billed for this request. Required for Requester Pays buckets. 7194func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall { 7195 c.urlParams_.Set("userProject", userProject) 7196 return c 7197} 7198 7199// Fields allows partial responses to be retrieved. See 7200// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7201// for more information. 7202func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall { 7203 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7204 return c 7205} 7206 7207// Context sets the context to be used in this call's Do method. Any 7208// pending HTTP request will be aborted if the provided context is 7209// canceled. 7210func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall { 7211 c.ctx_ = ctx 7212 return c 7213} 7214 7215// Header returns an http.Header that can be modified by the caller to 7216// add HTTP headers to the request. 7217func (c *NotificationsInsertCall) Header() http.Header { 7218 if c.header_ == nil { 7219 c.header_ = make(http.Header) 7220 } 7221 return c.header_ 7222} 7223 7224func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) { 7225 reqHeaders := make(http.Header) 7226 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7227 for k, v := range c.header_ { 7228 reqHeaders[k] = v 7229 } 7230 reqHeaders.Set("User-Agent", c.s.userAgent()) 7231 var body io.Reader = nil 7232 body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification) 7233 if err != nil { 7234 return nil, err 7235 } 7236 reqHeaders.Set("Content-Type", "application/json") 7237 c.urlParams_.Set("alt", alt) 7238 c.urlParams_.Set("prettyPrint", "false") 7239 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs") 7240 urls += "?" + c.urlParams_.Encode() 7241 req, err := http.NewRequest("POST", urls, body) 7242 if err != nil { 7243 return nil, err 7244 } 7245 req.Header = reqHeaders 7246 googleapi.Expand(req.URL, map[string]string{ 7247 "bucket": c.bucket, 7248 }) 7249 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7250} 7251 7252// Do executes the "storage.notifications.insert" call. 7253// Exactly one of *Notification or error will be non-nil. Any non-2xx 7254// status code is an error. Response headers are in either 7255// *Notification.ServerResponse.Header or (if a response was returned at 7256// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7257// to check whether the returned error was because 7258// http.StatusNotModified was returned. 7259func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) { 7260 gensupport.SetOptions(c.urlParams_, opts...) 7261 res, err := c.doRequest("json") 7262 if res != nil && res.StatusCode == http.StatusNotModified { 7263 if res.Body != nil { 7264 res.Body.Close() 7265 } 7266 return nil, &googleapi.Error{ 7267 Code: res.StatusCode, 7268 Header: res.Header, 7269 } 7270 } 7271 if err != nil { 7272 return nil, err 7273 } 7274 defer googleapi.CloseBody(res) 7275 if err := googleapi.CheckResponse(res); err != nil { 7276 return nil, err 7277 } 7278 ret := &Notification{ 7279 ServerResponse: googleapi.ServerResponse{ 7280 Header: res.Header, 7281 HTTPStatusCode: res.StatusCode, 7282 }, 7283 } 7284 target := &ret 7285 if err := gensupport.DecodeResponse(target, res); err != nil { 7286 return nil, err 7287 } 7288 return ret, nil 7289 // { 7290 // "description": "Creates a notification subscription for a given bucket.", 7291 // "httpMethod": "POST", 7292 // "id": "storage.notifications.insert", 7293 // "parameterOrder": [ 7294 // "bucket" 7295 // ], 7296 // "parameters": { 7297 // "bucket": { 7298 // "description": "The parent bucket of the notification.", 7299 // "location": "path", 7300 // "required": true, 7301 // "type": "string" 7302 // }, 7303 // "provisionalUserProject": { 7304 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7305 // "location": "query", 7306 // "type": "string" 7307 // }, 7308 // "userProject": { 7309 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7310 // "location": "query", 7311 // "type": "string" 7312 // } 7313 // }, 7314 // "path": "b/{bucket}/notificationConfigs", 7315 // "request": { 7316 // "$ref": "Notification" 7317 // }, 7318 // "response": { 7319 // "$ref": "Notification" 7320 // }, 7321 // "scopes": [ 7322 // "https://www.googleapis.com/auth/cloud-platform", 7323 // "https://www.googleapis.com/auth/devstorage.full_control", 7324 // "https://www.googleapis.com/auth/devstorage.read_write" 7325 // ] 7326 // } 7327 7328} 7329 7330// method id "storage.notifications.list": 7331 7332type NotificationsListCall struct { 7333 s *Service 7334 bucket string 7335 urlParams_ gensupport.URLParams 7336 ifNoneMatch_ string 7337 ctx_ context.Context 7338 header_ http.Header 7339} 7340 7341// List: Retrieves a list of notification subscriptions for a given 7342// bucket. 7343// 7344// - bucket: Name of a Google Cloud Storage bucket. 7345func (r *NotificationsService) List(bucket string) *NotificationsListCall { 7346 c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7347 c.bucket = bucket 7348 return c 7349} 7350 7351// ProvisionalUserProject sets the optional parameter 7352// "provisionalUserProject": The project to be billed for this request 7353// if the target bucket is requester-pays bucket. 7354func (c *NotificationsListCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsListCall { 7355 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7356 return c 7357} 7358 7359// UserProject sets the optional parameter "userProject": The project to 7360// be billed for this request. Required for Requester Pays buckets. 7361func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall { 7362 c.urlParams_.Set("userProject", userProject) 7363 return c 7364} 7365 7366// Fields allows partial responses to be retrieved. See 7367// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7368// for more information. 7369func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall { 7370 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7371 return c 7372} 7373 7374// IfNoneMatch sets the optional parameter which makes the operation 7375// fail if the object's ETag matches the given value. This is useful for 7376// getting updates only after the object has changed since the last 7377// request. Use googleapi.IsNotModified to check whether the response 7378// error from Do is the result of In-None-Match. 7379func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall { 7380 c.ifNoneMatch_ = entityTag 7381 return c 7382} 7383 7384// Context sets the context to be used in this call's Do method. Any 7385// pending HTTP request will be aborted if the provided context is 7386// canceled. 7387func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall { 7388 c.ctx_ = ctx 7389 return c 7390} 7391 7392// Header returns an http.Header that can be modified by the caller to 7393// add HTTP headers to the request. 7394func (c *NotificationsListCall) Header() http.Header { 7395 if c.header_ == nil { 7396 c.header_ = make(http.Header) 7397 } 7398 return c.header_ 7399} 7400 7401func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) { 7402 reqHeaders := make(http.Header) 7403 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7404 for k, v := range c.header_ { 7405 reqHeaders[k] = v 7406 } 7407 reqHeaders.Set("User-Agent", c.s.userAgent()) 7408 if c.ifNoneMatch_ != "" { 7409 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7410 } 7411 var body io.Reader = nil 7412 c.urlParams_.Set("alt", alt) 7413 c.urlParams_.Set("prettyPrint", "false") 7414 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs") 7415 urls += "?" + c.urlParams_.Encode() 7416 req, err := http.NewRequest("GET", urls, body) 7417 if err != nil { 7418 return nil, err 7419 } 7420 req.Header = reqHeaders 7421 googleapi.Expand(req.URL, map[string]string{ 7422 "bucket": c.bucket, 7423 }) 7424 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7425} 7426 7427// Do executes the "storage.notifications.list" call. 7428// Exactly one of *Notifications or error will be non-nil. Any non-2xx 7429// status code is an error. Response headers are in either 7430// *Notifications.ServerResponse.Header or (if a response was returned 7431// at all) in error.(*googleapi.Error).Header. Use 7432// googleapi.IsNotModified to check whether the returned error was 7433// because http.StatusNotModified was returned. 7434func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) { 7435 gensupport.SetOptions(c.urlParams_, opts...) 7436 res, err := c.doRequest("json") 7437 if res != nil && res.StatusCode == http.StatusNotModified { 7438 if res.Body != nil { 7439 res.Body.Close() 7440 } 7441 return nil, &googleapi.Error{ 7442 Code: res.StatusCode, 7443 Header: res.Header, 7444 } 7445 } 7446 if err != nil { 7447 return nil, err 7448 } 7449 defer googleapi.CloseBody(res) 7450 if err := googleapi.CheckResponse(res); err != nil { 7451 return nil, err 7452 } 7453 ret := &Notifications{ 7454 ServerResponse: googleapi.ServerResponse{ 7455 Header: res.Header, 7456 HTTPStatusCode: res.StatusCode, 7457 }, 7458 } 7459 target := &ret 7460 if err := gensupport.DecodeResponse(target, res); err != nil { 7461 return nil, err 7462 } 7463 return ret, nil 7464 // { 7465 // "description": "Retrieves a list of notification subscriptions for a given bucket.", 7466 // "httpMethod": "GET", 7467 // "id": "storage.notifications.list", 7468 // "parameterOrder": [ 7469 // "bucket" 7470 // ], 7471 // "parameters": { 7472 // "bucket": { 7473 // "description": "Name of a Google Cloud Storage bucket.", 7474 // "location": "path", 7475 // "required": true, 7476 // "type": "string" 7477 // }, 7478 // "provisionalUserProject": { 7479 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7480 // "location": "query", 7481 // "type": "string" 7482 // }, 7483 // "userProject": { 7484 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7485 // "location": "query", 7486 // "type": "string" 7487 // } 7488 // }, 7489 // "path": "b/{bucket}/notificationConfigs", 7490 // "response": { 7491 // "$ref": "Notifications" 7492 // }, 7493 // "scopes": [ 7494 // "https://www.googleapis.com/auth/cloud-platform", 7495 // "https://www.googleapis.com/auth/cloud-platform.read-only", 7496 // "https://www.googleapis.com/auth/devstorage.full_control", 7497 // "https://www.googleapis.com/auth/devstorage.read_only", 7498 // "https://www.googleapis.com/auth/devstorage.read_write" 7499 // ] 7500 // } 7501 7502} 7503 7504// method id "storage.objectAccessControls.delete": 7505 7506type ObjectAccessControlsDeleteCall struct { 7507 s *Service 7508 bucket string 7509 object string 7510 entity string 7511 urlParams_ gensupport.URLParams 7512 ctx_ context.Context 7513 header_ http.Header 7514} 7515 7516// Delete: Permanently deletes the ACL entry for the specified entity on 7517// the specified object. 7518// 7519// - bucket: Name of a bucket. 7520// - entity: The entity holding the permission. Can be user-userId, 7521// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 7522// allAuthenticatedUsers. 7523// - object: Name of the object. For information about how to URL encode 7524// object names to be path safe, see Encoding URI Path Parts. 7525func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall { 7526 c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7527 c.bucket = bucket 7528 c.object = object 7529 c.entity = entity 7530 return c 7531} 7532 7533// Generation sets the optional parameter "generation": If present, 7534// selects a specific revision of this object (as opposed to the latest 7535// version, the default). 7536func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall { 7537 c.urlParams_.Set("generation", fmt.Sprint(generation)) 7538 return c 7539} 7540 7541// ProvisionalUserProject sets the optional parameter 7542// "provisionalUserProject": The project to be billed for this request 7543// if the target bucket is requester-pays bucket. 7544func (c *ObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsDeleteCall { 7545 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7546 return c 7547} 7548 7549// UserProject sets the optional parameter "userProject": The project to 7550// be billed for this request. Required for Requester Pays buckets. 7551func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall { 7552 c.urlParams_.Set("userProject", userProject) 7553 return c 7554} 7555 7556// Fields allows partial responses to be retrieved. See 7557// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7558// for more information. 7559func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall { 7560 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7561 return c 7562} 7563 7564// Context sets the context to be used in this call's Do method. Any 7565// pending HTTP request will be aborted if the provided context is 7566// canceled. 7567func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall { 7568 c.ctx_ = ctx 7569 return c 7570} 7571 7572// Header returns an http.Header that can be modified by the caller to 7573// add HTTP headers to the request. 7574func (c *ObjectAccessControlsDeleteCall) Header() http.Header { 7575 if c.header_ == nil { 7576 c.header_ = make(http.Header) 7577 } 7578 return c.header_ 7579} 7580 7581func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { 7582 reqHeaders := make(http.Header) 7583 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7584 for k, v := range c.header_ { 7585 reqHeaders[k] = v 7586 } 7587 reqHeaders.Set("User-Agent", c.s.userAgent()) 7588 var body io.Reader = nil 7589 c.urlParams_.Set("alt", alt) 7590 c.urlParams_.Set("prettyPrint", "false") 7591 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 7592 urls += "?" + c.urlParams_.Encode() 7593 req, err := http.NewRequest("DELETE", urls, body) 7594 if err != nil { 7595 return nil, err 7596 } 7597 req.Header = reqHeaders 7598 googleapi.Expand(req.URL, map[string]string{ 7599 "bucket": c.bucket, 7600 "object": c.object, 7601 "entity": c.entity, 7602 }) 7603 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7604} 7605 7606// Do executes the "storage.objectAccessControls.delete" call. 7607func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { 7608 gensupport.SetOptions(c.urlParams_, opts...) 7609 res, err := c.doRequest("json") 7610 if err != nil { 7611 return err 7612 } 7613 defer googleapi.CloseBody(res) 7614 if err := googleapi.CheckResponse(res); err != nil { 7615 return err 7616 } 7617 return nil 7618 // { 7619 // "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", 7620 // "httpMethod": "DELETE", 7621 // "id": "storage.objectAccessControls.delete", 7622 // "parameterOrder": [ 7623 // "bucket", 7624 // "object", 7625 // "entity" 7626 // ], 7627 // "parameters": { 7628 // "bucket": { 7629 // "description": "Name of a bucket.", 7630 // "location": "path", 7631 // "required": true, 7632 // "type": "string" 7633 // }, 7634 // "entity": { 7635 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 7636 // "location": "path", 7637 // "required": true, 7638 // "type": "string" 7639 // }, 7640 // "generation": { 7641 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 7642 // "format": "int64", 7643 // "location": "query", 7644 // "type": "string" 7645 // }, 7646 // "object": { 7647 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 7648 // "location": "path", 7649 // "required": true, 7650 // "type": "string" 7651 // }, 7652 // "provisionalUserProject": { 7653 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7654 // "location": "query", 7655 // "type": "string" 7656 // }, 7657 // "userProject": { 7658 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7659 // "location": "query", 7660 // "type": "string" 7661 // } 7662 // }, 7663 // "path": "b/{bucket}/o/{object}/acl/{entity}", 7664 // "scopes": [ 7665 // "https://www.googleapis.com/auth/cloud-platform", 7666 // "https://www.googleapis.com/auth/devstorage.full_control" 7667 // ] 7668 // } 7669 7670} 7671 7672// method id "storage.objectAccessControls.get": 7673 7674type ObjectAccessControlsGetCall struct { 7675 s *Service 7676 bucket string 7677 object string 7678 entity string 7679 urlParams_ gensupport.URLParams 7680 ifNoneMatch_ string 7681 ctx_ context.Context 7682 header_ http.Header 7683} 7684 7685// Get: Returns the ACL entry for the specified entity on the specified 7686// object. 7687// 7688// - bucket: Name of a bucket. 7689// - entity: The entity holding the permission. Can be user-userId, 7690// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 7691// allAuthenticatedUsers. 7692// - object: Name of the object. For information about how to URL encode 7693// object names to be path safe, see Encoding URI Path Parts. 7694func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall { 7695 c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7696 c.bucket = bucket 7697 c.object = object 7698 c.entity = entity 7699 return c 7700} 7701 7702// Generation sets the optional parameter "generation": If present, 7703// selects a specific revision of this object (as opposed to the latest 7704// version, the default). 7705func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall { 7706 c.urlParams_.Set("generation", fmt.Sprint(generation)) 7707 return c 7708} 7709 7710// ProvisionalUserProject sets the optional parameter 7711// "provisionalUserProject": The project to be billed for this request 7712// if the target bucket is requester-pays bucket. 7713func (c *ObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsGetCall { 7714 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7715 return c 7716} 7717 7718// UserProject sets the optional parameter "userProject": The project to 7719// be billed for this request. Required for Requester Pays buckets. 7720func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall { 7721 c.urlParams_.Set("userProject", userProject) 7722 return c 7723} 7724 7725// Fields allows partial responses to be retrieved. See 7726// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7727// for more information. 7728func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall { 7729 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7730 return c 7731} 7732 7733// IfNoneMatch sets the optional parameter which makes the operation 7734// fail if the object's ETag matches the given value. This is useful for 7735// getting updates only after the object has changed since the last 7736// request. Use googleapi.IsNotModified to check whether the response 7737// error from Do is the result of In-None-Match. 7738func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall { 7739 c.ifNoneMatch_ = entityTag 7740 return c 7741} 7742 7743// Context sets the context to be used in this call's Do method. Any 7744// pending HTTP request will be aborted if the provided context is 7745// canceled. 7746func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall { 7747 c.ctx_ = ctx 7748 return c 7749} 7750 7751// Header returns an http.Header that can be modified by the caller to 7752// add HTTP headers to the request. 7753func (c *ObjectAccessControlsGetCall) Header() http.Header { 7754 if c.header_ == nil { 7755 c.header_ = make(http.Header) 7756 } 7757 return c.header_ 7758} 7759 7760func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { 7761 reqHeaders := make(http.Header) 7762 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7763 for k, v := range c.header_ { 7764 reqHeaders[k] = v 7765 } 7766 reqHeaders.Set("User-Agent", c.s.userAgent()) 7767 if c.ifNoneMatch_ != "" { 7768 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7769 } 7770 var body io.Reader = nil 7771 c.urlParams_.Set("alt", alt) 7772 c.urlParams_.Set("prettyPrint", "false") 7773 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 7774 urls += "?" + c.urlParams_.Encode() 7775 req, err := http.NewRequest("GET", urls, body) 7776 if err != nil { 7777 return nil, err 7778 } 7779 req.Header = reqHeaders 7780 googleapi.Expand(req.URL, map[string]string{ 7781 "bucket": c.bucket, 7782 "object": c.object, 7783 "entity": c.entity, 7784 }) 7785 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7786} 7787 7788// Do executes the "storage.objectAccessControls.get" call. 7789// Exactly one of *ObjectAccessControl or error will be non-nil. Any 7790// non-2xx status code is an error. Response headers are in either 7791// *ObjectAccessControl.ServerResponse.Header or (if a response was 7792// returned at all) in error.(*googleapi.Error).Header. Use 7793// googleapi.IsNotModified to check whether the returned error was 7794// because http.StatusNotModified was returned. 7795func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 7796 gensupport.SetOptions(c.urlParams_, opts...) 7797 res, err := c.doRequest("json") 7798 if res != nil && res.StatusCode == http.StatusNotModified { 7799 if res.Body != nil { 7800 res.Body.Close() 7801 } 7802 return nil, &googleapi.Error{ 7803 Code: res.StatusCode, 7804 Header: res.Header, 7805 } 7806 } 7807 if err != nil { 7808 return nil, err 7809 } 7810 defer googleapi.CloseBody(res) 7811 if err := googleapi.CheckResponse(res); err != nil { 7812 return nil, err 7813 } 7814 ret := &ObjectAccessControl{ 7815 ServerResponse: googleapi.ServerResponse{ 7816 Header: res.Header, 7817 HTTPStatusCode: res.StatusCode, 7818 }, 7819 } 7820 target := &ret 7821 if err := gensupport.DecodeResponse(target, res); err != nil { 7822 return nil, err 7823 } 7824 return ret, nil 7825 // { 7826 // "description": "Returns the ACL entry for the specified entity on the specified object.", 7827 // "httpMethod": "GET", 7828 // "id": "storage.objectAccessControls.get", 7829 // "parameterOrder": [ 7830 // "bucket", 7831 // "object", 7832 // "entity" 7833 // ], 7834 // "parameters": { 7835 // "bucket": { 7836 // "description": "Name of a bucket.", 7837 // "location": "path", 7838 // "required": true, 7839 // "type": "string" 7840 // }, 7841 // "entity": { 7842 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 7843 // "location": "path", 7844 // "required": true, 7845 // "type": "string" 7846 // }, 7847 // "generation": { 7848 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 7849 // "format": "int64", 7850 // "location": "query", 7851 // "type": "string" 7852 // }, 7853 // "object": { 7854 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 7855 // "location": "path", 7856 // "required": true, 7857 // "type": "string" 7858 // }, 7859 // "provisionalUserProject": { 7860 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 7861 // "location": "query", 7862 // "type": "string" 7863 // }, 7864 // "userProject": { 7865 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 7866 // "location": "query", 7867 // "type": "string" 7868 // } 7869 // }, 7870 // "path": "b/{bucket}/o/{object}/acl/{entity}", 7871 // "response": { 7872 // "$ref": "ObjectAccessControl" 7873 // }, 7874 // "scopes": [ 7875 // "https://www.googleapis.com/auth/cloud-platform", 7876 // "https://www.googleapis.com/auth/devstorage.full_control" 7877 // ] 7878 // } 7879 7880} 7881 7882// method id "storage.objectAccessControls.insert": 7883 7884type ObjectAccessControlsInsertCall struct { 7885 s *Service 7886 bucket string 7887 object string 7888 objectaccesscontrol *ObjectAccessControl 7889 urlParams_ gensupport.URLParams 7890 ctx_ context.Context 7891 header_ http.Header 7892} 7893 7894// Insert: Creates a new ACL entry on the specified object. 7895// 7896// - bucket: Name of a bucket. 7897// - object: Name of the object. For information about how to URL encode 7898// object names to be path safe, see Encoding URI Path Parts. 7899func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall { 7900 c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7901 c.bucket = bucket 7902 c.object = object 7903 c.objectaccesscontrol = objectaccesscontrol 7904 return c 7905} 7906 7907// Generation sets the optional parameter "generation": If present, 7908// selects a specific revision of this object (as opposed to the latest 7909// version, the default). 7910func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall { 7911 c.urlParams_.Set("generation", fmt.Sprint(generation)) 7912 return c 7913} 7914 7915// ProvisionalUserProject sets the optional parameter 7916// "provisionalUserProject": The project to be billed for this request 7917// if the target bucket is requester-pays bucket. 7918func (c *ObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsInsertCall { 7919 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 7920 return c 7921} 7922 7923// UserProject sets the optional parameter "userProject": The project to 7924// be billed for this request. Required for Requester Pays buckets. 7925func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall { 7926 c.urlParams_.Set("userProject", userProject) 7927 return c 7928} 7929 7930// Fields allows partial responses to be retrieved. See 7931// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7932// for more information. 7933func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall { 7934 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7935 return c 7936} 7937 7938// Context sets the context to be used in this call's Do method. Any 7939// pending HTTP request will be aborted if the provided context is 7940// canceled. 7941func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall { 7942 c.ctx_ = ctx 7943 return c 7944} 7945 7946// Header returns an http.Header that can be modified by the caller to 7947// add HTTP headers to the request. 7948func (c *ObjectAccessControlsInsertCall) Header() http.Header { 7949 if c.header_ == nil { 7950 c.header_ = make(http.Header) 7951 } 7952 return c.header_ 7953} 7954 7955func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { 7956 reqHeaders := make(http.Header) 7957 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7958 for k, v := range c.header_ { 7959 reqHeaders[k] = v 7960 } 7961 reqHeaders.Set("User-Agent", c.s.userAgent()) 7962 var body io.Reader = nil 7963 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 7964 if err != nil { 7965 return nil, err 7966 } 7967 reqHeaders.Set("Content-Type", "application/json") 7968 c.urlParams_.Set("alt", alt) 7969 c.urlParams_.Set("prettyPrint", "false") 7970 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") 7971 urls += "?" + c.urlParams_.Encode() 7972 req, err := http.NewRequest("POST", urls, body) 7973 if err != nil { 7974 return nil, err 7975 } 7976 req.Header = reqHeaders 7977 googleapi.Expand(req.URL, map[string]string{ 7978 "bucket": c.bucket, 7979 "object": c.object, 7980 }) 7981 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7982} 7983 7984// Do executes the "storage.objectAccessControls.insert" call. 7985// Exactly one of *ObjectAccessControl or error will be non-nil. Any 7986// non-2xx status code is an error. Response headers are in either 7987// *ObjectAccessControl.ServerResponse.Header or (if a response was 7988// returned at all) in error.(*googleapi.Error).Header. Use 7989// googleapi.IsNotModified to check whether the returned error was 7990// because http.StatusNotModified was returned. 7991func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 7992 gensupport.SetOptions(c.urlParams_, opts...) 7993 res, err := c.doRequest("json") 7994 if res != nil && res.StatusCode == http.StatusNotModified { 7995 if res.Body != nil { 7996 res.Body.Close() 7997 } 7998 return nil, &googleapi.Error{ 7999 Code: res.StatusCode, 8000 Header: res.Header, 8001 } 8002 } 8003 if err != nil { 8004 return nil, err 8005 } 8006 defer googleapi.CloseBody(res) 8007 if err := googleapi.CheckResponse(res); err != nil { 8008 return nil, err 8009 } 8010 ret := &ObjectAccessControl{ 8011 ServerResponse: googleapi.ServerResponse{ 8012 Header: res.Header, 8013 HTTPStatusCode: res.StatusCode, 8014 }, 8015 } 8016 target := &ret 8017 if err := gensupport.DecodeResponse(target, res); err != nil { 8018 return nil, err 8019 } 8020 return ret, nil 8021 // { 8022 // "description": "Creates a new ACL entry on the specified object.", 8023 // "httpMethod": "POST", 8024 // "id": "storage.objectAccessControls.insert", 8025 // "parameterOrder": [ 8026 // "bucket", 8027 // "object" 8028 // ], 8029 // "parameters": { 8030 // "bucket": { 8031 // "description": "Name of a bucket.", 8032 // "location": "path", 8033 // "required": true, 8034 // "type": "string" 8035 // }, 8036 // "generation": { 8037 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 8038 // "format": "int64", 8039 // "location": "query", 8040 // "type": "string" 8041 // }, 8042 // "object": { 8043 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8044 // "location": "path", 8045 // "required": true, 8046 // "type": "string" 8047 // }, 8048 // "provisionalUserProject": { 8049 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8050 // "location": "query", 8051 // "type": "string" 8052 // }, 8053 // "userProject": { 8054 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8055 // "location": "query", 8056 // "type": "string" 8057 // } 8058 // }, 8059 // "path": "b/{bucket}/o/{object}/acl", 8060 // "request": { 8061 // "$ref": "ObjectAccessControl" 8062 // }, 8063 // "response": { 8064 // "$ref": "ObjectAccessControl" 8065 // }, 8066 // "scopes": [ 8067 // "https://www.googleapis.com/auth/cloud-platform", 8068 // "https://www.googleapis.com/auth/devstorage.full_control" 8069 // ] 8070 // } 8071 8072} 8073 8074// method id "storage.objectAccessControls.list": 8075 8076type ObjectAccessControlsListCall struct { 8077 s *Service 8078 bucket string 8079 object string 8080 urlParams_ gensupport.URLParams 8081 ifNoneMatch_ string 8082 ctx_ context.Context 8083 header_ http.Header 8084} 8085 8086// List: Retrieves ACL entries on the specified object. 8087// 8088// - bucket: Name of a bucket. 8089// - object: Name of the object. For information about how to URL encode 8090// object names to be path safe, see Encoding URI Path Parts. 8091func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall { 8092 c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8093 c.bucket = bucket 8094 c.object = object 8095 return c 8096} 8097 8098// Generation sets the optional parameter "generation": If present, 8099// selects a specific revision of this object (as opposed to the latest 8100// version, the default). 8101func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall { 8102 c.urlParams_.Set("generation", fmt.Sprint(generation)) 8103 return c 8104} 8105 8106// ProvisionalUserProject sets the optional parameter 8107// "provisionalUserProject": The project to be billed for this request 8108// if the target bucket is requester-pays bucket. 8109func (c *ObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsListCall { 8110 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8111 return c 8112} 8113 8114// UserProject sets the optional parameter "userProject": The project to 8115// be billed for this request. Required for Requester Pays buckets. 8116func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall { 8117 c.urlParams_.Set("userProject", userProject) 8118 return c 8119} 8120 8121// Fields allows partial responses to be retrieved. See 8122// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8123// for more information. 8124func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall { 8125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8126 return c 8127} 8128 8129// IfNoneMatch sets the optional parameter which makes the operation 8130// fail if the object's ETag matches the given value. This is useful for 8131// getting updates only after the object has changed since the last 8132// request. Use googleapi.IsNotModified to check whether the response 8133// error from Do is the result of In-None-Match. 8134func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall { 8135 c.ifNoneMatch_ = entityTag 8136 return c 8137} 8138 8139// Context sets the context to be used in this call's Do method. Any 8140// pending HTTP request will be aborted if the provided context is 8141// canceled. 8142func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall { 8143 c.ctx_ = ctx 8144 return c 8145} 8146 8147// Header returns an http.Header that can be modified by the caller to 8148// add HTTP headers to the request. 8149func (c *ObjectAccessControlsListCall) Header() http.Header { 8150 if c.header_ == nil { 8151 c.header_ = make(http.Header) 8152 } 8153 return c.header_ 8154} 8155 8156func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { 8157 reqHeaders := make(http.Header) 8158 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8159 for k, v := range c.header_ { 8160 reqHeaders[k] = v 8161 } 8162 reqHeaders.Set("User-Agent", c.s.userAgent()) 8163 if c.ifNoneMatch_ != "" { 8164 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8165 } 8166 var body io.Reader = nil 8167 c.urlParams_.Set("alt", alt) 8168 c.urlParams_.Set("prettyPrint", "false") 8169 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl") 8170 urls += "?" + c.urlParams_.Encode() 8171 req, err := http.NewRequest("GET", urls, body) 8172 if err != nil { 8173 return nil, err 8174 } 8175 req.Header = reqHeaders 8176 googleapi.Expand(req.URL, map[string]string{ 8177 "bucket": c.bucket, 8178 "object": c.object, 8179 }) 8180 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8181} 8182 8183// Do executes the "storage.objectAccessControls.list" call. 8184// Exactly one of *ObjectAccessControls or error will be non-nil. Any 8185// non-2xx status code is an error. Response headers are in either 8186// *ObjectAccessControls.ServerResponse.Header or (if a response was 8187// returned at all) in error.(*googleapi.Error).Header. Use 8188// googleapi.IsNotModified to check whether the returned error was 8189// because http.StatusNotModified was returned. 8190func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) { 8191 gensupport.SetOptions(c.urlParams_, opts...) 8192 res, err := c.doRequest("json") 8193 if res != nil && res.StatusCode == http.StatusNotModified { 8194 if res.Body != nil { 8195 res.Body.Close() 8196 } 8197 return nil, &googleapi.Error{ 8198 Code: res.StatusCode, 8199 Header: res.Header, 8200 } 8201 } 8202 if err != nil { 8203 return nil, err 8204 } 8205 defer googleapi.CloseBody(res) 8206 if err := googleapi.CheckResponse(res); err != nil { 8207 return nil, err 8208 } 8209 ret := &ObjectAccessControls{ 8210 ServerResponse: googleapi.ServerResponse{ 8211 Header: res.Header, 8212 HTTPStatusCode: res.StatusCode, 8213 }, 8214 } 8215 target := &ret 8216 if err := gensupport.DecodeResponse(target, res); err != nil { 8217 return nil, err 8218 } 8219 return ret, nil 8220 // { 8221 // "description": "Retrieves ACL entries on the specified object.", 8222 // "httpMethod": "GET", 8223 // "id": "storage.objectAccessControls.list", 8224 // "parameterOrder": [ 8225 // "bucket", 8226 // "object" 8227 // ], 8228 // "parameters": { 8229 // "bucket": { 8230 // "description": "Name of a bucket.", 8231 // "location": "path", 8232 // "required": true, 8233 // "type": "string" 8234 // }, 8235 // "generation": { 8236 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 8237 // "format": "int64", 8238 // "location": "query", 8239 // "type": "string" 8240 // }, 8241 // "object": { 8242 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8243 // "location": "path", 8244 // "required": true, 8245 // "type": "string" 8246 // }, 8247 // "provisionalUserProject": { 8248 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8249 // "location": "query", 8250 // "type": "string" 8251 // }, 8252 // "userProject": { 8253 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8254 // "location": "query", 8255 // "type": "string" 8256 // } 8257 // }, 8258 // "path": "b/{bucket}/o/{object}/acl", 8259 // "response": { 8260 // "$ref": "ObjectAccessControls" 8261 // }, 8262 // "scopes": [ 8263 // "https://www.googleapis.com/auth/cloud-platform", 8264 // "https://www.googleapis.com/auth/devstorage.full_control" 8265 // ] 8266 // } 8267 8268} 8269 8270// method id "storage.objectAccessControls.patch": 8271 8272type ObjectAccessControlsPatchCall struct { 8273 s *Service 8274 bucket string 8275 object string 8276 entity string 8277 objectaccesscontrol *ObjectAccessControl 8278 urlParams_ gensupport.URLParams 8279 ctx_ context.Context 8280 header_ http.Header 8281} 8282 8283// Patch: Patches an ACL entry on the specified object. 8284// 8285// - bucket: Name of a bucket. 8286// - entity: The entity holding the permission. Can be user-userId, 8287// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 8288// allAuthenticatedUsers. 8289// - object: Name of the object. For information about how to URL encode 8290// object names to be path safe, see Encoding URI Path Parts. 8291func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall { 8292 c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8293 c.bucket = bucket 8294 c.object = object 8295 c.entity = entity 8296 c.objectaccesscontrol = objectaccesscontrol 8297 return c 8298} 8299 8300// Generation sets the optional parameter "generation": If present, 8301// selects a specific revision of this object (as opposed to the latest 8302// version, the default). 8303func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall { 8304 c.urlParams_.Set("generation", fmt.Sprint(generation)) 8305 return c 8306} 8307 8308// ProvisionalUserProject sets the optional parameter 8309// "provisionalUserProject": The project to be billed for this request 8310// if the target bucket is requester-pays bucket. 8311func (c *ObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsPatchCall { 8312 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8313 return c 8314} 8315 8316// UserProject sets the optional parameter "userProject": The project to 8317// be billed for this request. Required for Requester Pays buckets. 8318func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall { 8319 c.urlParams_.Set("userProject", userProject) 8320 return c 8321} 8322 8323// Fields allows partial responses to be retrieved. See 8324// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8325// for more information. 8326func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall { 8327 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8328 return c 8329} 8330 8331// Context sets the context to be used in this call's Do method. Any 8332// pending HTTP request will be aborted if the provided context is 8333// canceled. 8334func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall { 8335 c.ctx_ = ctx 8336 return c 8337} 8338 8339// Header returns an http.Header that can be modified by the caller to 8340// add HTTP headers to the request. 8341func (c *ObjectAccessControlsPatchCall) Header() http.Header { 8342 if c.header_ == nil { 8343 c.header_ = make(http.Header) 8344 } 8345 return c.header_ 8346} 8347 8348func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { 8349 reqHeaders := make(http.Header) 8350 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8351 for k, v := range c.header_ { 8352 reqHeaders[k] = v 8353 } 8354 reqHeaders.Set("User-Agent", c.s.userAgent()) 8355 var body io.Reader = nil 8356 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 8357 if err != nil { 8358 return nil, err 8359 } 8360 reqHeaders.Set("Content-Type", "application/json") 8361 c.urlParams_.Set("alt", alt) 8362 c.urlParams_.Set("prettyPrint", "false") 8363 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 8364 urls += "?" + c.urlParams_.Encode() 8365 req, err := http.NewRequest("PATCH", urls, body) 8366 if err != nil { 8367 return nil, err 8368 } 8369 req.Header = reqHeaders 8370 googleapi.Expand(req.URL, map[string]string{ 8371 "bucket": c.bucket, 8372 "object": c.object, 8373 "entity": c.entity, 8374 }) 8375 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8376} 8377 8378// Do executes the "storage.objectAccessControls.patch" call. 8379// Exactly one of *ObjectAccessControl or error will be non-nil. Any 8380// non-2xx status code is an error. Response headers are in either 8381// *ObjectAccessControl.ServerResponse.Header or (if a response was 8382// returned at all) in error.(*googleapi.Error).Header. Use 8383// googleapi.IsNotModified to check whether the returned error was 8384// because http.StatusNotModified was returned. 8385func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 8386 gensupport.SetOptions(c.urlParams_, opts...) 8387 res, err := c.doRequest("json") 8388 if res != nil && res.StatusCode == http.StatusNotModified { 8389 if res.Body != nil { 8390 res.Body.Close() 8391 } 8392 return nil, &googleapi.Error{ 8393 Code: res.StatusCode, 8394 Header: res.Header, 8395 } 8396 } 8397 if err != nil { 8398 return nil, err 8399 } 8400 defer googleapi.CloseBody(res) 8401 if err := googleapi.CheckResponse(res); err != nil { 8402 return nil, err 8403 } 8404 ret := &ObjectAccessControl{ 8405 ServerResponse: googleapi.ServerResponse{ 8406 Header: res.Header, 8407 HTTPStatusCode: res.StatusCode, 8408 }, 8409 } 8410 target := &ret 8411 if err := gensupport.DecodeResponse(target, res); err != nil { 8412 return nil, err 8413 } 8414 return ret, nil 8415 // { 8416 // "description": "Patches an ACL entry on the specified object.", 8417 // "httpMethod": "PATCH", 8418 // "id": "storage.objectAccessControls.patch", 8419 // "parameterOrder": [ 8420 // "bucket", 8421 // "object", 8422 // "entity" 8423 // ], 8424 // "parameters": { 8425 // "bucket": { 8426 // "description": "Name of a bucket.", 8427 // "location": "path", 8428 // "required": true, 8429 // "type": "string" 8430 // }, 8431 // "entity": { 8432 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 8433 // "location": "path", 8434 // "required": true, 8435 // "type": "string" 8436 // }, 8437 // "generation": { 8438 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 8439 // "format": "int64", 8440 // "location": "query", 8441 // "type": "string" 8442 // }, 8443 // "object": { 8444 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8445 // "location": "path", 8446 // "required": true, 8447 // "type": "string" 8448 // }, 8449 // "provisionalUserProject": { 8450 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8451 // "location": "query", 8452 // "type": "string" 8453 // }, 8454 // "userProject": { 8455 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8456 // "location": "query", 8457 // "type": "string" 8458 // } 8459 // }, 8460 // "path": "b/{bucket}/o/{object}/acl/{entity}", 8461 // "request": { 8462 // "$ref": "ObjectAccessControl" 8463 // }, 8464 // "response": { 8465 // "$ref": "ObjectAccessControl" 8466 // }, 8467 // "scopes": [ 8468 // "https://www.googleapis.com/auth/cloud-platform", 8469 // "https://www.googleapis.com/auth/devstorage.full_control" 8470 // ] 8471 // } 8472 8473} 8474 8475// method id "storage.objectAccessControls.update": 8476 8477type ObjectAccessControlsUpdateCall struct { 8478 s *Service 8479 bucket string 8480 object string 8481 entity string 8482 objectaccesscontrol *ObjectAccessControl 8483 urlParams_ gensupport.URLParams 8484 ctx_ context.Context 8485 header_ http.Header 8486} 8487 8488// Update: Updates an ACL entry on the specified object. 8489// 8490// - bucket: Name of a bucket. 8491// - entity: The entity holding the permission. Can be user-userId, 8492// user-emailAddress, group-groupId, group-emailAddress, allUsers, or 8493// allAuthenticatedUsers. 8494// - object: Name of the object. For information about how to URL encode 8495// object names to be path safe, see Encoding URI Path Parts. 8496func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall { 8497 c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8498 c.bucket = bucket 8499 c.object = object 8500 c.entity = entity 8501 c.objectaccesscontrol = objectaccesscontrol 8502 return c 8503} 8504 8505// Generation sets the optional parameter "generation": If present, 8506// selects a specific revision of this object (as opposed to the latest 8507// version, the default). 8508func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall { 8509 c.urlParams_.Set("generation", fmt.Sprint(generation)) 8510 return c 8511} 8512 8513// ProvisionalUserProject sets the optional parameter 8514// "provisionalUserProject": The project to be billed for this request 8515// if the target bucket is requester-pays bucket. 8516func (c *ObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsUpdateCall { 8517 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8518 return c 8519} 8520 8521// UserProject sets the optional parameter "userProject": The project to 8522// be billed for this request. Required for Requester Pays buckets. 8523func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall { 8524 c.urlParams_.Set("userProject", userProject) 8525 return c 8526} 8527 8528// Fields allows partial responses to be retrieved. See 8529// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8530// for more information. 8531func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall { 8532 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8533 return c 8534} 8535 8536// Context sets the context to be used in this call's Do method. Any 8537// pending HTTP request will be aborted if the provided context is 8538// canceled. 8539func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall { 8540 c.ctx_ = ctx 8541 return c 8542} 8543 8544// Header returns an http.Header that can be modified by the caller to 8545// add HTTP headers to the request. 8546func (c *ObjectAccessControlsUpdateCall) Header() http.Header { 8547 if c.header_ == nil { 8548 c.header_ = make(http.Header) 8549 } 8550 return c.header_ 8551} 8552 8553func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { 8554 reqHeaders := make(http.Header) 8555 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8556 for k, v := range c.header_ { 8557 reqHeaders[k] = v 8558 } 8559 reqHeaders.Set("User-Agent", c.s.userAgent()) 8560 var body io.Reader = nil 8561 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) 8562 if err != nil { 8563 return nil, err 8564 } 8565 reqHeaders.Set("Content-Type", "application/json") 8566 c.urlParams_.Set("alt", alt) 8567 c.urlParams_.Set("prettyPrint", "false") 8568 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") 8569 urls += "?" + c.urlParams_.Encode() 8570 req, err := http.NewRequest("PUT", urls, body) 8571 if err != nil { 8572 return nil, err 8573 } 8574 req.Header = reqHeaders 8575 googleapi.Expand(req.URL, map[string]string{ 8576 "bucket": c.bucket, 8577 "object": c.object, 8578 "entity": c.entity, 8579 }) 8580 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8581} 8582 8583// Do executes the "storage.objectAccessControls.update" call. 8584// Exactly one of *ObjectAccessControl or error will be non-nil. Any 8585// non-2xx status code is an error. Response headers are in either 8586// *ObjectAccessControl.ServerResponse.Header or (if a response was 8587// returned at all) in error.(*googleapi.Error).Header. Use 8588// googleapi.IsNotModified to check whether the returned error was 8589// because http.StatusNotModified was returned. 8590func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { 8591 gensupport.SetOptions(c.urlParams_, opts...) 8592 res, err := c.doRequest("json") 8593 if res != nil && res.StatusCode == http.StatusNotModified { 8594 if res.Body != nil { 8595 res.Body.Close() 8596 } 8597 return nil, &googleapi.Error{ 8598 Code: res.StatusCode, 8599 Header: res.Header, 8600 } 8601 } 8602 if err != nil { 8603 return nil, err 8604 } 8605 defer googleapi.CloseBody(res) 8606 if err := googleapi.CheckResponse(res); err != nil { 8607 return nil, err 8608 } 8609 ret := &ObjectAccessControl{ 8610 ServerResponse: googleapi.ServerResponse{ 8611 Header: res.Header, 8612 HTTPStatusCode: res.StatusCode, 8613 }, 8614 } 8615 target := &ret 8616 if err := gensupport.DecodeResponse(target, res); err != nil { 8617 return nil, err 8618 } 8619 return ret, nil 8620 // { 8621 // "description": "Updates an ACL entry on the specified object.", 8622 // "httpMethod": "PUT", 8623 // "id": "storage.objectAccessControls.update", 8624 // "parameterOrder": [ 8625 // "bucket", 8626 // "object", 8627 // "entity" 8628 // ], 8629 // "parameters": { 8630 // "bucket": { 8631 // "description": "Name of a bucket.", 8632 // "location": "path", 8633 // "required": true, 8634 // "type": "string" 8635 // }, 8636 // "entity": { 8637 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", 8638 // "location": "path", 8639 // "required": true, 8640 // "type": "string" 8641 // }, 8642 // "generation": { 8643 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 8644 // "format": "int64", 8645 // "location": "query", 8646 // "type": "string" 8647 // }, 8648 // "object": { 8649 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8650 // "location": "path", 8651 // "required": true, 8652 // "type": "string" 8653 // }, 8654 // "provisionalUserProject": { 8655 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8656 // "location": "query", 8657 // "type": "string" 8658 // }, 8659 // "userProject": { 8660 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8661 // "location": "query", 8662 // "type": "string" 8663 // } 8664 // }, 8665 // "path": "b/{bucket}/o/{object}/acl/{entity}", 8666 // "request": { 8667 // "$ref": "ObjectAccessControl" 8668 // }, 8669 // "response": { 8670 // "$ref": "ObjectAccessControl" 8671 // }, 8672 // "scopes": [ 8673 // "https://www.googleapis.com/auth/cloud-platform", 8674 // "https://www.googleapis.com/auth/devstorage.full_control" 8675 // ] 8676 // } 8677 8678} 8679 8680// method id "storage.objects.compose": 8681 8682type ObjectsComposeCall struct { 8683 s *Service 8684 destinationBucket string 8685 destinationObject string 8686 composerequest *ComposeRequest 8687 urlParams_ gensupport.URLParams 8688 ctx_ context.Context 8689 header_ http.Header 8690} 8691 8692// Compose: Concatenates a list of existing objects into a new object in 8693// the same bucket. 8694// 8695// - destinationBucket: Name of the bucket containing the source 8696// objects. The destination object is stored in this bucket. 8697// - destinationObject: Name of the new object. For information about 8698// how to URL encode object names to be path safe, see Encoding URI 8699// Path Parts. 8700func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall { 8701 c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8702 c.destinationBucket = destinationBucket 8703 c.destinationObject = destinationObject 8704 c.composerequest = composerequest 8705 return c 8706} 8707 8708// DestinationPredefinedAcl sets the optional parameter 8709// "destinationPredefinedAcl": Apply a predefined set of access controls 8710// to the destination object. 8711// 8712// Possible values: 8713// "authenticatedRead" - Object owner gets OWNER access, and 8714// allAuthenticatedUsers get READER access. 8715// "bucketOwnerFullControl" - Object owner gets OWNER access, and 8716// project team owners get OWNER access. 8717// "bucketOwnerRead" - Object owner gets OWNER access, and project 8718// team owners get READER access. 8719// "private" - Object owner gets OWNER access. 8720// "projectPrivate" - Object owner gets OWNER access, and project team 8721// members get access according to their roles. 8722// "publicRead" - Object owner gets OWNER access, and allUsers get 8723// READER access. 8724func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall { 8725 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) 8726 return c 8727} 8728 8729// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 8730// Makes the operation conditional on whether the object's current 8731// generation matches the given value. Setting to 0 makes the operation 8732// succeed only if there are no live versions of the object. 8733func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall { 8734 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 8735 return c 8736} 8737 8738// IfMetagenerationMatch sets the optional parameter 8739// "ifMetagenerationMatch": Makes the operation conditional on whether 8740// the object's current metageneration matches the given value. 8741func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall { 8742 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 8743 return c 8744} 8745 8746// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of 8747// the Cloud KMS key, of the form 8748// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 8749// that will be used to encrypt the object. Overrides the object 8750// metadata's kms_key_name value, if any. 8751func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall { 8752 c.urlParams_.Set("kmsKeyName", kmsKeyName) 8753 return c 8754} 8755 8756// ProvisionalUserProject sets the optional parameter 8757// "provisionalUserProject": The project to be billed for this request 8758// if the target bucket is requester-pays bucket. 8759func (c *ObjectsComposeCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsComposeCall { 8760 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 8761 return c 8762} 8763 8764// UserProject sets the optional parameter "userProject": The project to 8765// be billed for this request. Required for Requester Pays buckets. 8766func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall { 8767 c.urlParams_.Set("userProject", userProject) 8768 return c 8769} 8770 8771// Fields allows partial responses to be retrieved. See 8772// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8773// for more information. 8774func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall { 8775 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8776 return c 8777} 8778 8779// Context sets the context to be used in this call's Do method. Any 8780// pending HTTP request will be aborted if the provided context is 8781// canceled. 8782func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall { 8783 c.ctx_ = ctx 8784 return c 8785} 8786 8787// Header returns an http.Header that can be modified by the caller to 8788// add HTTP headers to the request. 8789func (c *ObjectsComposeCall) Header() http.Header { 8790 if c.header_ == nil { 8791 c.header_ = make(http.Header) 8792 } 8793 return c.header_ 8794} 8795 8796func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { 8797 reqHeaders := make(http.Header) 8798 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8799 for k, v := range c.header_ { 8800 reqHeaders[k] = v 8801 } 8802 reqHeaders.Set("User-Agent", c.s.userAgent()) 8803 var body io.Reader = nil 8804 body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest) 8805 if err != nil { 8806 return nil, err 8807 } 8808 reqHeaders.Set("Content-Type", "application/json") 8809 c.urlParams_.Set("alt", alt) 8810 c.urlParams_.Set("prettyPrint", "false") 8811 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose") 8812 urls += "?" + c.urlParams_.Encode() 8813 req, err := http.NewRequest("POST", urls, body) 8814 if err != nil { 8815 return nil, err 8816 } 8817 req.Header = reqHeaders 8818 googleapi.Expand(req.URL, map[string]string{ 8819 "destinationBucket": c.destinationBucket, 8820 "destinationObject": c.destinationObject, 8821 }) 8822 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8823} 8824 8825// Do executes the "storage.objects.compose" call. 8826// Exactly one of *Object or error will be non-nil. Any non-2xx status 8827// code is an error. Response headers are in either 8828// *Object.ServerResponse.Header or (if a response was returned at all) 8829// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8830// check whether the returned error was because http.StatusNotModified 8831// was returned. 8832func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) { 8833 gensupport.SetOptions(c.urlParams_, opts...) 8834 res, err := c.doRequest("json") 8835 if res != nil && res.StatusCode == http.StatusNotModified { 8836 if res.Body != nil { 8837 res.Body.Close() 8838 } 8839 return nil, &googleapi.Error{ 8840 Code: res.StatusCode, 8841 Header: res.Header, 8842 } 8843 } 8844 if err != nil { 8845 return nil, err 8846 } 8847 defer googleapi.CloseBody(res) 8848 if err := googleapi.CheckResponse(res); err != nil { 8849 return nil, err 8850 } 8851 ret := &Object{ 8852 ServerResponse: googleapi.ServerResponse{ 8853 Header: res.Header, 8854 HTTPStatusCode: res.StatusCode, 8855 }, 8856 } 8857 target := &ret 8858 if err := gensupport.DecodeResponse(target, res); err != nil { 8859 return nil, err 8860 } 8861 return ret, nil 8862 // { 8863 // "description": "Concatenates a list of existing objects into a new object in the same bucket.", 8864 // "httpMethod": "POST", 8865 // "id": "storage.objects.compose", 8866 // "parameterOrder": [ 8867 // "destinationBucket", 8868 // "destinationObject" 8869 // ], 8870 // "parameters": { 8871 // "destinationBucket": { 8872 // "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", 8873 // "location": "path", 8874 // "required": true, 8875 // "type": "string" 8876 // }, 8877 // "destinationObject": { 8878 // "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 8879 // "location": "path", 8880 // "required": true, 8881 // "type": "string" 8882 // }, 8883 // "destinationPredefinedAcl": { 8884 // "description": "Apply a predefined set of access controls to the destination object.", 8885 // "enum": [ 8886 // "authenticatedRead", 8887 // "bucketOwnerFullControl", 8888 // "bucketOwnerRead", 8889 // "private", 8890 // "projectPrivate", 8891 // "publicRead" 8892 // ], 8893 // "enumDescriptions": [ 8894 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 8895 // "Object owner gets OWNER access, and project team owners get OWNER access.", 8896 // "Object owner gets OWNER access, and project team owners get READER access.", 8897 // "Object owner gets OWNER access.", 8898 // "Object owner gets OWNER access, and project team members get access according to their roles.", 8899 // "Object owner gets OWNER access, and allUsers get READER access." 8900 // ], 8901 // "location": "query", 8902 // "type": "string" 8903 // }, 8904 // "ifGenerationMatch": { 8905 // "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.", 8906 // "format": "int64", 8907 // "location": "query", 8908 // "type": "string" 8909 // }, 8910 // "ifMetagenerationMatch": { 8911 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 8912 // "format": "int64", 8913 // "location": "query", 8914 // "type": "string" 8915 // }, 8916 // "kmsKeyName": { 8917 // "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.", 8918 // "location": "query", 8919 // "type": "string" 8920 // }, 8921 // "provisionalUserProject": { 8922 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 8923 // "location": "query", 8924 // "type": "string" 8925 // }, 8926 // "userProject": { 8927 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 8928 // "location": "query", 8929 // "type": "string" 8930 // } 8931 // }, 8932 // "path": "b/{destinationBucket}/o/{destinationObject}/compose", 8933 // "request": { 8934 // "$ref": "ComposeRequest" 8935 // }, 8936 // "response": { 8937 // "$ref": "Object" 8938 // }, 8939 // "scopes": [ 8940 // "https://www.googleapis.com/auth/cloud-platform", 8941 // "https://www.googleapis.com/auth/devstorage.full_control", 8942 // "https://www.googleapis.com/auth/devstorage.read_write" 8943 // ] 8944 // } 8945 8946} 8947 8948// method id "storage.objects.copy": 8949 8950type ObjectsCopyCall struct { 8951 s *Service 8952 sourceBucket string 8953 sourceObject string 8954 destinationBucket string 8955 destinationObject string 8956 object *Object 8957 urlParams_ gensupport.URLParams 8958 ctx_ context.Context 8959 header_ http.Header 8960} 8961 8962// Copy: Copies a source object to a destination object. Optionally 8963// overrides metadata. 8964// 8965// - destinationBucket: Name of the bucket in which to store the new 8966// object. Overrides the provided object metadata's bucket value, if 8967// any.For information about how to URL encode object names to be path 8968// safe, see Encoding URI Path Parts. 8969// - destinationObject: Name of the new object. Required when the object 8970// metadata is not otherwise provided. Overrides the object metadata's 8971// name value, if any. 8972// - sourceBucket: Name of the bucket in which to find the source 8973// object. 8974// - sourceObject: Name of the source object. For information about how 8975// to URL encode object names to be path safe, see Encoding URI Path 8976// Parts. 8977func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall { 8978 c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8979 c.sourceBucket = sourceBucket 8980 c.sourceObject = sourceObject 8981 c.destinationBucket = destinationBucket 8982 c.destinationObject = destinationObject 8983 c.object = object 8984 return c 8985} 8986 8987// DestinationKmsKeyName sets the optional parameter 8988// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the 8989// form 8990// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 8991// that will be used to encrypt the object. Overrides the object 8992// metadata's kms_key_name value, if any. 8993func (c *ObjectsCopyCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsCopyCall { 8994 c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName) 8995 return c 8996} 8997 8998// DestinationPredefinedAcl sets the optional parameter 8999// "destinationPredefinedAcl": Apply a predefined set of access controls 9000// to the destination object. 9001// 9002// Possible values: 9003// "authenticatedRead" - Object owner gets OWNER access, and 9004// allAuthenticatedUsers get READER access. 9005// "bucketOwnerFullControl" - Object owner gets OWNER access, and 9006// project team owners get OWNER access. 9007// "bucketOwnerRead" - Object owner gets OWNER access, and project 9008// team owners get READER access. 9009// "private" - Object owner gets OWNER access. 9010// "projectPrivate" - Object owner gets OWNER access, and project team 9011// members get access according to their roles. 9012// "publicRead" - Object owner gets OWNER access, and allUsers get 9013// READER access. 9014func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall { 9015 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) 9016 return c 9017} 9018 9019// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 9020// Makes the operation conditional on whether the destination object's 9021// current generation matches the given value. Setting to 0 makes the 9022// operation succeed only if there are no live versions of the object. 9023func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall { 9024 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 9025 return c 9026} 9027 9028// IfGenerationNotMatch sets the optional parameter 9029// "ifGenerationNotMatch": Makes the operation conditional on whether 9030// the destination object's current generation does not match the given 9031// value. If no live object exists, the precondition fails. Setting to 0 9032// makes the operation succeed only if there is a live version of the 9033// object. 9034func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall { 9035 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 9036 return c 9037} 9038 9039// IfMetagenerationMatch sets the optional parameter 9040// "ifMetagenerationMatch": Makes the operation conditional on whether 9041// the destination object's current metageneration matches the given 9042// value. 9043func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall { 9044 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 9045 return c 9046} 9047 9048// IfMetagenerationNotMatch sets the optional parameter 9049// "ifMetagenerationNotMatch": Makes the operation conditional on 9050// whether the destination object's current metageneration does not 9051// match the given value. 9052func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall { 9053 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 9054 return c 9055} 9056 9057// IfSourceGenerationMatch sets the optional parameter 9058// "ifSourceGenerationMatch": Makes the operation conditional on whether 9059// the source object's current generation matches the given value. 9060func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall { 9061 c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch)) 9062 return c 9063} 9064 9065// IfSourceGenerationNotMatch sets the optional parameter 9066// "ifSourceGenerationNotMatch": Makes the operation conditional on 9067// whether the source object's current generation does not match the 9068// given value. 9069func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall { 9070 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch)) 9071 return c 9072} 9073 9074// IfSourceMetagenerationMatch sets the optional parameter 9075// "ifSourceMetagenerationMatch": Makes the operation conditional on 9076// whether the source object's current metageneration matches the given 9077// value. 9078func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall { 9079 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch)) 9080 return c 9081} 9082 9083// IfSourceMetagenerationNotMatch sets the optional parameter 9084// "ifSourceMetagenerationNotMatch": Makes the operation conditional on 9085// whether the source object's current metageneration does not match the 9086// given value. 9087func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall { 9088 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch)) 9089 return c 9090} 9091 9092// Projection sets the optional parameter "projection": Set of 9093// properties to return. Defaults to noAcl, unless the object resource 9094// specifies the acl property, when it defaults to full. 9095// 9096// Possible values: 9097// "full" - Include all properties. 9098// "noAcl" - Omit the owner, acl property. 9099func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall { 9100 c.urlParams_.Set("projection", projection) 9101 return c 9102} 9103 9104// ProvisionalUserProject sets the optional parameter 9105// "provisionalUserProject": The project to be billed for this request 9106// if the target bucket is requester-pays bucket. 9107func (c *ObjectsCopyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsCopyCall { 9108 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9109 return c 9110} 9111 9112// SourceGeneration sets the optional parameter "sourceGeneration": If 9113// present, selects a specific revision of the source object (as opposed 9114// to the latest version, the default). 9115func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall { 9116 c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration)) 9117 return c 9118} 9119 9120// UserProject sets the optional parameter "userProject": The project to 9121// be billed for this request. Required for Requester Pays buckets. 9122func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall { 9123 c.urlParams_.Set("userProject", userProject) 9124 return c 9125} 9126 9127// Fields allows partial responses to be retrieved. See 9128// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9129// for more information. 9130func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall { 9131 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9132 return c 9133} 9134 9135// Context sets the context to be used in this call's Do method. Any 9136// pending HTTP request will be aborted if the provided context is 9137// canceled. 9138func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall { 9139 c.ctx_ = ctx 9140 return c 9141} 9142 9143// Header returns an http.Header that can be modified by the caller to 9144// add HTTP headers to the request. 9145func (c *ObjectsCopyCall) Header() http.Header { 9146 if c.header_ == nil { 9147 c.header_ = make(http.Header) 9148 } 9149 return c.header_ 9150} 9151 9152func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { 9153 reqHeaders := make(http.Header) 9154 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9155 for k, v := range c.header_ { 9156 reqHeaders[k] = v 9157 } 9158 reqHeaders.Set("User-Agent", c.s.userAgent()) 9159 var body io.Reader = nil 9160 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) 9161 if err != nil { 9162 return nil, err 9163 } 9164 reqHeaders.Set("Content-Type", "application/json") 9165 c.urlParams_.Set("alt", alt) 9166 c.urlParams_.Set("prettyPrint", "false") 9167 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}") 9168 urls += "?" + c.urlParams_.Encode() 9169 req, err := http.NewRequest("POST", urls, body) 9170 if err != nil { 9171 return nil, err 9172 } 9173 req.Header = reqHeaders 9174 googleapi.Expand(req.URL, map[string]string{ 9175 "sourceBucket": c.sourceBucket, 9176 "sourceObject": c.sourceObject, 9177 "destinationBucket": c.destinationBucket, 9178 "destinationObject": c.destinationObject, 9179 }) 9180 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9181} 9182 9183// Do executes the "storage.objects.copy" call. 9184// Exactly one of *Object or error will be non-nil. Any non-2xx status 9185// code is an error. Response headers are in either 9186// *Object.ServerResponse.Header or (if a response was returned at all) 9187// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9188// check whether the returned error was because http.StatusNotModified 9189// was returned. 9190func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) { 9191 gensupport.SetOptions(c.urlParams_, opts...) 9192 res, err := c.doRequest("json") 9193 if res != nil && res.StatusCode == http.StatusNotModified { 9194 if res.Body != nil { 9195 res.Body.Close() 9196 } 9197 return nil, &googleapi.Error{ 9198 Code: res.StatusCode, 9199 Header: res.Header, 9200 } 9201 } 9202 if err != nil { 9203 return nil, err 9204 } 9205 defer googleapi.CloseBody(res) 9206 if err := googleapi.CheckResponse(res); err != nil { 9207 return nil, err 9208 } 9209 ret := &Object{ 9210 ServerResponse: googleapi.ServerResponse{ 9211 Header: res.Header, 9212 HTTPStatusCode: res.StatusCode, 9213 }, 9214 } 9215 target := &ret 9216 if err := gensupport.DecodeResponse(target, res); err != nil { 9217 return nil, err 9218 } 9219 return ret, nil 9220 // { 9221 // "description": "Copies a source object to a destination object. Optionally overrides metadata.", 9222 // "httpMethod": "POST", 9223 // "id": "storage.objects.copy", 9224 // "parameterOrder": [ 9225 // "sourceBucket", 9226 // "sourceObject", 9227 // "destinationBucket", 9228 // "destinationObject" 9229 // ], 9230 // "parameters": { 9231 // "destinationBucket": { 9232 // "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.", 9233 // "location": "path", 9234 // "required": true, 9235 // "type": "string" 9236 // }, 9237 // "destinationKmsKeyName": { 9238 // "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.", 9239 // "location": "query", 9240 // "type": "string" 9241 // }, 9242 // "destinationObject": { 9243 // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", 9244 // "location": "path", 9245 // "required": true, 9246 // "type": "string" 9247 // }, 9248 // "destinationPredefinedAcl": { 9249 // "description": "Apply a predefined set of access controls to the destination object.", 9250 // "enum": [ 9251 // "authenticatedRead", 9252 // "bucketOwnerFullControl", 9253 // "bucketOwnerRead", 9254 // "private", 9255 // "projectPrivate", 9256 // "publicRead" 9257 // ], 9258 // "enumDescriptions": [ 9259 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 9260 // "Object owner gets OWNER access, and project team owners get OWNER access.", 9261 // "Object owner gets OWNER access, and project team owners get READER access.", 9262 // "Object owner gets OWNER access.", 9263 // "Object owner gets OWNER access, and project team members get access according to their roles.", 9264 // "Object owner gets OWNER access, and allUsers get READER access." 9265 // ], 9266 // "location": "query", 9267 // "type": "string" 9268 // }, 9269 // "ifGenerationMatch": { 9270 // "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.", 9271 // "format": "int64", 9272 // "location": "query", 9273 // "type": "string" 9274 // }, 9275 // "ifGenerationNotMatch": { 9276 // "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.", 9277 // "format": "int64", 9278 // "location": "query", 9279 // "type": "string" 9280 // }, 9281 // "ifMetagenerationMatch": { 9282 // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", 9283 // "format": "int64", 9284 // "location": "query", 9285 // "type": "string" 9286 // }, 9287 // "ifMetagenerationNotMatch": { 9288 // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", 9289 // "format": "int64", 9290 // "location": "query", 9291 // "type": "string" 9292 // }, 9293 // "ifSourceGenerationMatch": { 9294 // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", 9295 // "format": "int64", 9296 // "location": "query", 9297 // "type": "string" 9298 // }, 9299 // "ifSourceGenerationNotMatch": { 9300 // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", 9301 // "format": "int64", 9302 // "location": "query", 9303 // "type": "string" 9304 // }, 9305 // "ifSourceMetagenerationMatch": { 9306 // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", 9307 // "format": "int64", 9308 // "location": "query", 9309 // "type": "string" 9310 // }, 9311 // "ifSourceMetagenerationNotMatch": { 9312 // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", 9313 // "format": "int64", 9314 // "location": "query", 9315 // "type": "string" 9316 // }, 9317 // "projection": { 9318 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", 9319 // "enum": [ 9320 // "full", 9321 // "noAcl" 9322 // ], 9323 // "enumDescriptions": [ 9324 // "Include all properties.", 9325 // "Omit the owner, acl property." 9326 // ], 9327 // "location": "query", 9328 // "type": "string" 9329 // }, 9330 // "provisionalUserProject": { 9331 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 9332 // "location": "query", 9333 // "type": "string" 9334 // }, 9335 // "sourceBucket": { 9336 // "description": "Name of the bucket in which to find the source object.", 9337 // "location": "path", 9338 // "required": true, 9339 // "type": "string" 9340 // }, 9341 // "sourceGeneration": { 9342 // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", 9343 // "format": "int64", 9344 // "location": "query", 9345 // "type": "string" 9346 // }, 9347 // "sourceObject": { 9348 // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9349 // "location": "path", 9350 // "required": true, 9351 // "type": "string" 9352 // }, 9353 // "userProject": { 9354 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 9355 // "location": "query", 9356 // "type": "string" 9357 // } 9358 // }, 9359 // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", 9360 // "request": { 9361 // "$ref": "Object" 9362 // }, 9363 // "response": { 9364 // "$ref": "Object" 9365 // }, 9366 // "scopes": [ 9367 // "https://www.googleapis.com/auth/cloud-platform", 9368 // "https://www.googleapis.com/auth/devstorage.full_control", 9369 // "https://www.googleapis.com/auth/devstorage.read_write" 9370 // ] 9371 // } 9372 9373} 9374 9375// method id "storage.objects.delete": 9376 9377type ObjectsDeleteCall struct { 9378 s *Service 9379 bucket string 9380 object string 9381 urlParams_ gensupport.URLParams 9382 ctx_ context.Context 9383 header_ http.Header 9384} 9385 9386// Delete: Deletes an object and its metadata. Deletions are permanent 9387// if versioning is not enabled for the bucket, or if the generation 9388// parameter is used. 9389// 9390// - bucket: Name of the bucket in which the object resides. 9391// - object: Name of the object. For information about how to URL encode 9392// object names to be path safe, see Encoding URI Path Parts. 9393func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall { 9394 c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9395 c.bucket = bucket 9396 c.object = object 9397 return c 9398} 9399 9400// Generation sets the optional parameter "generation": If present, 9401// permanently deletes a specific revision of this object (as opposed to 9402// the latest version, the default). 9403func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall { 9404 c.urlParams_.Set("generation", fmt.Sprint(generation)) 9405 return c 9406} 9407 9408// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 9409// Makes the operation conditional on whether the object's current 9410// generation matches the given value. Setting to 0 makes the operation 9411// succeed only if there are no live versions of the object. 9412func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall { 9413 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 9414 return c 9415} 9416 9417// IfGenerationNotMatch sets the optional parameter 9418// "ifGenerationNotMatch": Makes the operation conditional on whether 9419// the object's current generation does not match the given value. If no 9420// live object exists, the precondition fails. Setting to 0 makes the 9421// operation succeed only if there is a live version of the object. 9422func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall { 9423 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 9424 return c 9425} 9426 9427// IfMetagenerationMatch sets the optional parameter 9428// "ifMetagenerationMatch": Makes the operation conditional on whether 9429// the object's current metageneration matches the given value. 9430func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall { 9431 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 9432 return c 9433} 9434 9435// IfMetagenerationNotMatch sets the optional parameter 9436// "ifMetagenerationNotMatch": Makes the operation conditional on 9437// whether the object's current metageneration does not match the given 9438// value. 9439func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall { 9440 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 9441 return c 9442} 9443 9444// ProvisionalUserProject sets the optional parameter 9445// "provisionalUserProject": The project to be billed for this request 9446// if the target bucket is requester-pays bucket. 9447func (c *ObjectsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsDeleteCall { 9448 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9449 return c 9450} 9451 9452// UserProject sets the optional parameter "userProject": The project to 9453// be billed for this request. Required for Requester Pays buckets. 9454func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall { 9455 c.urlParams_.Set("userProject", userProject) 9456 return c 9457} 9458 9459// Fields allows partial responses to be retrieved. See 9460// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9461// for more information. 9462func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall { 9463 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9464 return c 9465} 9466 9467// Context sets the context to be used in this call's Do method. Any 9468// pending HTTP request will be aborted if the provided context is 9469// canceled. 9470func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall { 9471 c.ctx_ = ctx 9472 return c 9473} 9474 9475// Header returns an http.Header that can be modified by the caller to 9476// add HTTP headers to the request. 9477func (c *ObjectsDeleteCall) Header() http.Header { 9478 if c.header_ == nil { 9479 c.header_ = make(http.Header) 9480 } 9481 return c.header_ 9482} 9483 9484func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { 9485 reqHeaders := make(http.Header) 9486 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9487 for k, v := range c.header_ { 9488 reqHeaders[k] = v 9489 } 9490 reqHeaders.Set("User-Agent", c.s.userAgent()) 9491 var body io.Reader = nil 9492 c.urlParams_.Set("alt", alt) 9493 c.urlParams_.Set("prettyPrint", "false") 9494 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 9495 urls += "?" + c.urlParams_.Encode() 9496 req, err := http.NewRequest("DELETE", urls, body) 9497 if err != nil { 9498 return nil, err 9499 } 9500 req.Header = reqHeaders 9501 googleapi.Expand(req.URL, map[string]string{ 9502 "bucket": c.bucket, 9503 "object": c.object, 9504 }) 9505 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9506} 9507 9508// Do executes the "storage.objects.delete" call. 9509func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error { 9510 gensupport.SetOptions(c.urlParams_, opts...) 9511 res, err := c.doRequest("json") 9512 if err != nil { 9513 return err 9514 } 9515 defer googleapi.CloseBody(res) 9516 if err := googleapi.CheckResponse(res); err != nil { 9517 return err 9518 } 9519 return nil 9520 // { 9521 // "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.", 9522 // "httpMethod": "DELETE", 9523 // "id": "storage.objects.delete", 9524 // "parameterOrder": [ 9525 // "bucket", 9526 // "object" 9527 // ], 9528 // "parameters": { 9529 // "bucket": { 9530 // "description": "Name of the bucket in which the object resides.", 9531 // "location": "path", 9532 // "required": true, 9533 // "type": "string" 9534 // }, 9535 // "generation": { 9536 // "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", 9537 // "format": "int64", 9538 // "location": "query", 9539 // "type": "string" 9540 // }, 9541 // "ifGenerationMatch": { 9542 // "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.", 9543 // "format": "int64", 9544 // "location": "query", 9545 // "type": "string" 9546 // }, 9547 // "ifGenerationNotMatch": { 9548 // "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.", 9549 // "format": "int64", 9550 // "location": "query", 9551 // "type": "string" 9552 // }, 9553 // "ifMetagenerationMatch": { 9554 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 9555 // "format": "int64", 9556 // "location": "query", 9557 // "type": "string" 9558 // }, 9559 // "ifMetagenerationNotMatch": { 9560 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 9561 // "format": "int64", 9562 // "location": "query", 9563 // "type": "string" 9564 // }, 9565 // "object": { 9566 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9567 // "location": "path", 9568 // "required": true, 9569 // "type": "string" 9570 // }, 9571 // "provisionalUserProject": { 9572 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 9573 // "location": "query", 9574 // "type": "string" 9575 // }, 9576 // "userProject": { 9577 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 9578 // "location": "query", 9579 // "type": "string" 9580 // } 9581 // }, 9582 // "path": "b/{bucket}/o/{object}", 9583 // "scopes": [ 9584 // "https://www.googleapis.com/auth/cloud-platform", 9585 // "https://www.googleapis.com/auth/devstorage.full_control", 9586 // "https://www.googleapis.com/auth/devstorage.read_write" 9587 // ] 9588 // } 9589 9590} 9591 9592// method id "storage.objects.get": 9593 9594type ObjectsGetCall struct { 9595 s *Service 9596 bucket string 9597 object string 9598 urlParams_ gensupport.URLParams 9599 ifNoneMatch_ string 9600 ctx_ context.Context 9601 header_ http.Header 9602} 9603 9604// Get: Retrieves an object or its metadata. 9605// 9606// - bucket: Name of the bucket in which the object resides. 9607// - object: Name of the object. For information about how to URL encode 9608// object names to be path safe, see Encoding URI Path Parts. 9609func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall { 9610 c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9611 c.bucket = bucket 9612 c.object = object 9613 return c 9614} 9615 9616// Generation sets the optional parameter "generation": If present, 9617// selects a specific revision of this object (as opposed to the latest 9618// version, the default). 9619func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall { 9620 c.urlParams_.Set("generation", fmt.Sprint(generation)) 9621 return c 9622} 9623 9624// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 9625// Makes the operation conditional on whether the object's current 9626// generation matches the given value. Setting to 0 makes the operation 9627// succeed only if there are no live versions of the object. 9628func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall { 9629 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 9630 return c 9631} 9632 9633// IfGenerationNotMatch sets the optional parameter 9634// "ifGenerationNotMatch": Makes the operation conditional on whether 9635// the object's current generation does not match the given value. If no 9636// live object exists, the precondition fails. Setting to 0 makes the 9637// operation succeed only if there is a live version of the object. 9638func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall { 9639 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 9640 return c 9641} 9642 9643// IfMetagenerationMatch sets the optional parameter 9644// "ifMetagenerationMatch": Makes the operation conditional on whether 9645// the object's current metageneration matches the given value. 9646func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall { 9647 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 9648 return c 9649} 9650 9651// IfMetagenerationNotMatch sets the optional parameter 9652// "ifMetagenerationNotMatch": Makes the operation conditional on 9653// whether the object's current metageneration does not match the given 9654// value. 9655func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall { 9656 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 9657 return c 9658} 9659 9660// Projection sets the optional parameter "projection": Set of 9661// properties to return. Defaults to noAcl. 9662// 9663// Possible values: 9664// "full" - Include all properties. 9665// "noAcl" - Omit the owner, acl property. 9666func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall { 9667 c.urlParams_.Set("projection", projection) 9668 return c 9669} 9670 9671// ProvisionalUserProject sets the optional parameter 9672// "provisionalUserProject": The project to be billed for this request 9673// if the target bucket is requester-pays bucket. 9674func (c *ObjectsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetCall { 9675 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9676 return c 9677} 9678 9679// UserProject sets the optional parameter "userProject": The project to 9680// be billed for this request. Required for Requester Pays buckets. 9681func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall { 9682 c.urlParams_.Set("userProject", userProject) 9683 return c 9684} 9685 9686// Fields allows partial responses to be retrieved. See 9687// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9688// for more information. 9689func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall { 9690 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9691 return c 9692} 9693 9694// IfNoneMatch sets the optional parameter which makes the operation 9695// fail if the object's ETag matches the given value. This is useful for 9696// getting updates only after the object has changed since the last 9697// request. Use googleapi.IsNotModified to check whether the response 9698// error from Do is the result of In-None-Match. 9699func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall { 9700 c.ifNoneMatch_ = entityTag 9701 return c 9702} 9703 9704// Context sets the context to be used in this call's Do and Download 9705// methods. Any pending HTTP request will be aborted if the provided 9706// context is canceled. 9707func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall { 9708 c.ctx_ = ctx 9709 return c 9710} 9711 9712// Header returns an http.Header that can be modified by the caller to 9713// add HTTP headers to the request. 9714func (c *ObjectsGetCall) Header() http.Header { 9715 if c.header_ == nil { 9716 c.header_ = make(http.Header) 9717 } 9718 return c.header_ 9719} 9720 9721func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { 9722 reqHeaders := make(http.Header) 9723 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9724 for k, v := range c.header_ { 9725 reqHeaders[k] = v 9726 } 9727 reqHeaders.Set("User-Agent", c.s.userAgent()) 9728 if c.ifNoneMatch_ != "" { 9729 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9730 } 9731 var body io.Reader = nil 9732 c.urlParams_.Set("alt", alt) 9733 c.urlParams_.Set("prettyPrint", "false") 9734 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 9735 urls += "?" + c.urlParams_.Encode() 9736 req, err := http.NewRequest("GET", urls, body) 9737 if err != nil { 9738 return nil, err 9739 } 9740 req.Header = reqHeaders 9741 googleapi.Expand(req.URL, map[string]string{ 9742 "bucket": c.bucket, 9743 "object": c.object, 9744 }) 9745 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9746} 9747 9748// Download fetches the API endpoint's "media" value, instead of the normal 9749// API response value. If the returned error is nil, the Response is guaranteed to 9750// have a 2xx status code. Callers must close the Response.Body as usual. 9751func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 9752 gensupport.SetOptions(c.urlParams_, opts...) 9753 res, err := c.doRequest("media") 9754 if err != nil { 9755 return nil, err 9756 } 9757 if err := googleapi.CheckMediaResponse(res); err != nil { 9758 res.Body.Close() 9759 return nil, err 9760 } 9761 return res, nil 9762} 9763 9764// Do executes the "storage.objects.get" call. 9765// Exactly one of *Object or error will be non-nil. Any non-2xx status 9766// code is an error. Response headers are in either 9767// *Object.ServerResponse.Header or (if a response was returned at all) 9768// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9769// check whether the returned error was because http.StatusNotModified 9770// was returned. 9771func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) { 9772 gensupport.SetOptions(c.urlParams_, opts...) 9773 res, err := c.doRequest("json") 9774 if res != nil && res.StatusCode == http.StatusNotModified { 9775 if res.Body != nil { 9776 res.Body.Close() 9777 } 9778 return nil, &googleapi.Error{ 9779 Code: res.StatusCode, 9780 Header: res.Header, 9781 } 9782 } 9783 if err != nil { 9784 return nil, err 9785 } 9786 defer googleapi.CloseBody(res) 9787 if err := googleapi.CheckResponse(res); err != nil { 9788 return nil, err 9789 } 9790 ret := &Object{ 9791 ServerResponse: googleapi.ServerResponse{ 9792 Header: res.Header, 9793 HTTPStatusCode: res.StatusCode, 9794 }, 9795 } 9796 target := &ret 9797 if err := gensupport.DecodeResponse(target, res); err != nil { 9798 return nil, err 9799 } 9800 return ret, nil 9801 // { 9802 // "description": "Retrieves an object or its metadata.", 9803 // "httpMethod": "GET", 9804 // "id": "storage.objects.get", 9805 // "parameterOrder": [ 9806 // "bucket", 9807 // "object" 9808 // ], 9809 // "parameters": { 9810 // "bucket": { 9811 // "description": "Name of the bucket in which the object resides.", 9812 // "location": "path", 9813 // "required": true, 9814 // "type": "string" 9815 // }, 9816 // "generation": { 9817 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 9818 // "format": "int64", 9819 // "location": "query", 9820 // "type": "string" 9821 // }, 9822 // "ifGenerationMatch": { 9823 // "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.", 9824 // "format": "int64", 9825 // "location": "query", 9826 // "type": "string" 9827 // }, 9828 // "ifGenerationNotMatch": { 9829 // "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.", 9830 // "format": "int64", 9831 // "location": "query", 9832 // "type": "string" 9833 // }, 9834 // "ifMetagenerationMatch": { 9835 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 9836 // "format": "int64", 9837 // "location": "query", 9838 // "type": "string" 9839 // }, 9840 // "ifMetagenerationNotMatch": { 9841 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 9842 // "format": "int64", 9843 // "location": "query", 9844 // "type": "string" 9845 // }, 9846 // "object": { 9847 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 9848 // "location": "path", 9849 // "required": true, 9850 // "type": "string" 9851 // }, 9852 // "projection": { 9853 // "description": "Set of properties to return. Defaults to noAcl.", 9854 // "enum": [ 9855 // "full", 9856 // "noAcl" 9857 // ], 9858 // "enumDescriptions": [ 9859 // "Include all properties.", 9860 // "Omit the owner, acl property." 9861 // ], 9862 // "location": "query", 9863 // "type": "string" 9864 // }, 9865 // "provisionalUserProject": { 9866 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 9867 // "location": "query", 9868 // "type": "string" 9869 // }, 9870 // "userProject": { 9871 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 9872 // "location": "query", 9873 // "type": "string" 9874 // } 9875 // }, 9876 // "path": "b/{bucket}/o/{object}", 9877 // "response": { 9878 // "$ref": "Object" 9879 // }, 9880 // "scopes": [ 9881 // "https://www.googleapis.com/auth/cloud-platform", 9882 // "https://www.googleapis.com/auth/cloud-platform.read-only", 9883 // "https://www.googleapis.com/auth/devstorage.full_control", 9884 // "https://www.googleapis.com/auth/devstorage.read_only", 9885 // "https://www.googleapis.com/auth/devstorage.read_write" 9886 // ], 9887 // "supportsMediaDownload": true, 9888 // "useMediaDownloadService": true 9889 // } 9890 9891} 9892 9893// method id "storage.objects.getIamPolicy": 9894 9895type ObjectsGetIamPolicyCall struct { 9896 s *Service 9897 bucket string 9898 object string 9899 urlParams_ gensupport.URLParams 9900 ifNoneMatch_ string 9901 ctx_ context.Context 9902 header_ http.Header 9903} 9904 9905// GetIamPolicy: Returns an IAM policy for the specified object. 9906// 9907// - bucket: Name of the bucket in which the object resides. 9908// - object: Name of the object. For information about how to URL encode 9909// object names to be path safe, see Encoding URI Path Parts. 9910func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall { 9911 c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9912 c.bucket = bucket 9913 c.object = object 9914 return c 9915} 9916 9917// Generation sets the optional parameter "generation": If present, 9918// selects a specific revision of this object (as opposed to the latest 9919// version, the default). 9920func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall { 9921 c.urlParams_.Set("generation", fmt.Sprint(generation)) 9922 return c 9923} 9924 9925// ProvisionalUserProject sets the optional parameter 9926// "provisionalUserProject": The project to be billed for this request 9927// if the target bucket is requester-pays bucket. 9928func (c *ObjectsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetIamPolicyCall { 9929 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 9930 return c 9931} 9932 9933// UserProject sets the optional parameter "userProject": The project to 9934// be billed for this request. Required for Requester Pays buckets. 9935func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall { 9936 c.urlParams_.Set("userProject", userProject) 9937 return c 9938} 9939 9940// Fields allows partial responses to be retrieved. See 9941// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9942// for more information. 9943func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall { 9944 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9945 return c 9946} 9947 9948// IfNoneMatch sets the optional parameter which makes the operation 9949// fail if the object's ETag matches the given value. This is useful for 9950// getting updates only after the object has changed since the last 9951// request. Use googleapi.IsNotModified to check whether the response 9952// error from Do is the result of In-None-Match. 9953func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall { 9954 c.ifNoneMatch_ = entityTag 9955 return c 9956} 9957 9958// Context sets the context to be used in this call's Do method. Any 9959// pending HTTP request will be aborted if the provided context is 9960// canceled. 9961func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall { 9962 c.ctx_ = ctx 9963 return c 9964} 9965 9966// Header returns an http.Header that can be modified by the caller to 9967// add HTTP headers to the request. 9968func (c *ObjectsGetIamPolicyCall) Header() http.Header { 9969 if c.header_ == nil { 9970 c.header_ = make(http.Header) 9971 } 9972 return c.header_ 9973} 9974 9975func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 9976 reqHeaders := make(http.Header) 9977 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9978 for k, v := range c.header_ { 9979 reqHeaders[k] = v 9980 } 9981 reqHeaders.Set("User-Agent", c.s.userAgent()) 9982 if c.ifNoneMatch_ != "" { 9983 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9984 } 9985 var body io.Reader = nil 9986 c.urlParams_.Set("alt", alt) 9987 c.urlParams_.Set("prettyPrint", "false") 9988 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam") 9989 urls += "?" + c.urlParams_.Encode() 9990 req, err := http.NewRequest("GET", urls, body) 9991 if err != nil { 9992 return nil, err 9993 } 9994 req.Header = reqHeaders 9995 googleapi.Expand(req.URL, map[string]string{ 9996 "bucket": c.bucket, 9997 "object": c.object, 9998 }) 9999 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10000} 10001 10002// Do executes the "storage.objects.getIamPolicy" call. 10003// Exactly one of *Policy or error will be non-nil. Any non-2xx status 10004// code is an error. Response headers are in either 10005// *Policy.ServerResponse.Header or (if a response was returned at all) 10006// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10007// check whether the returned error was because http.StatusNotModified 10008// was returned. 10009func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 10010 gensupport.SetOptions(c.urlParams_, opts...) 10011 res, err := c.doRequest("json") 10012 if res != nil && res.StatusCode == http.StatusNotModified { 10013 if res.Body != nil { 10014 res.Body.Close() 10015 } 10016 return nil, &googleapi.Error{ 10017 Code: res.StatusCode, 10018 Header: res.Header, 10019 } 10020 } 10021 if err != nil { 10022 return nil, err 10023 } 10024 defer googleapi.CloseBody(res) 10025 if err := googleapi.CheckResponse(res); err != nil { 10026 return nil, err 10027 } 10028 ret := &Policy{ 10029 ServerResponse: googleapi.ServerResponse{ 10030 Header: res.Header, 10031 HTTPStatusCode: res.StatusCode, 10032 }, 10033 } 10034 target := &ret 10035 if err := gensupport.DecodeResponse(target, res); err != nil { 10036 return nil, err 10037 } 10038 return ret, nil 10039 // { 10040 // "description": "Returns an IAM policy for the specified object.", 10041 // "httpMethod": "GET", 10042 // "id": "storage.objects.getIamPolicy", 10043 // "parameterOrder": [ 10044 // "bucket", 10045 // "object" 10046 // ], 10047 // "parameters": { 10048 // "bucket": { 10049 // "description": "Name of the bucket in which the object resides.", 10050 // "location": "path", 10051 // "required": true, 10052 // "type": "string" 10053 // }, 10054 // "generation": { 10055 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 10056 // "format": "int64", 10057 // "location": "query", 10058 // "type": "string" 10059 // }, 10060 // "object": { 10061 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 10062 // "location": "path", 10063 // "required": true, 10064 // "type": "string" 10065 // }, 10066 // "provisionalUserProject": { 10067 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 10068 // "location": "query", 10069 // "type": "string" 10070 // }, 10071 // "userProject": { 10072 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 10073 // "location": "query", 10074 // "type": "string" 10075 // } 10076 // }, 10077 // "path": "b/{bucket}/o/{object}/iam", 10078 // "response": { 10079 // "$ref": "Policy" 10080 // }, 10081 // "scopes": [ 10082 // "https://www.googleapis.com/auth/cloud-platform", 10083 // "https://www.googleapis.com/auth/cloud-platform.read-only", 10084 // "https://www.googleapis.com/auth/devstorage.full_control", 10085 // "https://www.googleapis.com/auth/devstorage.read_only", 10086 // "https://www.googleapis.com/auth/devstorage.read_write" 10087 // ] 10088 // } 10089 10090} 10091 10092// method id "storage.objects.insert": 10093 10094type ObjectsInsertCall struct { 10095 s *Service 10096 bucket string 10097 object *Object 10098 urlParams_ gensupport.URLParams 10099 mediaInfo_ *gensupport.MediaInfo 10100 ctx_ context.Context 10101 header_ http.Header 10102} 10103 10104// Insert: Stores a new object and metadata. 10105// 10106// - bucket: Name of the bucket in which to store the new object. 10107// Overrides the provided object metadata's bucket value, if any. 10108func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall { 10109 c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10110 c.bucket = bucket 10111 c.object = object 10112 return c 10113} 10114 10115// ContentEncoding sets the optional parameter "contentEncoding": If 10116// set, sets the contentEncoding property of the final object to this 10117// value. Setting this parameter is equivalent to setting the 10118// contentEncoding metadata property. This can be useful when uploading 10119// an object with uploadType=media to indicate the encoding of the 10120// content being uploaded. 10121func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall { 10122 c.urlParams_.Set("contentEncoding", contentEncoding) 10123 return c 10124} 10125 10126// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 10127// Makes the operation conditional on whether the object's current 10128// generation matches the given value. Setting to 0 makes the operation 10129// succeed only if there are no live versions of the object. 10130func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall { 10131 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 10132 return c 10133} 10134 10135// IfGenerationNotMatch sets the optional parameter 10136// "ifGenerationNotMatch": Makes the operation conditional on whether 10137// the object's current generation does not match the given value. If no 10138// live object exists, the precondition fails. Setting to 0 makes the 10139// operation succeed only if there is a live version of the object. 10140func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall { 10141 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 10142 return c 10143} 10144 10145// IfMetagenerationMatch sets the optional parameter 10146// "ifMetagenerationMatch": Makes the operation conditional on whether 10147// the object's current metageneration matches the given value. 10148func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall { 10149 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 10150 return c 10151} 10152 10153// IfMetagenerationNotMatch sets the optional parameter 10154// "ifMetagenerationNotMatch": Makes the operation conditional on 10155// whether the object's current metageneration does not match the given 10156// value. 10157func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall { 10158 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 10159 return c 10160} 10161 10162// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of 10163// the Cloud KMS key, of the form 10164// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 10165// that will be used to encrypt the object. Overrides the object 10166// metadata's kms_key_name value, if any. 10167func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall { 10168 c.urlParams_.Set("kmsKeyName", kmsKeyName) 10169 return c 10170} 10171 10172// Name sets the optional parameter "name": Name of the object. Required 10173// when the object metadata is not otherwise provided. Overrides the 10174// object metadata's name value, if any. For information about how to 10175// URL encode object names to be path safe, see Encoding URI Path Parts. 10176func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall { 10177 c.urlParams_.Set("name", name) 10178 return c 10179} 10180 10181// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 10182// predefined set of access controls to this object. 10183// 10184// Possible values: 10185// "authenticatedRead" - Object owner gets OWNER access, and 10186// allAuthenticatedUsers get READER access. 10187// "bucketOwnerFullControl" - Object owner gets OWNER access, and 10188// project team owners get OWNER access. 10189// "bucketOwnerRead" - Object owner gets OWNER access, and project 10190// team owners get READER access. 10191// "private" - Object owner gets OWNER access. 10192// "projectPrivate" - Object owner gets OWNER access, and project team 10193// members get access according to their roles. 10194// "publicRead" - Object owner gets OWNER access, and allUsers get 10195// READER access. 10196func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall { 10197 c.urlParams_.Set("predefinedAcl", predefinedAcl) 10198 return c 10199} 10200 10201// Projection sets the optional parameter "projection": Set of 10202// properties to return. Defaults to noAcl, unless the object resource 10203// specifies the acl property, when it defaults to full. 10204// 10205// Possible values: 10206// "full" - Include all properties. 10207// "noAcl" - Omit the owner, acl property. 10208func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { 10209 c.urlParams_.Set("projection", projection) 10210 return c 10211} 10212 10213// ProvisionalUserProject sets the optional parameter 10214// "provisionalUserProject": The project to be billed for this request 10215// if the target bucket is requester-pays bucket. 10216func (c *ObjectsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsInsertCall { 10217 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 10218 return c 10219} 10220 10221// UserProject sets the optional parameter "userProject": The project to 10222// be billed for this request. Required for Requester Pays buckets. 10223func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall { 10224 c.urlParams_.Set("userProject", userProject) 10225 return c 10226} 10227 10228// Media specifies the media to upload in one or more chunks. The chunk 10229// size may be controlled by supplying a MediaOption generated by 10230// googleapi.ChunkSize. The chunk size defaults to 10231// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 10232// upload request will be determined by sniffing the contents of r, 10233// unless a MediaOption generated by googleapi.ContentType is 10234// supplied. 10235// At most one of Media and ResumableMedia may be set. 10236func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall { 10237 if ct := c.object.ContentType; ct != "" { 10238 options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...) 10239 } 10240 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 10241 return c 10242} 10243 10244// ResumableMedia specifies the media to upload in chunks and can be 10245// canceled with ctx. 10246// 10247// Deprecated: use Media instead. 10248// 10249// At most one of Media and ResumableMedia may be set. mediaType 10250// identifies the MIME media type of the upload, such as "image/png". If 10251// mediaType is "", it will be auto-detected. The provided ctx will 10252// supersede any context previously provided to the Context method. 10253func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall { 10254 c.ctx_ = ctx 10255 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 10256 return c 10257} 10258 10259// ProgressUpdater provides a callback function that will be called 10260// after every chunk. It should be a low-latency function in order to 10261// not slow down the upload operation. This should only be called when 10262// using ResumableMedia (as opposed to Media). 10263func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall { 10264 c.mediaInfo_.SetProgressUpdater(pu) 10265 return c 10266} 10267 10268// Fields allows partial responses to be retrieved. See 10269// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10270// for more information. 10271func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall { 10272 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10273 return c 10274} 10275 10276// Context sets the context to be used in this call's Do method. Any 10277// pending HTTP request will be aborted if the provided context is 10278// canceled. 10279// This context will supersede any context previously provided to the 10280// ResumableMedia method. 10281func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall { 10282 c.ctx_ = ctx 10283 return c 10284} 10285 10286// Header returns an http.Header that can be modified by the caller to 10287// add HTTP headers to the request. 10288func (c *ObjectsInsertCall) Header() http.Header { 10289 if c.header_ == nil { 10290 c.header_ = make(http.Header) 10291 } 10292 return c.header_ 10293} 10294 10295func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { 10296 reqHeaders := make(http.Header) 10297 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10298 for k, v := range c.header_ { 10299 reqHeaders[k] = v 10300 } 10301 reqHeaders.Set("User-Agent", c.s.userAgent()) 10302 var body io.Reader = nil 10303 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) 10304 if err != nil { 10305 return nil, err 10306 } 10307 reqHeaders.Set("Content-Type", "application/json") 10308 c.urlParams_.Set("alt", alt) 10309 c.urlParams_.Set("prettyPrint", "false") 10310 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") 10311 if c.mediaInfo_ != nil { 10312 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1/b/{bucket}/o") 10313 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 10314 } 10315 if body == nil { 10316 body = new(bytes.Buffer) 10317 reqHeaders.Set("Content-Type", "application/json") 10318 } 10319 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 10320 defer cleanup() 10321 urls += "?" + c.urlParams_.Encode() 10322 req, err := http.NewRequest("POST", urls, body) 10323 if err != nil { 10324 return nil, err 10325 } 10326 req.Header = reqHeaders 10327 req.GetBody = getBody 10328 googleapi.Expand(req.URL, map[string]string{ 10329 "bucket": c.bucket, 10330 }) 10331 return gensupport.SendRequestWithRetry(c.ctx_, c.s.client, req) 10332} 10333 10334// Do executes the "storage.objects.insert" call. 10335// Exactly one of *Object or error will be non-nil. Any non-2xx status 10336// code is an error. Response headers are in either 10337// *Object.ServerResponse.Header or (if a response was returned at all) 10338// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10339// check whether the returned error was because http.StatusNotModified 10340// was returned. 10341func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) { 10342 gensupport.SetOptions(c.urlParams_, opts...) 10343 res, err := c.doRequest("json") 10344 if res != nil && res.StatusCode == http.StatusNotModified { 10345 if res.Body != nil { 10346 res.Body.Close() 10347 } 10348 return nil, &googleapi.Error{ 10349 Code: res.StatusCode, 10350 Header: res.Header, 10351 } 10352 } 10353 if err != nil { 10354 return nil, err 10355 } 10356 defer googleapi.CloseBody(res) 10357 if err := googleapi.CheckResponse(res); err != nil { 10358 return nil, err 10359 } 10360 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 10361 if rx != nil { 10362 rx.Client = c.s.client 10363 rx.UserAgent = c.s.userAgent() 10364 ctx := c.ctx_ 10365 if ctx == nil { 10366 ctx = context.TODO() 10367 } 10368 res, err = rx.Upload(ctx) 10369 if err != nil { 10370 return nil, err 10371 } 10372 defer res.Body.Close() 10373 if err := googleapi.CheckResponse(res); err != nil { 10374 return nil, err 10375 } 10376 } 10377 ret := &Object{ 10378 ServerResponse: googleapi.ServerResponse{ 10379 Header: res.Header, 10380 HTTPStatusCode: res.StatusCode, 10381 }, 10382 } 10383 target := &ret 10384 if err := gensupport.DecodeResponse(target, res); err != nil { 10385 return nil, err 10386 } 10387 return ret, nil 10388 // { 10389 // "description": "Stores a new object and metadata.", 10390 // "httpMethod": "POST", 10391 // "id": "storage.objects.insert", 10392 // "mediaUpload": { 10393 // "accept": [ 10394 // "*/*" 10395 // ], 10396 // "protocols": { 10397 // "resumable": { 10398 // "multipart": true, 10399 // "path": "/resumable/upload/storage/v1/b/{bucket}/o" 10400 // }, 10401 // "simple": { 10402 // "multipart": true, 10403 // "path": "/upload/storage/v1/b/{bucket}/o" 10404 // } 10405 // } 10406 // }, 10407 // "parameterOrder": [ 10408 // "bucket" 10409 // ], 10410 // "parameters": { 10411 // "bucket": { 10412 // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", 10413 // "location": "path", 10414 // "required": true, 10415 // "type": "string" 10416 // }, 10417 // "contentEncoding": { 10418 // "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.", 10419 // "location": "query", 10420 // "type": "string" 10421 // }, 10422 // "ifGenerationMatch": { 10423 // "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.", 10424 // "format": "int64", 10425 // "location": "query", 10426 // "type": "string" 10427 // }, 10428 // "ifGenerationNotMatch": { 10429 // "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.", 10430 // "format": "int64", 10431 // "location": "query", 10432 // "type": "string" 10433 // }, 10434 // "ifMetagenerationMatch": { 10435 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 10436 // "format": "int64", 10437 // "location": "query", 10438 // "type": "string" 10439 // }, 10440 // "ifMetagenerationNotMatch": { 10441 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 10442 // "format": "int64", 10443 // "location": "query", 10444 // "type": "string" 10445 // }, 10446 // "kmsKeyName": { 10447 // "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.", 10448 // "location": "query", 10449 // "type": "string" 10450 // }, 10451 // "name": { 10452 // "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.", 10453 // "location": "query", 10454 // "type": "string" 10455 // }, 10456 // "predefinedAcl": { 10457 // "description": "Apply a predefined set of access controls to this object.", 10458 // "enum": [ 10459 // "authenticatedRead", 10460 // "bucketOwnerFullControl", 10461 // "bucketOwnerRead", 10462 // "private", 10463 // "projectPrivate", 10464 // "publicRead" 10465 // ], 10466 // "enumDescriptions": [ 10467 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 10468 // "Object owner gets OWNER access, and project team owners get OWNER access.", 10469 // "Object owner gets OWNER access, and project team owners get READER access.", 10470 // "Object owner gets OWNER access.", 10471 // "Object owner gets OWNER access, and project team members get access according to their roles.", 10472 // "Object owner gets OWNER access, and allUsers get READER access." 10473 // ], 10474 // "location": "query", 10475 // "type": "string" 10476 // }, 10477 // "projection": { 10478 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", 10479 // "enum": [ 10480 // "full", 10481 // "noAcl" 10482 // ], 10483 // "enumDescriptions": [ 10484 // "Include all properties.", 10485 // "Omit the owner, acl property." 10486 // ], 10487 // "location": "query", 10488 // "type": "string" 10489 // }, 10490 // "provisionalUserProject": { 10491 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 10492 // "location": "query", 10493 // "type": "string" 10494 // }, 10495 // "userProject": { 10496 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 10497 // "location": "query", 10498 // "type": "string" 10499 // } 10500 // }, 10501 // "path": "b/{bucket}/o", 10502 // "request": { 10503 // "$ref": "Object" 10504 // }, 10505 // "response": { 10506 // "$ref": "Object" 10507 // }, 10508 // "scopes": [ 10509 // "https://www.googleapis.com/auth/cloud-platform", 10510 // "https://www.googleapis.com/auth/devstorage.full_control", 10511 // "https://www.googleapis.com/auth/devstorage.read_write" 10512 // ], 10513 // "supportsMediaUpload": true 10514 // } 10515 10516} 10517 10518// method id "storage.objects.list": 10519 10520type ObjectsListCall struct { 10521 s *Service 10522 bucket string 10523 urlParams_ gensupport.URLParams 10524 ifNoneMatch_ string 10525 ctx_ context.Context 10526 header_ http.Header 10527} 10528 10529// List: Retrieves a list of objects matching the criteria. 10530// 10531// - bucket: Name of the bucket in which to look for objects. 10532func (r *ObjectsService) List(bucket string) *ObjectsListCall { 10533 c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10534 c.bucket = bucket 10535 return c 10536} 10537 10538// Delimiter sets the optional parameter "delimiter": Returns results in 10539// a directory-like mode. items will contain only objects whose names, 10540// aside from the prefix, do not contain delimiter. Objects whose names, 10541// aside from the prefix, contain delimiter will have their name, 10542// truncated after the delimiter, returned in prefixes. Duplicate 10543// prefixes are omitted. 10544func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall { 10545 c.urlParams_.Set("delimiter", delimiter) 10546 return c 10547} 10548 10549// EndOffset sets the optional parameter "endOffset": Filter results to 10550// objects whose names are lexicographically before endOffset. If 10551// startOffset is also set, the objects listed will have names between 10552// startOffset (inclusive) and endOffset (exclusive). 10553func (c *ObjectsListCall) EndOffset(endOffset string) *ObjectsListCall { 10554 c.urlParams_.Set("endOffset", endOffset) 10555 return c 10556} 10557 10558// IncludeTrailingDelimiter sets the optional parameter 10559// "includeTrailingDelimiter": If true, objects that end in exactly one 10560// instance of delimiter will have their metadata included in items in 10561// addition to prefixes. 10562func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall { 10563 c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter)) 10564 return c 10565} 10566 10567// MaxResults sets the optional parameter "maxResults": Maximum number 10568// of items plus prefixes to return in a single page of responses. As 10569// duplicate prefixes are omitted, fewer total results may be returned 10570// than requested. The service will use this parameter or 1,000 items, 10571// whichever is smaller. 10572func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall { 10573 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10574 return c 10575} 10576 10577// PageToken sets the optional parameter "pageToken": A 10578// previously-returned page token representing part of the larger set of 10579// results to view. 10580func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall { 10581 c.urlParams_.Set("pageToken", pageToken) 10582 return c 10583} 10584 10585// Prefix sets the optional parameter "prefix": Filter results to 10586// objects whose names begin with this prefix. 10587func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall { 10588 c.urlParams_.Set("prefix", prefix) 10589 return c 10590} 10591 10592// Projection sets the optional parameter "projection": Set of 10593// properties to return. Defaults to noAcl. 10594// 10595// Possible values: 10596// "full" - Include all properties. 10597// "noAcl" - Omit the owner, acl property. 10598func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall { 10599 c.urlParams_.Set("projection", projection) 10600 return c 10601} 10602 10603// ProvisionalUserProject sets the optional parameter 10604// "provisionalUserProject": The project to be billed for this request 10605// if the target bucket is requester-pays bucket. 10606func (c *ObjectsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsListCall { 10607 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 10608 return c 10609} 10610 10611// StartOffset sets the optional parameter "startOffset": Filter results 10612// to objects whose names are lexicographically equal to or after 10613// startOffset. If endOffset is also set, the objects listed will have 10614// names between startOffset (inclusive) and endOffset (exclusive). 10615func (c *ObjectsListCall) StartOffset(startOffset string) *ObjectsListCall { 10616 c.urlParams_.Set("startOffset", startOffset) 10617 return c 10618} 10619 10620// UserProject sets the optional parameter "userProject": The project to 10621// be billed for this request. Required for Requester Pays buckets. 10622func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall { 10623 c.urlParams_.Set("userProject", userProject) 10624 return c 10625} 10626 10627// Versions sets the optional parameter "versions": If true, lists all 10628// versions of an object as distinct results. The default is false. For 10629// more information, see Object Versioning. 10630func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall { 10631 c.urlParams_.Set("versions", fmt.Sprint(versions)) 10632 return c 10633} 10634 10635// Fields allows partial responses to be retrieved. See 10636// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10637// for more information. 10638func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall { 10639 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10640 return c 10641} 10642 10643// IfNoneMatch sets the optional parameter which makes the operation 10644// fail if the object's ETag matches the given value. This is useful for 10645// getting updates only after the object has changed since the last 10646// request. Use googleapi.IsNotModified to check whether the response 10647// error from Do is the result of In-None-Match. 10648func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall { 10649 c.ifNoneMatch_ = entityTag 10650 return c 10651} 10652 10653// Context sets the context to be used in this call's Do method. Any 10654// pending HTTP request will be aborted if the provided context is 10655// canceled. 10656func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall { 10657 c.ctx_ = ctx 10658 return c 10659} 10660 10661// Header returns an http.Header that can be modified by the caller to 10662// add HTTP headers to the request. 10663func (c *ObjectsListCall) Header() http.Header { 10664 if c.header_ == nil { 10665 c.header_ = make(http.Header) 10666 } 10667 return c.header_ 10668} 10669 10670func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { 10671 reqHeaders := make(http.Header) 10672 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10673 for k, v := range c.header_ { 10674 reqHeaders[k] = v 10675 } 10676 reqHeaders.Set("User-Agent", c.s.userAgent()) 10677 if c.ifNoneMatch_ != "" { 10678 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10679 } 10680 var body io.Reader = nil 10681 c.urlParams_.Set("alt", alt) 10682 c.urlParams_.Set("prettyPrint", "false") 10683 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o") 10684 urls += "?" + c.urlParams_.Encode() 10685 req, err := http.NewRequest("GET", urls, body) 10686 if err != nil { 10687 return nil, err 10688 } 10689 req.Header = reqHeaders 10690 googleapi.Expand(req.URL, map[string]string{ 10691 "bucket": c.bucket, 10692 }) 10693 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10694} 10695 10696// Do executes the "storage.objects.list" call. 10697// Exactly one of *Objects or error will be non-nil. Any non-2xx status 10698// code is an error. Response headers are in either 10699// *Objects.ServerResponse.Header or (if a response was returned at all) 10700// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10701// check whether the returned error was because http.StatusNotModified 10702// was returned. 10703func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) { 10704 gensupport.SetOptions(c.urlParams_, opts...) 10705 res, err := c.doRequest("json") 10706 if res != nil && res.StatusCode == http.StatusNotModified { 10707 if res.Body != nil { 10708 res.Body.Close() 10709 } 10710 return nil, &googleapi.Error{ 10711 Code: res.StatusCode, 10712 Header: res.Header, 10713 } 10714 } 10715 if err != nil { 10716 return nil, err 10717 } 10718 defer googleapi.CloseBody(res) 10719 if err := googleapi.CheckResponse(res); err != nil { 10720 return nil, err 10721 } 10722 ret := &Objects{ 10723 ServerResponse: googleapi.ServerResponse{ 10724 Header: res.Header, 10725 HTTPStatusCode: res.StatusCode, 10726 }, 10727 } 10728 target := &ret 10729 if err := gensupport.DecodeResponse(target, res); err != nil { 10730 return nil, err 10731 } 10732 return ret, nil 10733 // { 10734 // "description": "Retrieves a list of objects matching the criteria.", 10735 // "httpMethod": "GET", 10736 // "id": "storage.objects.list", 10737 // "parameterOrder": [ 10738 // "bucket" 10739 // ], 10740 // "parameters": { 10741 // "bucket": { 10742 // "description": "Name of the bucket in which to look for objects.", 10743 // "location": "path", 10744 // "required": true, 10745 // "type": "string" 10746 // }, 10747 // "delimiter": { 10748 // "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.", 10749 // "location": "query", 10750 // "type": "string" 10751 // }, 10752 // "endOffset": { 10753 // "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).", 10754 // "location": "query", 10755 // "type": "string" 10756 // }, 10757 // "includeTrailingDelimiter": { 10758 // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", 10759 // "location": "query", 10760 // "type": "boolean" 10761 // }, 10762 // "maxResults": { 10763 // "default": "1000", 10764 // "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.", 10765 // "format": "uint32", 10766 // "location": "query", 10767 // "minimum": "0", 10768 // "type": "integer" 10769 // }, 10770 // "pageToken": { 10771 // "description": "A previously-returned page token representing part of the larger set of results to view.", 10772 // "location": "query", 10773 // "type": "string" 10774 // }, 10775 // "prefix": { 10776 // "description": "Filter results to objects whose names begin with this prefix.", 10777 // "location": "query", 10778 // "type": "string" 10779 // }, 10780 // "projection": { 10781 // "description": "Set of properties to return. Defaults to noAcl.", 10782 // "enum": [ 10783 // "full", 10784 // "noAcl" 10785 // ], 10786 // "enumDescriptions": [ 10787 // "Include all properties.", 10788 // "Omit the owner, acl property." 10789 // ], 10790 // "location": "query", 10791 // "type": "string" 10792 // }, 10793 // "provisionalUserProject": { 10794 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 10795 // "location": "query", 10796 // "type": "string" 10797 // }, 10798 // "startOffset": { 10799 // "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).", 10800 // "location": "query", 10801 // "type": "string" 10802 // }, 10803 // "userProject": { 10804 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 10805 // "location": "query", 10806 // "type": "string" 10807 // }, 10808 // "versions": { 10809 // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", 10810 // "location": "query", 10811 // "type": "boolean" 10812 // } 10813 // }, 10814 // "path": "b/{bucket}/o", 10815 // "response": { 10816 // "$ref": "Objects" 10817 // }, 10818 // "scopes": [ 10819 // "https://www.googleapis.com/auth/cloud-platform", 10820 // "https://www.googleapis.com/auth/cloud-platform.read-only", 10821 // "https://www.googleapis.com/auth/devstorage.full_control", 10822 // "https://www.googleapis.com/auth/devstorage.read_only", 10823 // "https://www.googleapis.com/auth/devstorage.read_write" 10824 // ], 10825 // "supportsSubscription": true 10826 // } 10827 10828} 10829 10830// Pages invokes f for each page of results. 10831// A non-nil error returned from f will halt the iteration. 10832// The provided context supersedes any context provided to the Context method. 10833func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error { 10834 c.ctx_ = ctx 10835 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10836 for { 10837 x, err := c.Do() 10838 if err != nil { 10839 return err 10840 } 10841 if err := f(x); err != nil { 10842 return err 10843 } 10844 if x.NextPageToken == "" { 10845 return nil 10846 } 10847 c.PageToken(x.NextPageToken) 10848 } 10849} 10850 10851// method id "storage.objects.patch": 10852 10853type ObjectsPatchCall struct { 10854 s *Service 10855 bucket string 10856 object string 10857 object2 *Object 10858 urlParams_ gensupport.URLParams 10859 ctx_ context.Context 10860 header_ http.Header 10861} 10862 10863// Patch: Patches an object's metadata. 10864// 10865// - bucket: Name of the bucket in which the object resides. 10866// - object: Name of the object. For information about how to URL encode 10867// object names to be path safe, see Encoding URI Path Parts. 10868func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall { 10869 c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10870 c.bucket = bucket 10871 c.object = object 10872 c.object2 = object2 10873 return c 10874} 10875 10876// Generation sets the optional parameter "generation": If present, 10877// selects a specific revision of this object (as opposed to the latest 10878// version, the default). 10879func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall { 10880 c.urlParams_.Set("generation", fmt.Sprint(generation)) 10881 return c 10882} 10883 10884// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 10885// Makes the operation conditional on whether the object's current 10886// generation matches the given value. Setting to 0 makes the operation 10887// succeed only if there are no live versions of the object. 10888func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall { 10889 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 10890 return c 10891} 10892 10893// IfGenerationNotMatch sets the optional parameter 10894// "ifGenerationNotMatch": Makes the operation conditional on whether 10895// the object's current generation does not match the given value. If no 10896// live object exists, the precondition fails. Setting to 0 makes the 10897// operation succeed only if there is a live version of the object. 10898func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall { 10899 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 10900 return c 10901} 10902 10903// IfMetagenerationMatch sets the optional parameter 10904// "ifMetagenerationMatch": Makes the operation conditional on whether 10905// the object's current metageneration matches the given value. 10906func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall { 10907 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 10908 return c 10909} 10910 10911// IfMetagenerationNotMatch sets the optional parameter 10912// "ifMetagenerationNotMatch": Makes the operation conditional on 10913// whether the object's current metageneration does not match the given 10914// value. 10915func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall { 10916 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 10917 return c 10918} 10919 10920// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 10921// predefined set of access controls to this object. 10922// 10923// Possible values: 10924// "authenticatedRead" - Object owner gets OWNER access, and 10925// allAuthenticatedUsers get READER access. 10926// "bucketOwnerFullControl" - Object owner gets OWNER access, and 10927// project team owners get OWNER access. 10928// "bucketOwnerRead" - Object owner gets OWNER access, and project 10929// team owners get READER access. 10930// "private" - Object owner gets OWNER access. 10931// "projectPrivate" - Object owner gets OWNER access, and project team 10932// members get access according to their roles. 10933// "publicRead" - Object owner gets OWNER access, and allUsers get 10934// READER access. 10935func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall { 10936 c.urlParams_.Set("predefinedAcl", predefinedAcl) 10937 return c 10938} 10939 10940// Projection sets the optional parameter "projection": Set of 10941// properties to return. Defaults to full. 10942// 10943// Possible values: 10944// "full" - Include all properties. 10945// "noAcl" - Omit the owner, acl property. 10946func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall { 10947 c.urlParams_.Set("projection", projection) 10948 return c 10949} 10950 10951// ProvisionalUserProject sets the optional parameter 10952// "provisionalUserProject": The project to be billed for this request 10953// if the target bucket is requester-pays bucket. 10954func (c *ObjectsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsPatchCall { 10955 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 10956 return c 10957} 10958 10959// UserProject sets the optional parameter "userProject": The project to 10960// be billed for this request, for Requester Pays buckets. 10961func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall { 10962 c.urlParams_.Set("userProject", userProject) 10963 return c 10964} 10965 10966// Fields allows partial responses to be retrieved. See 10967// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10968// for more information. 10969func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall { 10970 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10971 return c 10972} 10973 10974// Context sets the context to be used in this call's Do method. Any 10975// pending HTTP request will be aborted if the provided context is 10976// canceled. 10977func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall { 10978 c.ctx_ = ctx 10979 return c 10980} 10981 10982// Header returns an http.Header that can be modified by the caller to 10983// add HTTP headers to the request. 10984func (c *ObjectsPatchCall) Header() http.Header { 10985 if c.header_ == nil { 10986 c.header_ = make(http.Header) 10987 } 10988 return c.header_ 10989} 10990 10991func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { 10992 reqHeaders := make(http.Header) 10993 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10994 for k, v := range c.header_ { 10995 reqHeaders[k] = v 10996 } 10997 reqHeaders.Set("User-Agent", c.s.userAgent()) 10998 var body io.Reader = nil 10999 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) 11000 if err != nil { 11001 return nil, err 11002 } 11003 reqHeaders.Set("Content-Type", "application/json") 11004 c.urlParams_.Set("alt", alt) 11005 c.urlParams_.Set("prettyPrint", "false") 11006 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 11007 urls += "?" + c.urlParams_.Encode() 11008 req, err := http.NewRequest("PATCH", urls, body) 11009 if err != nil { 11010 return nil, err 11011 } 11012 req.Header = reqHeaders 11013 googleapi.Expand(req.URL, map[string]string{ 11014 "bucket": c.bucket, 11015 "object": c.object, 11016 }) 11017 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11018} 11019 11020// Do executes the "storage.objects.patch" call. 11021// Exactly one of *Object or error will be non-nil. Any non-2xx status 11022// code is an error. Response headers are in either 11023// *Object.ServerResponse.Header or (if a response was returned at all) 11024// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11025// check whether the returned error was because http.StatusNotModified 11026// was returned. 11027func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) { 11028 gensupport.SetOptions(c.urlParams_, opts...) 11029 res, err := c.doRequest("json") 11030 if res != nil && res.StatusCode == http.StatusNotModified { 11031 if res.Body != nil { 11032 res.Body.Close() 11033 } 11034 return nil, &googleapi.Error{ 11035 Code: res.StatusCode, 11036 Header: res.Header, 11037 } 11038 } 11039 if err != nil { 11040 return nil, err 11041 } 11042 defer googleapi.CloseBody(res) 11043 if err := googleapi.CheckResponse(res); err != nil { 11044 return nil, err 11045 } 11046 ret := &Object{ 11047 ServerResponse: googleapi.ServerResponse{ 11048 Header: res.Header, 11049 HTTPStatusCode: res.StatusCode, 11050 }, 11051 } 11052 target := &ret 11053 if err := gensupport.DecodeResponse(target, res); err != nil { 11054 return nil, err 11055 } 11056 return ret, nil 11057 // { 11058 // "description": "Patches an object's metadata.", 11059 // "httpMethod": "PATCH", 11060 // "id": "storage.objects.patch", 11061 // "parameterOrder": [ 11062 // "bucket", 11063 // "object" 11064 // ], 11065 // "parameters": { 11066 // "bucket": { 11067 // "description": "Name of the bucket in which the object resides.", 11068 // "location": "path", 11069 // "required": true, 11070 // "type": "string" 11071 // }, 11072 // "generation": { 11073 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 11074 // "format": "int64", 11075 // "location": "query", 11076 // "type": "string" 11077 // }, 11078 // "ifGenerationMatch": { 11079 // "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.", 11080 // "format": "int64", 11081 // "location": "query", 11082 // "type": "string" 11083 // }, 11084 // "ifGenerationNotMatch": { 11085 // "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.", 11086 // "format": "int64", 11087 // "location": "query", 11088 // "type": "string" 11089 // }, 11090 // "ifMetagenerationMatch": { 11091 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 11092 // "format": "int64", 11093 // "location": "query", 11094 // "type": "string" 11095 // }, 11096 // "ifMetagenerationNotMatch": { 11097 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 11098 // "format": "int64", 11099 // "location": "query", 11100 // "type": "string" 11101 // }, 11102 // "object": { 11103 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11104 // "location": "path", 11105 // "required": true, 11106 // "type": "string" 11107 // }, 11108 // "predefinedAcl": { 11109 // "description": "Apply a predefined set of access controls to this object.", 11110 // "enum": [ 11111 // "authenticatedRead", 11112 // "bucketOwnerFullControl", 11113 // "bucketOwnerRead", 11114 // "private", 11115 // "projectPrivate", 11116 // "publicRead" 11117 // ], 11118 // "enumDescriptions": [ 11119 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 11120 // "Object owner gets OWNER access, and project team owners get OWNER access.", 11121 // "Object owner gets OWNER access, and project team owners get READER access.", 11122 // "Object owner gets OWNER access.", 11123 // "Object owner gets OWNER access, and project team members get access according to their roles.", 11124 // "Object owner gets OWNER access, and allUsers get READER access." 11125 // ], 11126 // "location": "query", 11127 // "type": "string" 11128 // }, 11129 // "projection": { 11130 // "description": "Set of properties to return. Defaults to full.", 11131 // "enum": [ 11132 // "full", 11133 // "noAcl" 11134 // ], 11135 // "enumDescriptions": [ 11136 // "Include all properties.", 11137 // "Omit the owner, acl property." 11138 // ], 11139 // "location": "query", 11140 // "type": "string" 11141 // }, 11142 // "provisionalUserProject": { 11143 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 11144 // "location": "query", 11145 // "type": "string" 11146 // }, 11147 // "userProject": { 11148 // "description": "The project to be billed for this request, for Requester Pays buckets.", 11149 // "location": "query", 11150 // "type": "string" 11151 // } 11152 // }, 11153 // "path": "b/{bucket}/o/{object}", 11154 // "request": { 11155 // "$ref": "Object" 11156 // }, 11157 // "response": { 11158 // "$ref": "Object" 11159 // }, 11160 // "scopes": [ 11161 // "https://www.googleapis.com/auth/cloud-platform", 11162 // "https://www.googleapis.com/auth/devstorage.full_control" 11163 // ] 11164 // } 11165 11166} 11167 11168// method id "storage.objects.rewrite": 11169 11170type ObjectsRewriteCall struct { 11171 s *Service 11172 sourceBucket string 11173 sourceObject string 11174 destinationBucket string 11175 destinationObject string 11176 object *Object 11177 urlParams_ gensupport.URLParams 11178 ctx_ context.Context 11179 header_ http.Header 11180} 11181 11182// Rewrite: Rewrites a source object to a destination object. Optionally 11183// overrides metadata. 11184// 11185// - destinationBucket: Name of the bucket in which to store the new 11186// object. Overrides the provided object metadata's bucket value, if 11187// any. 11188// - destinationObject: Name of the new object. Required when the object 11189// metadata is not otherwise provided. Overrides the object metadata's 11190// name value, if any. For information about how to URL encode object 11191// names to be path safe, see Encoding URI Path Parts. 11192// - sourceBucket: Name of the bucket in which to find the source 11193// object. 11194// - sourceObject: Name of the source object. For information about how 11195// to URL encode object names to be path safe, see Encoding URI Path 11196// Parts. 11197func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall { 11198 c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11199 c.sourceBucket = sourceBucket 11200 c.sourceObject = sourceObject 11201 c.destinationBucket = destinationBucket 11202 c.destinationObject = destinationObject 11203 c.object = object 11204 return c 11205} 11206 11207// DestinationKmsKeyName sets the optional parameter 11208// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the 11209// form 11210// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, 11211// that will be used to encrypt the object. Overrides the object 11212// metadata's kms_key_name value, if any. 11213func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall { 11214 c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName) 11215 return c 11216} 11217 11218// DestinationPredefinedAcl sets the optional parameter 11219// "destinationPredefinedAcl": Apply a predefined set of access controls 11220// to the destination object. 11221// 11222// Possible values: 11223// "authenticatedRead" - Object owner gets OWNER access, and 11224// allAuthenticatedUsers get READER access. 11225// "bucketOwnerFullControl" - Object owner gets OWNER access, and 11226// project team owners get OWNER access. 11227// "bucketOwnerRead" - Object owner gets OWNER access, and project 11228// team owners get READER access. 11229// "private" - Object owner gets OWNER access. 11230// "projectPrivate" - Object owner gets OWNER access, and project team 11231// members get access according to their roles. 11232// "publicRead" - Object owner gets OWNER access, and allUsers get 11233// READER access. 11234func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall { 11235 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl) 11236 return c 11237} 11238 11239// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 11240// Makes the operation conditional on whether the object's current 11241// generation matches the given value. Setting to 0 makes the operation 11242// succeed only if there are no live versions of the object. 11243func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall { 11244 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 11245 return c 11246} 11247 11248// IfGenerationNotMatch sets the optional parameter 11249// "ifGenerationNotMatch": Makes the operation conditional on whether 11250// the object's current generation does not match the given value. If no 11251// live object exists, the precondition fails. Setting to 0 makes the 11252// operation succeed only if there is a live version of the object. 11253func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall { 11254 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 11255 return c 11256} 11257 11258// IfMetagenerationMatch sets the optional parameter 11259// "ifMetagenerationMatch": Makes the operation conditional on whether 11260// the destination object's current metageneration matches the given 11261// value. 11262func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall { 11263 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 11264 return c 11265} 11266 11267// IfMetagenerationNotMatch sets the optional parameter 11268// "ifMetagenerationNotMatch": Makes the operation conditional on 11269// whether the destination object's current metageneration does not 11270// match the given value. 11271func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall { 11272 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 11273 return c 11274} 11275 11276// IfSourceGenerationMatch sets the optional parameter 11277// "ifSourceGenerationMatch": Makes the operation conditional on whether 11278// the source object's current generation matches the given value. 11279func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall { 11280 c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch)) 11281 return c 11282} 11283 11284// IfSourceGenerationNotMatch sets the optional parameter 11285// "ifSourceGenerationNotMatch": Makes the operation conditional on 11286// whether the source object's current generation does not match the 11287// given value. 11288func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall { 11289 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch)) 11290 return c 11291} 11292 11293// IfSourceMetagenerationMatch sets the optional parameter 11294// "ifSourceMetagenerationMatch": Makes the operation conditional on 11295// whether the source object's current metageneration matches the given 11296// value. 11297func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall { 11298 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch)) 11299 return c 11300} 11301 11302// IfSourceMetagenerationNotMatch sets the optional parameter 11303// "ifSourceMetagenerationNotMatch": Makes the operation conditional on 11304// whether the source object's current metageneration does not match the 11305// given value. 11306func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall { 11307 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch)) 11308 return c 11309} 11310 11311// MaxBytesRewrittenPerCall sets the optional parameter 11312// "maxBytesRewrittenPerCall": The maximum number of bytes that will be 11313// rewritten per rewrite request. Most callers shouldn't need to specify 11314// this parameter - it is primarily in place to support testing. If 11315// specified the value must be an integral multiple of 1 MiB (1048576). 11316// Also, this only applies to requests where the source and destination 11317// span locations and/or storage classes. Finally, this value must not 11318// change across rewrite calls else you'll get an error that the 11319// rewriteToken is invalid. 11320func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall { 11321 c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall)) 11322 return c 11323} 11324 11325// Projection sets the optional parameter "projection": Set of 11326// properties to return. Defaults to noAcl, unless the object resource 11327// specifies the acl property, when it defaults to full. 11328// 11329// Possible values: 11330// "full" - Include all properties. 11331// "noAcl" - Omit the owner, acl property. 11332func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall { 11333 c.urlParams_.Set("projection", projection) 11334 return c 11335} 11336 11337// ProvisionalUserProject sets the optional parameter 11338// "provisionalUserProject": The project to be billed for this request 11339// if the target bucket is requester-pays bucket. 11340func (c *ObjectsRewriteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsRewriteCall { 11341 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 11342 return c 11343} 11344 11345// RewriteToken sets the optional parameter "rewriteToken": Include this 11346// field (from the previous rewrite response) on each rewrite request 11347// after the first one, until the rewrite response 'done' flag is true. 11348// Calls that provide a rewriteToken can omit all other request fields, 11349// but if included those fields must match the values provided in the 11350// first rewrite request. 11351func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall { 11352 c.urlParams_.Set("rewriteToken", rewriteToken) 11353 return c 11354} 11355 11356// SourceGeneration sets the optional parameter "sourceGeneration": If 11357// present, selects a specific revision of the source object (as opposed 11358// to the latest version, the default). 11359func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall { 11360 c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration)) 11361 return c 11362} 11363 11364// UserProject sets the optional parameter "userProject": The project to 11365// be billed for this request. Required for Requester Pays buckets. 11366func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall { 11367 c.urlParams_.Set("userProject", userProject) 11368 return c 11369} 11370 11371// Fields allows partial responses to be retrieved. See 11372// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11373// for more information. 11374func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall { 11375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11376 return c 11377} 11378 11379// Context sets the context to be used in this call's Do method. Any 11380// pending HTTP request will be aborted if the provided context is 11381// canceled. 11382func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall { 11383 c.ctx_ = ctx 11384 return c 11385} 11386 11387// Header returns an http.Header that can be modified by the caller to 11388// add HTTP headers to the request. 11389func (c *ObjectsRewriteCall) Header() http.Header { 11390 if c.header_ == nil { 11391 c.header_ = make(http.Header) 11392 } 11393 return c.header_ 11394} 11395 11396func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { 11397 reqHeaders := make(http.Header) 11398 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11399 for k, v := range c.header_ { 11400 reqHeaders[k] = v 11401 } 11402 reqHeaders.Set("User-Agent", c.s.userAgent()) 11403 var body io.Reader = nil 11404 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) 11405 if err != nil { 11406 return nil, err 11407 } 11408 reqHeaders.Set("Content-Type", "application/json") 11409 c.urlParams_.Set("alt", alt) 11410 c.urlParams_.Set("prettyPrint", "false") 11411 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}") 11412 urls += "?" + c.urlParams_.Encode() 11413 req, err := http.NewRequest("POST", urls, body) 11414 if err != nil { 11415 return nil, err 11416 } 11417 req.Header = reqHeaders 11418 googleapi.Expand(req.URL, map[string]string{ 11419 "sourceBucket": c.sourceBucket, 11420 "sourceObject": c.sourceObject, 11421 "destinationBucket": c.destinationBucket, 11422 "destinationObject": c.destinationObject, 11423 }) 11424 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11425} 11426 11427// Do executes the "storage.objects.rewrite" call. 11428// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx 11429// status code is an error. Response headers are in either 11430// *RewriteResponse.ServerResponse.Header or (if a response was returned 11431// at all) in error.(*googleapi.Error).Header. Use 11432// googleapi.IsNotModified to check whether the returned error was 11433// because http.StatusNotModified was returned. 11434func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) { 11435 gensupport.SetOptions(c.urlParams_, opts...) 11436 res, err := c.doRequest("json") 11437 if res != nil && res.StatusCode == http.StatusNotModified { 11438 if res.Body != nil { 11439 res.Body.Close() 11440 } 11441 return nil, &googleapi.Error{ 11442 Code: res.StatusCode, 11443 Header: res.Header, 11444 } 11445 } 11446 if err != nil { 11447 return nil, err 11448 } 11449 defer googleapi.CloseBody(res) 11450 if err := googleapi.CheckResponse(res); err != nil { 11451 return nil, err 11452 } 11453 ret := &RewriteResponse{ 11454 ServerResponse: googleapi.ServerResponse{ 11455 Header: res.Header, 11456 HTTPStatusCode: res.StatusCode, 11457 }, 11458 } 11459 target := &ret 11460 if err := gensupport.DecodeResponse(target, res); err != nil { 11461 return nil, err 11462 } 11463 return ret, nil 11464 // { 11465 // "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", 11466 // "httpMethod": "POST", 11467 // "id": "storage.objects.rewrite", 11468 // "parameterOrder": [ 11469 // "sourceBucket", 11470 // "sourceObject", 11471 // "destinationBucket", 11472 // "destinationObject" 11473 // ], 11474 // "parameters": { 11475 // "destinationBucket": { 11476 // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", 11477 // "location": "path", 11478 // "required": true, 11479 // "type": "string" 11480 // }, 11481 // "destinationKmsKeyName": { 11482 // "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.", 11483 // "location": "query", 11484 // "type": "string" 11485 // }, 11486 // "destinationObject": { 11487 // "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.", 11488 // "location": "path", 11489 // "required": true, 11490 // "type": "string" 11491 // }, 11492 // "destinationPredefinedAcl": { 11493 // "description": "Apply a predefined set of access controls to the destination object.", 11494 // "enum": [ 11495 // "authenticatedRead", 11496 // "bucketOwnerFullControl", 11497 // "bucketOwnerRead", 11498 // "private", 11499 // "projectPrivate", 11500 // "publicRead" 11501 // ], 11502 // "enumDescriptions": [ 11503 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 11504 // "Object owner gets OWNER access, and project team owners get OWNER access.", 11505 // "Object owner gets OWNER access, and project team owners get READER access.", 11506 // "Object owner gets OWNER access.", 11507 // "Object owner gets OWNER access, and project team members get access according to their roles.", 11508 // "Object owner gets OWNER access, and allUsers get READER access." 11509 // ], 11510 // "location": "query", 11511 // "type": "string" 11512 // }, 11513 // "ifGenerationMatch": { 11514 // "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.", 11515 // "format": "int64", 11516 // "location": "query", 11517 // "type": "string" 11518 // }, 11519 // "ifGenerationNotMatch": { 11520 // "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.", 11521 // "format": "int64", 11522 // "location": "query", 11523 // "type": "string" 11524 // }, 11525 // "ifMetagenerationMatch": { 11526 // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", 11527 // "format": "int64", 11528 // "location": "query", 11529 // "type": "string" 11530 // }, 11531 // "ifMetagenerationNotMatch": { 11532 // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", 11533 // "format": "int64", 11534 // "location": "query", 11535 // "type": "string" 11536 // }, 11537 // "ifSourceGenerationMatch": { 11538 // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", 11539 // "format": "int64", 11540 // "location": "query", 11541 // "type": "string" 11542 // }, 11543 // "ifSourceGenerationNotMatch": { 11544 // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", 11545 // "format": "int64", 11546 // "location": "query", 11547 // "type": "string" 11548 // }, 11549 // "ifSourceMetagenerationMatch": { 11550 // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", 11551 // "format": "int64", 11552 // "location": "query", 11553 // "type": "string" 11554 // }, 11555 // "ifSourceMetagenerationNotMatch": { 11556 // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", 11557 // "format": "int64", 11558 // "location": "query", 11559 // "type": "string" 11560 // }, 11561 // "maxBytesRewrittenPerCall": { 11562 // "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.", 11563 // "format": "int64", 11564 // "location": "query", 11565 // "type": "string" 11566 // }, 11567 // "projection": { 11568 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", 11569 // "enum": [ 11570 // "full", 11571 // "noAcl" 11572 // ], 11573 // "enumDescriptions": [ 11574 // "Include all properties.", 11575 // "Omit the owner, acl property." 11576 // ], 11577 // "location": "query", 11578 // "type": "string" 11579 // }, 11580 // "provisionalUserProject": { 11581 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 11582 // "location": "query", 11583 // "type": "string" 11584 // }, 11585 // "rewriteToken": { 11586 // "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.", 11587 // "location": "query", 11588 // "type": "string" 11589 // }, 11590 // "sourceBucket": { 11591 // "description": "Name of the bucket in which to find the source object.", 11592 // "location": "path", 11593 // "required": true, 11594 // "type": "string" 11595 // }, 11596 // "sourceGeneration": { 11597 // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", 11598 // "format": "int64", 11599 // "location": "query", 11600 // "type": "string" 11601 // }, 11602 // "sourceObject": { 11603 // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11604 // "location": "path", 11605 // "required": true, 11606 // "type": "string" 11607 // }, 11608 // "userProject": { 11609 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 11610 // "location": "query", 11611 // "type": "string" 11612 // } 11613 // }, 11614 // "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", 11615 // "request": { 11616 // "$ref": "Object" 11617 // }, 11618 // "response": { 11619 // "$ref": "RewriteResponse" 11620 // }, 11621 // "scopes": [ 11622 // "https://www.googleapis.com/auth/cloud-platform", 11623 // "https://www.googleapis.com/auth/devstorage.full_control", 11624 // "https://www.googleapis.com/auth/devstorage.read_write" 11625 // ] 11626 // } 11627 11628} 11629 11630// method id "storage.objects.setIamPolicy": 11631 11632type ObjectsSetIamPolicyCall struct { 11633 s *Service 11634 bucket string 11635 object string 11636 policy *Policy 11637 urlParams_ gensupport.URLParams 11638 ctx_ context.Context 11639 header_ http.Header 11640} 11641 11642// SetIamPolicy: Updates an IAM policy for the specified object. 11643// 11644// - bucket: Name of the bucket in which the object resides. 11645// - object: Name of the object. For information about how to URL encode 11646// object names to be path safe, see Encoding URI Path Parts. 11647func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall { 11648 c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11649 c.bucket = bucket 11650 c.object = object 11651 c.policy = policy 11652 return c 11653} 11654 11655// Generation sets the optional parameter "generation": If present, 11656// selects a specific revision of this object (as opposed to the latest 11657// version, the default). 11658func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall { 11659 c.urlParams_.Set("generation", fmt.Sprint(generation)) 11660 return c 11661} 11662 11663// ProvisionalUserProject sets the optional parameter 11664// "provisionalUserProject": The project to be billed for this request 11665// if the target bucket is requester-pays bucket. 11666func (c *ObjectsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsSetIamPolicyCall { 11667 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 11668 return c 11669} 11670 11671// UserProject sets the optional parameter "userProject": The project to 11672// be billed for this request. Required for Requester Pays buckets. 11673func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall { 11674 c.urlParams_.Set("userProject", userProject) 11675 return c 11676} 11677 11678// Fields allows partial responses to be retrieved. See 11679// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11680// for more information. 11681func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall { 11682 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11683 return c 11684} 11685 11686// Context sets the context to be used in this call's Do method. Any 11687// pending HTTP request will be aborted if the provided context is 11688// canceled. 11689func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall { 11690 c.ctx_ = ctx 11691 return c 11692} 11693 11694// Header returns an http.Header that can be modified by the caller to 11695// add HTTP headers to the request. 11696func (c *ObjectsSetIamPolicyCall) Header() http.Header { 11697 if c.header_ == nil { 11698 c.header_ = make(http.Header) 11699 } 11700 return c.header_ 11701} 11702 11703func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 11704 reqHeaders := make(http.Header) 11705 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11706 for k, v := range c.header_ { 11707 reqHeaders[k] = v 11708 } 11709 reqHeaders.Set("User-Agent", c.s.userAgent()) 11710 var body io.Reader = nil 11711 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy) 11712 if err != nil { 11713 return nil, err 11714 } 11715 reqHeaders.Set("Content-Type", "application/json") 11716 c.urlParams_.Set("alt", alt) 11717 c.urlParams_.Set("prettyPrint", "false") 11718 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam") 11719 urls += "?" + c.urlParams_.Encode() 11720 req, err := http.NewRequest("PUT", urls, body) 11721 if err != nil { 11722 return nil, err 11723 } 11724 req.Header = reqHeaders 11725 googleapi.Expand(req.URL, map[string]string{ 11726 "bucket": c.bucket, 11727 "object": c.object, 11728 }) 11729 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11730} 11731 11732// Do executes the "storage.objects.setIamPolicy" call. 11733// Exactly one of *Policy or error will be non-nil. Any non-2xx status 11734// code is an error. Response headers are in either 11735// *Policy.ServerResponse.Header or (if a response was returned at all) 11736// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11737// check whether the returned error was because http.StatusNotModified 11738// was returned. 11739func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 11740 gensupport.SetOptions(c.urlParams_, opts...) 11741 res, err := c.doRequest("json") 11742 if res != nil && res.StatusCode == http.StatusNotModified { 11743 if res.Body != nil { 11744 res.Body.Close() 11745 } 11746 return nil, &googleapi.Error{ 11747 Code: res.StatusCode, 11748 Header: res.Header, 11749 } 11750 } 11751 if err != nil { 11752 return nil, err 11753 } 11754 defer googleapi.CloseBody(res) 11755 if err := googleapi.CheckResponse(res); err != nil { 11756 return nil, err 11757 } 11758 ret := &Policy{ 11759 ServerResponse: googleapi.ServerResponse{ 11760 Header: res.Header, 11761 HTTPStatusCode: res.StatusCode, 11762 }, 11763 } 11764 target := &ret 11765 if err := gensupport.DecodeResponse(target, res); err != nil { 11766 return nil, err 11767 } 11768 return ret, nil 11769 // { 11770 // "description": "Updates an IAM policy for the specified object.", 11771 // "httpMethod": "PUT", 11772 // "id": "storage.objects.setIamPolicy", 11773 // "parameterOrder": [ 11774 // "bucket", 11775 // "object" 11776 // ], 11777 // "parameters": { 11778 // "bucket": { 11779 // "description": "Name of the bucket in which the object resides.", 11780 // "location": "path", 11781 // "required": true, 11782 // "type": "string" 11783 // }, 11784 // "generation": { 11785 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 11786 // "format": "int64", 11787 // "location": "query", 11788 // "type": "string" 11789 // }, 11790 // "object": { 11791 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11792 // "location": "path", 11793 // "required": true, 11794 // "type": "string" 11795 // }, 11796 // "provisionalUserProject": { 11797 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 11798 // "location": "query", 11799 // "type": "string" 11800 // }, 11801 // "userProject": { 11802 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 11803 // "location": "query", 11804 // "type": "string" 11805 // } 11806 // }, 11807 // "path": "b/{bucket}/o/{object}/iam", 11808 // "request": { 11809 // "$ref": "Policy" 11810 // }, 11811 // "response": { 11812 // "$ref": "Policy" 11813 // }, 11814 // "scopes": [ 11815 // "https://www.googleapis.com/auth/cloud-platform", 11816 // "https://www.googleapis.com/auth/devstorage.full_control", 11817 // "https://www.googleapis.com/auth/devstorage.read_write" 11818 // ] 11819 // } 11820 11821} 11822 11823// method id "storage.objects.testIamPermissions": 11824 11825type ObjectsTestIamPermissionsCall struct { 11826 s *Service 11827 bucket string 11828 object string 11829 urlParams_ gensupport.URLParams 11830 ifNoneMatch_ string 11831 ctx_ context.Context 11832 header_ http.Header 11833} 11834 11835// TestIamPermissions: Tests a set of permissions on the given object to 11836// see which, if any, are held by the caller. 11837// 11838// - bucket: Name of the bucket in which the object resides. 11839// - object: Name of the object. For information about how to URL encode 11840// object names to be path safe, see Encoding URI Path Parts. 11841// - permissions: Permissions to test. 11842func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall { 11843 c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11844 c.bucket = bucket 11845 c.object = object 11846 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...)) 11847 return c 11848} 11849 11850// Generation sets the optional parameter "generation": If present, 11851// selects a specific revision of this object (as opposed to the latest 11852// version, the default). 11853func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall { 11854 c.urlParams_.Set("generation", fmt.Sprint(generation)) 11855 return c 11856} 11857 11858// ProvisionalUserProject sets the optional parameter 11859// "provisionalUserProject": The project to be billed for this request 11860// if the target bucket is requester-pays bucket. 11861func (c *ObjectsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsTestIamPermissionsCall { 11862 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 11863 return c 11864} 11865 11866// UserProject sets the optional parameter "userProject": The project to 11867// be billed for this request. Required for Requester Pays buckets. 11868func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall { 11869 c.urlParams_.Set("userProject", userProject) 11870 return c 11871} 11872 11873// Fields allows partial responses to be retrieved. See 11874// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11875// for more information. 11876func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall { 11877 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11878 return c 11879} 11880 11881// IfNoneMatch sets the optional parameter which makes the operation 11882// fail if the object's ETag matches the given value. This is useful for 11883// getting updates only after the object has changed since the last 11884// request. Use googleapi.IsNotModified to check whether the response 11885// error from Do is the result of In-None-Match. 11886func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall { 11887 c.ifNoneMatch_ = entityTag 11888 return c 11889} 11890 11891// Context sets the context to be used in this call's Do method. Any 11892// pending HTTP request will be aborted if the provided context is 11893// canceled. 11894func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall { 11895 c.ctx_ = ctx 11896 return c 11897} 11898 11899// Header returns an http.Header that can be modified by the caller to 11900// add HTTP headers to the request. 11901func (c *ObjectsTestIamPermissionsCall) Header() http.Header { 11902 if c.header_ == nil { 11903 c.header_ = make(http.Header) 11904 } 11905 return c.header_ 11906} 11907 11908func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 11909 reqHeaders := make(http.Header) 11910 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11911 for k, v := range c.header_ { 11912 reqHeaders[k] = v 11913 } 11914 reqHeaders.Set("User-Agent", c.s.userAgent()) 11915 if c.ifNoneMatch_ != "" { 11916 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11917 } 11918 var body io.Reader = nil 11919 c.urlParams_.Set("alt", alt) 11920 c.urlParams_.Set("prettyPrint", "false") 11921 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions") 11922 urls += "?" + c.urlParams_.Encode() 11923 req, err := http.NewRequest("GET", urls, body) 11924 if err != nil { 11925 return nil, err 11926 } 11927 req.Header = reqHeaders 11928 googleapi.Expand(req.URL, map[string]string{ 11929 "bucket": c.bucket, 11930 "object": c.object, 11931 }) 11932 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11933} 11934 11935// Do executes the "storage.objects.testIamPermissions" call. 11936// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 11937// Any non-2xx status code is an error. Response headers are in either 11938// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 11939// was returned at all) in error.(*googleapi.Error).Header. Use 11940// googleapi.IsNotModified to check whether the returned error was 11941// because http.StatusNotModified was returned. 11942func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 11943 gensupport.SetOptions(c.urlParams_, opts...) 11944 res, err := c.doRequest("json") 11945 if res != nil && res.StatusCode == http.StatusNotModified { 11946 if res.Body != nil { 11947 res.Body.Close() 11948 } 11949 return nil, &googleapi.Error{ 11950 Code: res.StatusCode, 11951 Header: res.Header, 11952 } 11953 } 11954 if err != nil { 11955 return nil, err 11956 } 11957 defer googleapi.CloseBody(res) 11958 if err := googleapi.CheckResponse(res); err != nil { 11959 return nil, err 11960 } 11961 ret := &TestIamPermissionsResponse{ 11962 ServerResponse: googleapi.ServerResponse{ 11963 Header: res.Header, 11964 HTTPStatusCode: res.StatusCode, 11965 }, 11966 } 11967 target := &ret 11968 if err := gensupport.DecodeResponse(target, res); err != nil { 11969 return nil, err 11970 } 11971 return ret, nil 11972 // { 11973 // "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", 11974 // "httpMethod": "GET", 11975 // "id": "storage.objects.testIamPermissions", 11976 // "parameterOrder": [ 11977 // "bucket", 11978 // "object", 11979 // "permissions" 11980 // ], 11981 // "parameters": { 11982 // "bucket": { 11983 // "description": "Name of the bucket in which the object resides.", 11984 // "location": "path", 11985 // "required": true, 11986 // "type": "string" 11987 // }, 11988 // "generation": { 11989 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 11990 // "format": "int64", 11991 // "location": "query", 11992 // "type": "string" 11993 // }, 11994 // "object": { 11995 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 11996 // "location": "path", 11997 // "required": true, 11998 // "type": "string" 11999 // }, 12000 // "permissions": { 12001 // "description": "Permissions to test.", 12002 // "location": "query", 12003 // "repeated": true, 12004 // "required": true, 12005 // "type": "string" 12006 // }, 12007 // "provisionalUserProject": { 12008 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 12009 // "location": "query", 12010 // "type": "string" 12011 // }, 12012 // "userProject": { 12013 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 12014 // "location": "query", 12015 // "type": "string" 12016 // } 12017 // }, 12018 // "path": "b/{bucket}/o/{object}/iam/testPermissions", 12019 // "response": { 12020 // "$ref": "TestIamPermissionsResponse" 12021 // }, 12022 // "scopes": [ 12023 // "https://www.googleapis.com/auth/cloud-platform", 12024 // "https://www.googleapis.com/auth/cloud-platform.read-only", 12025 // "https://www.googleapis.com/auth/devstorage.full_control", 12026 // "https://www.googleapis.com/auth/devstorage.read_only", 12027 // "https://www.googleapis.com/auth/devstorage.read_write" 12028 // ] 12029 // } 12030 12031} 12032 12033// method id "storage.objects.update": 12034 12035type ObjectsUpdateCall struct { 12036 s *Service 12037 bucket string 12038 object string 12039 object2 *Object 12040 urlParams_ gensupport.URLParams 12041 ctx_ context.Context 12042 header_ http.Header 12043} 12044 12045// Update: Updates an object's metadata. 12046// 12047// - bucket: Name of the bucket in which the object resides. 12048// - object: Name of the object. For information about how to URL encode 12049// object names to be path safe, see Encoding URI Path Parts. 12050func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall { 12051 c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12052 c.bucket = bucket 12053 c.object = object 12054 c.object2 = object2 12055 return c 12056} 12057 12058// Generation sets the optional parameter "generation": If present, 12059// selects a specific revision of this object (as opposed to the latest 12060// version, the default). 12061func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall { 12062 c.urlParams_.Set("generation", fmt.Sprint(generation)) 12063 return c 12064} 12065 12066// IfGenerationMatch sets the optional parameter "ifGenerationMatch": 12067// Makes the operation conditional on whether the object's current 12068// generation matches the given value. Setting to 0 makes the operation 12069// succeed only if there are no live versions of the object. 12070func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall { 12071 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch)) 12072 return c 12073} 12074 12075// IfGenerationNotMatch sets the optional parameter 12076// "ifGenerationNotMatch": Makes the operation conditional on whether 12077// the object's current generation does not match the given value. If no 12078// live object exists, the precondition fails. Setting to 0 makes the 12079// operation succeed only if there is a live version of the object. 12080func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall { 12081 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch)) 12082 return c 12083} 12084 12085// IfMetagenerationMatch sets the optional parameter 12086// "ifMetagenerationMatch": Makes the operation conditional on whether 12087// the object's current metageneration matches the given value. 12088func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall { 12089 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) 12090 return c 12091} 12092 12093// IfMetagenerationNotMatch sets the optional parameter 12094// "ifMetagenerationNotMatch": Makes the operation conditional on 12095// whether the object's current metageneration does not match the given 12096// value. 12097func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall { 12098 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) 12099 return c 12100} 12101 12102// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a 12103// predefined set of access controls to this object. 12104// 12105// Possible values: 12106// "authenticatedRead" - Object owner gets OWNER access, and 12107// allAuthenticatedUsers get READER access. 12108// "bucketOwnerFullControl" - Object owner gets OWNER access, and 12109// project team owners get OWNER access. 12110// "bucketOwnerRead" - Object owner gets OWNER access, and project 12111// team owners get READER access. 12112// "private" - Object owner gets OWNER access. 12113// "projectPrivate" - Object owner gets OWNER access, and project team 12114// members get access according to their roles. 12115// "publicRead" - Object owner gets OWNER access, and allUsers get 12116// READER access. 12117func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall { 12118 c.urlParams_.Set("predefinedAcl", predefinedAcl) 12119 return c 12120} 12121 12122// Projection sets the optional parameter "projection": Set of 12123// properties to return. Defaults to full. 12124// 12125// Possible values: 12126// "full" - Include all properties. 12127// "noAcl" - Omit the owner, acl property. 12128func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall { 12129 c.urlParams_.Set("projection", projection) 12130 return c 12131} 12132 12133// ProvisionalUserProject sets the optional parameter 12134// "provisionalUserProject": The project to be billed for this request 12135// if the target bucket is requester-pays bucket. 12136func (c *ObjectsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsUpdateCall { 12137 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 12138 return c 12139} 12140 12141// UserProject sets the optional parameter "userProject": The project to 12142// be billed for this request. Required for Requester Pays buckets. 12143func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall { 12144 c.urlParams_.Set("userProject", userProject) 12145 return c 12146} 12147 12148// Fields allows partial responses to be retrieved. See 12149// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12150// for more information. 12151func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall { 12152 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12153 return c 12154} 12155 12156// Context sets the context to be used in this call's Do method. Any 12157// pending HTTP request will be aborted if the provided context is 12158// canceled. 12159func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall { 12160 c.ctx_ = ctx 12161 return c 12162} 12163 12164// Header returns an http.Header that can be modified by the caller to 12165// add HTTP headers to the request. 12166func (c *ObjectsUpdateCall) Header() http.Header { 12167 if c.header_ == nil { 12168 c.header_ = make(http.Header) 12169 } 12170 return c.header_ 12171} 12172 12173func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { 12174 reqHeaders := make(http.Header) 12175 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12176 for k, v := range c.header_ { 12177 reqHeaders[k] = v 12178 } 12179 reqHeaders.Set("User-Agent", c.s.userAgent()) 12180 var body io.Reader = nil 12181 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) 12182 if err != nil { 12183 return nil, err 12184 } 12185 reqHeaders.Set("Content-Type", "application/json") 12186 c.urlParams_.Set("alt", alt) 12187 c.urlParams_.Set("prettyPrint", "false") 12188 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") 12189 urls += "?" + c.urlParams_.Encode() 12190 req, err := http.NewRequest("PUT", urls, body) 12191 if err != nil { 12192 return nil, err 12193 } 12194 req.Header = reqHeaders 12195 googleapi.Expand(req.URL, map[string]string{ 12196 "bucket": c.bucket, 12197 "object": c.object, 12198 }) 12199 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12200} 12201 12202// Do executes the "storage.objects.update" call. 12203// Exactly one of *Object or error will be non-nil. Any non-2xx status 12204// code is an error. Response headers are in either 12205// *Object.ServerResponse.Header or (if a response was returned at all) 12206// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12207// check whether the returned error was because http.StatusNotModified 12208// was returned. 12209func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) { 12210 gensupport.SetOptions(c.urlParams_, opts...) 12211 res, err := c.doRequest("json") 12212 if res != nil && res.StatusCode == http.StatusNotModified { 12213 if res.Body != nil { 12214 res.Body.Close() 12215 } 12216 return nil, &googleapi.Error{ 12217 Code: res.StatusCode, 12218 Header: res.Header, 12219 } 12220 } 12221 if err != nil { 12222 return nil, err 12223 } 12224 defer googleapi.CloseBody(res) 12225 if err := googleapi.CheckResponse(res); err != nil { 12226 return nil, err 12227 } 12228 ret := &Object{ 12229 ServerResponse: googleapi.ServerResponse{ 12230 Header: res.Header, 12231 HTTPStatusCode: res.StatusCode, 12232 }, 12233 } 12234 target := &ret 12235 if err := gensupport.DecodeResponse(target, res); err != nil { 12236 return nil, err 12237 } 12238 return ret, nil 12239 // { 12240 // "description": "Updates an object's metadata.", 12241 // "httpMethod": "PUT", 12242 // "id": "storage.objects.update", 12243 // "parameterOrder": [ 12244 // "bucket", 12245 // "object" 12246 // ], 12247 // "parameters": { 12248 // "bucket": { 12249 // "description": "Name of the bucket in which the object resides.", 12250 // "location": "path", 12251 // "required": true, 12252 // "type": "string" 12253 // }, 12254 // "generation": { 12255 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", 12256 // "format": "int64", 12257 // "location": "query", 12258 // "type": "string" 12259 // }, 12260 // "ifGenerationMatch": { 12261 // "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.", 12262 // "format": "int64", 12263 // "location": "query", 12264 // "type": "string" 12265 // }, 12266 // "ifGenerationNotMatch": { 12267 // "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.", 12268 // "format": "int64", 12269 // "location": "query", 12270 // "type": "string" 12271 // }, 12272 // "ifMetagenerationMatch": { 12273 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", 12274 // "format": "int64", 12275 // "location": "query", 12276 // "type": "string" 12277 // }, 12278 // "ifMetagenerationNotMatch": { 12279 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", 12280 // "format": "int64", 12281 // "location": "query", 12282 // "type": "string" 12283 // }, 12284 // "object": { 12285 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 12286 // "location": "path", 12287 // "required": true, 12288 // "type": "string" 12289 // }, 12290 // "predefinedAcl": { 12291 // "description": "Apply a predefined set of access controls to this object.", 12292 // "enum": [ 12293 // "authenticatedRead", 12294 // "bucketOwnerFullControl", 12295 // "bucketOwnerRead", 12296 // "private", 12297 // "projectPrivate", 12298 // "publicRead" 12299 // ], 12300 // "enumDescriptions": [ 12301 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", 12302 // "Object owner gets OWNER access, and project team owners get OWNER access.", 12303 // "Object owner gets OWNER access, and project team owners get READER access.", 12304 // "Object owner gets OWNER access.", 12305 // "Object owner gets OWNER access, and project team members get access according to their roles.", 12306 // "Object owner gets OWNER access, and allUsers get READER access." 12307 // ], 12308 // "location": "query", 12309 // "type": "string" 12310 // }, 12311 // "projection": { 12312 // "description": "Set of properties to return. Defaults to full.", 12313 // "enum": [ 12314 // "full", 12315 // "noAcl" 12316 // ], 12317 // "enumDescriptions": [ 12318 // "Include all properties.", 12319 // "Omit the owner, acl property." 12320 // ], 12321 // "location": "query", 12322 // "type": "string" 12323 // }, 12324 // "provisionalUserProject": { 12325 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 12326 // "location": "query", 12327 // "type": "string" 12328 // }, 12329 // "userProject": { 12330 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 12331 // "location": "query", 12332 // "type": "string" 12333 // } 12334 // }, 12335 // "path": "b/{bucket}/o/{object}", 12336 // "request": { 12337 // "$ref": "Object" 12338 // }, 12339 // "response": { 12340 // "$ref": "Object" 12341 // }, 12342 // "scopes": [ 12343 // "https://www.googleapis.com/auth/cloud-platform", 12344 // "https://www.googleapis.com/auth/devstorage.full_control" 12345 // ] 12346 // } 12347 12348} 12349 12350// method id "storage.objects.watchAll": 12351 12352type ObjectsWatchAllCall struct { 12353 s *Service 12354 bucket string 12355 channel *Channel 12356 urlParams_ gensupport.URLParams 12357 ctx_ context.Context 12358 header_ http.Header 12359} 12360 12361// WatchAll: Watch for changes on all objects in a bucket. 12362// 12363// - bucket: Name of the bucket in which to look for objects. 12364func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall { 12365 c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12366 c.bucket = bucket 12367 c.channel = channel 12368 return c 12369} 12370 12371// Delimiter sets the optional parameter "delimiter": Returns results in 12372// a directory-like mode. items will contain only objects whose names, 12373// aside from the prefix, do not contain delimiter. Objects whose names, 12374// aside from the prefix, contain delimiter will have their name, 12375// truncated after the delimiter, returned in prefixes. Duplicate 12376// prefixes are omitted. 12377func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall { 12378 c.urlParams_.Set("delimiter", delimiter) 12379 return c 12380} 12381 12382// EndOffset sets the optional parameter "endOffset": Filter results to 12383// objects whose names are lexicographically before endOffset. If 12384// startOffset is also set, the objects listed will have names between 12385// startOffset (inclusive) and endOffset (exclusive). 12386func (c *ObjectsWatchAllCall) EndOffset(endOffset string) *ObjectsWatchAllCall { 12387 c.urlParams_.Set("endOffset", endOffset) 12388 return c 12389} 12390 12391// IncludeTrailingDelimiter sets the optional parameter 12392// "includeTrailingDelimiter": If true, objects that end in exactly one 12393// instance of delimiter will have their metadata included in items in 12394// addition to prefixes. 12395func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall { 12396 c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter)) 12397 return c 12398} 12399 12400// MaxResults sets the optional parameter "maxResults": Maximum number 12401// of items plus prefixes to return in a single page of responses. As 12402// duplicate prefixes are omitted, fewer total results may be returned 12403// than requested. The service will use this parameter or 1,000 items, 12404// whichever is smaller. 12405func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall { 12406 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12407 return c 12408} 12409 12410// PageToken sets the optional parameter "pageToken": A 12411// previously-returned page token representing part of the larger set of 12412// results to view. 12413func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall { 12414 c.urlParams_.Set("pageToken", pageToken) 12415 return c 12416} 12417 12418// Prefix sets the optional parameter "prefix": Filter results to 12419// objects whose names begin with this prefix. 12420func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall { 12421 c.urlParams_.Set("prefix", prefix) 12422 return c 12423} 12424 12425// Projection sets the optional parameter "projection": Set of 12426// properties to return. Defaults to noAcl. 12427// 12428// Possible values: 12429// "full" - Include all properties. 12430// "noAcl" - Omit the owner, acl property. 12431func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall { 12432 c.urlParams_.Set("projection", projection) 12433 return c 12434} 12435 12436// ProvisionalUserProject sets the optional parameter 12437// "provisionalUserProject": The project to be billed for this request 12438// if the target bucket is requester-pays bucket. 12439func (c *ObjectsWatchAllCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsWatchAllCall { 12440 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 12441 return c 12442} 12443 12444// StartOffset sets the optional parameter "startOffset": Filter results 12445// to objects whose names are lexicographically equal to or after 12446// startOffset. If endOffset is also set, the objects listed will have 12447// names between startOffset (inclusive) and endOffset (exclusive). 12448func (c *ObjectsWatchAllCall) StartOffset(startOffset string) *ObjectsWatchAllCall { 12449 c.urlParams_.Set("startOffset", startOffset) 12450 return c 12451} 12452 12453// UserProject sets the optional parameter "userProject": The project to 12454// be billed for this request. Required for Requester Pays buckets. 12455func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall { 12456 c.urlParams_.Set("userProject", userProject) 12457 return c 12458} 12459 12460// Versions sets the optional parameter "versions": If true, lists all 12461// versions of an object as distinct results. The default is false. For 12462// more information, see Object Versioning. 12463func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall { 12464 c.urlParams_.Set("versions", fmt.Sprint(versions)) 12465 return c 12466} 12467 12468// Fields allows partial responses to be retrieved. See 12469// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12470// for more information. 12471func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall { 12472 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12473 return c 12474} 12475 12476// Context sets the context to be used in this call's Do method. Any 12477// pending HTTP request will be aborted if the provided context is 12478// canceled. 12479func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall { 12480 c.ctx_ = ctx 12481 return c 12482} 12483 12484// Header returns an http.Header that can be modified by the caller to 12485// add HTTP headers to the request. 12486func (c *ObjectsWatchAllCall) Header() http.Header { 12487 if c.header_ == nil { 12488 c.header_ = make(http.Header) 12489 } 12490 return c.header_ 12491} 12492 12493func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { 12494 reqHeaders := make(http.Header) 12495 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12496 for k, v := range c.header_ { 12497 reqHeaders[k] = v 12498 } 12499 reqHeaders.Set("User-Agent", c.s.userAgent()) 12500 var body io.Reader = nil 12501 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 12502 if err != nil { 12503 return nil, err 12504 } 12505 reqHeaders.Set("Content-Type", "application/json") 12506 c.urlParams_.Set("alt", alt) 12507 c.urlParams_.Set("prettyPrint", "false") 12508 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch") 12509 urls += "?" + c.urlParams_.Encode() 12510 req, err := http.NewRequest("POST", urls, body) 12511 if err != nil { 12512 return nil, err 12513 } 12514 req.Header = reqHeaders 12515 googleapi.Expand(req.URL, map[string]string{ 12516 "bucket": c.bucket, 12517 }) 12518 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12519} 12520 12521// Do executes the "storage.objects.watchAll" call. 12522// Exactly one of *Channel or error will be non-nil. Any non-2xx status 12523// code is an error. Response headers are in either 12524// *Channel.ServerResponse.Header or (if a response was returned at all) 12525// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12526// check whether the returned error was because http.StatusNotModified 12527// was returned. 12528func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 12529 gensupport.SetOptions(c.urlParams_, opts...) 12530 res, err := c.doRequest("json") 12531 if res != nil && res.StatusCode == http.StatusNotModified { 12532 if res.Body != nil { 12533 res.Body.Close() 12534 } 12535 return nil, &googleapi.Error{ 12536 Code: res.StatusCode, 12537 Header: res.Header, 12538 } 12539 } 12540 if err != nil { 12541 return nil, err 12542 } 12543 defer googleapi.CloseBody(res) 12544 if err := googleapi.CheckResponse(res); err != nil { 12545 return nil, err 12546 } 12547 ret := &Channel{ 12548 ServerResponse: googleapi.ServerResponse{ 12549 Header: res.Header, 12550 HTTPStatusCode: res.StatusCode, 12551 }, 12552 } 12553 target := &ret 12554 if err := gensupport.DecodeResponse(target, res); err != nil { 12555 return nil, err 12556 } 12557 return ret, nil 12558 // { 12559 // "description": "Watch for changes on all objects in a bucket.", 12560 // "httpMethod": "POST", 12561 // "id": "storage.objects.watchAll", 12562 // "parameterOrder": [ 12563 // "bucket" 12564 // ], 12565 // "parameters": { 12566 // "bucket": { 12567 // "description": "Name of the bucket in which to look for objects.", 12568 // "location": "path", 12569 // "required": true, 12570 // "type": "string" 12571 // }, 12572 // "delimiter": { 12573 // "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.", 12574 // "location": "query", 12575 // "type": "string" 12576 // }, 12577 // "endOffset": { 12578 // "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).", 12579 // "location": "query", 12580 // "type": "string" 12581 // }, 12582 // "includeTrailingDelimiter": { 12583 // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", 12584 // "location": "query", 12585 // "type": "boolean" 12586 // }, 12587 // "maxResults": { 12588 // "default": "1000", 12589 // "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.", 12590 // "format": "uint32", 12591 // "location": "query", 12592 // "minimum": "0", 12593 // "type": "integer" 12594 // }, 12595 // "pageToken": { 12596 // "description": "A previously-returned page token representing part of the larger set of results to view.", 12597 // "location": "query", 12598 // "type": "string" 12599 // }, 12600 // "prefix": { 12601 // "description": "Filter results to objects whose names begin with this prefix.", 12602 // "location": "query", 12603 // "type": "string" 12604 // }, 12605 // "projection": { 12606 // "description": "Set of properties to return. Defaults to noAcl.", 12607 // "enum": [ 12608 // "full", 12609 // "noAcl" 12610 // ], 12611 // "enumDescriptions": [ 12612 // "Include all properties.", 12613 // "Omit the owner, acl property." 12614 // ], 12615 // "location": "query", 12616 // "type": "string" 12617 // }, 12618 // "provisionalUserProject": { 12619 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 12620 // "location": "query", 12621 // "type": "string" 12622 // }, 12623 // "startOffset": { 12624 // "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).", 12625 // "location": "query", 12626 // "type": "string" 12627 // }, 12628 // "userProject": { 12629 // "description": "The project to be billed for this request. Required for Requester Pays buckets.", 12630 // "location": "query", 12631 // "type": "string" 12632 // }, 12633 // "versions": { 12634 // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", 12635 // "location": "query", 12636 // "type": "boolean" 12637 // } 12638 // }, 12639 // "path": "b/{bucket}/o/watch", 12640 // "request": { 12641 // "$ref": "Channel", 12642 // "parameterName": "resource" 12643 // }, 12644 // "response": { 12645 // "$ref": "Channel" 12646 // }, 12647 // "scopes": [ 12648 // "https://www.googleapis.com/auth/cloud-platform", 12649 // "https://www.googleapis.com/auth/cloud-platform.read-only", 12650 // "https://www.googleapis.com/auth/devstorage.full_control", 12651 // "https://www.googleapis.com/auth/devstorage.read_only", 12652 // "https://www.googleapis.com/auth/devstorage.read_write" 12653 // ], 12654 // "supportsSubscription": true 12655 // } 12656 12657} 12658 12659// method id "storage.projects.hmacKeys.create": 12660 12661type ProjectsHmacKeysCreateCall struct { 12662 s *Service 12663 projectId string 12664 urlParams_ gensupport.URLParams 12665 ctx_ context.Context 12666 header_ http.Header 12667} 12668 12669// Create: Creates a new HMAC key for the specified service account. 12670// 12671// - projectId: Project ID owning the service account. 12672// - serviceAccountEmail: Email address of the service account. 12673func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall { 12674 c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12675 c.projectId = projectId 12676 c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail) 12677 return c 12678} 12679 12680// UserProject sets the optional parameter "userProject": The project to 12681// be billed for this request. 12682func (c *ProjectsHmacKeysCreateCall) UserProject(userProject string) *ProjectsHmacKeysCreateCall { 12683 c.urlParams_.Set("userProject", userProject) 12684 return c 12685} 12686 12687// Fields allows partial responses to be retrieved. See 12688// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12689// for more information. 12690func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall { 12691 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12692 return c 12693} 12694 12695// Context sets the context to be used in this call's Do method. Any 12696// pending HTTP request will be aborted if the provided context is 12697// canceled. 12698func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall { 12699 c.ctx_ = ctx 12700 return c 12701} 12702 12703// Header returns an http.Header that can be modified by the caller to 12704// add HTTP headers to the request. 12705func (c *ProjectsHmacKeysCreateCall) Header() http.Header { 12706 if c.header_ == nil { 12707 c.header_ = make(http.Header) 12708 } 12709 return c.header_ 12710} 12711 12712func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) { 12713 reqHeaders := make(http.Header) 12714 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12715 for k, v := range c.header_ { 12716 reqHeaders[k] = v 12717 } 12718 reqHeaders.Set("User-Agent", c.s.userAgent()) 12719 var body io.Reader = nil 12720 c.urlParams_.Set("alt", alt) 12721 c.urlParams_.Set("prettyPrint", "false") 12722 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") 12723 urls += "?" + c.urlParams_.Encode() 12724 req, err := http.NewRequest("POST", urls, body) 12725 if err != nil { 12726 return nil, err 12727 } 12728 req.Header = reqHeaders 12729 googleapi.Expand(req.URL, map[string]string{ 12730 "projectId": c.projectId, 12731 }) 12732 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12733} 12734 12735// Do executes the "storage.projects.hmacKeys.create" call. 12736// Exactly one of *HmacKey or error will be non-nil. Any non-2xx status 12737// code is an error. Response headers are in either 12738// *HmacKey.ServerResponse.Header or (if a response was returned at all) 12739// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12740// check whether the returned error was because http.StatusNotModified 12741// was returned. 12742func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) { 12743 gensupport.SetOptions(c.urlParams_, opts...) 12744 res, err := c.doRequest("json") 12745 if res != nil && res.StatusCode == http.StatusNotModified { 12746 if res.Body != nil { 12747 res.Body.Close() 12748 } 12749 return nil, &googleapi.Error{ 12750 Code: res.StatusCode, 12751 Header: res.Header, 12752 } 12753 } 12754 if err != nil { 12755 return nil, err 12756 } 12757 defer googleapi.CloseBody(res) 12758 if err := googleapi.CheckResponse(res); err != nil { 12759 return nil, err 12760 } 12761 ret := &HmacKey{ 12762 ServerResponse: googleapi.ServerResponse{ 12763 Header: res.Header, 12764 HTTPStatusCode: res.StatusCode, 12765 }, 12766 } 12767 target := &ret 12768 if err := gensupport.DecodeResponse(target, res); err != nil { 12769 return nil, err 12770 } 12771 return ret, nil 12772 // { 12773 // "description": "Creates a new HMAC key for the specified service account.", 12774 // "httpMethod": "POST", 12775 // "id": "storage.projects.hmacKeys.create", 12776 // "parameterOrder": [ 12777 // "projectId", 12778 // "serviceAccountEmail" 12779 // ], 12780 // "parameters": { 12781 // "projectId": { 12782 // "description": "Project ID owning the service account.", 12783 // "location": "path", 12784 // "required": true, 12785 // "type": "string" 12786 // }, 12787 // "serviceAccountEmail": { 12788 // "description": "Email address of the service account.", 12789 // "location": "query", 12790 // "required": true, 12791 // "type": "string" 12792 // }, 12793 // "userProject": { 12794 // "description": "The project to be billed for this request.", 12795 // "location": "query", 12796 // "type": "string" 12797 // } 12798 // }, 12799 // "path": "projects/{projectId}/hmacKeys", 12800 // "response": { 12801 // "$ref": "HmacKey" 12802 // }, 12803 // "scopes": [ 12804 // "https://www.googleapis.com/auth/cloud-platform", 12805 // "https://www.googleapis.com/auth/devstorage.full_control" 12806 // ] 12807 // } 12808 12809} 12810 12811// method id "storage.projects.hmacKeys.delete": 12812 12813type ProjectsHmacKeysDeleteCall struct { 12814 s *Service 12815 projectId string 12816 accessId string 12817 urlParams_ gensupport.URLParams 12818 ctx_ context.Context 12819 header_ http.Header 12820} 12821 12822// Delete: Deletes an HMAC key. 12823// 12824// - accessId: Name of the HMAC key to be deleted. 12825// - projectId: Project ID owning the requested key. 12826func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall { 12827 c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12828 c.projectId = projectId 12829 c.accessId = accessId 12830 return c 12831} 12832 12833// UserProject sets the optional parameter "userProject": The project to 12834// be billed for this request. 12835func (c *ProjectsHmacKeysDeleteCall) UserProject(userProject string) *ProjectsHmacKeysDeleteCall { 12836 c.urlParams_.Set("userProject", userProject) 12837 return c 12838} 12839 12840// Fields allows partial responses to be retrieved. See 12841// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12842// for more information. 12843func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall { 12844 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12845 return c 12846} 12847 12848// Context sets the context to be used in this call's Do method. Any 12849// pending HTTP request will be aborted if the provided context is 12850// canceled. 12851func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall { 12852 c.ctx_ = ctx 12853 return c 12854} 12855 12856// Header returns an http.Header that can be modified by the caller to 12857// add HTTP headers to the request. 12858func (c *ProjectsHmacKeysDeleteCall) Header() http.Header { 12859 if c.header_ == nil { 12860 c.header_ = make(http.Header) 12861 } 12862 return c.header_ 12863} 12864 12865func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) { 12866 reqHeaders := make(http.Header) 12867 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12868 for k, v := range c.header_ { 12869 reqHeaders[k] = v 12870 } 12871 reqHeaders.Set("User-Agent", c.s.userAgent()) 12872 var body io.Reader = nil 12873 c.urlParams_.Set("alt", alt) 12874 c.urlParams_.Set("prettyPrint", "false") 12875 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") 12876 urls += "?" + c.urlParams_.Encode() 12877 req, err := http.NewRequest("DELETE", urls, body) 12878 if err != nil { 12879 return nil, err 12880 } 12881 req.Header = reqHeaders 12882 googleapi.Expand(req.URL, map[string]string{ 12883 "projectId": c.projectId, 12884 "accessId": c.accessId, 12885 }) 12886 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12887} 12888 12889// Do executes the "storage.projects.hmacKeys.delete" call. 12890func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error { 12891 gensupport.SetOptions(c.urlParams_, opts...) 12892 res, err := c.doRequest("json") 12893 if err != nil { 12894 return err 12895 } 12896 defer googleapi.CloseBody(res) 12897 if err := googleapi.CheckResponse(res); err != nil { 12898 return err 12899 } 12900 return nil 12901 // { 12902 // "description": "Deletes an HMAC key.", 12903 // "httpMethod": "DELETE", 12904 // "id": "storage.projects.hmacKeys.delete", 12905 // "parameterOrder": [ 12906 // "projectId", 12907 // "accessId" 12908 // ], 12909 // "parameters": { 12910 // "accessId": { 12911 // "description": "Name of the HMAC key to be deleted.", 12912 // "location": "path", 12913 // "required": true, 12914 // "type": "string" 12915 // }, 12916 // "projectId": { 12917 // "description": "Project ID owning the requested key", 12918 // "location": "path", 12919 // "required": true, 12920 // "type": "string" 12921 // }, 12922 // "userProject": { 12923 // "description": "The project to be billed for this request.", 12924 // "location": "query", 12925 // "type": "string" 12926 // } 12927 // }, 12928 // "path": "projects/{projectId}/hmacKeys/{accessId}", 12929 // "scopes": [ 12930 // "https://www.googleapis.com/auth/cloud-platform", 12931 // "https://www.googleapis.com/auth/devstorage.full_control", 12932 // "https://www.googleapis.com/auth/devstorage.read_write" 12933 // ] 12934 // } 12935 12936} 12937 12938// method id "storage.projects.hmacKeys.get": 12939 12940type ProjectsHmacKeysGetCall struct { 12941 s *Service 12942 projectId string 12943 accessId string 12944 urlParams_ gensupport.URLParams 12945 ifNoneMatch_ string 12946 ctx_ context.Context 12947 header_ http.Header 12948} 12949 12950// Get: Retrieves an HMAC key's metadata 12951// 12952// - accessId: Name of the HMAC key. 12953// - projectId: Project ID owning the service account of the requested 12954// key. 12955func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall { 12956 c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12957 c.projectId = projectId 12958 c.accessId = accessId 12959 return c 12960} 12961 12962// UserProject sets the optional parameter "userProject": The project to 12963// be billed for this request. 12964func (c *ProjectsHmacKeysGetCall) UserProject(userProject string) *ProjectsHmacKeysGetCall { 12965 c.urlParams_.Set("userProject", userProject) 12966 return c 12967} 12968 12969// Fields allows partial responses to be retrieved. See 12970// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12971// for more information. 12972func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall { 12973 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12974 return c 12975} 12976 12977// IfNoneMatch sets the optional parameter which makes the operation 12978// fail if the object's ETag matches the given value. This is useful for 12979// getting updates only after the object has changed since the last 12980// request. Use googleapi.IsNotModified to check whether the response 12981// error from Do is the result of In-None-Match. 12982func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall { 12983 c.ifNoneMatch_ = entityTag 12984 return c 12985} 12986 12987// Context sets the context to be used in this call's Do method. Any 12988// pending HTTP request will be aborted if the provided context is 12989// canceled. 12990func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall { 12991 c.ctx_ = ctx 12992 return c 12993} 12994 12995// Header returns an http.Header that can be modified by the caller to 12996// add HTTP headers to the request. 12997func (c *ProjectsHmacKeysGetCall) Header() http.Header { 12998 if c.header_ == nil { 12999 c.header_ = make(http.Header) 13000 } 13001 return c.header_ 13002} 13003 13004func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) { 13005 reqHeaders := make(http.Header) 13006 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13007 for k, v := range c.header_ { 13008 reqHeaders[k] = v 13009 } 13010 reqHeaders.Set("User-Agent", c.s.userAgent()) 13011 if c.ifNoneMatch_ != "" { 13012 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13013 } 13014 var body io.Reader = nil 13015 c.urlParams_.Set("alt", alt) 13016 c.urlParams_.Set("prettyPrint", "false") 13017 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") 13018 urls += "?" + c.urlParams_.Encode() 13019 req, err := http.NewRequest("GET", urls, body) 13020 if err != nil { 13021 return nil, err 13022 } 13023 req.Header = reqHeaders 13024 googleapi.Expand(req.URL, map[string]string{ 13025 "projectId": c.projectId, 13026 "accessId": c.accessId, 13027 }) 13028 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13029} 13030 13031// Do executes the "storage.projects.hmacKeys.get" call. 13032// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx 13033// status code is an error. Response headers are in either 13034// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned 13035// at all) in error.(*googleapi.Error).Header. Use 13036// googleapi.IsNotModified to check whether the returned error was 13037// because http.StatusNotModified was returned. 13038func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) { 13039 gensupport.SetOptions(c.urlParams_, opts...) 13040 res, err := c.doRequest("json") 13041 if res != nil && res.StatusCode == http.StatusNotModified { 13042 if res.Body != nil { 13043 res.Body.Close() 13044 } 13045 return nil, &googleapi.Error{ 13046 Code: res.StatusCode, 13047 Header: res.Header, 13048 } 13049 } 13050 if err != nil { 13051 return nil, err 13052 } 13053 defer googleapi.CloseBody(res) 13054 if err := googleapi.CheckResponse(res); err != nil { 13055 return nil, err 13056 } 13057 ret := &HmacKeyMetadata{ 13058 ServerResponse: googleapi.ServerResponse{ 13059 Header: res.Header, 13060 HTTPStatusCode: res.StatusCode, 13061 }, 13062 } 13063 target := &ret 13064 if err := gensupport.DecodeResponse(target, res); err != nil { 13065 return nil, err 13066 } 13067 return ret, nil 13068 // { 13069 // "description": "Retrieves an HMAC key's metadata", 13070 // "httpMethod": "GET", 13071 // "id": "storage.projects.hmacKeys.get", 13072 // "parameterOrder": [ 13073 // "projectId", 13074 // "accessId" 13075 // ], 13076 // "parameters": { 13077 // "accessId": { 13078 // "description": "Name of the HMAC key.", 13079 // "location": "path", 13080 // "required": true, 13081 // "type": "string" 13082 // }, 13083 // "projectId": { 13084 // "description": "Project ID owning the service account of the requested key.", 13085 // "location": "path", 13086 // "required": true, 13087 // "type": "string" 13088 // }, 13089 // "userProject": { 13090 // "description": "The project to be billed for this request.", 13091 // "location": "query", 13092 // "type": "string" 13093 // } 13094 // }, 13095 // "path": "projects/{projectId}/hmacKeys/{accessId}", 13096 // "response": { 13097 // "$ref": "HmacKeyMetadata" 13098 // }, 13099 // "scopes": [ 13100 // "https://www.googleapis.com/auth/cloud-platform", 13101 // "https://www.googleapis.com/auth/cloud-platform.read-only", 13102 // "https://www.googleapis.com/auth/devstorage.full_control", 13103 // "https://www.googleapis.com/auth/devstorage.read_only" 13104 // ] 13105 // } 13106 13107} 13108 13109// method id "storage.projects.hmacKeys.list": 13110 13111type ProjectsHmacKeysListCall struct { 13112 s *Service 13113 projectId string 13114 urlParams_ gensupport.URLParams 13115 ifNoneMatch_ string 13116 ctx_ context.Context 13117 header_ http.Header 13118} 13119 13120// List: Retrieves a list of HMAC keys matching the criteria. 13121// 13122// - projectId: Name of the project in which to look for HMAC keys. 13123func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall { 13124 c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13125 c.projectId = projectId 13126 return c 13127} 13128 13129// MaxResults sets the optional parameter "maxResults": Maximum number 13130// of items to return in a single page of responses. The service uses 13131// this parameter or 250 items, whichever is smaller. The max number of 13132// items per page will also be limited by the number of distinct service 13133// accounts in the response. If the number of service accounts in a 13134// single response is too high, the page will truncated and a next page 13135// token will be returned. 13136func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall { 13137 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 13138 return c 13139} 13140 13141// PageToken sets the optional parameter "pageToken": A 13142// previously-returned page token representing part of the larger set of 13143// results to view. 13144func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall { 13145 c.urlParams_.Set("pageToken", pageToken) 13146 return c 13147} 13148 13149// ServiceAccountEmail sets the optional parameter 13150// "serviceAccountEmail": If present, only keys for the given service 13151// account are returned. 13152func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall { 13153 c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail) 13154 return c 13155} 13156 13157// ShowDeletedKeys sets the optional parameter "showDeletedKeys": 13158// Whether or not to show keys in the DELETED state. 13159func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall { 13160 c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys)) 13161 return c 13162} 13163 13164// UserProject sets the optional parameter "userProject": The project to 13165// be billed for this request. 13166func (c *ProjectsHmacKeysListCall) UserProject(userProject string) *ProjectsHmacKeysListCall { 13167 c.urlParams_.Set("userProject", userProject) 13168 return c 13169} 13170 13171// Fields allows partial responses to be retrieved. See 13172// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13173// for more information. 13174func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall { 13175 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13176 return c 13177} 13178 13179// IfNoneMatch sets the optional parameter which makes the operation 13180// fail if the object's ETag matches the given value. This is useful for 13181// getting updates only after the object has changed since the last 13182// request. Use googleapi.IsNotModified to check whether the response 13183// error from Do is the result of In-None-Match. 13184func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall { 13185 c.ifNoneMatch_ = entityTag 13186 return c 13187} 13188 13189// Context sets the context to be used in this call's Do method. Any 13190// pending HTTP request will be aborted if the provided context is 13191// canceled. 13192func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall { 13193 c.ctx_ = ctx 13194 return c 13195} 13196 13197// Header returns an http.Header that can be modified by the caller to 13198// add HTTP headers to the request. 13199func (c *ProjectsHmacKeysListCall) Header() http.Header { 13200 if c.header_ == nil { 13201 c.header_ = make(http.Header) 13202 } 13203 return c.header_ 13204} 13205 13206func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) { 13207 reqHeaders := make(http.Header) 13208 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13209 for k, v := range c.header_ { 13210 reqHeaders[k] = v 13211 } 13212 reqHeaders.Set("User-Agent", c.s.userAgent()) 13213 if c.ifNoneMatch_ != "" { 13214 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13215 } 13216 var body io.Reader = nil 13217 c.urlParams_.Set("alt", alt) 13218 c.urlParams_.Set("prettyPrint", "false") 13219 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys") 13220 urls += "?" + c.urlParams_.Encode() 13221 req, err := http.NewRequest("GET", urls, body) 13222 if err != nil { 13223 return nil, err 13224 } 13225 req.Header = reqHeaders 13226 googleapi.Expand(req.URL, map[string]string{ 13227 "projectId": c.projectId, 13228 }) 13229 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13230} 13231 13232// Do executes the "storage.projects.hmacKeys.list" call. 13233// Exactly one of *HmacKeysMetadata or error will be non-nil. Any 13234// non-2xx status code is an error. Response headers are in either 13235// *HmacKeysMetadata.ServerResponse.Header or (if a response was 13236// returned at all) in error.(*googleapi.Error).Header. Use 13237// googleapi.IsNotModified to check whether the returned error was 13238// because http.StatusNotModified was returned. 13239func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) { 13240 gensupport.SetOptions(c.urlParams_, opts...) 13241 res, err := c.doRequest("json") 13242 if res != nil && res.StatusCode == http.StatusNotModified { 13243 if res.Body != nil { 13244 res.Body.Close() 13245 } 13246 return nil, &googleapi.Error{ 13247 Code: res.StatusCode, 13248 Header: res.Header, 13249 } 13250 } 13251 if err != nil { 13252 return nil, err 13253 } 13254 defer googleapi.CloseBody(res) 13255 if err := googleapi.CheckResponse(res); err != nil { 13256 return nil, err 13257 } 13258 ret := &HmacKeysMetadata{ 13259 ServerResponse: googleapi.ServerResponse{ 13260 Header: res.Header, 13261 HTTPStatusCode: res.StatusCode, 13262 }, 13263 } 13264 target := &ret 13265 if err := gensupport.DecodeResponse(target, res); err != nil { 13266 return nil, err 13267 } 13268 return ret, nil 13269 // { 13270 // "description": "Retrieves a list of HMAC keys matching the criteria.", 13271 // "httpMethod": "GET", 13272 // "id": "storage.projects.hmacKeys.list", 13273 // "parameterOrder": [ 13274 // "projectId" 13275 // ], 13276 // "parameters": { 13277 // "maxResults": { 13278 // "default": "250", 13279 // "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.", 13280 // "format": "uint32", 13281 // "location": "query", 13282 // "minimum": "0", 13283 // "type": "integer" 13284 // }, 13285 // "pageToken": { 13286 // "description": "A previously-returned page token representing part of the larger set of results to view.", 13287 // "location": "query", 13288 // "type": "string" 13289 // }, 13290 // "projectId": { 13291 // "description": "Name of the project in which to look for HMAC keys.", 13292 // "location": "path", 13293 // "required": true, 13294 // "type": "string" 13295 // }, 13296 // "serviceAccountEmail": { 13297 // "description": "If present, only keys for the given service account are returned.", 13298 // "location": "query", 13299 // "type": "string" 13300 // }, 13301 // "showDeletedKeys": { 13302 // "description": "Whether or not to show keys in the DELETED state.", 13303 // "location": "query", 13304 // "type": "boolean" 13305 // }, 13306 // "userProject": { 13307 // "description": "The project to be billed for this request.", 13308 // "location": "query", 13309 // "type": "string" 13310 // } 13311 // }, 13312 // "path": "projects/{projectId}/hmacKeys", 13313 // "response": { 13314 // "$ref": "HmacKeysMetadata" 13315 // }, 13316 // "scopes": [ 13317 // "https://www.googleapis.com/auth/cloud-platform", 13318 // "https://www.googleapis.com/auth/cloud-platform.read-only", 13319 // "https://www.googleapis.com/auth/devstorage.full_control", 13320 // "https://www.googleapis.com/auth/devstorage.read_only" 13321 // ] 13322 // } 13323 13324} 13325 13326// Pages invokes f for each page of results. 13327// A non-nil error returned from f will halt the iteration. 13328// The provided context supersedes any context provided to the Context method. 13329func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error { 13330 c.ctx_ = ctx 13331 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13332 for { 13333 x, err := c.Do() 13334 if err != nil { 13335 return err 13336 } 13337 if err := f(x); err != nil { 13338 return err 13339 } 13340 if x.NextPageToken == "" { 13341 return nil 13342 } 13343 c.PageToken(x.NextPageToken) 13344 } 13345} 13346 13347// method id "storage.projects.hmacKeys.update": 13348 13349type ProjectsHmacKeysUpdateCall struct { 13350 s *Service 13351 projectId string 13352 accessId string 13353 hmackeymetadata *HmacKeyMetadata 13354 urlParams_ gensupport.URLParams 13355 ctx_ context.Context 13356 header_ http.Header 13357} 13358 13359// Update: Updates the state of an HMAC key. See the HMAC Key resource 13360// descriptor for valid states. 13361// 13362// - accessId: Name of the HMAC key being updated. 13363// - projectId: Project ID owning the service account of the updated 13364// key. 13365func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall { 13366 c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13367 c.projectId = projectId 13368 c.accessId = accessId 13369 c.hmackeymetadata = hmackeymetadata 13370 return c 13371} 13372 13373// UserProject sets the optional parameter "userProject": The project to 13374// be billed for this request. 13375func (c *ProjectsHmacKeysUpdateCall) UserProject(userProject string) *ProjectsHmacKeysUpdateCall { 13376 c.urlParams_.Set("userProject", userProject) 13377 return c 13378} 13379 13380// Fields allows partial responses to be retrieved. See 13381// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13382// for more information. 13383func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall { 13384 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13385 return c 13386} 13387 13388// Context sets the context to be used in this call's Do method. Any 13389// pending HTTP request will be aborted if the provided context is 13390// canceled. 13391func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall { 13392 c.ctx_ = ctx 13393 return c 13394} 13395 13396// Header returns an http.Header that can be modified by the caller to 13397// add HTTP headers to the request. 13398func (c *ProjectsHmacKeysUpdateCall) Header() http.Header { 13399 if c.header_ == nil { 13400 c.header_ = make(http.Header) 13401 } 13402 return c.header_ 13403} 13404 13405func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) { 13406 reqHeaders := make(http.Header) 13407 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13408 for k, v := range c.header_ { 13409 reqHeaders[k] = v 13410 } 13411 reqHeaders.Set("User-Agent", c.s.userAgent()) 13412 var body io.Reader = nil 13413 body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata) 13414 if err != nil { 13415 return nil, err 13416 } 13417 reqHeaders.Set("Content-Type", "application/json") 13418 c.urlParams_.Set("alt", alt) 13419 c.urlParams_.Set("prettyPrint", "false") 13420 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}") 13421 urls += "?" + c.urlParams_.Encode() 13422 req, err := http.NewRequest("PUT", urls, body) 13423 if err != nil { 13424 return nil, err 13425 } 13426 req.Header = reqHeaders 13427 googleapi.Expand(req.URL, map[string]string{ 13428 "projectId": c.projectId, 13429 "accessId": c.accessId, 13430 }) 13431 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13432} 13433 13434// Do executes the "storage.projects.hmacKeys.update" call. 13435// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx 13436// status code is an error. Response headers are in either 13437// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned 13438// at all) in error.(*googleapi.Error).Header. Use 13439// googleapi.IsNotModified to check whether the returned error was 13440// because http.StatusNotModified was returned. 13441func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) { 13442 gensupport.SetOptions(c.urlParams_, opts...) 13443 res, err := c.doRequest("json") 13444 if res != nil && res.StatusCode == http.StatusNotModified { 13445 if res.Body != nil { 13446 res.Body.Close() 13447 } 13448 return nil, &googleapi.Error{ 13449 Code: res.StatusCode, 13450 Header: res.Header, 13451 } 13452 } 13453 if err != nil { 13454 return nil, err 13455 } 13456 defer googleapi.CloseBody(res) 13457 if err := googleapi.CheckResponse(res); err != nil { 13458 return nil, err 13459 } 13460 ret := &HmacKeyMetadata{ 13461 ServerResponse: googleapi.ServerResponse{ 13462 Header: res.Header, 13463 HTTPStatusCode: res.StatusCode, 13464 }, 13465 } 13466 target := &ret 13467 if err := gensupport.DecodeResponse(target, res); err != nil { 13468 return nil, err 13469 } 13470 return ret, nil 13471 // { 13472 // "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", 13473 // "httpMethod": "PUT", 13474 // "id": "storage.projects.hmacKeys.update", 13475 // "parameterOrder": [ 13476 // "projectId", 13477 // "accessId" 13478 // ], 13479 // "parameters": { 13480 // "accessId": { 13481 // "description": "Name of the HMAC key being updated.", 13482 // "location": "path", 13483 // "required": true, 13484 // "type": "string" 13485 // }, 13486 // "projectId": { 13487 // "description": "Project ID owning the service account of the updated key.", 13488 // "location": "path", 13489 // "required": true, 13490 // "type": "string" 13491 // }, 13492 // "userProject": { 13493 // "description": "The project to be billed for this request.", 13494 // "location": "query", 13495 // "type": "string" 13496 // } 13497 // }, 13498 // "path": "projects/{projectId}/hmacKeys/{accessId}", 13499 // "request": { 13500 // "$ref": "HmacKeyMetadata" 13501 // }, 13502 // "response": { 13503 // "$ref": "HmacKeyMetadata" 13504 // }, 13505 // "scopes": [ 13506 // "https://www.googleapis.com/auth/cloud-platform", 13507 // "https://www.googleapis.com/auth/devstorage.full_control" 13508 // ] 13509 // } 13510 13511} 13512 13513// method id "storage.projects.serviceAccount.get": 13514 13515type ProjectsServiceAccountGetCall struct { 13516 s *Service 13517 projectId string 13518 urlParams_ gensupport.URLParams 13519 ifNoneMatch_ string 13520 ctx_ context.Context 13521 header_ http.Header 13522} 13523 13524// Get: Get the email address of this project's Google Cloud Storage 13525// service account. 13526// 13527// - projectId: Project ID. 13528func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall { 13529 c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13530 c.projectId = projectId 13531 return c 13532} 13533 13534// ProvisionalUserProject sets the optional parameter 13535// "provisionalUserProject": The project to be billed for this request 13536// if the target bucket is requester-pays bucket. 13537func (c *ProjectsServiceAccountGetCall) ProvisionalUserProject(provisionalUserProject string) *ProjectsServiceAccountGetCall { 13538 c.urlParams_.Set("provisionalUserProject", provisionalUserProject) 13539 return c 13540} 13541 13542// UserProject sets the optional parameter "userProject": The project to 13543// be billed for this request. 13544func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall { 13545 c.urlParams_.Set("userProject", userProject) 13546 return c 13547} 13548 13549// Fields allows partial responses to be retrieved. See 13550// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13551// for more information. 13552func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall { 13553 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13554 return c 13555} 13556 13557// IfNoneMatch sets the optional parameter which makes the operation 13558// fail if the object's ETag matches the given value. This is useful for 13559// getting updates only after the object has changed since the last 13560// request. Use googleapi.IsNotModified to check whether the response 13561// error from Do is the result of In-None-Match. 13562func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall { 13563 c.ifNoneMatch_ = entityTag 13564 return c 13565} 13566 13567// Context sets the context to be used in this call's Do method. Any 13568// pending HTTP request will be aborted if the provided context is 13569// canceled. 13570func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall { 13571 c.ctx_ = ctx 13572 return c 13573} 13574 13575// Header returns an http.Header that can be modified by the caller to 13576// add HTTP headers to the request. 13577func (c *ProjectsServiceAccountGetCall) Header() http.Header { 13578 if c.header_ == nil { 13579 c.header_ = make(http.Header) 13580 } 13581 return c.header_ 13582} 13583 13584func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) { 13585 reqHeaders := make(http.Header) 13586 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 13587 for k, v := range c.header_ { 13588 reqHeaders[k] = v 13589 } 13590 reqHeaders.Set("User-Agent", c.s.userAgent()) 13591 if c.ifNoneMatch_ != "" { 13592 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13593 } 13594 var body io.Reader = nil 13595 c.urlParams_.Set("alt", alt) 13596 c.urlParams_.Set("prettyPrint", "false") 13597 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount") 13598 urls += "?" + c.urlParams_.Encode() 13599 req, err := http.NewRequest("GET", urls, body) 13600 if err != nil { 13601 return nil, err 13602 } 13603 req.Header = reqHeaders 13604 googleapi.Expand(req.URL, map[string]string{ 13605 "projectId": c.projectId, 13606 }) 13607 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13608} 13609 13610// Do executes the "storage.projects.serviceAccount.get" call. 13611// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx 13612// status code is an error. Response headers are in either 13613// *ServiceAccount.ServerResponse.Header or (if a response was returned 13614// at all) in error.(*googleapi.Error).Header. Use 13615// googleapi.IsNotModified to check whether the returned error was 13616// because http.StatusNotModified was returned. 13617func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) { 13618 gensupport.SetOptions(c.urlParams_, opts...) 13619 res, err := c.doRequest("json") 13620 if res != nil && res.StatusCode == http.StatusNotModified { 13621 if res.Body != nil { 13622 res.Body.Close() 13623 } 13624 return nil, &googleapi.Error{ 13625 Code: res.StatusCode, 13626 Header: res.Header, 13627 } 13628 } 13629 if err != nil { 13630 return nil, err 13631 } 13632 defer googleapi.CloseBody(res) 13633 if err := googleapi.CheckResponse(res); err != nil { 13634 return nil, err 13635 } 13636 ret := &ServiceAccount{ 13637 ServerResponse: googleapi.ServerResponse{ 13638 Header: res.Header, 13639 HTTPStatusCode: res.StatusCode, 13640 }, 13641 } 13642 target := &ret 13643 if err := gensupport.DecodeResponse(target, res); err != nil { 13644 return nil, err 13645 } 13646 return ret, nil 13647 // { 13648 // "description": "Get the email address of this project's Google Cloud Storage service account.", 13649 // "httpMethod": "GET", 13650 // "id": "storage.projects.serviceAccount.get", 13651 // "parameterOrder": [ 13652 // "projectId" 13653 // ], 13654 // "parameters": { 13655 // "projectId": { 13656 // "description": "Project ID", 13657 // "location": "path", 13658 // "required": true, 13659 // "type": "string" 13660 // }, 13661 // "provisionalUserProject": { 13662 // "description": "The project to be billed for this request if the target bucket is requester-pays bucket.", 13663 // "location": "query", 13664 // "type": "string" 13665 // }, 13666 // "userProject": { 13667 // "description": "The project to be billed for this request.", 13668 // "location": "query", 13669 // "type": "string" 13670 // } 13671 // }, 13672 // "path": "projects/{projectId}/serviceAccount", 13673 // "response": { 13674 // "$ref": "ServiceAccount" 13675 // }, 13676 // "scopes": [ 13677 // "https://www.googleapis.com/auth/cloud-platform", 13678 // "https://www.googleapis.com/auth/cloud-platform.read-only", 13679 // "https://www.googleapis.com/auth/devstorage.full_control", 13680 // "https://www.googleapis.com/auth/devstorage.read_only", 13681 // "https://www.googleapis.com/auth/devstorage.read_write" 13682 // ] 13683 // } 13684 13685} 13686