...

Source file src/google.golang.org/api/storage/v1/storage-gen.go

Documentation: google.golang.org/api/storage/v1

     1  // Copyright 2024 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  // # Library status
    14  //
    15  // These client libraries are officially supported by Google. However, this
    16  // library is considered complete and is in maintenance mode. This means
    17  // that we will address critical bugs and security issues but will not add
    18  // any new features.
    19  //
    20  // When possible, we recommend using our newer
    21  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    22  // that are still actively being worked and iterated on.
    23  //
    24  // # Creating a client
    25  //
    26  // Usage example:
    27  //
    28  //	import "google.golang.org/api/storage/v1"
    29  //	...
    30  //	ctx := context.Background()
    31  //	storageService, err := storage.NewService(ctx)
    32  //
    33  // In this example, Google Application Default Credentials are used for
    34  // authentication. For information on how to create and obtain Application
    35  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    36  //
    37  // # Other authentication options
    38  //
    39  // By default, all available scopes (see "Constants") are used to authenticate.
    40  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    41  //
    42  //	storageService, err := storage.NewService(ctx, option.WithScopes(storage.DevstorageReadWriteScope))
    43  //
    44  // To use an API key for authentication (note: some APIs do not support API
    45  // keys), use [google.golang.org/api/option.WithAPIKey]:
    46  //
    47  //	storageService, err := storage.NewService(ctx, option.WithAPIKey("AIza..."))
    48  //
    49  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    50  // flow, use [google.golang.org/api/option.WithTokenSource]:
    51  //
    52  //	config := &oauth2.Config{...}
    53  //	// ...
    54  //	token, err := config.Exchange(ctx, ...)
    55  //	storageService, err := storage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    56  //
    57  // See [google.golang.org/api/option.ClientOption] for details on options.
    58  package storage // import "google.golang.org/api/storage/v1"
    59  
    60  import (
    61  	"bytes"
    62  	"context"
    63  	"encoding/json"
    64  	"errors"
    65  	"fmt"
    66  	"io"
    67  	"net/http"
    68  	"net/url"
    69  	"strconv"
    70  	"strings"
    71  
    72  	"github.com/googleapis/gax-go/v2"
    73  	googleapi "google.golang.org/api/googleapi"
    74  	internal "google.golang.org/api/internal"
    75  	gensupport "google.golang.org/api/internal/gensupport"
    76  	option "google.golang.org/api/option"
    77  	internaloption "google.golang.org/api/option/internaloption"
    78  	htransport "google.golang.org/api/transport/http"
    79  )
    80  
    81  // Always reference these packages, just in case the auto-generated code
    82  // below doesn't.
    83  var _ = bytes.NewBuffer
    84  var _ = strconv.Itoa
    85  var _ = fmt.Sprintf
    86  var _ = json.NewDecoder
    87  var _ = io.Copy
    88  var _ = url.Parse
    89  var _ = gensupport.MarshalJSON
    90  var _ = googleapi.Version
    91  var _ = errors.New
    92  var _ = strings.Replace
    93  var _ = context.Canceled
    94  var _ = internaloption.WithDefaultEndpoint
    95  var _ = internal.Version
    96  
    97  const apiId = "storage:v1"
    98  const apiName = "storage"
    99  const apiVersion = "v1"
   100  const basePath = "https://storage.googleapis.com/storage/v1/"
   101  const basePathTemplate = "https://storage.UNIVERSE_DOMAIN/storage/v1/"
   102  const mtlsBasePath = "https://storage.mtls.googleapis.com/storage/v1/"
   103  
   104  // OAuth2 scopes used by this API.
   105  const (
   106  	// View and manage your data across Google Cloud Platform services
   107  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   108  
   109  	// View your data across Google Cloud Platform services
   110  	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
   111  
   112  	// Manage your data and permissions in Google Cloud Storage
   113  	DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
   114  
   115  	// View your data in Google Cloud Storage
   116  	DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
   117  
   118  	// Manage your data in Google Cloud Storage
   119  	DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
   120  )
   121  
   122  // NewService creates a new Service.
   123  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   124  	scopesOption := internaloption.WithDefaultScopes(
   125  		"https://www.googleapis.com/auth/cloud-platform",
   126  		"https://www.googleapis.com/auth/cloud-platform.read-only",
   127  		"https://www.googleapis.com/auth/devstorage.full_control",
   128  		"https://www.googleapis.com/auth/devstorage.read_only",
   129  		"https://www.googleapis.com/auth/devstorage.read_write",
   130  	)
   131  	// NOTE: prepend, so we don't override user-specified scopes.
   132  	opts = append([]option.ClientOption{scopesOption}, opts...)
   133  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   134  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   135  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   136  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   137  	if err != nil {
   138  		return nil, err
   139  	}
   140  	s, err := New(client)
   141  	if err != nil {
   142  		return nil, err
   143  	}
   144  	if endpoint != "" {
   145  		s.BasePath = endpoint
   146  	}
   147  	return s, nil
   148  }
   149  
   150  // New creates a new Service. It uses the provided http.Client for requests.
   151  //
   152  // Deprecated: please use NewService instead.
   153  // To provide a custom HTTP client, use option.WithHTTPClient.
   154  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   155  func New(client *http.Client) (*Service, error) {
   156  	if client == nil {
   157  		return nil, errors.New("client is nil")
   158  	}
   159  	s := &Service{client: client, BasePath: basePath}
   160  	s.AnywhereCaches = NewAnywhereCachesService(s)
   161  	s.BucketAccessControls = NewBucketAccessControlsService(s)
   162  	s.Buckets = NewBucketsService(s)
   163  	s.Channels = NewChannelsService(s)
   164  	s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
   165  	s.Folders = NewFoldersService(s)
   166  	s.ManagedFolders = NewManagedFoldersService(s)
   167  	s.Notifications = NewNotificationsService(s)
   168  	s.ObjectAccessControls = NewObjectAccessControlsService(s)
   169  	s.Objects = NewObjectsService(s)
   170  	s.Operations = NewOperationsService(s)
   171  	s.Projects = NewProjectsService(s)
   172  	return s, nil
   173  }
   174  
   175  type Service struct {
   176  	client    *http.Client
   177  	BasePath  string // API endpoint base URL
   178  	UserAgent string // optional additional User-Agent fragment
   179  
   180  	AnywhereCaches *AnywhereCachesService
   181  
   182  	BucketAccessControls *BucketAccessControlsService
   183  
   184  	Buckets *BucketsService
   185  
   186  	Channels *ChannelsService
   187  
   188  	DefaultObjectAccessControls *DefaultObjectAccessControlsService
   189  
   190  	Folders *FoldersService
   191  
   192  	ManagedFolders *ManagedFoldersService
   193  
   194  	Notifications *NotificationsService
   195  
   196  	ObjectAccessControls *ObjectAccessControlsService
   197  
   198  	Objects *ObjectsService
   199  
   200  	Operations *OperationsService
   201  
   202  	Projects *ProjectsService
   203  }
   204  
   205  func (s *Service) userAgent() string {
   206  	if s.UserAgent == "" {
   207  		return googleapi.UserAgent
   208  	}
   209  	return googleapi.UserAgent + " " + s.UserAgent
   210  }
   211  
   212  func NewAnywhereCachesService(s *Service) *AnywhereCachesService {
   213  	rs := &AnywhereCachesService{s: s}
   214  	return rs
   215  }
   216  
   217  type AnywhereCachesService struct {
   218  	s *Service
   219  }
   220  
   221  func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
   222  	rs := &BucketAccessControlsService{s: s}
   223  	return rs
   224  }
   225  
   226  type BucketAccessControlsService struct {
   227  	s *Service
   228  }
   229  
   230  func NewBucketsService(s *Service) *BucketsService {
   231  	rs := &BucketsService{s: s}
   232  	return rs
   233  }
   234  
   235  type BucketsService struct {
   236  	s *Service
   237  }
   238  
   239  func NewChannelsService(s *Service) *ChannelsService {
   240  	rs := &ChannelsService{s: s}
   241  	return rs
   242  }
   243  
   244  type ChannelsService struct {
   245  	s *Service
   246  }
   247  
   248  func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
   249  	rs := &DefaultObjectAccessControlsService{s: s}
   250  	return rs
   251  }
   252  
   253  type DefaultObjectAccessControlsService struct {
   254  	s *Service
   255  }
   256  
   257  func NewFoldersService(s *Service) *FoldersService {
   258  	rs := &FoldersService{s: s}
   259  	return rs
   260  }
   261  
   262  type FoldersService struct {
   263  	s *Service
   264  }
   265  
   266  func NewManagedFoldersService(s *Service) *ManagedFoldersService {
   267  	rs := &ManagedFoldersService{s: s}
   268  	return rs
   269  }
   270  
   271  type ManagedFoldersService struct {
   272  	s *Service
   273  }
   274  
   275  func NewNotificationsService(s *Service) *NotificationsService {
   276  	rs := &NotificationsService{s: s}
   277  	return rs
   278  }
   279  
   280  type NotificationsService struct {
   281  	s *Service
   282  }
   283  
   284  func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
   285  	rs := &ObjectAccessControlsService{s: s}
   286  	return rs
   287  }
   288  
   289  type ObjectAccessControlsService struct {
   290  	s *Service
   291  }
   292  
   293  func NewObjectsService(s *Service) *ObjectsService {
   294  	rs := &ObjectsService{s: s}
   295  	return rs
   296  }
   297  
   298  type ObjectsService struct {
   299  	s *Service
   300  }
   301  
   302  func NewOperationsService(s *Service) *OperationsService {
   303  	rs := &OperationsService{s: s}
   304  	return rs
   305  }
   306  
   307  type OperationsService struct {
   308  	s *Service
   309  }
   310  
   311  func NewProjectsService(s *Service) *ProjectsService {
   312  	rs := &ProjectsService{s: s}
   313  	rs.HmacKeys = NewProjectsHmacKeysService(s)
   314  	rs.ServiceAccount = NewProjectsServiceAccountService(s)
   315  	return rs
   316  }
   317  
   318  type ProjectsService struct {
   319  	s *Service
   320  
   321  	HmacKeys *ProjectsHmacKeysService
   322  
   323  	ServiceAccount *ProjectsServiceAccountService
   324  }
   325  
   326  func NewProjectsHmacKeysService(s *Service) *ProjectsHmacKeysService {
   327  	rs := &ProjectsHmacKeysService{s: s}
   328  	return rs
   329  }
   330  
   331  type ProjectsHmacKeysService struct {
   332  	s *Service
   333  }
   334  
   335  func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
   336  	rs := &ProjectsServiceAccountService{s: s}
   337  	return rs
   338  }
   339  
   340  type ProjectsServiceAccountService struct {
   341  	s *Service
   342  }
   343  
   344  // AnywhereCache: An Anywhere Cache instance.
   345  type AnywhereCache struct {
   346  	// AdmissionPolicy: The cache-level entry admission policy.
   347  	AdmissionPolicy string `json:"admissionPolicy,omitempty"`
   348  	// AnywhereCacheId: The ID of the Anywhere cache instance.
   349  	AnywhereCacheId string `json:"anywhereCacheId,omitempty"`
   350  	// Bucket: The name of the bucket containing this cache instance.
   351  	Bucket string `json:"bucket,omitempty"`
   352  	// CreateTime: The creation time of the cache instance in RFC 3339 format.
   353  	CreateTime string `json:"createTime,omitempty"`
   354  	// Id: The ID of the resource, including the project number, bucket name and
   355  	// anywhere cache ID.
   356  	Id string `json:"id,omitempty"`
   357  	// Kind: The kind of item this is. For Anywhere Cache, this is always
   358  	// storage#anywhereCache.
   359  	Kind string `json:"kind,omitempty"`
   360  	// PendingUpdate: True if the cache instance has an active Update long-running
   361  	// operation.
   362  	PendingUpdate bool `json:"pendingUpdate,omitempty"`
   363  	// SelfLink: The link to this cache instance.
   364  	SelfLink string `json:"selfLink,omitempty"`
   365  	// State: The current state of the cache instance.
   366  	State string `json:"state,omitempty"`
   367  	// Ttl: The TTL of all cache entries in whole seconds. e.g., "7200s".
   368  	Ttl string `json:"ttl,omitempty"`
   369  	// UpdateTime: The modification time of the cache instance metadata in RFC 3339
   370  	// format.
   371  	UpdateTime string `json:"updateTime,omitempty"`
   372  	// Zone: The zone in which the cache instance is running. For example,
   373  	// us-central1-a.
   374  	Zone string `json:"zone,omitempty"`
   375  
   376  	// ServerResponse contains the HTTP response code and headers from the server.
   377  	googleapi.ServerResponse `json:"-"`
   378  	// ForceSendFields is a list of field names (e.g. "AdmissionPolicy") to
   379  	// unconditionally include in API requests. By default, fields with empty or
   380  	// default values are omitted from API requests. See
   381  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   382  	// details.
   383  	ForceSendFields []string `json:"-"`
   384  	// NullFields is a list of field names (e.g. "AdmissionPolicy") to include in
   385  	// API requests with the JSON null value. By default, fields with empty values
   386  	// are omitted from API requests. See
   387  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   388  	NullFields []string `json:"-"`
   389  }
   390  
   391  func (s *AnywhereCache) MarshalJSON() ([]byte, error) {
   392  	type NoMethod AnywhereCache
   393  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   394  }
   395  
   396  // AnywhereCaches: A list of Anywhere Caches.
   397  type AnywhereCaches struct {
   398  	// Items: The list of items.
   399  	Items []*AnywhereCache `json:"items,omitempty"`
   400  	// Kind: The kind of item this is. For lists of Anywhere Caches, this is always
   401  	// storage#anywhereCaches.
   402  	Kind string `json:"kind,omitempty"`
   403  	// NextPageToken: The continuation token, used to page through large result
   404  	// sets. Provide this value in a subsequent request to return the next page of
   405  	// results.
   406  	NextPageToken string `json:"nextPageToken,omitempty"`
   407  
   408  	// ServerResponse contains the HTTP response code and headers from the server.
   409  	googleapi.ServerResponse `json:"-"`
   410  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
   411  	// include in API requests. By default, fields with empty or default values are
   412  	// omitted from API requests. See
   413  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   414  	// details.
   415  	ForceSendFields []string `json:"-"`
   416  	// NullFields is a list of field names (e.g. "Items") to include in API
   417  	// requests with the JSON null value. By default, fields with empty values are
   418  	// omitted from API requests. See
   419  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   420  	NullFields []string `json:"-"`
   421  }
   422  
   423  func (s *AnywhereCaches) MarshalJSON() ([]byte, error) {
   424  	type NoMethod AnywhereCaches
   425  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   426  }
   427  
   428  // Bucket: A bucket.
   429  type Bucket struct {
   430  	// Acl: Access controls on the bucket.
   431  	Acl []*BucketAccessControl `json:"acl,omitempty"`
   432  	// Autoclass: The bucket's Autoclass configuration.
   433  	Autoclass *BucketAutoclass `json:"autoclass,omitempty"`
   434  	// Billing: The bucket's billing configuration.
   435  	Billing *BucketBilling `json:"billing,omitempty"`
   436  	// Cors: The bucket's Cross-Origin Resource Sharing (CORS) configuration.
   437  	Cors []*BucketCors `json:"cors,omitempty"`
   438  	// CustomPlacementConfig: The bucket's custom placement configuration for
   439  	// Custom Dual Regions.
   440  	CustomPlacementConfig *BucketCustomPlacementConfig `json:"customPlacementConfig,omitempty"`
   441  	// DefaultEventBasedHold: The default value for event-based hold on newly
   442  	// created objects in this bucket. Event-based hold is a way to retain objects
   443  	// indefinitely until an event occurs, signified by the hold's release. After
   444  	// being released, such objects will be subject to bucket-level retention (if
   445  	// any). One sample use case of this flag is for banks to hold loan documents
   446  	// for at least 3 years after loan is paid in full. Here, bucket-level
   447  	// retention is 3 years and the event is loan being paid in full. In this
   448  	// example, these objects will be held intact for any number of years until the
   449  	// event has occurred (event-based hold on the object is released) and then 3
   450  	// more years after that. That means retention duration of the objects begins
   451  	// from the moment event-based hold transitioned from true to false. Objects
   452  	// under event-based hold cannot be deleted, overwritten or archived until the
   453  	// hold is removed.
   454  	DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
   455  	// DefaultObjectAcl: Default access controls to apply to new objects when no
   456  	// ACL is provided.
   457  	DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
   458  	// Encryption: Encryption configuration for a bucket.
   459  	Encryption *BucketEncryption `json:"encryption,omitempty"`
   460  	// Etag: HTTP 1.1 Entity tag for the bucket.
   461  	Etag string `json:"etag,omitempty"`
   462  	// HierarchicalNamespace: The bucket's hierarchical namespace configuration.
   463  	HierarchicalNamespace *BucketHierarchicalNamespace `json:"hierarchicalNamespace,omitempty"`
   464  	// IamConfiguration: The bucket's IAM configuration.
   465  	IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"`
   466  	// Id: The ID of the bucket. For buckets, the id and name properties are the
   467  	// same.
   468  	Id string `json:"id,omitempty"`
   469  	// Kind: The kind of item this is. For buckets, this is always storage#bucket.
   470  	Kind string `json:"kind,omitempty"`
   471  	// Labels: User-provided labels, in key/value pairs.
   472  	Labels map[string]string `json:"labels,omitempty"`
   473  	// Lifecycle: The bucket's lifecycle configuration. See lifecycle management
   474  	// for more information.
   475  	Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
   476  	// Location: The location of the bucket. Object data for objects in the bucket
   477  	// resides in physical storage within this region. Defaults to US. See the
   478  	// developer's guide for the authoritative list.
   479  	Location string `json:"location,omitempty"`
   480  	// LocationType: The type of the bucket location.
   481  	LocationType string `json:"locationType,omitempty"`
   482  	// Logging: The bucket's logging configuration, which defines the destination
   483  	// bucket and optional name prefix for the current bucket's logs.
   484  	Logging *BucketLogging `json:"logging,omitempty"`
   485  	// Metageneration: The metadata generation of this bucket.
   486  	Metageneration int64 `json:"metageneration,omitempty,string"`
   487  	// Name: The name of the bucket.
   488  	Name string `json:"name,omitempty"`
   489  	// ObjectRetention: The bucket's object retention config.
   490  	ObjectRetention *BucketObjectRetention `json:"objectRetention,omitempty"`
   491  	// Owner: The owner of the bucket. This is always the project team's owner
   492  	// group.
   493  	Owner *BucketOwner `json:"owner,omitempty"`
   494  	// ProjectNumber: The project number of the project the bucket belongs to.
   495  	ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
   496  	// RetentionPolicy: The bucket's retention policy. The retention policy
   497  	// enforces a minimum retention time for all objects contained in the bucket,
   498  	// based on their creation time. Any attempt to overwrite or delete objects
   499  	// younger than the retention period will result in a PERMISSION_DENIED error.
   500  	// An unlocked retention policy can be modified or removed from the bucket via
   501  	// a storage.buckets.update operation. A locked retention policy cannot be
   502  	// removed or shortened in duration for the lifetime of the bucket. Attempting
   503  	// to remove or decrease period of a locked retention policy will result in a
   504  	// PERMISSION_DENIED error.
   505  	RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"`
   506  	// Rpo: The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO
   507  	// to turn on Turbo Replication on a bucket.
   508  	Rpo string `json:"rpo,omitempty"`
   509  	// SatisfiesPZS: Reserved for future use.
   510  	SatisfiesPZS bool `json:"satisfiesPZS,omitempty"`
   511  	// SelfLink: The URI of this bucket.
   512  	SelfLink string `json:"selfLink,omitempty"`
   513  	// SoftDeletePolicy: The bucket's soft delete policy, which defines the period
   514  	// of time that soft-deleted objects will be retained, and cannot be
   515  	// permanently deleted.
   516  	SoftDeletePolicy *BucketSoftDeletePolicy `json:"softDeletePolicy,omitempty"`
   517  	// StorageClass: The bucket's default storage class, used whenever no
   518  	// storageClass is specified for a newly-created object. This defines how
   519  	// objects in the bucket are stored and determines the SLA and the cost of
   520  	// storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE,
   521  	// COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not
   522  	// specified when the bucket is created, it will default to STANDARD. For more
   523  	// information, see storage classes.
   524  	StorageClass string `json:"storageClass,omitempty"`
   525  	// TimeCreated: The creation time of the bucket in RFC 3339 format.
   526  	TimeCreated string `json:"timeCreated,omitempty"`
   527  	// Updated: The modification time of the bucket in RFC 3339 format.
   528  	Updated string `json:"updated,omitempty"`
   529  	// Versioning: The bucket's versioning configuration.
   530  	Versioning *BucketVersioning `json:"versioning,omitempty"`
   531  	// Website: The bucket's website configuration, controlling how the service
   532  	// behaves when accessing bucket contents as a web site. See the Static Website
   533  	// Examples for more information.
   534  	Website *BucketWebsite `json:"website,omitempty"`
   535  
   536  	// ServerResponse contains the HTTP response code and headers from the server.
   537  	googleapi.ServerResponse `json:"-"`
   538  	// ForceSendFields is a list of field names (e.g. "Acl") to unconditionally
   539  	// include in API requests. By default, fields with empty or default values are
   540  	// omitted from API requests. See
   541  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   542  	// details.
   543  	ForceSendFields []string `json:"-"`
   544  	// NullFields is a list of field names (e.g. "Acl") to include in API requests
   545  	// with the JSON null value. By default, fields with empty values are omitted
   546  	// from API requests. See
   547  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   548  	NullFields []string `json:"-"`
   549  }
   550  
   551  func (s *Bucket) MarshalJSON() ([]byte, error) {
   552  	type NoMethod Bucket
   553  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   554  }
   555  
   556  // BucketAutoclass: The bucket's Autoclass configuration.
   557  type BucketAutoclass struct {
   558  	// Enabled: Whether or not Autoclass is enabled on this bucket
   559  	Enabled bool `json:"enabled,omitempty"`
   560  	// TerminalStorageClass: The storage class that objects in the bucket
   561  	// eventually transition to if they are not read for a certain length of time.
   562  	// Valid values are NEARLINE and ARCHIVE.
   563  	TerminalStorageClass string `json:"terminalStorageClass,omitempty"`
   564  	// TerminalStorageClassUpdateTime: A date and time in RFC 3339 format
   565  	// representing the time of the most recent update to "terminalStorageClass".
   566  	TerminalStorageClassUpdateTime string `json:"terminalStorageClassUpdateTime,omitempty"`
   567  	// ToggleTime: A date and time in RFC 3339 format representing the instant at
   568  	// which "enabled" was last toggled.
   569  	ToggleTime string `json:"toggleTime,omitempty"`
   570  	// ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally
   571  	// include in API requests. By default, fields with empty or default values are
   572  	// omitted from API requests. See
   573  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   574  	// details.
   575  	ForceSendFields []string `json:"-"`
   576  	// NullFields is a list of field names (e.g. "Enabled") to include in API
   577  	// requests with the JSON null value. By default, fields with empty values are
   578  	// omitted from API requests. See
   579  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   580  	NullFields []string `json:"-"`
   581  }
   582  
   583  func (s *BucketAutoclass) MarshalJSON() ([]byte, error) {
   584  	type NoMethod BucketAutoclass
   585  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   586  }
   587  
   588  // BucketBilling: The bucket's billing configuration.
   589  type BucketBilling struct {
   590  	// RequesterPays: When set to true, Requester Pays is enabled for this bucket.
   591  	RequesterPays bool `json:"requesterPays,omitempty"`
   592  	// ForceSendFields is a list of field names (e.g. "RequesterPays") to
   593  	// unconditionally include in API requests. By default, fields with empty or
   594  	// default values are omitted from API requests. See
   595  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   596  	// details.
   597  	ForceSendFields []string `json:"-"`
   598  	// NullFields is a list of field names (e.g. "RequesterPays") to include in API
   599  	// requests with the JSON null value. By default, fields with empty values are
   600  	// omitted from API requests. See
   601  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   602  	NullFields []string `json:"-"`
   603  }
   604  
   605  func (s *BucketBilling) MarshalJSON() ([]byte, error) {
   606  	type NoMethod BucketBilling
   607  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   608  }
   609  
   610  type BucketCors struct {
   611  	// MaxAgeSeconds: The value, in seconds, to return in the
   612  	// Access-Control-Max-Age header used in preflight responses.
   613  	MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
   614  	// Method: The list of HTTP methods on which to include CORS response headers,
   615  	// (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and
   616  	// means "any method".
   617  	Method []string `json:"method,omitempty"`
   618  	// Origin: The list of Origins eligible to receive CORS response headers. Note:
   619  	// "*" is permitted in the list of origins, and means "any Origin".
   620  	Origin []string `json:"origin,omitempty"`
   621  	// ResponseHeader: The list of HTTP headers other than the simple response
   622  	// headers to give permission for the user-agent to share across domains.
   623  	ResponseHeader []string `json:"responseHeader,omitempty"`
   624  	// ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
   625  	// unconditionally include in API requests. By default, fields with empty or
   626  	// default values are omitted from API requests. See
   627  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   628  	// details.
   629  	ForceSendFields []string `json:"-"`
   630  	// NullFields is a list of field names (e.g. "MaxAgeSeconds") to include in API
   631  	// requests with the JSON null value. By default, fields with empty values are
   632  	// omitted from API requests. See
   633  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   634  	NullFields []string `json:"-"`
   635  }
   636  
   637  func (s *BucketCors) MarshalJSON() ([]byte, error) {
   638  	type NoMethod BucketCors
   639  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   640  }
   641  
   642  // BucketCustomPlacementConfig: The bucket's custom placement configuration for
   643  // Custom Dual Regions.
   644  type BucketCustomPlacementConfig struct {
   645  	// DataLocations: The list of regional locations in which data is placed.
   646  	DataLocations []string `json:"dataLocations,omitempty"`
   647  	// ForceSendFields is a list of field names (e.g. "DataLocations") to
   648  	// unconditionally include in API requests. By default, fields with empty or
   649  	// default values are omitted from API requests. See
   650  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   651  	// details.
   652  	ForceSendFields []string `json:"-"`
   653  	// NullFields is a list of field names (e.g. "DataLocations") to include in API
   654  	// requests with the JSON null value. By default, fields with empty values are
   655  	// omitted from API requests. See
   656  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   657  	NullFields []string `json:"-"`
   658  }
   659  
   660  func (s *BucketCustomPlacementConfig) MarshalJSON() ([]byte, error) {
   661  	type NoMethod BucketCustomPlacementConfig
   662  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   663  }
   664  
   665  // BucketEncryption: Encryption configuration for a bucket.
   666  type BucketEncryption struct {
   667  	// DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt objects
   668  	// inserted into this bucket, if no encryption method is specified.
   669  	DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
   670  	// ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName") to
   671  	// unconditionally include in API requests. By default, fields with empty or
   672  	// default values are omitted from API requests. See
   673  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   674  	// details.
   675  	ForceSendFields []string `json:"-"`
   676  	// NullFields is a list of field names (e.g. "DefaultKmsKeyName") to include in
   677  	// API requests with the JSON null value. By default, fields with empty values
   678  	// are omitted from API requests. See
   679  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   680  	NullFields []string `json:"-"`
   681  }
   682  
   683  func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
   684  	type NoMethod BucketEncryption
   685  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   686  }
   687  
   688  // BucketHierarchicalNamespace: The bucket's hierarchical namespace
   689  // configuration.
   690  type BucketHierarchicalNamespace struct {
   691  	// Enabled: When set to true, hierarchical namespace is enabled for this
   692  	// bucket.
   693  	Enabled bool `json:"enabled,omitempty"`
   694  	// ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally
   695  	// include in API requests. By default, fields with empty or default values are
   696  	// omitted from API requests. See
   697  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   698  	// details.
   699  	ForceSendFields []string `json:"-"`
   700  	// NullFields is a list of field names (e.g. "Enabled") to include in API
   701  	// requests with the JSON null value. By default, fields with empty values are
   702  	// omitted from API requests. See
   703  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   704  	NullFields []string `json:"-"`
   705  }
   706  
   707  func (s *BucketHierarchicalNamespace) MarshalJSON() ([]byte, error) {
   708  	type NoMethod BucketHierarchicalNamespace
   709  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   710  }
   711  
   712  // BucketIamConfiguration: The bucket's IAM configuration.
   713  type BucketIamConfiguration struct {
   714  	// BucketPolicyOnly: The bucket's uniform bucket-level access configuration.
   715  	// The feature was formerly known as Bucket Policy Only. For backward
   716  	// compatibility, this field will be populated with identical information as
   717  	// the uniformBucketLevelAccess field. We recommend using the
   718  	// uniformBucketLevelAccess field to enable and disable the feature.
   719  	BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"`
   720  	// PublicAccessPrevention: The bucket's Public Access Prevention configuration.
   721  	// Currently, 'inherited' and 'enforced' are supported.
   722  	PublicAccessPrevention string `json:"publicAccessPrevention,omitempty"`
   723  	// UniformBucketLevelAccess: The bucket's uniform bucket-level access
   724  	// configuration.
   725  	UniformBucketLevelAccess *BucketIamConfigurationUniformBucketLevelAccess `json:"uniformBucketLevelAccess,omitempty"`
   726  	// ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to
   727  	// unconditionally include in API requests. By default, fields with empty or
   728  	// default values are omitted from API requests. See
   729  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   730  	// details.
   731  	ForceSendFields []string `json:"-"`
   732  	// NullFields is a list of field names (e.g. "BucketPolicyOnly") to include in
   733  	// API requests with the JSON null value. By default, fields with empty values
   734  	// are omitted from API requests. See
   735  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   736  	NullFields []string `json:"-"`
   737  }
   738  
   739  func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) {
   740  	type NoMethod BucketIamConfiguration
   741  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   742  }
   743  
   744  // BucketIamConfigurationBucketPolicyOnly: The bucket's uniform bucket-level
   745  // access configuration. The feature was formerly known as Bucket Policy Only.
   746  // For backward compatibility, this field will be populated with identical
   747  // information as the uniformBucketLevelAccess field. We recommend using the
   748  // uniformBucketLevelAccess field to enable and disable the feature.
   749  type BucketIamConfigurationBucketPolicyOnly struct {
   750  	// Enabled: If set, access is controlled only by bucket-level or above IAM
   751  	// policies.
   752  	Enabled bool `json:"enabled,omitempty"`
   753  	// LockedTime: The deadline for changing
   754  	// iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339
   755  	// format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true
   756  	// to false until the locked time, after which the field is immutable.
   757  	LockedTime string `json:"lockedTime,omitempty"`
   758  	// ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally
   759  	// include in API requests. By default, fields with empty or default values are
   760  	// omitted from API requests. See
   761  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   762  	// details.
   763  	ForceSendFields []string `json:"-"`
   764  	// NullFields is a list of field names (e.g. "Enabled") to include in API
   765  	// requests with the JSON null value. By default, fields with empty values are
   766  	// omitted from API requests. See
   767  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   768  	NullFields []string `json:"-"`
   769  }
   770  
   771  func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) {
   772  	type NoMethod BucketIamConfigurationBucketPolicyOnly
   773  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   774  }
   775  
   776  // BucketIamConfigurationUniformBucketLevelAccess: The bucket's uniform
   777  // bucket-level access configuration.
   778  type BucketIamConfigurationUniformBucketLevelAccess struct {
   779  	// Enabled: If set, access is controlled only by bucket-level or above IAM
   780  	// policies.
   781  	Enabled bool `json:"enabled,omitempty"`
   782  	// LockedTime: The deadline for changing
   783  	// iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC
   784  	// 3339  format. iamConfiguration.uniformBucketLevelAccess.enabled may be
   785  	// changed from true to false until the locked time, after which the field is
   786  	// immutable.
   787  	LockedTime string `json:"lockedTime,omitempty"`
   788  	// ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally
   789  	// include in API requests. By default, fields with empty or default values are
   790  	// omitted from API requests. See
   791  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   792  	// details.
   793  	ForceSendFields []string `json:"-"`
   794  	// NullFields is a list of field names (e.g. "Enabled") to include in API
   795  	// requests with the JSON null value. By default, fields with empty values are
   796  	// omitted from API requests. See
   797  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   798  	NullFields []string `json:"-"`
   799  }
   800  
   801  func (s *BucketIamConfigurationUniformBucketLevelAccess) MarshalJSON() ([]byte, error) {
   802  	type NoMethod BucketIamConfigurationUniformBucketLevelAccess
   803  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   804  }
   805  
   806  // BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
   807  // management for more information.
   808  type BucketLifecycle struct {
   809  	// Rule: A lifecycle management rule, which is made of an action to take and
   810  	// the condition(s) under which the action will be taken.
   811  	Rule []*BucketLifecycleRule `json:"rule,omitempty"`
   812  	// ForceSendFields is a list of field names (e.g. "Rule") to unconditionally
   813  	// include in API requests. By default, fields with empty or default values are
   814  	// omitted from API requests. See
   815  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   816  	// details.
   817  	ForceSendFields []string `json:"-"`
   818  	// NullFields is a list of field names (e.g. "Rule") to include in API requests
   819  	// with the JSON null value. By default, fields with empty values are omitted
   820  	// from API requests. See
   821  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   822  	NullFields []string `json:"-"`
   823  }
   824  
   825  func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
   826  	type NoMethod BucketLifecycle
   827  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   828  }
   829  
   830  type BucketLifecycleRule struct {
   831  	// Action: The action to take.
   832  	Action *BucketLifecycleRuleAction `json:"action,omitempty"`
   833  	// Condition: The condition(s) under which the action will be taken.
   834  	Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
   835  	// ForceSendFields is a list of field names (e.g. "Action") to unconditionally
   836  	// include in API requests. By default, fields with empty or default values are
   837  	// omitted from API requests. See
   838  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   839  	// details.
   840  	ForceSendFields []string `json:"-"`
   841  	// NullFields is a list of field names (e.g. "Action") to include in API
   842  	// requests with the JSON null value. By default, fields with empty values are
   843  	// omitted from API requests. See
   844  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   845  	NullFields []string `json:"-"`
   846  }
   847  
   848  func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
   849  	type NoMethod BucketLifecycleRule
   850  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   851  }
   852  
   853  // BucketLifecycleRuleAction: The action to take.
   854  type BucketLifecycleRuleAction struct {
   855  	// StorageClass: Target storage class. Required iff the type of the action is
   856  	// SetStorageClass.
   857  	StorageClass string `json:"storageClass,omitempty"`
   858  	// Type: Type of the action. Currently, only Delete, SetStorageClass, and
   859  	// AbortIncompleteMultipartUpload are supported.
   860  	Type string `json:"type,omitempty"`
   861  	// ForceSendFields is a list of field names (e.g. "StorageClass") to
   862  	// unconditionally include in API requests. By default, fields with empty or
   863  	// default values are omitted from API requests. See
   864  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   865  	// details.
   866  	ForceSendFields []string `json:"-"`
   867  	// NullFields is a list of field names (e.g. "StorageClass") to include in API
   868  	// requests with the JSON null value. By default, fields with empty values are
   869  	// omitted from API requests. See
   870  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   871  	NullFields []string `json:"-"`
   872  }
   873  
   874  func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
   875  	type NoMethod BucketLifecycleRuleAction
   876  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   877  }
   878  
   879  // BucketLifecycleRuleCondition: The condition(s) under which the action will
   880  // be taken.
   881  type BucketLifecycleRuleCondition struct {
   882  	// Age: Age of an object (in days). This condition is satisfied when an object
   883  	// reaches the specified age.
   884  	Age *int64 `json:"age,omitempty"`
   885  	// CreatedBefore: A date in RFC 3339 format with only the date part (for
   886  	// instance, "2013-01-15"). This condition is satisfied when an object is
   887  	// created before midnight of the specified date in UTC.
   888  	CreatedBefore string `json:"createdBefore,omitempty"`
   889  	// CustomTimeBefore: A date in RFC 3339 format with only the date part (for
   890  	// instance, "2013-01-15"). This condition is satisfied when the custom time on
   891  	// an object is before this date in UTC.
   892  	CustomTimeBefore string `json:"customTimeBefore,omitempty"`
   893  	// DaysSinceCustomTime: Number of days elapsed since the user-specified
   894  	// timestamp set on an object. The condition is satisfied if the days elapsed
   895  	// is at least this number. If no custom timestamp is specified on an object,
   896  	// the condition does not apply.
   897  	DaysSinceCustomTime int64 `json:"daysSinceCustomTime,omitempty"`
   898  	// DaysSinceNoncurrentTime: Number of days elapsed since the noncurrent
   899  	// timestamp of an object. The condition is satisfied if the days elapsed is at
   900  	// least this number. This condition is relevant only for versioned objects.
   901  	// The value of the field must be a nonnegative integer. If it's zero, the
   902  	// object version will become eligible for Lifecycle action as soon as it
   903  	// becomes noncurrent.
   904  	DaysSinceNoncurrentTime int64 `json:"daysSinceNoncurrentTime,omitempty"`
   905  	// IsLive: Relevant only for versioned objects. If the value is true, this
   906  	// condition matches live objects; if the value is false, it matches archived
   907  	// objects.
   908  	IsLive *bool `json:"isLive,omitempty"`
   909  	// MatchesPattern: A regular expression that satisfies the RE2 syntax. This
   910  	// condition is satisfied when the name of the object matches the RE2 pattern.
   911  	// Note: This feature is currently in the "Early Access" launch stage and is
   912  	// only available to a whitelisted set of users; that means that this feature
   913  	// may be changed in backward-incompatible ways and that it is not guaranteed
   914  	// to be released.
   915  	MatchesPattern string `json:"matchesPattern,omitempty"`
   916  	// MatchesPrefix: List of object name prefixes. This condition will be
   917  	// satisfied when at least one of the prefixes exactly matches the beginning of
   918  	// the object name.
   919  	MatchesPrefix []string `json:"matchesPrefix,omitempty"`
   920  	// MatchesStorageClass: Objects having any of the storage classes specified by
   921  	// this condition will be matched. Values include MULTI_REGIONAL, REGIONAL,
   922  	// NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.
   923  	MatchesStorageClass []string `json:"matchesStorageClass,omitempty"`
   924  	// MatchesSuffix: List of object name suffixes. This condition will be
   925  	// satisfied when at least one of the suffixes exactly matches the end of the
   926  	// object name.
   927  	MatchesSuffix []string `json:"matchesSuffix,omitempty"`
   928  	// NoncurrentTimeBefore: A date in RFC 3339 format with only the date part (for
   929  	// instance, "2013-01-15"). This condition is satisfied when the noncurrent
   930  	// time on an object is before this date in UTC. This condition is relevant
   931  	// only for versioned objects.
   932  	NoncurrentTimeBefore string `json:"noncurrentTimeBefore,omitempty"`
   933  	// NumNewerVersions: Relevant only for versioned objects. If the value is N,
   934  	// this condition is satisfied when there are at least N versions (including
   935  	// the live version) newer than this version of the object.
   936  	NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
   937  	// ForceSendFields is a list of field names (e.g. "Age") to unconditionally
   938  	// include in API requests. By default, fields with empty or default values are
   939  	// omitted from API requests. See
   940  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   941  	// details.
   942  	ForceSendFields []string `json:"-"`
   943  	// NullFields is a list of field names (e.g. "Age") to include in API requests
   944  	// with the JSON null value. By default, fields with empty values are omitted
   945  	// from API requests. See
   946  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   947  	NullFields []string `json:"-"`
   948  }
   949  
   950  func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
   951  	type NoMethod BucketLifecycleRuleCondition
   952  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   953  }
   954  
   955  // BucketLogging: The bucket's logging configuration, which defines the
   956  // destination bucket and optional name prefix for the current bucket's logs.
   957  type BucketLogging struct {
   958  	// LogBucket: The destination bucket where the current bucket's logs should be
   959  	// placed.
   960  	LogBucket string `json:"logBucket,omitempty"`
   961  	// LogObjectPrefix: A prefix for log object names.
   962  	LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
   963  	// ForceSendFields is a list of field names (e.g. "LogBucket") to
   964  	// unconditionally include in API requests. By default, fields with empty or
   965  	// default values are omitted from API requests. See
   966  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   967  	// details.
   968  	ForceSendFields []string `json:"-"`
   969  	// NullFields is a list of field names (e.g. "LogBucket") to include in API
   970  	// requests with the JSON null value. By default, fields with empty values are
   971  	// omitted from API requests. See
   972  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   973  	NullFields []string `json:"-"`
   974  }
   975  
   976  func (s *BucketLogging) MarshalJSON() ([]byte, error) {
   977  	type NoMethod BucketLogging
   978  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   979  }
   980  
   981  // BucketObjectRetention: The bucket's object retention config.
   982  type BucketObjectRetention struct {
   983  	// Mode: The bucket's object retention mode. Can be Enabled.
   984  	Mode string `json:"mode,omitempty"`
   985  	// ForceSendFields is a list of field names (e.g. "Mode") to unconditionally
   986  	// include in API requests. By default, fields with empty or default values are
   987  	// omitted from API requests. See
   988  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   989  	// details.
   990  	ForceSendFields []string `json:"-"`
   991  	// NullFields is a list of field names (e.g. "Mode") to include in API requests
   992  	// with the JSON null value. By default, fields with empty values are omitted
   993  	// from API requests. See
   994  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   995  	NullFields []string `json:"-"`
   996  }
   997  
   998  func (s *BucketObjectRetention) MarshalJSON() ([]byte, error) {
   999  	type NoMethod BucketObjectRetention
  1000  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1001  }
  1002  
  1003  // BucketOwner: The owner of the bucket. This is always the project team's
  1004  // owner group.
  1005  type BucketOwner struct {
  1006  	// Entity: The entity, in the form project-owner-projectId.
  1007  	Entity string `json:"entity,omitempty"`
  1008  	// EntityId: The ID for the entity.
  1009  	EntityId string `json:"entityId,omitempty"`
  1010  	// ForceSendFields is a list of field names (e.g. "Entity") to unconditionally
  1011  	// include in API requests. By default, fields with empty or default values are
  1012  	// omitted from API requests. See
  1013  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1014  	// details.
  1015  	ForceSendFields []string `json:"-"`
  1016  	// NullFields is a list of field names (e.g. "Entity") to include in API
  1017  	// requests with the JSON null value. By default, fields with empty values are
  1018  	// omitted from API requests. See
  1019  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1020  	NullFields []string `json:"-"`
  1021  }
  1022  
  1023  func (s *BucketOwner) MarshalJSON() ([]byte, error) {
  1024  	type NoMethod BucketOwner
  1025  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1026  }
  1027  
  1028  // BucketRetentionPolicy: The bucket's retention policy. The retention policy
  1029  // enforces a minimum retention time for all objects contained in the bucket,
  1030  // based on their creation time. Any attempt to overwrite or delete objects
  1031  // younger than the retention period will result in a PERMISSION_DENIED error.
  1032  // An unlocked retention policy can be modified or removed from the bucket via
  1033  // a storage.buckets.update operation. A locked retention policy cannot be
  1034  // removed or shortened in duration for the lifetime of the bucket. Attempting
  1035  // to remove or decrease period of a locked retention policy will result in a
  1036  // PERMISSION_DENIED error.
  1037  type BucketRetentionPolicy struct {
  1038  	// EffectiveTime: Server-determined value that indicates the time from which
  1039  	// policy was enforced and effective. This value is in RFC 3339 format.
  1040  	EffectiveTime string `json:"effectiveTime,omitempty"`
  1041  	// IsLocked: Once locked, an object retention policy cannot be modified.
  1042  	IsLocked bool `json:"isLocked,omitempty"`
  1043  	// RetentionPeriod: The duration in seconds that objects need to be retained.
  1044  	// Retention duration must be greater than zero and less than 100 years. Note
  1045  	// that enforcement of retention periods less than a day is not guaranteed.
  1046  	// Such periods should only be used for testing purposes.
  1047  	RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"`
  1048  	// ForceSendFields is a list of field names (e.g. "EffectiveTime") to
  1049  	// unconditionally include in API requests. By default, fields with empty or
  1050  	// default values are omitted from API requests. See
  1051  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1052  	// details.
  1053  	ForceSendFields []string `json:"-"`
  1054  	// NullFields is a list of field names (e.g. "EffectiveTime") to include in API
  1055  	// requests with the JSON null value. By default, fields with empty values are
  1056  	// omitted from API requests. See
  1057  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1058  	NullFields []string `json:"-"`
  1059  }
  1060  
  1061  func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) {
  1062  	type NoMethod BucketRetentionPolicy
  1063  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1064  }
  1065  
  1066  // BucketSoftDeletePolicy: The bucket's soft delete policy, which defines the
  1067  // period of time that soft-deleted objects will be retained, and cannot be
  1068  // permanently deleted.
  1069  type BucketSoftDeletePolicy struct {
  1070  	// EffectiveTime: Server-determined value that indicates the time from which
  1071  	// the policy, or one with a greater retention, was effective. This value is in
  1072  	// RFC 3339 format.
  1073  	EffectiveTime string `json:"effectiveTime,omitempty"`
  1074  	// RetentionDurationSeconds: The duration in seconds that soft-deleted objects
  1075  	// in the bucket will be retained and cannot be permanently deleted.
  1076  	RetentionDurationSeconds int64 `json:"retentionDurationSeconds,omitempty,string"`
  1077  	// ForceSendFields is a list of field names (e.g. "EffectiveTime") to
  1078  	// unconditionally include in API requests. By default, fields with empty or
  1079  	// default values are omitted from API requests. See
  1080  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1081  	// details.
  1082  	ForceSendFields []string `json:"-"`
  1083  	// NullFields is a list of field names (e.g. "EffectiveTime") to include in API
  1084  	// requests with the JSON null value. By default, fields with empty values are
  1085  	// omitted from API requests. See
  1086  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1087  	NullFields []string `json:"-"`
  1088  }
  1089  
  1090  func (s *BucketSoftDeletePolicy) MarshalJSON() ([]byte, error) {
  1091  	type NoMethod BucketSoftDeletePolicy
  1092  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1093  }
  1094  
  1095  // BucketVersioning: The bucket's versioning configuration.
  1096  type BucketVersioning struct {
  1097  	// Enabled: While set to true, versioning is fully enabled for this bucket.
  1098  	Enabled bool `json:"enabled,omitempty"`
  1099  	// ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally
  1100  	// include in API requests. By default, fields with empty or default values are
  1101  	// omitted from API requests. See
  1102  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1103  	// details.
  1104  	ForceSendFields []string `json:"-"`
  1105  	// NullFields is a list of field names (e.g. "Enabled") to include in API
  1106  	// requests with the JSON null value. By default, fields with empty values are
  1107  	// omitted from API requests. See
  1108  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1109  	NullFields []string `json:"-"`
  1110  }
  1111  
  1112  func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
  1113  	type NoMethod BucketVersioning
  1114  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1115  }
  1116  
  1117  // BucketWebsite: The bucket's website configuration, controlling how the
  1118  // service behaves when accessing bucket contents as a web site. See the Static
  1119  // Website Examples for more information.
  1120  type BucketWebsite struct {
  1121  	// MainPageSuffix: If the requested object path is missing, the service will
  1122  	// ensure the path has a trailing '/', append this suffix, and attempt to
  1123  	// retrieve the resulting object. This allows the creation of index.html
  1124  	// objects to represent directory pages.
  1125  	MainPageSuffix string `json:"mainPageSuffix,omitempty"`
  1126  	// NotFoundPage: If the requested object path is missing, and any
  1127  	// mainPageSuffix object is missing, if applicable, the service will return the
  1128  	// named object from this bucket as the content for a 404 Not Found result.
  1129  	NotFoundPage string `json:"notFoundPage,omitempty"`
  1130  	// ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
  1131  	// unconditionally include in API requests. By default, fields with empty or
  1132  	// default values are omitted from API requests. See
  1133  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1134  	// details.
  1135  	ForceSendFields []string `json:"-"`
  1136  	// NullFields is a list of field names (e.g. "MainPageSuffix") to include in
  1137  	// API requests with the JSON null value. By default, fields with empty values
  1138  	// are omitted from API requests. See
  1139  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1140  	NullFields []string `json:"-"`
  1141  }
  1142  
  1143  func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
  1144  	type NoMethod BucketWebsite
  1145  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1146  }
  1147  
  1148  // BucketAccessControl: An access-control entry.
  1149  type BucketAccessControl struct {
  1150  	// Bucket: The name of the bucket.
  1151  	Bucket string `json:"bucket,omitempty"`
  1152  	// Domain: The domain associated with the entity, if any.
  1153  	Domain string `json:"domain,omitempty"`
  1154  	// Email: The email address associated with the entity, if any.
  1155  	Email string `json:"email,omitempty"`
  1156  	// Entity: The entity holding the permission, in one of the following forms:
  1157  	// - user-userId
  1158  	// - user-email
  1159  	// - group-groupId
  1160  	// - group-email
  1161  	// - domain-domain
  1162  	// - project-team-projectId
  1163  	// - allUsers
  1164  	// - allAuthenticatedUsers Examples:
  1165  	// - The user liz@example.com would be user-liz@example.com.
  1166  	// - The group example@googlegroups.com would be
  1167  	// group-example@googlegroups.com.
  1168  	// - To refer to all members of the Google Apps for Business domain
  1169  	// example.com, the entity would be domain-example.com.
  1170  	Entity string `json:"entity,omitempty"`
  1171  	// EntityId: The ID for the entity, if any.
  1172  	EntityId string `json:"entityId,omitempty"`
  1173  	// Etag: HTTP 1.1 Entity tag for the access-control entry.
  1174  	Etag string `json:"etag,omitempty"`
  1175  	// Id: The ID of the access-control entry.
  1176  	Id string `json:"id,omitempty"`
  1177  	// Kind: The kind of item this is. For bucket access control entries, this is
  1178  	// always storage#bucketAccessControl.
  1179  	Kind string `json:"kind,omitempty"`
  1180  	// ProjectTeam: The project team associated with the entity, if any.
  1181  	ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
  1182  	// Role: The access permission for the entity.
  1183  	Role string `json:"role,omitempty"`
  1184  	// SelfLink: The link to this access-control entry.
  1185  	SelfLink string `json:"selfLink,omitempty"`
  1186  
  1187  	// ServerResponse contains the HTTP response code and headers from the server.
  1188  	googleapi.ServerResponse `json:"-"`
  1189  	// ForceSendFields is a list of field names (e.g. "Bucket") to unconditionally
  1190  	// include in API requests. By default, fields with empty or default values are
  1191  	// omitted from API requests. See
  1192  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1193  	// details.
  1194  	ForceSendFields []string `json:"-"`
  1195  	// NullFields is a list of field names (e.g. "Bucket") to include in API
  1196  	// requests with the JSON null value. By default, fields with empty values are
  1197  	// omitted from API requests. See
  1198  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1199  	NullFields []string `json:"-"`
  1200  }
  1201  
  1202  func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
  1203  	type NoMethod BucketAccessControl
  1204  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1205  }
  1206  
  1207  // BucketAccessControlProjectTeam: The project team associated with the entity,
  1208  // if any.
  1209  type BucketAccessControlProjectTeam struct {
  1210  	// ProjectNumber: The project number.
  1211  	ProjectNumber string `json:"projectNumber,omitempty"`
  1212  	// Team: The team.
  1213  	Team string `json:"team,omitempty"`
  1214  	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
  1215  	// unconditionally include in API requests. By default, fields with empty or
  1216  	// default values are omitted from API requests. See
  1217  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1218  	// details.
  1219  	ForceSendFields []string `json:"-"`
  1220  	// NullFields is a list of field names (e.g. "ProjectNumber") to include in API
  1221  	// requests with the JSON null value. By default, fields with empty values are
  1222  	// omitted from API requests. See
  1223  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1224  	NullFields []string `json:"-"`
  1225  }
  1226  
  1227  func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
  1228  	type NoMethod BucketAccessControlProjectTeam
  1229  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1230  }
  1231  
  1232  // BucketAccessControls: An access-control list.
  1233  type BucketAccessControls struct {
  1234  	// Items: The list of items.
  1235  	Items []*BucketAccessControl `json:"items,omitempty"`
  1236  	// Kind: The kind of item this is. For lists of bucket access control entries,
  1237  	// this is always storage#bucketAccessControls.
  1238  	Kind string `json:"kind,omitempty"`
  1239  
  1240  	// ServerResponse contains the HTTP response code and headers from the server.
  1241  	googleapi.ServerResponse `json:"-"`
  1242  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  1243  	// include in API requests. By default, fields with empty or default values are
  1244  	// omitted from API requests. See
  1245  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1246  	// details.
  1247  	ForceSendFields []string `json:"-"`
  1248  	// NullFields is a list of field names (e.g. "Items") to include in API
  1249  	// requests with the JSON null value. By default, fields with empty values are
  1250  	// omitted from API requests. See
  1251  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1252  	NullFields []string `json:"-"`
  1253  }
  1254  
  1255  func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
  1256  	type NoMethod BucketAccessControls
  1257  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1258  }
  1259  
  1260  // Buckets: A list of buckets.
  1261  type Buckets struct {
  1262  	// Items: The list of items.
  1263  	Items []*Bucket `json:"items,omitempty"`
  1264  	// Kind: The kind of item this is. For lists of buckets, this is always
  1265  	// storage#buckets.
  1266  	Kind string `json:"kind,omitempty"`
  1267  	// NextPageToken: The continuation token, used to page through large result
  1268  	// sets. Provide this value in a subsequent request to return the next page of
  1269  	// results.
  1270  	NextPageToken string `json:"nextPageToken,omitempty"`
  1271  
  1272  	// ServerResponse contains the HTTP response code and headers from the server.
  1273  	googleapi.ServerResponse `json:"-"`
  1274  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  1275  	// include in API requests. By default, fields with empty or default values are
  1276  	// omitted from API requests. See
  1277  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1278  	// details.
  1279  	ForceSendFields []string `json:"-"`
  1280  	// NullFields is a list of field names (e.g. "Items") to include in API
  1281  	// requests with the JSON null value. By default, fields with empty values are
  1282  	// omitted from API requests. See
  1283  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1284  	NullFields []string `json:"-"`
  1285  }
  1286  
  1287  func (s *Buckets) MarshalJSON() ([]byte, error) {
  1288  	type NoMethod Buckets
  1289  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1290  }
  1291  
  1292  // BulkRestoreObjectsRequest: A bulk restore objects request.
  1293  type BulkRestoreObjectsRequest struct {
  1294  	// AllowOverwrite: If false (default), the restore will not overwrite live
  1295  	// objects with the same name at the destination. This means some deleted
  1296  	// objects may be skipped. If true, live objects will be overwritten resulting
  1297  	// in a noncurrent object (if versioning is enabled). If versioning is not
  1298  	// enabled, overwriting the object will result in a soft-deleted object. In
  1299  	// either case, if a noncurrent object already exists with the same name, a
  1300  	// live version can be written without issue.
  1301  	AllowOverwrite bool `json:"allowOverwrite,omitempty"`
  1302  	// CopySourceAcl: If true, copies the source object's ACL; otherwise, uses the
  1303  	// bucket's default object ACL. The default is false.
  1304  	CopySourceAcl bool `json:"copySourceAcl,omitempty"`
  1305  	// MatchGlobs: Restores only the objects matching any of the specified glob(s).
  1306  	// If this parameter is not specified, all objects will be restored within the
  1307  	// specified time range.
  1308  	MatchGlobs []string `json:"matchGlobs,omitempty"`
  1309  	// SoftDeletedAfterTime: Restores only the objects that were soft-deleted after
  1310  	// this time.
  1311  	SoftDeletedAfterTime string `json:"softDeletedAfterTime,omitempty"`
  1312  	// SoftDeletedBeforeTime: Restores only the objects that were soft-deleted
  1313  	// before this time.
  1314  	SoftDeletedBeforeTime string `json:"softDeletedBeforeTime,omitempty"`
  1315  	// ForceSendFields is a list of field names (e.g. "AllowOverwrite") to
  1316  	// unconditionally include in API requests. By default, fields with empty or
  1317  	// default values are omitted from API requests. See
  1318  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1319  	// details.
  1320  	ForceSendFields []string `json:"-"`
  1321  	// NullFields is a list of field names (e.g. "AllowOverwrite") to include in
  1322  	// API requests with the JSON null value. By default, fields with empty values
  1323  	// are omitted from API requests. See
  1324  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1325  	NullFields []string `json:"-"`
  1326  }
  1327  
  1328  func (s *BulkRestoreObjectsRequest) MarshalJSON() ([]byte, error) {
  1329  	type NoMethod BulkRestoreObjectsRequest
  1330  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1331  }
  1332  
  1333  // Channel: An notification channel used to watch for resource changes.
  1334  type Channel struct {
  1335  	// Address: The address where notifications are delivered for this channel.
  1336  	Address string `json:"address,omitempty"`
  1337  	// Expiration: Date and time of notification channel expiration, expressed as a
  1338  	// Unix timestamp, in milliseconds. Optional.
  1339  	Expiration int64 `json:"expiration,omitempty,string"`
  1340  	// Id: A UUID or similar unique string that identifies this channel.
  1341  	Id string `json:"id,omitempty"`
  1342  	// Kind: Identifies this as a notification channel used to watch for changes to
  1343  	// a resource, which is "api#channel".
  1344  	Kind string `json:"kind,omitempty"`
  1345  	// Params: Additional parameters controlling delivery channel behavior.
  1346  	// Optional.
  1347  	Params map[string]string `json:"params,omitempty"`
  1348  	// Payload: A Boolean value to indicate whether payload is wanted. Optional.
  1349  	Payload bool `json:"payload,omitempty"`
  1350  	// ResourceId: An opaque ID that identifies the resource being watched on this
  1351  	// channel. Stable across different API versions.
  1352  	ResourceId string `json:"resourceId,omitempty"`
  1353  	// ResourceUri: A version-specific identifier for the watched resource.
  1354  	ResourceUri string `json:"resourceUri,omitempty"`
  1355  	// Token: An arbitrary string delivered to the target address with each
  1356  	// notification delivered over this channel. Optional.
  1357  	Token string `json:"token,omitempty"`
  1358  	// Type: The type of delivery mechanism used for this channel.
  1359  	Type string `json:"type,omitempty"`
  1360  
  1361  	// ServerResponse contains the HTTP response code and headers from the server.
  1362  	googleapi.ServerResponse `json:"-"`
  1363  	// ForceSendFields is a list of field names (e.g. "Address") to unconditionally
  1364  	// include in API requests. By default, fields with empty or default values are
  1365  	// omitted from API requests. See
  1366  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1367  	// details.
  1368  	ForceSendFields []string `json:"-"`
  1369  	// NullFields is a list of field names (e.g. "Address") to include in API
  1370  	// requests with the JSON null value. By default, fields with empty values are
  1371  	// omitted from API requests. See
  1372  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1373  	NullFields []string `json:"-"`
  1374  }
  1375  
  1376  func (s *Channel) MarshalJSON() ([]byte, error) {
  1377  	type NoMethod Channel
  1378  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1379  }
  1380  
  1381  // ComposeRequest: A Compose request.
  1382  type ComposeRequest struct {
  1383  	// Destination: Properties of the resulting object.
  1384  	Destination *Object `json:"destination,omitempty"`
  1385  	// Kind: The kind of item this is.
  1386  	Kind string `json:"kind,omitempty"`
  1387  	// SourceObjects: The list of source objects that will be concatenated into a
  1388  	// single object.
  1389  	SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
  1390  	// ForceSendFields is a list of field names (e.g. "Destination") to
  1391  	// unconditionally include in API requests. By default, fields with empty or
  1392  	// default values are omitted from API requests. See
  1393  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1394  	// details.
  1395  	ForceSendFields []string `json:"-"`
  1396  	// NullFields is a list of field names (e.g. "Destination") to include in API
  1397  	// requests with the JSON null value. By default, fields with empty values are
  1398  	// omitted from API requests. See
  1399  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1400  	NullFields []string `json:"-"`
  1401  }
  1402  
  1403  func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
  1404  	type NoMethod ComposeRequest
  1405  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1406  }
  1407  
  1408  type ComposeRequestSourceObjects struct {
  1409  	// Generation: The generation of this object to use as the source.
  1410  	Generation int64 `json:"generation,omitempty,string"`
  1411  	// Name: The source object's name. All source objects must reside in the same
  1412  	// bucket.
  1413  	Name string `json:"name,omitempty"`
  1414  	// ObjectPreconditions: Conditions that must be met for this operation to
  1415  	// execute.
  1416  	ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
  1417  	// ForceSendFields is a list of field names (e.g. "Generation") to
  1418  	// unconditionally include in API requests. By default, fields with empty or
  1419  	// default values are omitted from API requests. See
  1420  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1421  	// details.
  1422  	ForceSendFields []string `json:"-"`
  1423  	// NullFields is a list of field names (e.g. "Generation") to include in API
  1424  	// requests with the JSON null value. By default, fields with empty values are
  1425  	// omitted from API requests. See
  1426  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1427  	NullFields []string `json:"-"`
  1428  }
  1429  
  1430  func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
  1431  	type NoMethod ComposeRequestSourceObjects
  1432  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1433  }
  1434  
  1435  // ComposeRequestSourceObjectsObjectPreconditions: Conditions that must be met
  1436  // for this operation to execute.
  1437  type ComposeRequestSourceObjectsObjectPreconditions struct {
  1438  	// IfGenerationMatch: Only perform the composition if the generation of the
  1439  	// source object that would be used matches this value. If this value and a
  1440  	// generation are both specified, they must be the same value or the call will
  1441  	// fail.
  1442  	IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
  1443  	// ForceSendFields is a list of field names (e.g. "IfGenerationMatch") to
  1444  	// unconditionally include in API requests. By default, fields with empty or
  1445  	// default values are omitted from API requests. See
  1446  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1447  	// details.
  1448  	ForceSendFields []string `json:"-"`
  1449  	// NullFields is a list of field names (e.g. "IfGenerationMatch") to include in
  1450  	// API requests with the JSON null value. By default, fields with empty values
  1451  	// are omitted from API requests. See
  1452  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1453  	NullFields []string `json:"-"`
  1454  }
  1455  
  1456  func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
  1457  	type NoMethod ComposeRequestSourceObjectsObjectPreconditions
  1458  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1459  }
  1460  
  1461  // Expr: Represents an expression text. Example: title: "User account presence"
  1462  // description: "Determines whether the request has a user account" expression:
  1463  // "size(request.user) > 0"
  1464  type Expr struct {
  1465  	// Description: An optional description of the expression. This is a longer
  1466  	// text which describes the expression, e.g. when hovered over it in a UI.
  1467  	Description string `json:"description,omitempty"`
  1468  	// Expression: Textual representation of an expression in Common Expression
  1469  	// Language syntax. The application context of the containing message
  1470  	// determines which well-known feature set of CEL is supported.
  1471  	Expression string `json:"expression,omitempty"`
  1472  	// Location: An optional string indicating the location of the expression for
  1473  	// error reporting, e.g. a file name and a position in the file.
  1474  	Location string `json:"location,omitempty"`
  1475  	// Title: An optional title for the expression, i.e. a short string describing
  1476  	// its purpose. This can be used e.g. in UIs which allow to enter the
  1477  	// expression.
  1478  	Title string `json:"title,omitempty"`
  1479  	// ForceSendFields is a list of field names (e.g. "Description") to
  1480  	// unconditionally include in API requests. By default, fields with empty or
  1481  	// default values are omitted from API requests. See
  1482  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1483  	// details.
  1484  	ForceSendFields []string `json:"-"`
  1485  	// NullFields is a list of field names (e.g. "Description") to include in API
  1486  	// requests with the JSON null value. By default, fields with empty values are
  1487  	// omitted from API requests. See
  1488  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1489  	NullFields []string `json:"-"`
  1490  }
  1491  
  1492  func (s *Expr) MarshalJSON() ([]byte, error) {
  1493  	type NoMethod Expr
  1494  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1495  }
  1496  
  1497  // Folder: A folder. Only available in buckets with hierarchical namespace
  1498  // enabled.
  1499  type Folder struct {
  1500  	// Bucket: The name of the bucket containing this folder.
  1501  	Bucket string `json:"bucket,omitempty"`
  1502  	// CreateTime: The creation time of the folder in RFC 3339 format.
  1503  	CreateTime string `json:"createTime,omitempty"`
  1504  	// Id: The ID of the folder, including the bucket name, folder name.
  1505  	Id string `json:"id,omitempty"`
  1506  	// Kind: The kind of item this is. For folders, this is always storage#folder.
  1507  	Kind string `json:"kind,omitempty"`
  1508  	// Metageneration: The version of the metadata for this folder. Used for
  1509  	// preconditions and for detecting changes in metadata.
  1510  	Metageneration int64 `json:"metageneration,omitempty,string"`
  1511  	// Name: The name of the folder. Required if not specified by URL parameter.
  1512  	Name string `json:"name,omitempty"`
  1513  	// PendingRenameInfo: Only present if the folder is part of an ongoing rename
  1514  	// folder operation. Contains information which can be used to query the
  1515  	// operation status.
  1516  	PendingRenameInfo *FolderPendingRenameInfo `json:"pendingRenameInfo,omitempty"`
  1517  	// SelfLink: The link to this folder.
  1518  	SelfLink string `json:"selfLink,omitempty"`
  1519  	// UpdateTime: The modification time of the folder metadata in RFC 3339 format.
  1520  	UpdateTime string `json:"updateTime,omitempty"`
  1521  
  1522  	// ServerResponse contains the HTTP response code and headers from the server.
  1523  	googleapi.ServerResponse `json:"-"`
  1524  	// ForceSendFields is a list of field names (e.g. "Bucket") to unconditionally
  1525  	// include in API requests. By default, fields with empty or default values are
  1526  	// omitted from API requests. See
  1527  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1528  	// details.
  1529  	ForceSendFields []string `json:"-"`
  1530  	// NullFields is a list of field names (e.g. "Bucket") to include in API
  1531  	// requests with the JSON null value. By default, fields with empty values are
  1532  	// omitted from API requests. See
  1533  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1534  	NullFields []string `json:"-"`
  1535  }
  1536  
  1537  func (s *Folder) MarshalJSON() ([]byte, error) {
  1538  	type NoMethod Folder
  1539  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1540  }
  1541  
  1542  // FolderPendingRenameInfo: Only present if the folder is part of an ongoing
  1543  // rename folder operation. Contains information which can be used to query the
  1544  // operation status.
  1545  type FolderPendingRenameInfo struct {
  1546  	// OperationId: The ID of the rename folder operation.
  1547  	OperationId string `json:"operationId,omitempty"`
  1548  	// ForceSendFields is a list of field names (e.g. "OperationId") to
  1549  	// unconditionally include in API requests. By default, fields with empty or
  1550  	// default values are omitted from API requests. See
  1551  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1552  	// details.
  1553  	ForceSendFields []string `json:"-"`
  1554  	// NullFields is a list of field names (e.g. "OperationId") to include in API
  1555  	// requests with the JSON null value. By default, fields with empty values are
  1556  	// omitted from API requests. See
  1557  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1558  	NullFields []string `json:"-"`
  1559  }
  1560  
  1561  func (s *FolderPendingRenameInfo) MarshalJSON() ([]byte, error) {
  1562  	type NoMethod FolderPendingRenameInfo
  1563  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1564  }
  1565  
  1566  // Folders: A list of folders.
  1567  type Folders struct {
  1568  	// Items: The list of items.
  1569  	Items []*Folder `json:"items,omitempty"`
  1570  	// Kind: The kind of item this is. For lists of folders, this is always
  1571  	// storage#folders.
  1572  	Kind string `json:"kind,omitempty"`
  1573  	// NextPageToken: The continuation token, used to page through large result
  1574  	// sets. Provide this value in a subsequent request to return the next page of
  1575  	// results.
  1576  	NextPageToken string `json:"nextPageToken,omitempty"`
  1577  
  1578  	// ServerResponse contains the HTTP response code and headers from the server.
  1579  	googleapi.ServerResponse `json:"-"`
  1580  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  1581  	// include in API requests. By default, fields with empty or default values are
  1582  	// omitted from API requests. See
  1583  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1584  	// details.
  1585  	ForceSendFields []string `json:"-"`
  1586  	// NullFields is a list of field names (e.g. "Items") to include in API
  1587  	// requests with the JSON null value. By default, fields with empty values are
  1588  	// omitted from API requests. See
  1589  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1590  	NullFields []string `json:"-"`
  1591  }
  1592  
  1593  func (s *Folders) MarshalJSON() ([]byte, error) {
  1594  	type NoMethod Folders
  1595  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1596  }
  1597  
  1598  // GoogleLongrunningListOperationsResponse: The response message for
  1599  // storage.buckets.operations.list.
  1600  type GoogleLongrunningListOperationsResponse struct {
  1601  	// NextPageToken: The continuation token, used to page through large result
  1602  	// sets. Provide this value in a subsequent request to return the next page of
  1603  	// results.
  1604  	NextPageToken string `json:"nextPageToken,omitempty"`
  1605  	// Operations: A list of operations that matches the specified filter in the
  1606  	// request.
  1607  	Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
  1608  
  1609  	// ServerResponse contains the HTTP response code and headers from the server.
  1610  	googleapi.ServerResponse `json:"-"`
  1611  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1612  	// unconditionally include in API requests. By default, fields with empty or
  1613  	// default values are omitted from API requests. See
  1614  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1615  	// details.
  1616  	ForceSendFields []string `json:"-"`
  1617  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1618  	// requests with the JSON null value. By default, fields with empty values are
  1619  	// omitted from API requests. See
  1620  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1621  	NullFields []string `json:"-"`
  1622  }
  1623  
  1624  func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
  1625  	type NoMethod GoogleLongrunningListOperationsResponse
  1626  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1627  }
  1628  
  1629  // GoogleLongrunningOperation: This resource represents a long-running
  1630  // operation that is the result of a network API call.
  1631  type GoogleLongrunningOperation struct {
  1632  	// Done: If the value is "false", it means the operation is still in progress.
  1633  	// If "true", the operation is completed, and either "error" or "response" is
  1634  	// available.
  1635  	Done bool `json:"done,omitempty"`
  1636  	// Error: The error result of the operation in case of failure or cancellation.
  1637  	Error *GoogleRpcStatus `json:"error,omitempty"`
  1638  	// Metadata: Service-specific metadata associated with the operation. It
  1639  	// typically contains progress information and common metadata such as create
  1640  	// time. Some services might not provide such metadata. Any method that returns
  1641  	// a long-running operation should document the metadata type, if any.
  1642  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1643  	// Name: The server-assigned name, which is only unique within the same service
  1644  	// that originally returns it. If you use the default HTTP mapping, the "name"
  1645  	// should be a resource name ending with "operations/{operationId}".
  1646  	Name string `json:"name,omitempty"`
  1647  	// Response: The normal response of the operation in case of success. If the
  1648  	// original method returns no data on success, such as "Delete", the response
  1649  	// is google.protobuf.Empty. If the original method is standard
  1650  	// Get/Create/Update, the response should be the resource. For other methods,
  1651  	// the response should have the type "XxxResponse", where "Xxx" is the original
  1652  	// method name. For example, if the original method name is "TakeSnapshot()",
  1653  	// the inferred response type is "TakeSnapshotResponse".
  1654  	Response googleapi.RawMessage `json:"response,omitempty"`
  1655  
  1656  	// ServerResponse contains the HTTP response code and headers from the server.
  1657  	googleapi.ServerResponse `json:"-"`
  1658  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
  1659  	// include in API requests. By default, fields with empty or default values are
  1660  	// omitted from API requests. See
  1661  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1662  	// details.
  1663  	ForceSendFields []string `json:"-"`
  1664  	// NullFields is a list of field names (e.g. "Done") to include in API requests
  1665  	// with the JSON null value. By default, fields with empty values are omitted
  1666  	// from API requests. See
  1667  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1668  	NullFields []string `json:"-"`
  1669  }
  1670  
  1671  func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  1672  	type NoMethod GoogleLongrunningOperation
  1673  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1674  }
  1675  
  1676  // GoogleRpcStatus: The "Status" type defines a logical error model that is
  1677  // suitable for different programming environments, including REST APIs and RPC
  1678  // APIs. It is used by gRPC (https://github.com/grpc). Each "Status" message
  1679  // contains three pieces of data: error code, error message, and error details.
  1680  // You can find out more about this error model and how to work with it in the
  1681  // API Design Guide (https://cloud.google.com/apis/design/errors).
  1682  type GoogleRpcStatus struct {
  1683  	// Code: The status code, which should be an enum value of google.rpc.Code.
  1684  	Code int64 `json:"code,omitempty"`
  1685  	// Details: A list of messages that carry the error details. There is a common
  1686  	// set of message types for APIs to use.
  1687  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1688  	// Message: A developer-facing error message, which should be in English.
  1689  	Message string `json:"message,omitempty"`
  1690  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1691  	// include in API requests. By default, fields with empty or default values are
  1692  	// omitted from API requests. See
  1693  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1694  	// details.
  1695  	ForceSendFields []string `json:"-"`
  1696  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1697  	// with the JSON null value. By default, fields with empty values are omitted
  1698  	// from API requests. See
  1699  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1700  	NullFields []string `json:"-"`
  1701  }
  1702  
  1703  func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  1704  	type NoMethod GoogleRpcStatus
  1705  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1706  }
  1707  
  1708  // HmacKey: JSON template to produce a JSON-style HMAC Key resource for Create
  1709  // responses.
  1710  type HmacKey struct {
  1711  	// Kind: The kind of item this is. For HMAC keys, this is always
  1712  	// storage#hmacKey.
  1713  	Kind string `json:"kind,omitempty"`
  1714  	// Metadata: Key metadata.
  1715  	Metadata *HmacKeyMetadata `json:"metadata,omitempty"`
  1716  	// Secret: HMAC secret key material.
  1717  	Secret string `json:"secret,omitempty"`
  1718  
  1719  	// ServerResponse contains the HTTP response code and headers from the server.
  1720  	googleapi.ServerResponse `json:"-"`
  1721  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  1722  	// include in API requests. By default, fields with empty or default values are
  1723  	// omitted from API requests. See
  1724  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1725  	// details.
  1726  	ForceSendFields []string `json:"-"`
  1727  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  1728  	// with the JSON null value. By default, fields with empty values are omitted
  1729  	// from API requests. See
  1730  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1731  	NullFields []string `json:"-"`
  1732  }
  1733  
  1734  func (s *HmacKey) MarshalJSON() ([]byte, error) {
  1735  	type NoMethod HmacKey
  1736  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1737  }
  1738  
  1739  // HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key metadata
  1740  // resource.
  1741  type HmacKeyMetadata struct {
  1742  	// AccessId: The ID of the HMAC Key.
  1743  	AccessId string `json:"accessId,omitempty"`
  1744  	// Etag: HTTP 1.1 Entity tag for the HMAC key.
  1745  	Etag string `json:"etag,omitempty"`
  1746  	// Id: The ID of the HMAC key, including the Project ID and the Access ID.
  1747  	Id string `json:"id,omitempty"`
  1748  	// Kind: The kind of item this is. For HMAC Key metadata, this is always
  1749  	// storage#hmacKeyMetadata.
  1750  	Kind string `json:"kind,omitempty"`
  1751  	// ProjectId: Project ID owning the service account to which the key
  1752  	// authenticates.
  1753  	ProjectId string `json:"projectId,omitempty"`
  1754  	// SelfLink: The link to this resource.
  1755  	SelfLink string `json:"selfLink,omitempty"`
  1756  	// ServiceAccountEmail: The email address of the key's associated service
  1757  	// account.
  1758  	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
  1759  	// State: The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED.
  1760  	State string `json:"state,omitempty"`
  1761  	// TimeCreated: The creation time of the HMAC key in RFC 3339 format.
  1762  	TimeCreated string `json:"timeCreated,omitempty"`
  1763  	// Updated: The last modification time of the HMAC key metadata in RFC 3339
  1764  	// format.
  1765  	Updated string `json:"updated,omitempty"`
  1766  
  1767  	// ServerResponse contains the HTTP response code and headers from the server.
  1768  	googleapi.ServerResponse `json:"-"`
  1769  	// ForceSendFields is a list of field names (e.g. "AccessId") to
  1770  	// unconditionally include in API requests. By default, fields with empty or
  1771  	// default values are omitted from API requests. See
  1772  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1773  	// details.
  1774  	ForceSendFields []string `json:"-"`
  1775  	// NullFields is a list of field names (e.g. "AccessId") to include in API
  1776  	// requests with the JSON null value. By default, fields with empty values are
  1777  	// omitted from API requests. See
  1778  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1779  	NullFields []string `json:"-"`
  1780  }
  1781  
  1782  func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) {
  1783  	type NoMethod HmacKeyMetadata
  1784  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1785  }
  1786  
  1787  // HmacKeysMetadata: A list of hmacKeys.
  1788  type HmacKeysMetadata struct {
  1789  	// Items: The list of items.
  1790  	Items []*HmacKeyMetadata `json:"items,omitempty"`
  1791  	// Kind: The kind of item this is. For lists of hmacKeys, this is always
  1792  	// storage#hmacKeysMetadata.
  1793  	Kind string `json:"kind,omitempty"`
  1794  	// NextPageToken: The continuation token, used to page through large result
  1795  	// sets. Provide this value in a subsequent request to return the next page of
  1796  	// results.
  1797  	NextPageToken string `json:"nextPageToken,omitempty"`
  1798  
  1799  	// ServerResponse contains the HTTP response code and headers from the server.
  1800  	googleapi.ServerResponse `json:"-"`
  1801  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  1802  	// include in API requests. By default, fields with empty or default values are
  1803  	// omitted from API requests. See
  1804  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1805  	// details.
  1806  	ForceSendFields []string `json:"-"`
  1807  	// NullFields is a list of field names (e.g. "Items") to include in API
  1808  	// requests with the JSON null value. By default, fields with empty values are
  1809  	// omitted from API requests. See
  1810  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1811  	NullFields []string `json:"-"`
  1812  }
  1813  
  1814  func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) {
  1815  	type NoMethod HmacKeysMetadata
  1816  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1817  }
  1818  
  1819  // ManagedFolder: A managed folder.
  1820  type ManagedFolder struct {
  1821  	// Bucket: The name of the bucket containing this managed folder.
  1822  	Bucket string `json:"bucket,omitempty"`
  1823  	// CreateTime: The creation time of the managed folder in RFC 3339 format.
  1824  	CreateTime string `json:"createTime,omitempty"`
  1825  	// Id: The ID of the managed folder, including the bucket name and managed
  1826  	// folder name.
  1827  	Id string `json:"id,omitempty"`
  1828  	// Kind: The kind of item this is. For managed folders, this is always
  1829  	// storage#managedFolder.
  1830  	Kind string `json:"kind,omitempty"`
  1831  	// Metageneration: The version of the metadata for this managed folder. Used
  1832  	// for preconditions and for detecting changes in metadata.
  1833  	Metageneration int64 `json:"metageneration,omitempty,string"`
  1834  	// Name: The name of the managed folder. Required if not specified by URL
  1835  	// parameter.
  1836  	Name string `json:"name,omitempty"`
  1837  	// SelfLink: The link to this managed folder.
  1838  	SelfLink string `json:"selfLink,omitempty"`
  1839  	// UpdateTime: The last update time of the managed folder metadata in RFC 3339
  1840  	// format.
  1841  	UpdateTime string `json:"updateTime,omitempty"`
  1842  
  1843  	// ServerResponse contains the HTTP response code and headers from the server.
  1844  	googleapi.ServerResponse `json:"-"`
  1845  	// ForceSendFields is a list of field names (e.g. "Bucket") to unconditionally
  1846  	// include in API requests. By default, fields with empty or default values are
  1847  	// omitted from API requests. See
  1848  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1849  	// details.
  1850  	ForceSendFields []string `json:"-"`
  1851  	// NullFields is a list of field names (e.g. "Bucket") to include in API
  1852  	// requests with the JSON null value. By default, fields with empty values are
  1853  	// omitted from API requests. See
  1854  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1855  	NullFields []string `json:"-"`
  1856  }
  1857  
  1858  func (s *ManagedFolder) MarshalJSON() ([]byte, error) {
  1859  	type NoMethod ManagedFolder
  1860  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1861  }
  1862  
  1863  // ManagedFolders: A list of managed folders.
  1864  type ManagedFolders struct {
  1865  	// Items: The list of items.
  1866  	Items []*ManagedFolder `json:"items,omitempty"`
  1867  	// Kind: The kind of item this is. For lists of managed folders, this is always
  1868  	// storage#managedFolders.
  1869  	Kind string `json:"kind,omitempty"`
  1870  	// NextPageToken: The continuation token, used to page through large result
  1871  	// sets. Provide this value in a subsequent request to return the next page of
  1872  	// results.
  1873  	NextPageToken string `json:"nextPageToken,omitempty"`
  1874  
  1875  	// ServerResponse contains the HTTP response code and headers from the server.
  1876  	googleapi.ServerResponse `json:"-"`
  1877  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  1878  	// include in API requests. By default, fields with empty or default values are
  1879  	// omitted from API requests. See
  1880  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1881  	// details.
  1882  	ForceSendFields []string `json:"-"`
  1883  	// NullFields is a list of field names (e.g. "Items") to include in API
  1884  	// requests with the JSON null value. By default, fields with empty values are
  1885  	// omitted from API requests. See
  1886  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1887  	NullFields []string `json:"-"`
  1888  }
  1889  
  1890  func (s *ManagedFolders) MarshalJSON() ([]byte, error) {
  1891  	type NoMethod ManagedFolders
  1892  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1893  }
  1894  
  1895  // Notification: A subscription to receive Google PubSub notifications.
  1896  type Notification struct {
  1897  	// CustomAttributes: An optional list of additional attributes to attach to
  1898  	// each Cloud PubSub message published for this notification subscription.
  1899  	CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
  1900  	// Etag: HTTP 1.1 Entity tag for this subscription notification.
  1901  	Etag string `json:"etag,omitempty"`
  1902  	// EventTypes: If present, only send notifications about listed event types. If
  1903  	// empty, sent notifications for all event types.
  1904  	EventTypes []string `json:"event_types,omitempty"`
  1905  	// Id: The ID of the notification.
  1906  	Id string `json:"id,omitempty"`
  1907  	// Kind: The kind of item this is. For notifications, this is always
  1908  	// storage#notification.
  1909  	Kind string `json:"kind,omitempty"`
  1910  	// ObjectNamePrefix: If present, only apply this notification configuration to
  1911  	// object names that begin with this prefix.
  1912  	ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
  1913  	// PayloadFormat: The desired content of the Payload.
  1914  	PayloadFormat string `json:"payload_format,omitempty"`
  1915  	// SelfLink: The canonical URL of this notification.
  1916  	SelfLink string `json:"selfLink,omitempty"`
  1917  	// Topic: The Cloud PubSub topic to which this subscription publishes.
  1918  	// Formatted as:
  1919  	// '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'
  1920  	Topic string `json:"topic,omitempty"`
  1921  
  1922  	// ServerResponse contains the HTTP response code and headers from the server.
  1923  	googleapi.ServerResponse `json:"-"`
  1924  	// ForceSendFields is a list of field names (e.g. "CustomAttributes") to
  1925  	// unconditionally include in API requests. By default, fields with empty or
  1926  	// default values are omitted from API requests. See
  1927  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1928  	// details.
  1929  	ForceSendFields []string `json:"-"`
  1930  	// NullFields is a list of field names (e.g. "CustomAttributes") to include in
  1931  	// API requests with the JSON null value. By default, fields with empty values
  1932  	// are omitted from API requests. See
  1933  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1934  	NullFields []string `json:"-"`
  1935  }
  1936  
  1937  func (s *Notification) MarshalJSON() ([]byte, error) {
  1938  	type NoMethod Notification
  1939  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1940  }
  1941  
  1942  // Notifications: A list of notification subscriptions.
  1943  type Notifications struct {
  1944  	// Items: The list of items.
  1945  	Items []*Notification `json:"items,omitempty"`
  1946  	// Kind: The kind of item this is. For lists of notifications, this is always
  1947  	// storage#notifications.
  1948  	Kind string `json:"kind,omitempty"`
  1949  
  1950  	// ServerResponse contains the HTTP response code and headers from the server.
  1951  	googleapi.ServerResponse `json:"-"`
  1952  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  1953  	// include in API requests. By default, fields with empty or default values are
  1954  	// omitted from API requests. See
  1955  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1956  	// details.
  1957  	ForceSendFields []string `json:"-"`
  1958  	// NullFields is a list of field names (e.g. "Items") to include in API
  1959  	// requests with the JSON null value. By default, fields with empty values are
  1960  	// omitted from API requests. See
  1961  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1962  	NullFields []string `json:"-"`
  1963  }
  1964  
  1965  func (s *Notifications) MarshalJSON() ([]byte, error) {
  1966  	type NoMethod Notifications
  1967  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1968  }
  1969  
  1970  // Object: An object.
  1971  type Object struct {
  1972  	// Acl: Access controls on the object.
  1973  	Acl []*ObjectAccessControl `json:"acl,omitempty"`
  1974  	// Bucket: The name of the bucket containing this object.
  1975  	Bucket string `json:"bucket,omitempty"`
  1976  	// CacheControl: Cache-Control directive for the object data. If omitted, and
  1977  	// the object is accessible to all anonymous users, the default will be public,
  1978  	// max-age=3600.
  1979  	CacheControl string `json:"cacheControl,omitempty"`
  1980  	// ComponentCount: Number of underlying components that make up this object.
  1981  	// Components are accumulated by compose operations.
  1982  	ComponentCount int64 `json:"componentCount,omitempty"`
  1983  	// ContentDisposition: Content-Disposition of the object data.
  1984  	ContentDisposition string `json:"contentDisposition,omitempty"`
  1985  	// ContentEncoding: Content-Encoding of the object data.
  1986  	ContentEncoding string `json:"contentEncoding,omitempty"`
  1987  	// ContentLanguage: Content-Language of the object data.
  1988  	ContentLanguage string `json:"contentLanguage,omitempty"`
  1989  	// ContentType: Content-Type of the object data. If an object is stored without
  1990  	// a Content-Type, it is served as application/octet-stream.
  1991  	ContentType string `json:"contentType,omitempty"`
  1992  	// Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B; encoded using
  1993  	// base64 in big-endian byte order. For more information about using the CRC32c
  1994  	// checksum, see Hashes and ETags: Best Practices.
  1995  	Crc32c string `json:"crc32c,omitempty"`
  1996  	// CustomTime: A timestamp in RFC 3339 format specified by the user for an
  1997  	// object.
  1998  	CustomTime string `json:"customTime,omitempty"`
  1999  	// CustomerEncryption: Metadata of customer-supplied encryption key, if the
  2000  	// object is encrypted by such a key.
  2001  	CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
  2002  	// Etag: HTTP 1.1 Entity tag for the object.
  2003  	Etag string `json:"etag,omitempty"`
  2004  	// EventBasedHold: Whether an object is under event-based hold. Event-based
  2005  	// hold is a way to retain objects until an event occurs, which is signified by
  2006  	// the hold's release (i.e. this value is set to false). After being released
  2007  	// (set to false), such objects will be subject to bucket-level retention (if
  2008  	// any). One sample use case of this flag is for banks to hold loan documents
  2009  	// for at least 3 years after loan is paid in full. Here, bucket-level
  2010  	// retention is 3 years and the event is the loan being paid in full. In this
  2011  	// example, these objects will be held intact for any number of years until the
  2012  	// event has occurred (event-based hold on the object is released) and then 3
  2013  	// more years after that. That means retention duration of the objects begins
  2014  	// from the moment event-based hold transitioned from true to false.
  2015  	EventBasedHold bool `json:"eventBasedHold,omitempty"`
  2016  	// Generation: The content generation of this object. Used for object
  2017  	// versioning.
  2018  	Generation int64 `json:"generation,omitempty,string"`
  2019  	// HardDeleteTime: This is the time (in the future) when the soft-deleted
  2020  	// object will no longer be restorable. It is equal to the soft delete time
  2021  	// plus the current soft delete retention duration of the bucket.
  2022  	HardDeleteTime string `json:"hardDeleteTime,omitempty"`
  2023  	// Id: The ID of the object, including the bucket name, object name, and
  2024  	// generation number.
  2025  	Id string `json:"id,omitempty"`
  2026  	// Kind: The kind of item this is. For objects, this is always storage#object.
  2027  	Kind string `json:"kind,omitempty"`
  2028  	// KmsKeyName: Not currently supported. Specifying the parameter causes the
  2029  	// request to fail with status code 400 - Bad Request.
  2030  	KmsKeyName string `json:"kmsKeyName,omitempty"`
  2031  	// Md5Hash: MD5 hash of the data; encoded using base64. For more information
  2032  	// about using the MD5 hash, see Hashes and ETags: Best Practices.
  2033  	Md5Hash string `json:"md5Hash,omitempty"`
  2034  	// MediaLink: Media download link.
  2035  	MediaLink string `json:"mediaLink,omitempty"`
  2036  	// Metadata: User-provided metadata, in key/value pairs.
  2037  	Metadata map[string]string `json:"metadata,omitempty"`
  2038  	// Metageneration: The version of the metadata for this object at this
  2039  	// generation. Used for preconditions and for detecting changes in metadata. A
  2040  	// metageneration number is only meaningful in the context of a particular
  2041  	// generation of a particular object.
  2042  	Metageneration int64 `json:"metageneration,omitempty,string"`
  2043  	// Name: The name of the object. Required if not specified by URL parameter.
  2044  	Name string `json:"name,omitempty"`
  2045  	// Owner: The owner of the object. This will always be the uploader of the
  2046  	// object.
  2047  	Owner *ObjectOwner `json:"owner,omitempty"`
  2048  	// Retention: A collection of object level retention parameters.
  2049  	Retention *ObjectRetention `json:"retention,omitempty"`
  2050  	// RetentionExpirationTime: A server-determined value that specifies the
  2051  	// earliest time that the object's retention period expires. This value is in
  2052  	// RFC 3339 format. Note 1: This field is not provided for objects with an
  2053  	// active event-based hold, since retention expiration is unknown until the
  2054  	// hold is removed. Note 2: This value can be provided even when temporary hold
  2055  	// is set (so that the user can reason about policy without having to first
  2056  	// unset the temporary hold).
  2057  	RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"`
  2058  	// SelfLink: The link to this object.
  2059  	SelfLink string `json:"selfLink,omitempty"`
  2060  	// Size: Content-Length of the data in bytes.
  2061  	Size uint64 `json:"size,omitempty,string"`
  2062  	// SoftDeleteTime: The time at which the object became soft-deleted in RFC 3339
  2063  	// format.
  2064  	SoftDeleteTime string `json:"softDeleteTime,omitempty"`
  2065  	// StorageClass: Storage class of the object.
  2066  	StorageClass string `json:"storageClass,omitempty"`
  2067  	// TemporaryHold: Whether an object is under temporary hold. While this flag is
  2068  	// set to true, the object is protected against deletion and overwrites. A
  2069  	// common use case of this flag is regulatory investigations where objects need
  2070  	// to be retained while the investigation is ongoing. Note that unlike
  2071  	// event-based hold, temporary hold does not impact retention expiration time
  2072  	// of an object.
  2073  	TemporaryHold bool `json:"temporaryHold,omitempty"`
  2074  	// TimeCreated: The creation time of the object in RFC 3339 format.
  2075  	TimeCreated string `json:"timeCreated,omitempty"`
  2076  	// TimeDeleted: The time at which the object became noncurrent in RFC 3339
  2077  	// format. Will be returned if and only if this version of the object has been
  2078  	// deleted.
  2079  	TimeDeleted string `json:"timeDeleted,omitempty"`
  2080  	// TimeStorageClassUpdated: The time at which the object's storage class was
  2081  	// last changed. When the object is initially created, it will be set to
  2082  	// timeCreated.
  2083  	TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
  2084  	// Updated: The modification time of the object metadata in RFC 3339 format.
  2085  	// Set initially to object creation time and then updated whenever any metadata
  2086  	// of the object changes. This includes changes made by a requester, such as
  2087  	// modifying custom metadata, as well as changes made by Cloud Storage on
  2088  	// behalf of a requester, such as changing the storage class based on an Object
  2089  	// Lifecycle Configuration.
  2090  	Updated string `json:"updated,omitempty"`
  2091  
  2092  	// ServerResponse contains the HTTP response code and headers from the server.
  2093  	googleapi.ServerResponse `json:"-"`
  2094  	// ForceSendFields is a list of field names (e.g. "Acl") to unconditionally
  2095  	// include in API requests. By default, fields with empty or default values are
  2096  	// omitted from API requests. See
  2097  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2098  	// details.
  2099  	ForceSendFields []string `json:"-"`
  2100  	// NullFields is a list of field names (e.g. "Acl") to include in API requests
  2101  	// with the JSON null value. By default, fields with empty values are omitted
  2102  	// from API requests. See
  2103  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2104  	NullFields []string `json:"-"`
  2105  }
  2106  
  2107  func (s *Object) MarshalJSON() ([]byte, error) {
  2108  	type NoMethod Object
  2109  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2110  }
  2111  
  2112  // ObjectCustomerEncryption: Metadata of customer-supplied encryption key, if
  2113  // the object is encrypted by such a key.
  2114  type ObjectCustomerEncryption struct {
  2115  	// EncryptionAlgorithm: The encryption algorithm.
  2116  	EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"`
  2117  	// KeySha256: SHA256 hash value of the encryption key.
  2118  	KeySha256 string `json:"keySha256,omitempty"`
  2119  	// ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm") to
  2120  	// unconditionally include in API requests. By default, fields with empty or
  2121  	// default values are omitted from API requests. See
  2122  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2123  	// details.
  2124  	ForceSendFields []string `json:"-"`
  2125  	// NullFields is a list of field names (e.g. "EncryptionAlgorithm") to include
  2126  	// in API requests with the JSON null value. By default, fields with empty
  2127  	// values are omitted from API requests. See
  2128  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2129  	NullFields []string `json:"-"`
  2130  }
  2131  
  2132  func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
  2133  	type NoMethod ObjectCustomerEncryption
  2134  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2135  }
  2136  
  2137  // ObjectOwner: The owner of the object. This will always be the uploader of
  2138  // the object.
  2139  type ObjectOwner struct {
  2140  	// Entity: The entity, in the form user-userId.
  2141  	Entity string `json:"entity,omitempty"`
  2142  	// EntityId: The ID for the entity.
  2143  	EntityId string `json:"entityId,omitempty"`
  2144  	// ForceSendFields is a list of field names (e.g. "Entity") to unconditionally
  2145  	// include in API requests. By default, fields with empty or default values are
  2146  	// omitted from API requests. See
  2147  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2148  	// details.
  2149  	ForceSendFields []string `json:"-"`
  2150  	// NullFields is a list of field names (e.g. "Entity") to include in API
  2151  	// requests with the JSON null value. By default, fields with empty values are
  2152  	// omitted from API requests. See
  2153  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2154  	NullFields []string `json:"-"`
  2155  }
  2156  
  2157  func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
  2158  	type NoMethod ObjectOwner
  2159  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2160  }
  2161  
  2162  // ObjectRetention: A collection of object level retention parameters.
  2163  type ObjectRetention struct {
  2164  	// Mode: The bucket's object retention mode, can only be Unlocked or Locked.
  2165  	Mode string `json:"mode,omitempty"`
  2166  	// RetainUntilTime: A time in RFC 3339 format until which object retention
  2167  	// protects this object.
  2168  	RetainUntilTime string `json:"retainUntilTime,omitempty"`
  2169  	// ForceSendFields is a list of field names (e.g. "Mode") to unconditionally
  2170  	// include in API requests. By default, fields with empty or default values are
  2171  	// omitted from API requests. See
  2172  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2173  	// details.
  2174  	ForceSendFields []string `json:"-"`
  2175  	// NullFields is a list of field names (e.g. "Mode") to include in API requests
  2176  	// with the JSON null value. By default, fields with empty values are omitted
  2177  	// from API requests. See
  2178  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2179  	NullFields []string `json:"-"`
  2180  }
  2181  
  2182  func (s *ObjectRetention) MarshalJSON() ([]byte, error) {
  2183  	type NoMethod ObjectRetention
  2184  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2185  }
  2186  
  2187  // ObjectAccessControl: An access-control entry.
  2188  type ObjectAccessControl struct {
  2189  	// Bucket: The name of the bucket.
  2190  	Bucket string `json:"bucket,omitempty"`
  2191  	// Domain: The domain associated with the entity, if any.
  2192  	Domain string `json:"domain,omitempty"`
  2193  	// Email: The email address associated with the entity, if any.
  2194  	Email string `json:"email,omitempty"`
  2195  	// Entity: The entity holding the permission, in one of the following forms:
  2196  	// - user-userId
  2197  	// - user-email
  2198  	// - group-groupId
  2199  	// - group-email
  2200  	// - domain-domain
  2201  	// - project-team-projectId
  2202  	// - allUsers
  2203  	// - allAuthenticatedUsers Examples:
  2204  	// - The user liz@example.com would be user-liz@example.com.
  2205  	// - The group example@googlegroups.com would be
  2206  	// group-example@googlegroups.com.
  2207  	// - To refer to all members of the Google Apps for Business domain
  2208  	// example.com, the entity would be domain-example.com.
  2209  	Entity string `json:"entity,omitempty"`
  2210  	// EntityId: The ID for the entity, if any.
  2211  	EntityId string `json:"entityId,omitempty"`
  2212  	// Etag: HTTP 1.1 Entity tag for the access-control entry.
  2213  	Etag string `json:"etag,omitempty"`
  2214  	// Generation: The content generation of the object, if applied to an object.
  2215  	Generation int64 `json:"generation,omitempty,string"`
  2216  	// Id: The ID of the access-control entry.
  2217  	Id string `json:"id,omitempty"`
  2218  	// Kind: The kind of item this is. For object access control entries, this is
  2219  	// always storage#objectAccessControl.
  2220  	Kind string `json:"kind,omitempty"`
  2221  	// Object: The name of the object, if applied to an object.
  2222  	Object string `json:"object,omitempty"`
  2223  	// ProjectTeam: The project team associated with the entity, if any.
  2224  	ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
  2225  	// Role: The access permission for the entity.
  2226  	Role string `json:"role,omitempty"`
  2227  	// SelfLink: The link to this access-control entry.
  2228  	SelfLink string `json:"selfLink,omitempty"`
  2229  
  2230  	// ServerResponse contains the HTTP response code and headers from the server.
  2231  	googleapi.ServerResponse `json:"-"`
  2232  	// ForceSendFields is a list of field names (e.g. "Bucket") to unconditionally
  2233  	// include in API requests. By default, fields with empty or default values are
  2234  	// omitted from API requests. See
  2235  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2236  	// details.
  2237  	ForceSendFields []string `json:"-"`
  2238  	// NullFields is a list of field names (e.g. "Bucket") to include in API
  2239  	// requests with the JSON null value. By default, fields with empty values are
  2240  	// omitted from API requests. See
  2241  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2242  	NullFields []string `json:"-"`
  2243  }
  2244  
  2245  func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
  2246  	type NoMethod ObjectAccessControl
  2247  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2248  }
  2249  
  2250  // ObjectAccessControlProjectTeam: The project team associated with the entity,
  2251  // if any.
  2252  type ObjectAccessControlProjectTeam struct {
  2253  	// ProjectNumber: The project number.
  2254  	ProjectNumber string `json:"projectNumber,omitempty"`
  2255  	// Team: The team.
  2256  	Team string `json:"team,omitempty"`
  2257  	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
  2258  	// unconditionally include in API requests. By default, fields with empty or
  2259  	// default values are omitted from API requests. See
  2260  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2261  	// details.
  2262  	ForceSendFields []string `json:"-"`
  2263  	// NullFields is a list of field names (e.g. "ProjectNumber") to include in API
  2264  	// requests with the JSON null value. By default, fields with empty values are
  2265  	// omitted from API requests. See
  2266  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2267  	NullFields []string `json:"-"`
  2268  }
  2269  
  2270  func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
  2271  	type NoMethod ObjectAccessControlProjectTeam
  2272  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2273  }
  2274  
  2275  // ObjectAccessControls: An access-control list.
  2276  type ObjectAccessControls struct {
  2277  	// Items: The list of items.
  2278  	Items []*ObjectAccessControl `json:"items,omitempty"`
  2279  	// Kind: The kind of item this is. For lists of object access control entries,
  2280  	// this is always storage#objectAccessControls.
  2281  	Kind string `json:"kind,omitempty"`
  2282  
  2283  	// ServerResponse contains the HTTP response code and headers from the server.
  2284  	googleapi.ServerResponse `json:"-"`
  2285  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  2286  	// include in API requests. By default, fields with empty or default values are
  2287  	// omitted from API requests. See
  2288  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2289  	// details.
  2290  	ForceSendFields []string `json:"-"`
  2291  	// NullFields is a list of field names (e.g. "Items") to include in API
  2292  	// requests with the JSON null value. By default, fields with empty values are
  2293  	// omitted from API requests. See
  2294  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2295  	NullFields []string `json:"-"`
  2296  }
  2297  
  2298  func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
  2299  	type NoMethod ObjectAccessControls
  2300  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2301  }
  2302  
  2303  // Objects: A list of objects.
  2304  type Objects struct {
  2305  	// Items: The list of items.
  2306  	Items []*Object `json:"items,omitempty"`
  2307  	// Kind: The kind of item this is. For lists of objects, this is always
  2308  	// storage#objects.
  2309  	Kind string `json:"kind,omitempty"`
  2310  	// NextPageToken: The continuation token, used to page through large result
  2311  	// sets. Provide this value in a subsequent request to return the next page of
  2312  	// results.
  2313  	NextPageToken string `json:"nextPageToken,omitempty"`
  2314  	// Prefixes: The list of prefixes of objects matching-but-not-listed up to and
  2315  	// including the requested delimiter.
  2316  	Prefixes []string `json:"prefixes,omitempty"`
  2317  
  2318  	// ServerResponse contains the HTTP response code and headers from the server.
  2319  	googleapi.ServerResponse `json:"-"`
  2320  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
  2321  	// include in API requests. By default, fields with empty or default values are
  2322  	// omitted from API requests. See
  2323  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2324  	// details.
  2325  	ForceSendFields []string `json:"-"`
  2326  	// NullFields is a list of field names (e.g. "Items") to include in API
  2327  	// requests with the JSON null value. By default, fields with empty values are
  2328  	// omitted from API requests. See
  2329  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2330  	NullFields []string `json:"-"`
  2331  }
  2332  
  2333  func (s *Objects) MarshalJSON() ([]byte, error) {
  2334  	type NoMethod Objects
  2335  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2336  }
  2337  
  2338  // Policy: A bucket/object/managedFolder IAM policy.
  2339  type Policy struct {
  2340  	// Bindings: An association between a role, which comes with a set of
  2341  	// permissions, and members who may assume that role.
  2342  	Bindings []*PolicyBindings `json:"bindings,omitempty"`
  2343  	// Etag: HTTP 1.1  Entity tag for the policy.
  2344  	Etag string `json:"etag,omitempty"`
  2345  	// Kind: The kind of item this is. For policies, this is always storage#policy.
  2346  	// This field is ignored on input.
  2347  	Kind string `json:"kind,omitempty"`
  2348  	// ResourceId: The ID of the resource to which this policy belongs. Will be of
  2349  	// the form projects/_/buckets/bucket for buckets,
  2350  	// projects/_/buckets/bucket/objects/object for objects, and
  2351  	// projects/_/buckets/bucket/managedFolders/managedFolder. A specific
  2352  	// generation may be specified by appending #generationNumber to the end of the
  2353  	// object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The
  2354  	// current generation can be denoted with #0. This field is ignored on input.
  2355  	ResourceId string `json:"resourceId,omitempty"`
  2356  	// Version: The IAM policy format version.
  2357  	Version int64 `json:"version,omitempty"`
  2358  
  2359  	// ServerResponse contains the HTTP response code and headers from the server.
  2360  	googleapi.ServerResponse `json:"-"`
  2361  	// ForceSendFields is a list of field names (e.g. "Bindings") to
  2362  	// unconditionally include in API requests. By default, fields with empty or
  2363  	// default values are omitted from API requests. See
  2364  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2365  	// details.
  2366  	ForceSendFields []string `json:"-"`
  2367  	// NullFields is a list of field names (e.g. "Bindings") to include in API
  2368  	// requests with the JSON null value. By default, fields with empty values are
  2369  	// omitted from API requests. See
  2370  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2371  	NullFields []string `json:"-"`
  2372  }
  2373  
  2374  func (s *Policy) MarshalJSON() ([]byte, error) {
  2375  	type NoMethod Policy
  2376  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2377  }
  2378  
  2379  type PolicyBindings struct {
  2380  	// Condition: The condition that is associated with this binding. NOTE: an
  2381  	// unsatisfied condition will not allow user access via current binding.
  2382  	// Different bindings, including their conditions, are examined independently.
  2383  	Condition *Expr `json:"condition,omitempty"`
  2384  	// Members: A collection of identifiers for members who may assume the provided
  2385  	// role. Recognized identifiers are as follows:
  2386  	// - allUsers — A special identifier that represents anyone on the internet;
  2387  	// with or without a Google account.
  2388  	// - allAuthenticatedUsers — A special identifier that represents anyone who
  2389  	// is authenticated with a Google account or a service account.
  2390  	// - user:emailid — An email address that represents a specific account. For
  2391  	// example, user:alice@gmail.com or user:joe@example.com.
  2392  	// - serviceAccount:emailid — An email address that represents a service
  2393  	// account. For example,
  2394  	// serviceAccount:my-other-app@appspot.gserviceaccount.com .
  2395  	// - group:emailid — An email address that represents a Google group. For
  2396  	// example, group:admins@example.com.
  2397  	// - domain:domain — A Google Apps domain name that represents all the users
  2398  	// of that domain. For example, domain:google.com or domain:example.com.
  2399  	// - projectOwner:projectid — Owners of the given project. For example,
  2400  	// projectOwner:my-example-project
  2401  	// - projectEditor:projectid — Editors of the given project. For example,
  2402  	// projectEditor:my-example-project
  2403  	// - projectViewer:projectid — Viewers of the given project. For example,
  2404  	// projectViewer:my-example-project
  2405  	Members []string `json:"members,omitempty"`
  2406  	// Role: The role to which members belong. Two types of roles are supported:
  2407  	// new IAM roles, which grant permissions that do not map directly to those
  2408  	// provided by ACLs, and legacy IAM roles, which do map directly to ACL
  2409  	// permissions. All roles are of the format roles/storage.specificRole.
  2410  	// The new IAM roles are:
  2411  	// - roles/storage.admin — Full control of Google Cloud Storage resources.
  2412  	//
  2413  	// - roles/storage.objectViewer — Read-Only access to Google Cloud Storage
  2414  	// objects.
  2415  	// - roles/storage.objectCreator — Access to create objects in Google Cloud
  2416  	// Storage.
  2417  	// - roles/storage.objectAdmin — Full control of Google Cloud Storage
  2418  	// objects.   The legacy IAM roles are:
  2419  	// - roles/storage.legacyObjectReader — Read-only access to objects without
  2420  	// listing. Equivalent to an ACL entry on an object with the READER role.
  2421  	// - roles/storage.legacyObjectOwner — Read/write access to existing objects
  2422  	// without listing. Equivalent to an ACL entry on an object with the OWNER
  2423  	// role.
  2424  	// - roles/storage.legacyBucketReader — Read access to buckets with object
  2425  	// listing. Equivalent to an ACL entry on a bucket with the READER role.
  2426  	// - roles/storage.legacyBucketWriter — Read access to buckets with object
  2427  	// listing/creation/deletion. Equivalent to an ACL entry on a bucket with the
  2428  	// WRITER role.
  2429  	// - roles/storage.legacyBucketOwner — Read and write access to existing
  2430  	// buckets with object listing/creation/deletion. Equivalent to an ACL entry on
  2431  	// a bucket with the OWNER role.
  2432  	Role string `json:"role,omitempty"`
  2433  	// ForceSendFields is a list of field names (e.g. "Condition") to
  2434  	// unconditionally include in API requests. By default, fields with empty or
  2435  	// default values are omitted from API requests. See
  2436  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2437  	// details.
  2438  	ForceSendFields []string `json:"-"`
  2439  	// NullFields is a list of field names (e.g. "Condition") to include in API
  2440  	// requests with the JSON null value. By default, fields with empty values are
  2441  	// omitted from API requests. See
  2442  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2443  	NullFields []string `json:"-"`
  2444  }
  2445  
  2446  func (s *PolicyBindings) MarshalJSON() ([]byte, error) {
  2447  	type NoMethod PolicyBindings
  2448  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2449  }
  2450  
  2451  // RewriteResponse: A rewrite response.
  2452  type RewriteResponse struct {
  2453  	// Done: true if the copy is finished; otherwise, false if the copy is in
  2454  	// progress. This property is always present in the response.
  2455  	Done bool `json:"done,omitempty"`
  2456  	// Kind: The kind of item this is.
  2457  	Kind string `json:"kind,omitempty"`
  2458  	// ObjectSize: The total size of the object being copied in bytes. This
  2459  	// property is always present in the response.
  2460  	ObjectSize int64 `json:"objectSize,omitempty,string"`
  2461  	// Resource: A resource containing the metadata for the copied-to object. This
  2462  	// property is present in the response only when copying completes.
  2463  	Resource *Object `json:"resource,omitempty"`
  2464  	// RewriteToken: A token to use in subsequent requests to continue copying
  2465  	// data. This token is present in the response only when there is more data to
  2466  	// copy.
  2467  	RewriteToken string `json:"rewriteToken,omitempty"`
  2468  	// TotalBytesRewritten: The total bytes written so far, which can be used to
  2469  	// provide a waiting user with a progress indicator. This property is always
  2470  	// present in the response.
  2471  	TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
  2472  
  2473  	// ServerResponse contains the HTTP response code and headers from the server.
  2474  	googleapi.ServerResponse `json:"-"`
  2475  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
  2476  	// include in API requests. By default, fields with empty or default values are
  2477  	// omitted from API requests. See
  2478  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2479  	// details.
  2480  	ForceSendFields []string `json:"-"`
  2481  	// NullFields is a list of field names (e.g. "Done") to include in API requests
  2482  	// with the JSON null value. By default, fields with empty values are omitted
  2483  	// from API requests. See
  2484  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2485  	NullFields []string `json:"-"`
  2486  }
  2487  
  2488  func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
  2489  	type NoMethod RewriteResponse
  2490  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2491  }
  2492  
  2493  // ServiceAccount: A subscription to receive Google PubSub notifications.
  2494  type ServiceAccount struct {
  2495  	// EmailAddress: The ID of the notification.
  2496  	EmailAddress string `json:"email_address,omitempty"`
  2497  	// Kind: The kind of item this is. For notifications, this is always
  2498  	// storage#notification.
  2499  	Kind string `json:"kind,omitempty"`
  2500  
  2501  	// ServerResponse contains the HTTP response code and headers from the server.
  2502  	googleapi.ServerResponse `json:"-"`
  2503  	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
  2504  	// unconditionally include in API requests. By default, fields with empty or
  2505  	// default values are omitted from API requests. See
  2506  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2507  	// details.
  2508  	ForceSendFields []string `json:"-"`
  2509  	// NullFields is a list of field names (e.g. "EmailAddress") to include in API
  2510  	// requests with the JSON null value. By default, fields with empty values are
  2511  	// omitted from API requests. See
  2512  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2513  	NullFields []string `json:"-"`
  2514  }
  2515  
  2516  func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  2517  	type NoMethod ServiceAccount
  2518  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2519  }
  2520  
  2521  // TestIamPermissionsResponse: A
  2522  // storage.(buckets|objects|managedFolders).testIamPermissions response.
  2523  type TestIamPermissionsResponse struct {
  2524  	// Kind: The kind of item this is.
  2525  	Kind string `json:"kind,omitempty"`
  2526  	// Permissions: The permissions held by the caller. Permissions are always of
  2527  	// the format storage.resource.capability, where resource is one of buckets,
  2528  	// objects, or managedFolders. The supported permissions are as follows:
  2529  	// - storage.buckets.delete — Delete bucket.
  2530  	// - storage.buckets.get — Read bucket metadata.
  2531  	// - storage.buckets.getIamPolicy — Read bucket IAM policy.
  2532  	// - storage.buckets.create — Create bucket.
  2533  	// - storage.buckets.list — List buckets.
  2534  	// - storage.buckets.setIamPolicy — Update bucket IAM policy.
  2535  	// - storage.buckets.update — Update bucket metadata.
  2536  	// - storage.objects.delete — Delete object.
  2537  	// - storage.objects.get — Read object data and metadata.
  2538  	// - storage.objects.getIamPolicy — Read object IAM policy.
  2539  	// - storage.objects.create — Create object.
  2540  	// - storage.objects.list — List objects.
  2541  	// - storage.objects.setIamPolicy — Update object IAM policy.
  2542  	// - storage.objects.update — Update object metadata.
  2543  	// - storage.managedFolders.delete — Delete managed folder.
  2544  	// - storage.managedFolders.get — Read managed folder metadata.
  2545  	// - storage.managedFolders.getIamPolicy — Read managed folder IAM policy.
  2546  	//
  2547  	// - storage.managedFolders.create — Create managed folder.
  2548  	// - storage.managedFolders.list — List managed folders.
  2549  	// - storage.managedFolders.setIamPolicy — Update managed folder IAM policy.
  2550  	Permissions []string `json:"permissions,omitempty"`
  2551  
  2552  	// ServerResponse contains the HTTP response code and headers from the server.
  2553  	googleapi.ServerResponse `json:"-"`
  2554  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2555  	// include in API requests. By default, fields with empty or default values are
  2556  	// omitted from API requests. See
  2557  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2558  	// details.
  2559  	ForceSendFields []string `json:"-"`
  2560  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2561  	// with the JSON null value. By default, fields with empty values are omitted
  2562  	// from API requests. See
  2563  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2564  	NullFields []string `json:"-"`
  2565  }
  2566  
  2567  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  2568  	type NoMethod TestIamPermissionsResponse
  2569  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2570  }
  2571  
  2572  type AnywhereCachesDisableCall struct {
  2573  	s               *Service
  2574  	bucket          string
  2575  	anywhereCacheId string
  2576  	urlParams_      gensupport.URLParams
  2577  	ctx_            context.Context
  2578  	header_         http.Header
  2579  }
  2580  
  2581  // Disable: Disables an Anywhere Cache instance.
  2582  //
  2583  // - anywhereCacheId: The ID of requested Anywhere Cache instance.
  2584  // - bucket: Name of the parent bucket.
  2585  func (r *AnywhereCachesService) Disable(bucket string, anywhereCacheId string) *AnywhereCachesDisableCall {
  2586  	c := &AnywhereCachesDisableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2587  	c.bucket = bucket
  2588  	c.anywhereCacheId = anywhereCacheId
  2589  	return c
  2590  }
  2591  
  2592  // Fields allows partial responses to be retrieved. See
  2593  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2594  // details.
  2595  func (c *AnywhereCachesDisableCall) Fields(s ...googleapi.Field) *AnywhereCachesDisableCall {
  2596  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2597  	return c
  2598  }
  2599  
  2600  // Context sets the context to be used in this call's Do method.
  2601  func (c *AnywhereCachesDisableCall) Context(ctx context.Context) *AnywhereCachesDisableCall {
  2602  	c.ctx_ = ctx
  2603  	return c
  2604  }
  2605  
  2606  // Header returns a http.Header that can be modified by the caller to add
  2607  // headers to the request.
  2608  func (c *AnywhereCachesDisableCall) Header() http.Header {
  2609  	if c.header_ == nil {
  2610  		c.header_ = make(http.Header)
  2611  	}
  2612  	return c.header_
  2613  }
  2614  
  2615  func (c *AnywhereCachesDisableCall) doRequest(alt string) (*http.Response, error) {
  2616  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2617  	var body io.Reader = nil
  2618  	c.urlParams_.Set("alt", alt)
  2619  	c.urlParams_.Set("prettyPrint", "false")
  2620  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}/disable")
  2621  	urls += "?" + c.urlParams_.Encode()
  2622  	req, err := http.NewRequest("POST", urls, body)
  2623  	if err != nil {
  2624  		return nil, err
  2625  	}
  2626  	req.Header = reqHeaders
  2627  	googleapi.Expand(req.URL, map[string]string{
  2628  		"bucket":          c.bucket,
  2629  		"anywhereCacheId": c.anywhereCacheId,
  2630  	})
  2631  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2632  }
  2633  
  2634  // Do executes the "storage.anywhereCaches.disable" call.
  2635  // Any non-2xx status code is an error. Response headers are in either
  2636  // *AnywhereCache.ServerResponse.Header or (if a response was returned at all)
  2637  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2638  // whether the returned error was because http.StatusNotModified was returned.
  2639  func (c *AnywhereCachesDisableCall) Do(opts ...googleapi.CallOption) (*AnywhereCache, error) {
  2640  	gensupport.SetOptions(c.urlParams_, opts...)
  2641  	res, err := c.doRequest("json")
  2642  	if res != nil && res.StatusCode == http.StatusNotModified {
  2643  		if res.Body != nil {
  2644  			res.Body.Close()
  2645  		}
  2646  		return nil, gensupport.WrapError(&googleapi.Error{
  2647  			Code:   res.StatusCode,
  2648  			Header: res.Header,
  2649  		})
  2650  	}
  2651  	if err != nil {
  2652  		return nil, err
  2653  	}
  2654  	defer googleapi.CloseBody(res)
  2655  	if err := googleapi.CheckResponse(res); err != nil {
  2656  		return nil, gensupport.WrapError(err)
  2657  	}
  2658  	ret := &AnywhereCache{
  2659  		ServerResponse: googleapi.ServerResponse{
  2660  			Header:         res.Header,
  2661  			HTTPStatusCode: res.StatusCode,
  2662  		},
  2663  	}
  2664  	target := &ret
  2665  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2666  		return nil, err
  2667  	}
  2668  	return ret, nil
  2669  }
  2670  
  2671  type AnywhereCachesGetCall struct {
  2672  	s               *Service
  2673  	bucket          string
  2674  	anywhereCacheId string
  2675  	urlParams_      gensupport.URLParams
  2676  	ifNoneMatch_    string
  2677  	ctx_            context.Context
  2678  	header_         http.Header
  2679  }
  2680  
  2681  // Get: Returns the metadata of an Anywhere Cache instance.
  2682  //
  2683  // - anywhereCacheId: The ID of requested Anywhere Cache instance.
  2684  // - bucket: Name of the parent bucket.
  2685  func (r *AnywhereCachesService) Get(bucket string, anywhereCacheId string) *AnywhereCachesGetCall {
  2686  	c := &AnywhereCachesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2687  	c.bucket = bucket
  2688  	c.anywhereCacheId = anywhereCacheId
  2689  	return c
  2690  }
  2691  
  2692  // Fields allows partial responses to be retrieved. See
  2693  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2694  // details.
  2695  func (c *AnywhereCachesGetCall) Fields(s ...googleapi.Field) *AnywhereCachesGetCall {
  2696  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2697  	return c
  2698  }
  2699  
  2700  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2701  // object's ETag matches the given value. This is useful for getting updates
  2702  // only after the object has changed since the last request.
  2703  func (c *AnywhereCachesGetCall) IfNoneMatch(entityTag string) *AnywhereCachesGetCall {
  2704  	c.ifNoneMatch_ = entityTag
  2705  	return c
  2706  }
  2707  
  2708  // Context sets the context to be used in this call's Do method.
  2709  func (c *AnywhereCachesGetCall) Context(ctx context.Context) *AnywhereCachesGetCall {
  2710  	c.ctx_ = ctx
  2711  	return c
  2712  }
  2713  
  2714  // Header returns a http.Header that can be modified by the caller to add
  2715  // headers to the request.
  2716  func (c *AnywhereCachesGetCall) Header() http.Header {
  2717  	if c.header_ == nil {
  2718  		c.header_ = make(http.Header)
  2719  	}
  2720  	return c.header_
  2721  }
  2722  
  2723  func (c *AnywhereCachesGetCall) doRequest(alt string) (*http.Response, error) {
  2724  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2725  	if c.ifNoneMatch_ != "" {
  2726  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2727  	}
  2728  	var body io.Reader = nil
  2729  	c.urlParams_.Set("alt", alt)
  2730  	c.urlParams_.Set("prettyPrint", "false")
  2731  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}")
  2732  	urls += "?" + c.urlParams_.Encode()
  2733  	req, err := http.NewRequest("GET", urls, body)
  2734  	if err != nil {
  2735  		return nil, err
  2736  	}
  2737  	req.Header = reqHeaders
  2738  	googleapi.Expand(req.URL, map[string]string{
  2739  		"bucket":          c.bucket,
  2740  		"anywhereCacheId": c.anywhereCacheId,
  2741  	})
  2742  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2743  }
  2744  
  2745  // Do executes the "storage.anywhereCaches.get" call.
  2746  // Any non-2xx status code is an error. Response headers are in either
  2747  // *AnywhereCache.ServerResponse.Header or (if a response was returned at all)
  2748  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2749  // whether the returned error was because http.StatusNotModified was returned.
  2750  func (c *AnywhereCachesGetCall) Do(opts ...googleapi.CallOption) (*AnywhereCache, error) {
  2751  	gensupport.SetOptions(c.urlParams_, opts...)
  2752  	res, err := c.doRequest("json")
  2753  	if res != nil && res.StatusCode == http.StatusNotModified {
  2754  		if res.Body != nil {
  2755  			res.Body.Close()
  2756  		}
  2757  		return nil, gensupport.WrapError(&googleapi.Error{
  2758  			Code:   res.StatusCode,
  2759  			Header: res.Header,
  2760  		})
  2761  	}
  2762  	if err != nil {
  2763  		return nil, err
  2764  	}
  2765  	defer googleapi.CloseBody(res)
  2766  	if err := googleapi.CheckResponse(res); err != nil {
  2767  		return nil, gensupport.WrapError(err)
  2768  	}
  2769  	ret := &AnywhereCache{
  2770  		ServerResponse: googleapi.ServerResponse{
  2771  			Header:         res.Header,
  2772  			HTTPStatusCode: res.StatusCode,
  2773  		},
  2774  	}
  2775  	target := &ret
  2776  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2777  		return nil, err
  2778  	}
  2779  	return ret, nil
  2780  }
  2781  
  2782  type AnywhereCachesInsertCall struct {
  2783  	s             *Service
  2784  	bucket        string
  2785  	anywherecache *AnywhereCache
  2786  	urlParams_    gensupport.URLParams
  2787  	ctx_          context.Context
  2788  	header_       http.Header
  2789  }
  2790  
  2791  // Insert: Creates an Anywhere Cache instance.
  2792  //
  2793  // - bucket: Name of the parent bucket.
  2794  func (r *AnywhereCachesService) Insert(bucket string, anywherecache *AnywhereCache) *AnywhereCachesInsertCall {
  2795  	c := &AnywhereCachesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2796  	c.bucket = bucket
  2797  	c.anywherecache = anywherecache
  2798  	return c
  2799  }
  2800  
  2801  // Fields allows partial responses to be retrieved. See
  2802  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2803  // details.
  2804  func (c *AnywhereCachesInsertCall) Fields(s ...googleapi.Field) *AnywhereCachesInsertCall {
  2805  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2806  	return c
  2807  }
  2808  
  2809  // Context sets the context to be used in this call's Do method.
  2810  func (c *AnywhereCachesInsertCall) Context(ctx context.Context) *AnywhereCachesInsertCall {
  2811  	c.ctx_ = ctx
  2812  	return c
  2813  }
  2814  
  2815  // Header returns a http.Header that can be modified by the caller to add
  2816  // headers to the request.
  2817  func (c *AnywhereCachesInsertCall) Header() http.Header {
  2818  	if c.header_ == nil {
  2819  		c.header_ = make(http.Header)
  2820  	}
  2821  	return c.header_
  2822  }
  2823  
  2824  func (c *AnywhereCachesInsertCall) doRequest(alt string) (*http.Response, error) {
  2825  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2826  	var body io.Reader = nil
  2827  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.anywherecache)
  2828  	if err != nil {
  2829  		return nil, err
  2830  	}
  2831  	c.urlParams_.Set("alt", alt)
  2832  	c.urlParams_.Set("prettyPrint", "false")
  2833  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches")
  2834  	urls += "?" + c.urlParams_.Encode()
  2835  	req, err := http.NewRequest("POST", urls, body)
  2836  	if err != nil {
  2837  		return nil, err
  2838  	}
  2839  	req.Header = reqHeaders
  2840  	googleapi.Expand(req.URL, map[string]string{
  2841  		"bucket": c.bucket,
  2842  	})
  2843  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2844  }
  2845  
  2846  // Do executes the "storage.anywhereCaches.insert" call.
  2847  // Any non-2xx status code is an error. Response headers are in either
  2848  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  2849  // returned at all) in error.(*googleapi.Error).Header. Use
  2850  // googleapi.IsNotModified to check whether the returned error was because
  2851  // http.StatusNotModified was returned.
  2852  func (c *AnywhereCachesInsertCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2853  	gensupport.SetOptions(c.urlParams_, opts...)
  2854  	res, err := c.doRequest("json")
  2855  	if res != nil && res.StatusCode == http.StatusNotModified {
  2856  		if res.Body != nil {
  2857  			res.Body.Close()
  2858  		}
  2859  		return nil, gensupport.WrapError(&googleapi.Error{
  2860  			Code:   res.StatusCode,
  2861  			Header: res.Header,
  2862  		})
  2863  	}
  2864  	if err != nil {
  2865  		return nil, err
  2866  	}
  2867  	defer googleapi.CloseBody(res)
  2868  	if err := googleapi.CheckResponse(res); err != nil {
  2869  		return nil, gensupport.WrapError(err)
  2870  	}
  2871  	ret := &GoogleLongrunningOperation{
  2872  		ServerResponse: googleapi.ServerResponse{
  2873  			Header:         res.Header,
  2874  			HTTPStatusCode: res.StatusCode,
  2875  		},
  2876  	}
  2877  	target := &ret
  2878  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2879  		return nil, err
  2880  	}
  2881  	return ret, nil
  2882  }
  2883  
  2884  type AnywhereCachesListCall struct {
  2885  	s            *Service
  2886  	bucket       string
  2887  	urlParams_   gensupport.URLParams
  2888  	ifNoneMatch_ string
  2889  	ctx_         context.Context
  2890  	header_      http.Header
  2891  }
  2892  
  2893  // List: Returns a list of Anywhere Cache instances of the bucket matching the
  2894  // criteria.
  2895  //
  2896  // - bucket: Name of the parent bucket.
  2897  func (r *AnywhereCachesService) List(bucket string) *AnywhereCachesListCall {
  2898  	c := &AnywhereCachesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2899  	c.bucket = bucket
  2900  	return c
  2901  }
  2902  
  2903  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  2904  // return in a single page of responses. Maximum 1000.
  2905  func (c *AnywhereCachesListCall) PageSize(pageSize int64) *AnywhereCachesListCall {
  2906  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2907  	return c
  2908  }
  2909  
  2910  // PageToken sets the optional parameter "pageToken": A previously-returned
  2911  // page token representing part of the larger set of results to view.
  2912  func (c *AnywhereCachesListCall) PageToken(pageToken string) *AnywhereCachesListCall {
  2913  	c.urlParams_.Set("pageToken", pageToken)
  2914  	return c
  2915  }
  2916  
  2917  // Fields allows partial responses to be retrieved. See
  2918  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2919  // details.
  2920  func (c *AnywhereCachesListCall) Fields(s ...googleapi.Field) *AnywhereCachesListCall {
  2921  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2922  	return c
  2923  }
  2924  
  2925  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2926  // object's ETag matches the given value. This is useful for getting updates
  2927  // only after the object has changed since the last request.
  2928  func (c *AnywhereCachesListCall) IfNoneMatch(entityTag string) *AnywhereCachesListCall {
  2929  	c.ifNoneMatch_ = entityTag
  2930  	return c
  2931  }
  2932  
  2933  // Context sets the context to be used in this call's Do method.
  2934  func (c *AnywhereCachesListCall) Context(ctx context.Context) *AnywhereCachesListCall {
  2935  	c.ctx_ = ctx
  2936  	return c
  2937  }
  2938  
  2939  // Header returns a http.Header that can be modified by the caller to add
  2940  // headers to the request.
  2941  func (c *AnywhereCachesListCall) Header() http.Header {
  2942  	if c.header_ == nil {
  2943  		c.header_ = make(http.Header)
  2944  	}
  2945  	return c.header_
  2946  }
  2947  
  2948  func (c *AnywhereCachesListCall) doRequest(alt string) (*http.Response, error) {
  2949  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2950  	if c.ifNoneMatch_ != "" {
  2951  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2952  	}
  2953  	var body io.Reader = nil
  2954  	c.urlParams_.Set("alt", alt)
  2955  	c.urlParams_.Set("prettyPrint", "false")
  2956  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches")
  2957  	urls += "?" + c.urlParams_.Encode()
  2958  	req, err := http.NewRequest("GET", urls, body)
  2959  	if err != nil {
  2960  		return nil, err
  2961  	}
  2962  	req.Header = reqHeaders
  2963  	googleapi.Expand(req.URL, map[string]string{
  2964  		"bucket": c.bucket,
  2965  	})
  2966  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2967  }
  2968  
  2969  // Do executes the "storage.anywhereCaches.list" call.
  2970  // Any non-2xx status code is an error. Response headers are in either
  2971  // *AnywhereCaches.ServerResponse.Header or (if a response was returned at all)
  2972  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2973  // whether the returned error was because http.StatusNotModified was returned.
  2974  func (c *AnywhereCachesListCall) Do(opts ...googleapi.CallOption) (*AnywhereCaches, error) {
  2975  	gensupport.SetOptions(c.urlParams_, opts...)
  2976  	res, err := c.doRequest("json")
  2977  	if res != nil && res.StatusCode == http.StatusNotModified {
  2978  		if res.Body != nil {
  2979  			res.Body.Close()
  2980  		}
  2981  		return nil, gensupport.WrapError(&googleapi.Error{
  2982  			Code:   res.StatusCode,
  2983  			Header: res.Header,
  2984  		})
  2985  	}
  2986  	if err != nil {
  2987  		return nil, err
  2988  	}
  2989  	defer googleapi.CloseBody(res)
  2990  	if err := googleapi.CheckResponse(res); err != nil {
  2991  		return nil, gensupport.WrapError(err)
  2992  	}
  2993  	ret := &AnywhereCaches{
  2994  		ServerResponse: googleapi.ServerResponse{
  2995  			Header:         res.Header,
  2996  			HTTPStatusCode: res.StatusCode,
  2997  		},
  2998  	}
  2999  	target := &ret
  3000  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3001  		return nil, err
  3002  	}
  3003  	return ret, nil
  3004  }
  3005  
  3006  // Pages invokes f for each page of results.
  3007  // A non-nil error returned from f will halt the iteration.
  3008  // The provided context supersedes any context provided to the Context method.
  3009  func (c *AnywhereCachesListCall) Pages(ctx context.Context, f func(*AnywhereCaches) error) error {
  3010  	c.ctx_ = ctx
  3011  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3012  	for {
  3013  		x, err := c.Do()
  3014  		if err != nil {
  3015  			return err
  3016  		}
  3017  		if err := f(x); err != nil {
  3018  			return err
  3019  		}
  3020  		if x.NextPageToken == "" {
  3021  			return nil
  3022  		}
  3023  		c.PageToken(x.NextPageToken)
  3024  	}
  3025  }
  3026  
  3027  type AnywhereCachesPauseCall struct {
  3028  	s               *Service
  3029  	bucket          string
  3030  	anywhereCacheId string
  3031  	urlParams_      gensupport.URLParams
  3032  	ctx_            context.Context
  3033  	header_         http.Header
  3034  }
  3035  
  3036  // Pause: Pauses an Anywhere Cache instance.
  3037  //
  3038  // - anywhereCacheId: The ID of requested Anywhere Cache instance.
  3039  // - bucket: Name of the parent bucket.
  3040  func (r *AnywhereCachesService) Pause(bucket string, anywhereCacheId string) *AnywhereCachesPauseCall {
  3041  	c := &AnywhereCachesPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3042  	c.bucket = bucket
  3043  	c.anywhereCacheId = anywhereCacheId
  3044  	return c
  3045  }
  3046  
  3047  // Fields allows partial responses to be retrieved. See
  3048  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3049  // details.
  3050  func (c *AnywhereCachesPauseCall) Fields(s ...googleapi.Field) *AnywhereCachesPauseCall {
  3051  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3052  	return c
  3053  }
  3054  
  3055  // Context sets the context to be used in this call's Do method.
  3056  func (c *AnywhereCachesPauseCall) Context(ctx context.Context) *AnywhereCachesPauseCall {
  3057  	c.ctx_ = ctx
  3058  	return c
  3059  }
  3060  
  3061  // Header returns a http.Header that can be modified by the caller to add
  3062  // headers to the request.
  3063  func (c *AnywhereCachesPauseCall) Header() http.Header {
  3064  	if c.header_ == nil {
  3065  		c.header_ = make(http.Header)
  3066  	}
  3067  	return c.header_
  3068  }
  3069  
  3070  func (c *AnywhereCachesPauseCall) doRequest(alt string) (*http.Response, error) {
  3071  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3072  	var body io.Reader = nil
  3073  	c.urlParams_.Set("alt", alt)
  3074  	c.urlParams_.Set("prettyPrint", "false")
  3075  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}/pause")
  3076  	urls += "?" + c.urlParams_.Encode()
  3077  	req, err := http.NewRequest("POST", urls, body)
  3078  	if err != nil {
  3079  		return nil, err
  3080  	}
  3081  	req.Header = reqHeaders
  3082  	googleapi.Expand(req.URL, map[string]string{
  3083  		"bucket":          c.bucket,
  3084  		"anywhereCacheId": c.anywhereCacheId,
  3085  	})
  3086  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3087  }
  3088  
  3089  // Do executes the "storage.anywhereCaches.pause" call.
  3090  // Any non-2xx status code is an error. Response headers are in either
  3091  // *AnywhereCache.ServerResponse.Header or (if a response was returned at all)
  3092  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3093  // whether the returned error was because http.StatusNotModified was returned.
  3094  func (c *AnywhereCachesPauseCall) Do(opts ...googleapi.CallOption) (*AnywhereCache, error) {
  3095  	gensupport.SetOptions(c.urlParams_, opts...)
  3096  	res, err := c.doRequest("json")
  3097  	if res != nil && res.StatusCode == http.StatusNotModified {
  3098  		if res.Body != nil {
  3099  			res.Body.Close()
  3100  		}
  3101  		return nil, gensupport.WrapError(&googleapi.Error{
  3102  			Code:   res.StatusCode,
  3103  			Header: res.Header,
  3104  		})
  3105  	}
  3106  	if err != nil {
  3107  		return nil, err
  3108  	}
  3109  	defer googleapi.CloseBody(res)
  3110  	if err := googleapi.CheckResponse(res); err != nil {
  3111  		return nil, gensupport.WrapError(err)
  3112  	}
  3113  	ret := &AnywhereCache{
  3114  		ServerResponse: googleapi.ServerResponse{
  3115  			Header:         res.Header,
  3116  			HTTPStatusCode: res.StatusCode,
  3117  		},
  3118  	}
  3119  	target := &ret
  3120  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3121  		return nil, err
  3122  	}
  3123  	return ret, nil
  3124  }
  3125  
  3126  type AnywhereCachesResumeCall struct {
  3127  	s               *Service
  3128  	bucket          string
  3129  	anywhereCacheId string
  3130  	urlParams_      gensupport.URLParams
  3131  	ctx_            context.Context
  3132  	header_         http.Header
  3133  }
  3134  
  3135  // Resume: Resumes a paused or disabled Anywhere Cache instance.
  3136  //
  3137  // - anywhereCacheId: The ID of requested Anywhere Cache instance.
  3138  // - bucket: Name of the parent bucket.
  3139  func (r *AnywhereCachesService) Resume(bucket string, anywhereCacheId string) *AnywhereCachesResumeCall {
  3140  	c := &AnywhereCachesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3141  	c.bucket = bucket
  3142  	c.anywhereCacheId = anywhereCacheId
  3143  	return c
  3144  }
  3145  
  3146  // Fields allows partial responses to be retrieved. See
  3147  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3148  // details.
  3149  func (c *AnywhereCachesResumeCall) Fields(s ...googleapi.Field) *AnywhereCachesResumeCall {
  3150  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3151  	return c
  3152  }
  3153  
  3154  // Context sets the context to be used in this call's Do method.
  3155  func (c *AnywhereCachesResumeCall) Context(ctx context.Context) *AnywhereCachesResumeCall {
  3156  	c.ctx_ = ctx
  3157  	return c
  3158  }
  3159  
  3160  // Header returns a http.Header that can be modified by the caller to add
  3161  // headers to the request.
  3162  func (c *AnywhereCachesResumeCall) Header() http.Header {
  3163  	if c.header_ == nil {
  3164  		c.header_ = make(http.Header)
  3165  	}
  3166  	return c.header_
  3167  }
  3168  
  3169  func (c *AnywhereCachesResumeCall) doRequest(alt string) (*http.Response, error) {
  3170  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3171  	var body io.Reader = nil
  3172  	c.urlParams_.Set("alt", alt)
  3173  	c.urlParams_.Set("prettyPrint", "false")
  3174  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}/resume")
  3175  	urls += "?" + c.urlParams_.Encode()
  3176  	req, err := http.NewRequest("POST", urls, body)
  3177  	if err != nil {
  3178  		return nil, err
  3179  	}
  3180  	req.Header = reqHeaders
  3181  	googleapi.Expand(req.URL, map[string]string{
  3182  		"bucket":          c.bucket,
  3183  		"anywhereCacheId": c.anywhereCacheId,
  3184  	})
  3185  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3186  }
  3187  
  3188  // Do executes the "storage.anywhereCaches.resume" call.
  3189  // Any non-2xx status code is an error. Response headers are in either
  3190  // *AnywhereCache.ServerResponse.Header or (if a response was returned at all)
  3191  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3192  // whether the returned error was because http.StatusNotModified was returned.
  3193  func (c *AnywhereCachesResumeCall) Do(opts ...googleapi.CallOption) (*AnywhereCache, error) {
  3194  	gensupport.SetOptions(c.urlParams_, opts...)
  3195  	res, err := c.doRequest("json")
  3196  	if res != nil && res.StatusCode == http.StatusNotModified {
  3197  		if res.Body != nil {
  3198  			res.Body.Close()
  3199  		}
  3200  		return nil, gensupport.WrapError(&googleapi.Error{
  3201  			Code:   res.StatusCode,
  3202  			Header: res.Header,
  3203  		})
  3204  	}
  3205  	if err != nil {
  3206  		return nil, err
  3207  	}
  3208  	defer googleapi.CloseBody(res)
  3209  	if err := googleapi.CheckResponse(res); err != nil {
  3210  		return nil, gensupport.WrapError(err)
  3211  	}
  3212  	ret := &AnywhereCache{
  3213  		ServerResponse: googleapi.ServerResponse{
  3214  			Header:         res.Header,
  3215  			HTTPStatusCode: res.StatusCode,
  3216  		},
  3217  	}
  3218  	target := &ret
  3219  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3220  		return nil, err
  3221  	}
  3222  	return ret, nil
  3223  }
  3224  
  3225  type AnywhereCachesUpdateCall struct {
  3226  	s               *Service
  3227  	bucket          string
  3228  	anywhereCacheId string
  3229  	anywherecache   *AnywhereCache
  3230  	urlParams_      gensupport.URLParams
  3231  	ctx_            context.Context
  3232  	header_         http.Header
  3233  }
  3234  
  3235  // Update: Updates the config(ttl and admissionPolicy) of an Anywhere Cache
  3236  // instance.
  3237  //
  3238  // - anywhereCacheId: The ID of requested Anywhere Cache instance.
  3239  // - bucket: Name of the parent bucket.
  3240  func (r *AnywhereCachesService) Update(bucket string, anywhereCacheId string, anywherecache *AnywhereCache) *AnywhereCachesUpdateCall {
  3241  	c := &AnywhereCachesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3242  	c.bucket = bucket
  3243  	c.anywhereCacheId = anywhereCacheId
  3244  	c.anywherecache = anywherecache
  3245  	return c
  3246  }
  3247  
  3248  // Fields allows partial responses to be retrieved. See
  3249  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3250  // details.
  3251  func (c *AnywhereCachesUpdateCall) Fields(s ...googleapi.Field) *AnywhereCachesUpdateCall {
  3252  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3253  	return c
  3254  }
  3255  
  3256  // Context sets the context to be used in this call's Do method.
  3257  func (c *AnywhereCachesUpdateCall) Context(ctx context.Context) *AnywhereCachesUpdateCall {
  3258  	c.ctx_ = ctx
  3259  	return c
  3260  }
  3261  
  3262  // Header returns a http.Header that can be modified by the caller to add
  3263  // headers to the request.
  3264  func (c *AnywhereCachesUpdateCall) Header() http.Header {
  3265  	if c.header_ == nil {
  3266  		c.header_ = make(http.Header)
  3267  	}
  3268  	return c.header_
  3269  }
  3270  
  3271  func (c *AnywhereCachesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3272  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3273  	var body io.Reader = nil
  3274  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.anywherecache)
  3275  	if err != nil {
  3276  		return nil, err
  3277  	}
  3278  	c.urlParams_.Set("alt", alt)
  3279  	c.urlParams_.Set("prettyPrint", "false")
  3280  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/anywhereCaches/{anywhereCacheId}")
  3281  	urls += "?" + c.urlParams_.Encode()
  3282  	req, err := http.NewRequest("PATCH", urls, body)
  3283  	if err != nil {
  3284  		return nil, err
  3285  	}
  3286  	req.Header = reqHeaders
  3287  	googleapi.Expand(req.URL, map[string]string{
  3288  		"bucket":          c.bucket,
  3289  		"anywhereCacheId": c.anywhereCacheId,
  3290  	})
  3291  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3292  }
  3293  
  3294  // Do executes the "storage.anywhereCaches.update" call.
  3295  // Any non-2xx status code is an error. Response headers are in either
  3296  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  3297  // returned at all) in error.(*googleapi.Error).Header. Use
  3298  // googleapi.IsNotModified to check whether the returned error was because
  3299  // http.StatusNotModified was returned.
  3300  func (c *AnywhereCachesUpdateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3301  	gensupport.SetOptions(c.urlParams_, opts...)
  3302  	res, err := c.doRequest("json")
  3303  	if res != nil && res.StatusCode == http.StatusNotModified {
  3304  		if res.Body != nil {
  3305  			res.Body.Close()
  3306  		}
  3307  		return nil, gensupport.WrapError(&googleapi.Error{
  3308  			Code:   res.StatusCode,
  3309  			Header: res.Header,
  3310  		})
  3311  	}
  3312  	if err != nil {
  3313  		return nil, err
  3314  	}
  3315  	defer googleapi.CloseBody(res)
  3316  	if err := googleapi.CheckResponse(res); err != nil {
  3317  		return nil, gensupport.WrapError(err)
  3318  	}
  3319  	ret := &GoogleLongrunningOperation{
  3320  		ServerResponse: googleapi.ServerResponse{
  3321  			Header:         res.Header,
  3322  			HTTPStatusCode: res.StatusCode,
  3323  		},
  3324  	}
  3325  	target := &ret
  3326  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3327  		return nil, err
  3328  	}
  3329  	return ret, nil
  3330  }
  3331  
  3332  type BucketAccessControlsDeleteCall struct {
  3333  	s          *Service
  3334  	bucket     string
  3335  	entity     string
  3336  	urlParams_ gensupport.URLParams
  3337  	ctx_       context.Context
  3338  	header_    http.Header
  3339  }
  3340  
  3341  // Delete: Permanently deletes the ACL entry for the specified entity on the
  3342  // specified bucket.
  3343  //
  3344  //   - bucket: Name of a bucket.
  3345  //   - entity: The entity holding the permission. Can be user-userId,
  3346  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  3347  //     allAuthenticatedUsers.
  3348  func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
  3349  	c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3350  	c.bucket = bucket
  3351  	c.entity = entity
  3352  	return c
  3353  }
  3354  
  3355  // UserProject sets the optional parameter "userProject": The project to be
  3356  // billed for this request. Required for Requester Pays buckets.
  3357  func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
  3358  	c.urlParams_.Set("userProject", userProject)
  3359  	return c
  3360  }
  3361  
  3362  // Fields allows partial responses to be retrieved. See
  3363  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3364  // details.
  3365  func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
  3366  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3367  	return c
  3368  }
  3369  
  3370  // Context sets the context to be used in this call's Do method.
  3371  func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
  3372  	c.ctx_ = ctx
  3373  	return c
  3374  }
  3375  
  3376  // Header returns a http.Header that can be modified by the caller to add
  3377  // headers to the request.
  3378  func (c *BucketAccessControlsDeleteCall) Header() http.Header {
  3379  	if c.header_ == nil {
  3380  		c.header_ = make(http.Header)
  3381  	}
  3382  	return c.header_
  3383  }
  3384  
  3385  func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3386  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3387  	var body io.Reader = nil
  3388  	c.urlParams_.Set("alt", alt)
  3389  	c.urlParams_.Set("prettyPrint", "false")
  3390  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  3391  	urls += "?" + c.urlParams_.Encode()
  3392  	req, err := http.NewRequest("DELETE", urls, body)
  3393  	if err != nil {
  3394  		return nil, err
  3395  	}
  3396  	req.Header = reqHeaders
  3397  	googleapi.Expand(req.URL, map[string]string{
  3398  		"bucket": c.bucket,
  3399  		"entity": c.entity,
  3400  	})
  3401  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3402  }
  3403  
  3404  // Do executes the "storage.bucketAccessControls.delete" call.
  3405  func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  3406  	gensupport.SetOptions(c.urlParams_, opts...)
  3407  	res, err := c.doRequest("json")
  3408  	if err != nil {
  3409  		return err
  3410  	}
  3411  	defer googleapi.CloseBody(res)
  3412  	if err := googleapi.CheckResponse(res); err != nil {
  3413  		return gensupport.WrapError(err)
  3414  	}
  3415  	return nil
  3416  }
  3417  
  3418  type BucketAccessControlsGetCall struct {
  3419  	s            *Service
  3420  	bucket       string
  3421  	entity       string
  3422  	urlParams_   gensupport.URLParams
  3423  	ifNoneMatch_ string
  3424  	ctx_         context.Context
  3425  	header_      http.Header
  3426  }
  3427  
  3428  // Get: Returns the ACL entry for the specified entity on the specified bucket.
  3429  //
  3430  //   - bucket: Name of a bucket.
  3431  //   - entity: The entity holding the permission. Can be user-userId,
  3432  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  3433  //     allAuthenticatedUsers.
  3434  func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
  3435  	c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3436  	c.bucket = bucket
  3437  	c.entity = entity
  3438  	return c
  3439  }
  3440  
  3441  // UserProject sets the optional parameter "userProject": The project to be
  3442  // billed for this request. Required for Requester Pays buckets.
  3443  func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
  3444  	c.urlParams_.Set("userProject", userProject)
  3445  	return c
  3446  }
  3447  
  3448  // Fields allows partial responses to be retrieved. See
  3449  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3450  // details.
  3451  func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
  3452  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3453  	return c
  3454  }
  3455  
  3456  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3457  // object's ETag matches the given value. This is useful for getting updates
  3458  // only after the object has changed since the last request.
  3459  func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
  3460  	c.ifNoneMatch_ = entityTag
  3461  	return c
  3462  }
  3463  
  3464  // Context sets the context to be used in this call's Do method.
  3465  func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
  3466  	c.ctx_ = ctx
  3467  	return c
  3468  }
  3469  
  3470  // Header returns a http.Header that can be modified by the caller to add
  3471  // headers to the request.
  3472  func (c *BucketAccessControlsGetCall) Header() http.Header {
  3473  	if c.header_ == nil {
  3474  		c.header_ = make(http.Header)
  3475  	}
  3476  	return c.header_
  3477  }
  3478  
  3479  func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  3480  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3481  	if c.ifNoneMatch_ != "" {
  3482  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3483  	}
  3484  	var body io.Reader = nil
  3485  	c.urlParams_.Set("alt", alt)
  3486  	c.urlParams_.Set("prettyPrint", "false")
  3487  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  3488  	urls += "?" + c.urlParams_.Encode()
  3489  	req, err := http.NewRequest("GET", urls, body)
  3490  	if err != nil {
  3491  		return nil, err
  3492  	}
  3493  	req.Header = reqHeaders
  3494  	googleapi.Expand(req.URL, map[string]string{
  3495  		"bucket": c.bucket,
  3496  		"entity": c.entity,
  3497  	})
  3498  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3499  }
  3500  
  3501  // Do executes the "storage.bucketAccessControls.get" call.
  3502  // Any non-2xx status code is an error. Response headers are in either
  3503  // *BucketAccessControl.ServerResponse.Header or (if a response was returned at
  3504  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3505  // check whether the returned error was because http.StatusNotModified was
  3506  // returned.
  3507  func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  3508  	gensupport.SetOptions(c.urlParams_, opts...)
  3509  	res, err := c.doRequest("json")
  3510  	if res != nil && res.StatusCode == http.StatusNotModified {
  3511  		if res.Body != nil {
  3512  			res.Body.Close()
  3513  		}
  3514  		return nil, gensupport.WrapError(&googleapi.Error{
  3515  			Code:   res.StatusCode,
  3516  			Header: res.Header,
  3517  		})
  3518  	}
  3519  	if err != nil {
  3520  		return nil, err
  3521  	}
  3522  	defer googleapi.CloseBody(res)
  3523  	if err := googleapi.CheckResponse(res); err != nil {
  3524  		return nil, gensupport.WrapError(err)
  3525  	}
  3526  	ret := &BucketAccessControl{
  3527  		ServerResponse: googleapi.ServerResponse{
  3528  			Header:         res.Header,
  3529  			HTTPStatusCode: res.StatusCode,
  3530  		},
  3531  	}
  3532  	target := &ret
  3533  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3534  		return nil, err
  3535  	}
  3536  	return ret, nil
  3537  }
  3538  
  3539  type BucketAccessControlsInsertCall struct {
  3540  	s                   *Service
  3541  	bucket              string
  3542  	bucketaccesscontrol *BucketAccessControl
  3543  	urlParams_          gensupport.URLParams
  3544  	ctx_                context.Context
  3545  	header_             http.Header
  3546  }
  3547  
  3548  // Insert: Creates a new ACL entry on the specified bucket.
  3549  //
  3550  // - bucket: Name of a bucket.
  3551  func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
  3552  	c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3553  	c.bucket = bucket
  3554  	c.bucketaccesscontrol = bucketaccesscontrol
  3555  	return c
  3556  }
  3557  
  3558  // UserProject sets the optional parameter "userProject": The project to be
  3559  // billed for this request. Required for Requester Pays buckets.
  3560  func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
  3561  	c.urlParams_.Set("userProject", userProject)
  3562  	return c
  3563  }
  3564  
  3565  // Fields allows partial responses to be retrieved. See
  3566  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3567  // details.
  3568  func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
  3569  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3570  	return c
  3571  }
  3572  
  3573  // Context sets the context to be used in this call's Do method.
  3574  func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
  3575  	c.ctx_ = ctx
  3576  	return c
  3577  }
  3578  
  3579  // Header returns a http.Header that can be modified by the caller to add
  3580  // headers to the request.
  3581  func (c *BucketAccessControlsInsertCall) Header() http.Header {
  3582  	if c.header_ == nil {
  3583  		c.header_ = make(http.Header)
  3584  	}
  3585  	return c.header_
  3586  }
  3587  
  3588  func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  3589  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3590  	var body io.Reader = nil
  3591  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  3592  	if err != nil {
  3593  		return nil, err
  3594  	}
  3595  	c.urlParams_.Set("alt", alt)
  3596  	c.urlParams_.Set("prettyPrint", "false")
  3597  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  3598  	urls += "?" + c.urlParams_.Encode()
  3599  	req, err := http.NewRequest("POST", urls, body)
  3600  	if err != nil {
  3601  		return nil, err
  3602  	}
  3603  	req.Header = reqHeaders
  3604  	googleapi.Expand(req.URL, map[string]string{
  3605  		"bucket": c.bucket,
  3606  	})
  3607  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3608  }
  3609  
  3610  // Do executes the "storage.bucketAccessControls.insert" call.
  3611  // Any non-2xx status code is an error. Response headers are in either
  3612  // *BucketAccessControl.ServerResponse.Header or (if a response was returned at
  3613  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3614  // check whether the returned error was because http.StatusNotModified was
  3615  // returned.
  3616  func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  3617  	gensupport.SetOptions(c.urlParams_, opts...)
  3618  	res, err := c.doRequest("json")
  3619  	if res != nil && res.StatusCode == http.StatusNotModified {
  3620  		if res.Body != nil {
  3621  			res.Body.Close()
  3622  		}
  3623  		return nil, gensupport.WrapError(&googleapi.Error{
  3624  			Code:   res.StatusCode,
  3625  			Header: res.Header,
  3626  		})
  3627  	}
  3628  	if err != nil {
  3629  		return nil, err
  3630  	}
  3631  	defer googleapi.CloseBody(res)
  3632  	if err := googleapi.CheckResponse(res); err != nil {
  3633  		return nil, gensupport.WrapError(err)
  3634  	}
  3635  	ret := &BucketAccessControl{
  3636  		ServerResponse: googleapi.ServerResponse{
  3637  			Header:         res.Header,
  3638  			HTTPStatusCode: res.StatusCode,
  3639  		},
  3640  	}
  3641  	target := &ret
  3642  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3643  		return nil, err
  3644  	}
  3645  	return ret, nil
  3646  }
  3647  
  3648  type BucketAccessControlsListCall struct {
  3649  	s            *Service
  3650  	bucket       string
  3651  	urlParams_   gensupport.URLParams
  3652  	ifNoneMatch_ string
  3653  	ctx_         context.Context
  3654  	header_      http.Header
  3655  }
  3656  
  3657  // List: Retrieves ACL entries on the specified bucket.
  3658  //
  3659  // - bucket: Name of a bucket.
  3660  func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
  3661  	c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3662  	c.bucket = bucket
  3663  	return c
  3664  }
  3665  
  3666  // UserProject sets the optional parameter "userProject": The project to be
  3667  // billed for this request. Required for Requester Pays buckets.
  3668  func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
  3669  	c.urlParams_.Set("userProject", userProject)
  3670  	return c
  3671  }
  3672  
  3673  // Fields allows partial responses to be retrieved. See
  3674  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3675  // details.
  3676  func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
  3677  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3678  	return c
  3679  }
  3680  
  3681  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3682  // object's ETag matches the given value. This is useful for getting updates
  3683  // only after the object has changed since the last request.
  3684  func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
  3685  	c.ifNoneMatch_ = entityTag
  3686  	return c
  3687  }
  3688  
  3689  // Context sets the context to be used in this call's Do method.
  3690  func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
  3691  	c.ctx_ = ctx
  3692  	return c
  3693  }
  3694  
  3695  // Header returns a http.Header that can be modified by the caller to add
  3696  // headers to the request.
  3697  func (c *BucketAccessControlsListCall) Header() http.Header {
  3698  	if c.header_ == nil {
  3699  		c.header_ = make(http.Header)
  3700  	}
  3701  	return c.header_
  3702  }
  3703  
  3704  func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  3705  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3706  	if c.ifNoneMatch_ != "" {
  3707  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3708  	}
  3709  	var body io.Reader = nil
  3710  	c.urlParams_.Set("alt", alt)
  3711  	c.urlParams_.Set("prettyPrint", "false")
  3712  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  3713  	urls += "?" + c.urlParams_.Encode()
  3714  	req, err := http.NewRequest("GET", urls, body)
  3715  	if err != nil {
  3716  		return nil, err
  3717  	}
  3718  	req.Header = reqHeaders
  3719  	googleapi.Expand(req.URL, map[string]string{
  3720  		"bucket": c.bucket,
  3721  	})
  3722  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3723  }
  3724  
  3725  // Do executes the "storage.bucketAccessControls.list" call.
  3726  // Any non-2xx status code is an error. Response headers are in either
  3727  // *BucketAccessControls.ServerResponse.Header or (if a response was returned
  3728  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3729  // check whether the returned error was because http.StatusNotModified was
  3730  // returned.
  3731  func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
  3732  	gensupport.SetOptions(c.urlParams_, opts...)
  3733  	res, err := c.doRequest("json")
  3734  	if res != nil && res.StatusCode == http.StatusNotModified {
  3735  		if res.Body != nil {
  3736  			res.Body.Close()
  3737  		}
  3738  		return nil, gensupport.WrapError(&googleapi.Error{
  3739  			Code:   res.StatusCode,
  3740  			Header: res.Header,
  3741  		})
  3742  	}
  3743  	if err != nil {
  3744  		return nil, err
  3745  	}
  3746  	defer googleapi.CloseBody(res)
  3747  	if err := googleapi.CheckResponse(res); err != nil {
  3748  		return nil, gensupport.WrapError(err)
  3749  	}
  3750  	ret := &BucketAccessControls{
  3751  		ServerResponse: googleapi.ServerResponse{
  3752  			Header:         res.Header,
  3753  			HTTPStatusCode: res.StatusCode,
  3754  		},
  3755  	}
  3756  	target := &ret
  3757  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3758  		return nil, err
  3759  	}
  3760  	return ret, nil
  3761  }
  3762  
  3763  type BucketAccessControlsPatchCall struct {
  3764  	s                   *Service
  3765  	bucket              string
  3766  	entity              string
  3767  	bucketaccesscontrol *BucketAccessControl
  3768  	urlParams_          gensupport.URLParams
  3769  	ctx_                context.Context
  3770  	header_             http.Header
  3771  }
  3772  
  3773  // Patch: Patches an ACL entry on the specified bucket.
  3774  //
  3775  //   - bucket: Name of a bucket.
  3776  //   - entity: The entity holding the permission. Can be user-userId,
  3777  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  3778  //     allAuthenticatedUsers.
  3779  func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
  3780  	c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3781  	c.bucket = bucket
  3782  	c.entity = entity
  3783  	c.bucketaccesscontrol = bucketaccesscontrol
  3784  	return c
  3785  }
  3786  
  3787  // UserProject sets the optional parameter "userProject": The project to be
  3788  // billed for this request. Required for Requester Pays buckets.
  3789  func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
  3790  	c.urlParams_.Set("userProject", userProject)
  3791  	return c
  3792  }
  3793  
  3794  // Fields allows partial responses to be retrieved. See
  3795  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3796  // details.
  3797  func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
  3798  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3799  	return c
  3800  }
  3801  
  3802  // Context sets the context to be used in this call's Do method.
  3803  func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
  3804  	c.ctx_ = ctx
  3805  	return c
  3806  }
  3807  
  3808  // Header returns a http.Header that can be modified by the caller to add
  3809  // headers to the request.
  3810  func (c *BucketAccessControlsPatchCall) Header() http.Header {
  3811  	if c.header_ == nil {
  3812  		c.header_ = make(http.Header)
  3813  	}
  3814  	return c.header_
  3815  }
  3816  
  3817  func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  3818  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3819  	var body io.Reader = nil
  3820  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  3821  	if err != nil {
  3822  		return nil, err
  3823  	}
  3824  	c.urlParams_.Set("alt", alt)
  3825  	c.urlParams_.Set("prettyPrint", "false")
  3826  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  3827  	urls += "?" + c.urlParams_.Encode()
  3828  	req, err := http.NewRequest("PATCH", urls, body)
  3829  	if err != nil {
  3830  		return nil, err
  3831  	}
  3832  	req.Header = reqHeaders
  3833  	googleapi.Expand(req.URL, map[string]string{
  3834  		"bucket": c.bucket,
  3835  		"entity": c.entity,
  3836  	})
  3837  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3838  }
  3839  
  3840  // Do executes the "storage.bucketAccessControls.patch" call.
  3841  // Any non-2xx status code is an error. Response headers are in either
  3842  // *BucketAccessControl.ServerResponse.Header or (if a response was returned at
  3843  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3844  // check whether the returned error was because http.StatusNotModified was
  3845  // returned.
  3846  func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  3847  	gensupport.SetOptions(c.urlParams_, opts...)
  3848  	res, err := c.doRequest("json")
  3849  	if res != nil && res.StatusCode == http.StatusNotModified {
  3850  		if res.Body != nil {
  3851  			res.Body.Close()
  3852  		}
  3853  		return nil, gensupport.WrapError(&googleapi.Error{
  3854  			Code:   res.StatusCode,
  3855  			Header: res.Header,
  3856  		})
  3857  	}
  3858  	if err != nil {
  3859  		return nil, err
  3860  	}
  3861  	defer googleapi.CloseBody(res)
  3862  	if err := googleapi.CheckResponse(res); err != nil {
  3863  		return nil, gensupport.WrapError(err)
  3864  	}
  3865  	ret := &BucketAccessControl{
  3866  		ServerResponse: googleapi.ServerResponse{
  3867  			Header:         res.Header,
  3868  			HTTPStatusCode: res.StatusCode,
  3869  		},
  3870  	}
  3871  	target := &ret
  3872  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3873  		return nil, err
  3874  	}
  3875  	return ret, nil
  3876  }
  3877  
  3878  type BucketAccessControlsUpdateCall struct {
  3879  	s                   *Service
  3880  	bucket              string
  3881  	entity              string
  3882  	bucketaccesscontrol *BucketAccessControl
  3883  	urlParams_          gensupport.URLParams
  3884  	ctx_                context.Context
  3885  	header_             http.Header
  3886  }
  3887  
  3888  // Update: Updates an ACL entry on the specified bucket.
  3889  //
  3890  //   - bucket: Name of a bucket.
  3891  //   - entity: The entity holding the permission. Can be user-userId,
  3892  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  3893  //     allAuthenticatedUsers.
  3894  func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
  3895  	c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3896  	c.bucket = bucket
  3897  	c.entity = entity
  3898  	c.bucketaccesscontrol = bucketaccesscontrol
  3899  	return c
  3900  }
  3901  
  3902  // UserProject sets the optional parameter "userProject": The project to be
  3903  // billed for this request. Required for Requester Pays buckets.
  3904  func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
  3905  	c.urlParams_.Set("userProject", userProject)
  3906  	return c
  3907  }
  3908  
  3909  // Fields allows partial responses to be retrieved. See
  3910  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3911  // details.
  3912  func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
  3913  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3914  	return c
  3915  }
  3916  
  3917  // Context sets the context to be used in this call's Do method.
  3918  func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
  3919  	c.ctx_ = ctx
  3920  	return c
  3921  }
  3922  
  3923  // Header returns a http.Header that can be modified by the caller to add
  3924  // headers to the request.
  3925  func (c *BucketAccessControlsUpdateCall) Header() http.Header {
  3926  	if c.header_ == nil {
  3927  		c.header_ = make(http.Header)
  3928  	}
  3929  	return c.header_
  3930  }
  3931  
  3932  func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3933  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3934  	var body io.Reader = nil
  3935  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  3936  	if err != nil {
  3937  		return nil, err
  3938  	}
  3939  	c.urlParams_.Set("alt", alt)
  3940  	c.urlParams_.Set("prettyPrint", "false")
  3941  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  3942  	urls += "?" + c.urlParams_.Encode()
  3943  	req, err := http.NewRequest("PUT", urls, body)
  3944  	if err != nil {
  3945  		return nil, err
  3946  	}
  3947  	req.Header = reqHeaders
  3948  	googleapi.Expand(req.URL, map[string]string{
  3949  		"bucket": c.bucket,
  3950  		"entity": c.entity,
  3951  	})
  3952  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3953  }
  3954  
  3955  // Do executes the "storage.bucketAccessControls.update" call.
  3956  // Any non-2xx status code is an error. Response headers are in either
  3957  // *BucketAccessControl.ServerResponse.Header or (if a response was returned at
  3958  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3959  // check whether the returned error was because http.StatusNotModified was
  3960  // returned.
  3961  func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  3962  	gensupport.SetOptions(c.urlParams_, opts...)
  3963  	res, err := c.doRequest("json")
  3964  	if res != nil && res.StatusCode == http.StatusNotModified {
  3965  		if res.Body != nil {
  3966  			res.Body.Close()
  3967  		}
  3968  		return nil, gensupport.WrapError(&googleapi.Error{
  3969  			Code:   res.StatusCode,
  3970  			Header: res.Header,
  3971  		})
  3972  	}
  3973  	if err != nil {
  3974  		return nil, err
  3975  	}
  3976  	defer googleapi.CloseBody(res)
  3977  	if err := googleapi.CheckResponse(res); err != nil {
  3978  		return nil, gensupport.WrapError(err)
  3979  	}
  3980  	ret := &BucketAccessControl{
  3981  		ServerResponse: googleapi.ServerResponse{
  3982  			Header:         res.Header,
  3983  			HTTPStatusCode: res.StatusCode,
  3984  		},
  3985  	}
  3986  	target := &ret
  3987  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3988  		return nil, err
  3989  	}
  3990  	return ret, nil
  3991  }
  3992  
  3993  type BucketsDeleteCall struct {
  3994  	s          *Service
  3995  	bucket     string
  3996  	urlParams_ gensupport.URLParams
  3997  	ctx_       context.Context
  3998  	header_    http.Header
  3999  }
  4000  
  4001  // Delete: Permanently deletes an empty bucket.
  4002  //
  4003  // - bucket: Name of a bucket.
  4004  func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
  4005  	c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4006  	c.bucket = bucket
  4007  	return c
  4008  }
  4009  
  4010  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  4011  // If set, only deletes the bucket if its metageneration matches this value.
  4012  func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall {
  4013  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  4014  	return c
  4015  }
  4016  
  4017  // IfMetagenerationNotMatch sets the optional parameter
  4018  // "ifMetagenerationNotMatch": If set, only deletes the bucket if its
  4019  // metageneration does not match this value.
  4020  func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall {
  4021  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  4022  	return c
  4023  }
  4024  
  4025  // UserProject sets the optional parameter "userProject": The project to be
  4026  // billed for this request. Required for Requester Pays buckets.
  4027  func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
  4028  	c.urlParams_.Set("userProject", userProject)
  4029  	return c
  4030  }
  4031  
  4032  // Fields allows partial responses to be retrieved. See
  4033  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4034  // details.
  4035  func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
  4036  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4037  	return c
  4038  }
  4039  
  4040  // Context sets the context to be used in this call's Do method.
  4041  func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
  4042  	c.ctx_ = ctx
  4043  	return c
  4044  }
  4045  
  4046  // Header returns a http.Header that can be modified by the caller to add
  4047  // headers to the request.
  4048  func (c *BucketsDeleteCall) Header() http.Header {
  4049  	if c.header_ == nil {
  4050  		c.header_ = make(http.Header)
  4051  	}
  4052  	return c.header_
  4053  }
  4054  
  4055  func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4056  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4057  	var body io.Reader = nil
  4058  	c.urlParams_.Set("alt", alt)
  4059  	c.urlParams_.Set("prettyPrint", "false")
  4060  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  4061  	urls += "?" + c.urlParams_.Encode()
  4062  	req, err := http.NewRequest("DELETE", urls, body)
  4063  	if err != nil {
  4064  		return nil, err
  4065  	}
  4066  	req.Header = reqHeaders
  4067  	googleapi.Expand(req.URL, map[string]string{
  4068  		"bucket": c.bucket,
  4069  	})
  4070  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4071  }
  4072  
  4073  // Do executes the "storage.buckets.delete" call.
  4074  func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4075  	gensupport.SetOptions(c.urlParams_, opts...)
  4076  	res, err := c.doRequest("json")
  4077  	if err != nil {
  4078  		return err
  4079  	}
  4080  	defer googleapi.CloseBody(res)
  4081  	if err := googleapi.CheckResponse(res); err != nil {
  4082  		return gensupport.WrapError(err)
  4083  	}
  4084  	return nil
  4085  }
  4086  
  4087  type BucketsGetCall struct {
  4088  	s            *Service
  4089  	bucket       string
  4090  	urlParams_   gensupport.URLParams
  4091  	ifNoneMatch_ string
  4092  	ctx_         context.Context
  4093  	header_      http.Header
  4094  }
  4095  
  4096  // Get: Returns metadata for the specified bucket.
  4097  //
  4098  // - bucket: Name of a bucket.
  4099  func (r *BucketsService) Get(bucket string) *BucketsGetCall {
  4100  	c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4101  	c.bucket = bucket
  4102  	return c
  4103  }
  4104  
  4105  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  4106  // Makes the return of the bucket metadata conditional on whether the bucket's
  4107  // current metageneration matches the given value.
  4108  func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
  4109  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  4110  	return c
  4111  }
  4112  
  4113  // IfMetagenerationNotMatch sets the optional parameter
  4114  // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  4115  // conditional on whether the bucket's current metageneration does not match
  4116  // the given value.
  4117  func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall {
  4118  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  4119  	return c
  4120  }
  4121  
  4122  // Projection sets the optional parameter "projection": Set of properties to
  4123  // return. Defaults to noAcl.
  4124  //
  4125  // Possible values:
  4126  //
  4127  //	"full" - Include all properties.
  4128  //	"noAcl" - Omit owner, acl and defaultObjectAcl properties.
  4129  func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
  4130  	c.urlParams_.Set("projection", projection)
  4131  	return c
  4132  }
  4133  
  4134  // UserProject sets the optional parameter "userProject": The project to be
  4135  // billed for this request. Required for Requester Pays buckets.
  4136  func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
  4137  	c.urlParams_.Set("userProject", userProject)
  4138  	return c
  4139  }
  4140  
  4141  // Fields allows partial responses to be retrieved. See
  4142  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4143  // details.
  4144  func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
  4145  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4146  	return c
  4147  }
  4148  
  4149  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4150  // object's ETag matches the given value. This is useful for getting updates
  4151  // only after the object has changed since the last request.
  4152  func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
  4153  	c.ifNoneMatch_ = entityTag
  4154  	return c
  4155  }
  4156  
  4157  // Context sets the context to be used in this call's Do method.
  4158  func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
  4159  	c.ctx_ = ctx
  4160  	return c
  4161  }
  4162  
  4163  // Header returns a http.Header that can be modified by the caller to add
  4164  // headers to the request.
  4165  func (c *BucketsGetCall) Header() http.Header {
  4166  	if c.header_ == nil {
  4167  		c.header_ = make(http.Header)
  4168  	}
  4169  	return c.header_
  4170  }
  4171  
  4172  func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
  4173  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4174  	if c.ifNoneMatch_ != "" {
  4175  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4176  	}
  4177  	var body io.Reader = nil
  4178  	c.urlParams_.Set("alt", alt)
  4179  	c.urlParams_.Set("prettyPrint", "false")
  4180  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  4181  	urls += "?" + c.urlParams_.Encode()
  4182  	req, err := http.NewRequest("GET", urls, body)
  4183  	if err != nil {
  4184  		return nil, err
  4185  	}
  4186  	req.Header = reqHeaders
  4187  	googleapi.Expand(req.URL, map[string]string{
  4188  		"bucket": c.bucket,
  4189  	})
  4190  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4191  }
  4192  
  4193  // Do executes the "storage.buckets.get" call.
  4194  // Any non-2xx status code is an error. Response headers are in either
  4195  // *Bucket.ServerResponse.Header or (if a response was returned at all) in
  4196  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4197  // whether the returned error was because http.StatusNotModified was returned.
  4198  func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  4199  	gensupport.SetOptions(c.urlParams_, opts...)
  4200  	res, err := c.doRequest("json")
  4201  	if res != nil && res.StatusCode == http.StatusNotModified {
  4202  		if res.Body != nil {
  4203  			res.Body.Close()
  4204  		}
  4205  		return nil, gensupport.WrapError(&googleapi.Error{
  4206  			Code:   res.StatusCode,
  4207  			Header: res.Header,
  4208  		})
  4209  	}
  4210  	if err != nil {
  4211  		return nil, err
  4212  	}
  4213  	defer googleapi.CloseBody(res)
  4214  	if err := googleapi.CheckResponse(res); err != nil {
  4215  		return nil, gensupport.WrapError(err)
  4216  	}
  4217  	ret := &Bucket{
  4218  		ServerResponse: googleapi.ServerResponse{
  4219  			Header:         res.Header,
  4220  			HTTPStatusCode: res.StatusCode,
  4221  		},
  4222  	}
  4223  	target := &ret
  4224  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4225  		return nil, err
  4226  	}
  4227  	return ret, nil
  4228  }
  4229  
  4230  type BucketsGetIamPolicyCall struct {
  4231  	s            *Service
  4232  	bucket       string
  4233  	urlParams_   gensupport.URLParams
  4234  	ifNoneMatch_ string
  4235  	ctx_         context.Context
  4236  	header_      http.Header
  4237  }
  4238  
  4239  // GetIamPolicy: Returns an IAM policy for the specified bucket.
  4240  //
  4241  // - bucket: Name of a bucket.
  4242  func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
  4243  	c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4244  	c.bucket = bucket
  4245  	return c
  4246  }
  4247  
  4248  // OptionsRequestedPolicyVersion sets the optional parameter
  4249  // "optionsRequestedPolicyVersion": The IAM policy format version to be
  4250  // returned. If the optionsRequestedPolicyVersion is for an older version that
  4251  // doesn't support part of the requested IAM policy, the request fails.
  4252  func (c *BucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BucketsGetIamPolicyCall {
  4253  	c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  4254  	return c
  4255  }
  4256  
  4257  // UserProject sets the optional parameter "userProject": The project to be
  4258  // billed for this request. Required for Requester Pays buckets.
  4259  func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
  4260  	c.urlParams_.Set("userProject", userProject)
  4261  	return c
  4262  }
  4263  
  4264  // Fields allows partial responses to be retrieved. See
  4265  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4266  // details.
  4267  func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall {
  4268  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4269  	return c
  4270  }
  4271  
  4272  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4273  // object's ETag matches the given value. This is useful for getting updates
  4274  // only after the object has changed since the last request.
  4275  func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall {
  4276  	c.ifNoneMatch_ = entityTag
  4277  	return c
  4278  }
  4279  
  4280  // Context sets the context to be used in this call's Do method.
  4281  func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
  4282  	c.ctx_ = ctx
  4283  	return c
  4284  }
  4285  
  4286  // Header returns a http.Header that can be modified by the caller to add
  4287  // headers to the request.
  4288  func (c *BucketsGetIamPolicyCall) Header() http.Header {
  4289  	if c.header_ == nil {
  4290  		c.header_ = make(http.Header)
  4291  	}
  4292  	return c.header_
  4293  }
  4294  
  4295  func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4296  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4297  	if c.ifNoneMatch_ != "" {
  4298  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4299  	}
  4300  	var body io.Reader = nil
  4301  	c.urlParams_.Set("alt", alt)
  4302  	c.urlParams_.Set("prettyPrint", "false")
  4303  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
  4304  	urls += "?" + c.urlParams_.Encode()
  4305  	req, err := http.NewRequest("GET", urls, body)
  4306  	if err != nil {
  4307  		return nil, err
  4308  	}
  4309  	req.Header = reqHeaders
  4310  	googleapi.Expand(req.URL, map[string]string{
  4311  		"bucket": c.bucket,
  4312  	})
  4313  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4314  }
  4315  
  4316  // Do executes the "storage.buckets.getIamPolicy" call.
  4317  // Any non-2xx status code is an error. Response headers are in either
  4318  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  4319  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4320  // whether the returned error was because http.StatusNotModified was returned.
  4321  func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4322  	gensupport.SetOptions(c.urlParams_, opts...)
  4323  	res, err := c.doRequest("json")
  4324  	if res != nil && res.StatusCode == http.StatusNotModified {
  4325  		if res.Body != nil {
  4326  			res.Body.Close()
  4327  		}
  4328  		return nil, gensupport.WrapError(&googleapi.Error{
  4329  			Code:   res.StatusCode,
  4330  			Header: res.Header,
  4331  		})
  4332  	}
  4333  	if err != nil {
  4334  		return nil, err
  4335  	}
  4336  	defer googleapi.CloseBody(res)
  4337  	if err := googleapi.CheckResponse(res); err != nil {
  4338  		return nil, gensupport.WrapError(err)
  4339  	}
  4340  	ret := &Policy{
  4341  		ServerResponse: googleapi.ServerResponse{
  4342  			Header:         res.Header,
  4343  			HTTPStatusCode: res.StatusCode,
  4344  		},
  4345  	}
  4346  	target := &ret
  4347  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4348  		return nil, err
  4349  	}
  4350  	return ret, nil
  4351  }
  4352  
  4353  type BucketsInsertCall struct {
  4354  	s          *Service
  4355  	bucket     *Bucket
  4356  	urlParams_ gensupport.URLParams
  4357  	ctx_       context.Context
  4358  	header_    http.Header
  4359  }
  4360  
  4361  // Insert: Creates a new bucket.
  4362  //
  4363  // - project: A valid API project identifier.
  4364  func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
  4365  	c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4366  	c.urlParams_.Set("project", projectid)
  4367  	c.bucket = bucket
  4368  	return c
  4369  }
  4370  
  4371  // EnableObjectRetention sets the optional parameter "enableObjectRetention":
  4372  // When set to true, object retention is enabled for this bucket.
  4373  func (c *BucketsInsertCall) EnableObjectRetention(enableObjectRetention bool) *BucketsInsertCall {
  4374  	c.urlParams_.Set("enableObjectRetention", fmt.Sprint(enableObjectRetention))
  4375  	return c
  4376  }
  4377  
  4378  // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
  4379  // predefined set of access controls to this bucket.
  4380  //
  4381  // Possible values:
  4382  //
  4383  //	"authenticatedRead" - Project team owners get OWNER access, and
  4384  //
  4385  // allAuthenticatedUsers get READER access.
  4386  //
  4387  //	"private" - Project team owners get OWNER access.
  4388  //	"projectPrivate" - Project team members get access according to their
  4389  //
  4390  // roles.
  4391  //
  4392  //	"publicRead" - Project team owners get OWNER access, and allUsers get
  4393  //
  4394  // READER access.
  4395  //
  4396  //	"publicReadWrite" - Project team owners get OWNER access, and allUsers get
  4397  //
  4398  // WRITER access.
  4399  func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall {
  4400  	c.urlParams_.Set("predefinedAcl", predefinedAcl)
  4401  	return c
  4402  }
  4403  
  4404  // PredefinedDefaultObjectAcl sets the optional parameter
  4405  // "predefinedDefaultObjectAcl": Apply a predefined set of default object
  4406  // access controls to this bucket.
  4407  //
  4408  // Possible values:
  4409  //
  4410  //	"authenticatedRead" - Object owner gets OWNER access, and
  4411  //
  4412  // allAuthenticatedUsers get READER access.
  4413  //
  4414  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
  4415  //
  4416  // team owners get OWNER access.
  4417  //
  4418  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
  4419  //
  4420  // owners get READER access.
  4421  //
  4422  //	"private" - Object owner gets OWNER access.
  4423  //	"projectPrivate" - Object owner gets OWNER access, and project team
  4424  //
  4425  // members get access according to their roles.
  4426  //
  4427  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
  4428  //
  4429  // access.
  4430  func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
  4431  	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
  4432  	return c
  4433  }
  4434  
  4435  // Projection sets the optional parameter "projection": Set of properties to
  4436  // return. Defaults to noAcl, unless the bucket resource specifies acl or
  4437  // defaultObjectAcl properties, when it defaults to full.
  4438  //
  4439  // Possible values:
  4440  //
  4441  //	"full" - Include all properties.
  4442  //	"noAcl" - Omit owner, acl and defaultObjectAcl properties.
  4443  func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
  4444  	c.urlParams_.Set("projection", projection)
  4445  	return c
  4446  }
  4447  
  4448  // UserProject sets the optional parameter "userProject": The project to be
  4449  // billed for this request.
  4450  func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall {
  4451  	c.urlParams_.Set("userProject", userProject)
  4452  	return c
  4453  }
  4454  
  4455  // Fields allows partial responses to be retrieved. See
  4456  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4457  // details.
  4458  func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
  4459  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4460  	return c
  4461  }
  4462  
  4463  // Context sets the context to be used in this call's Do method.
  4464  func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
  4465  	c.ctx_ = ctx
  4466  	return c
  4467  }
  4468  
  4469  // Header returns a http.Header that can be modified by the caller to add
  4470  // headers to the request.
  4471  func (c *BucketsInsertCall) Header() http.Header {
  4472  	if c.header_ == nil {
  4473  		c.header_ = make(http.Header)
  4474  	}
  4475  	return c.header_
  4476  }
  4477  
  4478  func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  4479  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4480  	var body io.Reader = nil
  4481  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
  4482  	if err != nil {
  4483  		return nil, err
  4484  	}
  4485  	c.urlParams_.Set("alt", alt)
  4486  	c.urlParams_.Set("prettyPrint", "false")
  4487  	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  4488  	urls += "?" + c.urlParams_.Encode()
  4489  	req, err := http.NewRequest("POST", urls, body)
  4490  	if err != nil {
  4491  		return nil, err
  4492  	}
  4493  	req.Header = reqHeaders
  4494  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4495  }
  4496  
  4497  // Do executes the "storage.buckets.insert" call.
  4498  // Any non-2xx status code is an error. Response headers are in either
  4499  // *Bucket.ServerResponse.Header or (if a response was returned at all) in
  4500  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4501  // whether the returned error was because http.StatusNotModified was returned.
  4502  func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  4503  	gensupport.SetOptions(c.urlParams_, opts...)
  4504  	res, err := c.doRequest("json")
  4505  	if res != nil && res.StatusCode == http.StatusNotModified {
  4506  		if res.Body != nil {
  4507  			res.Body.Close()
  4508  		}
  4509  		return nil, gensupport.WrapError(&googleapi.Error{
  4510  			Code:   res.StatusCode,
  4511  			Header: res.Header,
  4512  		})
  4513  	}
  4514  	if err != nil {
  4515  		return nil, err
  4516  	}
  4517  	defer googleapi.CloseBody(res)
  4518  	if err := googleapi.CheckResponse(res); err != nil {
  4519  		return nil, gensupport.WrapError(err)
  4520  	}
  4521  	ret := &Bucket{
  4522  		ServerResponse: googleapi.ServerResponse{
  4523  			Header:         res.Header,
  4524  			HTTPStatusCode: res.StatusCode,
  4525  		},
  4526  	}
  4527  	target := &ret
  4528  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4529  		return nil, err
  4530  	}
  4531  	return ret, nil
  4532  }
  4533  
  4534  type BucketsListCall struct {
  4535  	s            *Service
  4536  	urlParams_   gensupport.URLParams
  4537  	ifNoneMatch_ string
  4538  	ctx_         context.Context
  4539  	header_      http.Header
  4540  }
  4541  
  4542  // List: Retrieves a list of buckets for a given project.
  4543  //
  4544  // - project: A valid API project identifier.
  4545  func (r *BucketsService) List(projectid string) *BucketsListCall {
  4546  	c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4547  	c.urlParams_.Set("project", projectid)
  4548  	return c
  4549  }
  4550  
  4551  // MaxResults sets the optional parameter "maxResults": Maximum number of
  4552  // buckets to return in a single response. The service will use this parameter
  4553  // or 1,000 items, whichever is smaller.
  4554  func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
  4555  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4556  	return c
  4557  }
  4558  
  4559  // PageToken sets the optional parameter "pageToken": A previously-returned
  4560  // page token representing part of the larger set of results to view.
  4561  func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
  4562  	c.urlParams_.Set("pageToken", pageToken)
  4563  	return c
  4564  }
  4565  
  4566  // Prefix sets the optional parameter "prefix": Filter results to buckets whose
  4567  // names begin with this prefix.
  4568  func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall {
  4569  	c.urlParams_.Set("prefix", prefix)
  4570  	return c
  4571  }
  4572  
  4573  // Projection sets the optional parameter "projection": Set of properties to
  4574  // return. Defaults to noAcl.
  4575  //
  4576  // Possible values:
  4577  //
  4578  //	"full" - Include all properties.
  4579  //	"noAcl" - Omit owner, acl and defaultObjectAcl properties.
  4580  func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
  4581  	c.urlParams_.Set("projection", projection)
  4582  	return c
  4583  }
  4584  
  4585  // UserProject sets the optional parameter "userProject": The project to be
  4586  // billed for this request.
  4587  func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall {
  4588  	c.urlParams_.Set("userProject", userProject)
  4589  	return c
  4590  }
  4591  
  4592  // Fields allows partial responses to be retrieved. See
  4593  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4594  // details.
  4595  func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
  4596  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4597  	return c
  4598  }
  4599  
  4600  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4601  // object's ETag matches the given value. This is useful for getting updates
  4602  // only after the object has changed since the last request.
  4603  func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
  4604  	c.ifNoneMatch_ = entityTag
  4605  	return c
  4606  }
  4607  
  4608  // Context sets the context to be used in this call's Do method.
  4609  func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
  4610  	c.ctx_ = ctx
  4611  	return c
  4612  }
  4613  
  4614  // Header returns a http.Header that can be modified by the caller to add
  4615  // headers to the request.
  4616  func (c *BucketsListCall) Header() http.Header {
  4617  	if c.header_ == nil {
  4618  		c.header_ = make(http.Header)
  4619  	}
  4620  	return c.header_
  4621  }
  4622  
  4623  func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
  4624  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4625  	if c.ifNoneMatch_ != "" {
  4626  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4627  	}
  4628  	var body io.Reader = nil
  4629  	c.urlParams_.Set("alt", alt)
  4630  	c.urlParams_.Set("prettyPrint", "false")
  4631  	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  4632  	urls += "?" + c.urlParams_.Encode()
  4633  	req, err := http.NewRequest("GET", urls, body)
  4634  	if err != nil {
  4635  		return nil, err
  4636  	}
  4637  	req.Header = reqHeaders
  4638  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4639  }
  4640  
  4641  // Do executes the "storage.buckets.list" call.
  4642  // Any non-2xx status code is an error. Response headers are in either
  4643  // *Buckets.ServerResponse.Header or (if a response was returned at all) in
  4644  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4645  // whether the returned error was because http.StatusNotModified was returned.
  4646  func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
  4647  	gensupport.SetOptions(c.urlParams_, opts...)
  4648  	res, err := c.doRequest("json")
  4649  	if res != nil && res.StatusCode == http.StatusNotModified {
  4650  		if res.Body != nil {
  4651  			res.Body.Close()
  4652  		}
  4653  		return nil, gensupport.WrapError(&googleapi.Error{
  4654  			Code:   res.StatusCode,
  4655  			Header: res.Header,
  4656  		})
  4657  	}
  4658  	if err != nil {
  4659  		return nil, err
  4660  	}
  4661  	defer googleapi.CloseBody(res)
  4662  	if err := googleapi.CheckResponse(res); err != nil {
  4663  		return nil, gensupport.WrapError(err)
  4664  	}
  4665  	ret := &Buckets{
  4666  		ServerResponse: googleapi.ServerResponse{
  4667  			Header:         res.Header,
  4668  			HTTPStatusCode: res.StatusCode,
  4669  		},
  4670  	}
  4671  	target := &ret
  4672  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4673  		return nil, err
  4674  	}
  4675  	return ret, nil
  4676  }
  4677  
  4678  // Pages invokes f for each page of results.
  4679  // A non-nil error returned from f will halt the iteration.
  4680  // The provided context supersedes any context provided to the Context method.
  4681  func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
  4682  	c.ctx_ = ctx
  4683  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4684  	for {
  4685  		x, err := c.Do()
  4686  		if err != nil {
  4687  			return err
  4688  		}
  4689  		if err := f(x); err != nil {
  4690  			return err
  4691  		}
  4692  		if x.NextPageToken == "" {
  4693  			return nil
  4694  		}
  4695  		c.PageToken(x.NextPageToken)
  4696  	}
  4697  }
  4698  
  4699  type BucketsLockRetentionPolicyCall struct {
  4700  	s          *Service
  4701  	bucket     string
  4702  	urlParams_ gensupport.URLParams
  4703  	ctx_       context.Context
  4704  	header_    http.Header
  4705  }
  4706  
  4707  // LockRetentionPolicy: Locks retention policy on a bucket.
  4708  //
  4709  //   - bucket: Name of a bucket.
  4710  //   - ifMetagenerationMatch: Makes the operation conditional on whether bucket's
  4711  //     current metageneration matches the given value.
  4712  func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall {
  4713  	c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4714  	c.bucket = bucket
  4715  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  4716  	return c
  4717  }
  4718  
  4719  // UserProject sets the optional parameter "userProject": The project to be
  4720  // billed for this request. Required for Requester Pays buckets.
  4721  func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall {
  4722  	c.urlParams_.Set("userProject", userProject)
  4723  	return c
  4724  }
  4725  
  4726  // Fields allows partial responses to be retrieved. See
  4727  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4728  // details.
  4729  func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall {
  4730  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4731  	return c
  4732  }
  4733  
  4734  // Context sets the context to be used in this call's Do method.
  4735  func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall {
  4736  	c.ctx_ = ctx
  4737  	return c
  4738  }
  4739  
  4740  // Header returns a http.Header that can be modified by the caller to add
  4741  // headers to the request.
  4742  func (c *BucketsLockRetentionPolicyCall) Header() http.Header {
  4743  	if c.header_ == nil {
  4744  		c.header_ = make(http.Header)
  4745  	}
  4746  	return c.header_
  4747  }
  4748  
  4749  func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
  4750  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4751  	var body io.Reader = nil
  4752  	c.urlParams_.Set("alt", alt)
  4753  	c.urlParams_.Set("prettyPrint", "false")
  4754  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy")
  4755  	urls += "?" + c.urlParams_.Encode()
  4756  	req, err := http.NewRequest("POST", urls, body)
  4757  	if err != nil {
  4758  		return nil, err
  4759  	}
  4760  	req.Header = reqHeaders
  4761  	googleapi.Expand(req.URL, map[string]string{
  4762  		"bucket": c.bucket,
  4763  	})
  4764  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4765  }
  4766  
  4767  // Do executes the "storage.buckets.lockRetentionPolicy" call.
  4768  // Any non-2xx status code is an error. Response headers are in either
  4769  // *Bucket.ServerResponse.Header or (if a response was returned at all) in
  4770  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4771  // whether the returned error was because http.StatusNotModified was returned.
  4772  func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  4773  	gensupport.SetOptions(c.urlParams_, opts...)
  4774  	res, err := c.doRequest("json")
  4775  	if res != nil && res.StatusCode == http.StatusNotModified {
  4776  		if res.Body != nil {
  4777  			res.Body.Close()
  4778  		}
  4779  		return nil, gensupport.WrapError(&googleapi.Error{
  4780  			Code:   res.StatusCode,
  4781  			Header: res.Header,
  4782  		})
  4783  	}
  4784  	if err != nil {
  4785  		return nil, err
  4786  	}
  4787  	defer googleapi.CloseBody(res)
  4788  	if err := googleapi.CheckResponse(res); err != nil {
  4789  		return nil, gensupport.WrapError(err)
  4790  	}
  4791  	ret := &Bucket{
  4792  		ServerResponse: googleapi.ServerResponse{
  4793  			Header:         res.Header,
  4794  			HTTPStatusCode: res.StatusCode,
  4795  		},
  4796  	}
  4797  	target := &ret
  4798  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4799  		return nil, err
  4800  	}
  4801  	return ret, nil
  4802  }
  4803  
  4804  type BucketsPatchCall struct {
  4805  	s          *Service
  4806  	bucket     string
  4807  	bucket2    *Bucket
  4808  	urlParams_ gensupport.URLParams
  4809  	ctx_       context.Context
  4810  	header_    http.Header
  4811  }
  4812  
  4813  // Patch: Patches a bucket. Changes to the bucket will be readable immediately
  4814  // after writing, but configuration changes may take time to propagate.
  4815  //
  4816  // - bucket: Name of a bucket.
  4817  func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
  4818  	c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4819  	c.bucket = bucket
  4820  	c.bucket2 = bucket2
  4821  	return c
  4822  }
  4823  
  4824  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  4825  // Makes the return of the bucket metadata conditional on whether the bucket's
  4826  // current metageneration matches the given value.
  4827  func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
  4828  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  4829  	return c
  4830  }
  4831  
  4832  // IfMetagenerationNotMatch sets the optional parameter
  4833  // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  4834  // conditional on whether the bucket's current metageneration does not match
  4835  // the given value.
  4836  func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall {
  4837  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  4838  	return c
  4839  }
  4840  
  4841  // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
  4842  // predefined set of access controls to this bucket.
  4843  //
  4844  // Possible values:
  4845  //
  4846  //	"authenticatedRead" - Project team owners get OWNER access, and
  4847  //
  4848  // allAuthenticatedUsers get READER access.
  4849  //
  4850  //	"private" - Project team owners get OWNER access.
  4851  //	"projectPrivate" - Project team members get access according to their
  4852  //
  4853  // roles.
  4854  //
  4855  //	"publicRead" - Project team owners get OWNER access, and allUsers get
  4856  //
  4857  // READER access.
  4858  //
  4859  //	"publicReadWrite" - Project team owners get OWNER access, and allUsers get
  4860  //
  4861  // WRITER access.
  4862  func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall {
  4863  	c.urlParams_.Set("predefinedAcl", predefinedAcl)
  4864  	return c
  4865  }
  4866  
  4867  // PredefinedDefaultObjectAcl sets the optional parameter
  4868  // "predefinedDefaultObjectAcl": Apply a predefined set of default object
  4869  // access controls to this bucket.
  4870  //
  4871  // Possible values:
  4872  //
  4873  //	"authenticatedRead" - Object owner gets OWNER access, and
  4874  //
  4875  // allAuthenticatedUsers get READER access.
  4876  //
  4877  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
  4878  //
  4879  // team owners get OWNER access.
  4880  //
  4881  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
  4882  //
  4883  // owners get READER access.
  4884  //
  4885  //	"private" - Object owner gets OWNER access.
  4886  //	"projectPrivate" - Object owner gets OWNER access, and project team
  4887  //
  4888  // members get access according to their roles.
  4889  //
  4890  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
  4891  //
  4892  // access.
  4893  func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
  4894  	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
  4895  	return c
  4896  }
  4897  
  4898  // Projection sets the optional parameter "projection": Set of properties to
  4899  // return. Defaults to full.
  4900  //
  4901  // Possible values:
  4902  //
  4903  //	"full" - Include all properties.
  4904  //	"noAcl" - Omit owner, acl and defaultObjectAcl properties.
  4905  func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
  4906  	c.urlParams_.Set("projection", projection)
  4907  	return c
  4908  }
  4909  
  4910  // UserProject sets the optional parameter "userProject": The project to be
  4911  // billed for this request. Required for Requester Pays buckets.
  4912  func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
  4913  	c.urlParams_.Set("userProject", userProject)
  4914  	return c
  4915  }
  4916  
  4917  // Fields allows partial responses to be retrieved. See
  4918  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4919  // details.
  4920  func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
  4921  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4922  	return c
  4923  }
  4924  
  4925  // Context sets the context to be used in this call's Do method.
  4926  func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
  4927  	c.ctx_ = ctx
  4928  	return c
  4929  }
  4930  
  4931  // Header returns a http.Header that can be modified by the caller to add
  4932  // headers to the request.
  4933  func (c *BucketsPatchCall) Header() http.Header {
  4934  	if c.header_ == nil {
  4935  		c.header_ = make(http.Header)
  4936  	}
  4937  	return c.header_
  4938  }
  4939  
  4940  func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  4941  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4942  	var body io.Reader = nil
  4943  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  4944  	if err != nil {
  4945  		return nil, err
  4946  	}
  4947  	c.urlParams_.Set("alt", alt)
  4948  	c.urlParams_.Set("prettyPrint", "false")
  4949  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  4950  	urls += "?" + c.urlParams_.Encode()
  4951  	req, err := http.NewRequest("PATCH", urls, body)
  4952  	if err != nil {
  4953  		return nil, err
  4954  	}
  4955  	req.Header = reqHeaders
  4956  	googleapi.Expand(req.URL, map[string]string{
  4957  		"bucket": c.bucket,
  4958  	})
  4959  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4960  }
  4961  
  4962  // Do executes the "storage.buckets.patch" call.
  4963  // Any non-2xx status code is an error. Response headers are in either
  4964  // *Bucket.ServerResponse.Header or (if a response was returned at all) in
  4965  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4966  // whether the returned error was because http.StatusNotModified was returned.
  4967  func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  4968  	gensupport.SetOptions(c.urlParams_, opts...)
  4969  	res, err := c.doRequest("json")
  4970  	if res != nil && res.StatusCode == http.StatusNotModified {
  4971  		if res.Body != nil {
  4972  			res.Body.Close()
  4973  		}
  4974  		return nil, gensupport.WrapError(&googleapi.Error{
  4975  			Code:   res.StatusCode,
  4976  			Header: res.Header,
  4977  		})
  4978  	}
  4979  	if err != nil {
  4980  		return nil, err
  4981  	}
  4982  	defer googleapi.CloseBody(res)
  4983  	if err := googleapi.CheckResponse(res); err != nil {
  4984  		return nil, gensupport.WrapError(err)
  4985  	}
  4986  	ret := &Bucket{
  4987  		ServerResponse: googleapi.ServerResponse{
  4988  			Header:         res.Header,
  4989  			HTTPStatusCode: res.StatusCode,
  4990  		},
  4991  	}
  4992  	target := &ret
  4993  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4994  		return nil, err
  4995  	}
  4996  	return ret, nil
  4997  }
  4998  
  4999  type BucketsSetIamPolicyCall struct {
  5000  	s          *Service
  5001  	bucket     string
  5002  	policy     *Policy
  5003  	urlParams_ gensupport.URLParams
  5004  	ctx_       context.Context
  5005  	header_    http.Header
  5006  }
  5007  
  5008  // SetIamPolicy: Updates an IAM policy for the specified bucket.
  5009  //
  5010  // - bucket: Name of a bucket.
  5011  func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall {
  5012  	c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5013  	c.bucket = bucket
  5014  	c.policy = policy
  5015  	return c
  5016  }
  5017  
  5018  // UserProject sets the optional parameter "userProject": The project to be
  5019  // billed for this request. Required for Requester Pays buckets.
  5020  func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
  5021  	c.urlParams_.Set("userProject", userProject)
  5022  	return c
  5023  }
  5024  
  5025  // Fields allows partial responses to be retrieved. See
  5026  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5027  // details.
  5028  func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall {
  5029  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5030  	return c
  5031  }
  5032  
  5033  // Context sets the context to be used in this call's Do method.
  5034  func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
  5035  	c.ctx_ = ctx
  5036  	return c
  5037  }
  5038  
  5039  // Header returns a http.Header that can be modified by the caller to add
  5040  // headers to the request.
  5041  func (c *BucketsSetIamPolicyCall) Header() http.Header {
  5042  	if c.header_ == nil {
  5043  		c.header_ = make(http.Header)
  5044  	}
  5045  	return c.header_
  5046  }
  5047  
  5048  func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5049  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5050  	var body io.Reader = nil
  5051  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
  5052  	if err != nil {
  5053  		return nil, err
  5054  	}
  5055  	c.urlParams_.Set("alt", alt)
  5056  	c.urlParams_.Set("prettyPrint", "false")
  5057  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
  5058  	urls += "?" + c.urlParams_.Encode()
  5059  	req, err := http.NewRequest("PUT", urls, body)
  5060  	if err != nil {
  5061  		return nil, err
  5062  	}
  5063  	req.Header = reqHeaders
  5064  	googleapi.Expand(req.URL, map[string]string{
  5065  		"bucket": c.bucket,
  5066  	})
  5067  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5068  }
  5069  
  5070  // Do executes the "storage.buckets.setIamPolicy" call.
  5071  // Any non-2xx status code is an error. Response headers are in either
  5072  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  5073  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5074  // whether the returned error was because http.StatusNotModified was returned.
  5075  func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5076  	gensupport.SetOptions(c.urlParams_, opts...)
  5077  	res, err := c.doRequest("json")
  5078  	if res != nil && res.StatusCode == http.StatusNotModified {
  5079  		if res.Body != nil {
  5080  			res.Body.Close()
  5081  		}
  5082  		return nil, gensupport.WrapError(&googleapi.Error{
  5083  			Code:   res.StatusCode,
  5084  			Header: res.Header,
  5085  		})
  5086  	}
  5087  	if err != nil {
  5088  		return nil, err
  5089  	}
  5090  	defer googleapi.CloseBody(res)
  5091  	if err := googleapi.CheckResponse(res); err != nil {
  5092  		return nil, gensupport.WrapError(err)
  5093  	}
  5094  	ret := &Policy{
  5095  		ServerResponse: googleapi.ServerResponse{
  5096  			Header:         res.Header,
  5097  			HTTPStatusCode: res.StatusCode,
  5098  		},
  5099  	}
  5100  	target := &ret
  5101  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5102  		return nil, err
  5103  	}
  5104  	return ret, nil
  5105  }
  5106  
  5107  type BucketsTestIamPermissionsCall struct {
  5108  	s            *Service
  5109  	bucket       string
  5110  	urlParams_   gensupport.URLParams
  5111  	ifNoneMatch_ string
  5112  	ctx_         context.Context
  5113  	header_      http.Header
  5114  }
  5115  
  5116  // TestIamPermissions: Tests a set of permissions on the given bucket to see
  5117  // which, if any, are held by the caller.
  5118  //
  5119  // - bucket: Name of a bucket.
  5120  // - permissions: Permissions to test.
  5121  func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall {
  5122  	c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5123  	c.bucket = bucket
  5124  	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
  5125  	return c
  5126  }
  5127  
  5128  // UserProject sets the optional parameter "userProject": The project to be
  5129  // billed for this request. Required for Requester Pays buckets.
  5130  func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
  5131  	c.urlParams_.Set("userProject", userProject)
  5132  	return c
  5133  }
  5134  
  5135  // Fields allows partial responses to be retrieved. See
  5136  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5137  // details.
  5138  func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall {
  5139  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5140  	return c
  5141  }
  5142  
  5143  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5144  // object's ETag matches the given value. This is useful for getting updates
  5145  // only after the object has changed since the last request.
  5146  func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall {
  5147  	c.ifNoneMatch_ = entityTag
  5148  	return c
  5149  }
  5150  
  5151  // Context sets the context to be used in this call's Do method.
  5152  func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
  5153  	c.ctx_ = ctx
  5154  	return c
  5155  }
  5156  
  5157  // Header returns a http.Header that can be modified by the caller to add
  5158  // headers to the request.
  5159  func (c *BucketsTestIamPermissionsCall) Header() http.Header {
  5160  	if c.header_ == nil {
  5161  		c.header_ = make(http.Header)
  5162  	}
  5163  	return c.header_
  5164  }
  5165  
  5166  func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  5167  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5168  	if c.ifNoneMatch_ != "" {
  5169  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5170  	}
  5171  	var body io.Reader = nil
  5172  	c.urlParams_.Set("alt", alt)
  5173  	c.urlParams_.Set("prettyPrint", "false")
  5174  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions")
  5175  	urls += "?" + c.urlParams_.Encode()
  5176  	req, err := http.NewRequest("GET", urls, body)
  5177  	if err != nil {
  5178  		return nil, err
  5179  	}
  5180  	req.Header = reqHeaders
  5181  	googleapi.Expand(req.URL, map[string]string{
  5182  		"bucket": c.bucket,
  5183  	})
  5184  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5185  }
  5186  
  5187  // Do executes the "storage.buckets.testIamPermissions" call.
  5188  // Any non-2xx status code is an error. Response headers are in either
  5189  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  5190  // returned at all) in error.(*googleapi.Error).Header. Use
  5191  // googleapi.IsNotModified to check whether the returned error was because
  5192  // http.StatusNotModified was returned.
  5193  func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  5194  	gensupport.SetOptions(c.urlParams_, opts...)
  5195  	res, err := c.doRequest("json")
  5196  	if res != nil && res.StatusCode == http.StatusNotModified {
  5197  		if res.Body != nil {
  5198  			res.Body.Close()
  5199  		}
  5200  		return nil, gensupport.WrapError(&googleapi.Error{
  5201  			Code:   res.StatusCode,
  5202  			Header: res.Header,
  5203  		})
  5204  	}
  5205  	if err != nil {
  5206  		return nil, err
  5207  	}
  5208  	defer googleapi.CloseBody(res)
  5209  	if err := googleapi.CheckResponse(res); err != nil {
  5210  		return nil, gensupport.WrapError(err)
  5211  	}
  5212  	ret := &TestIamPermissionsResponse{
  5213  		ServerResponse: googleapi.ServerResponse{
  5214  			Header:         res.Header,
  5215  			HTTPStatusCode: res.StatusCode,
  5216  		},
  5217  	}
  5218  	target := &ret
  5219  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5220  		return nil, err
  5221  	}
  5222  	return ret, nil
  5223  }
  5224  
  5225  type BucketsUpdateCall struct {
  5226  	s          *Service
  5227  	bucket     string
  5228  	bucket2    *Bucket
  5229  	urlParams_ gensupport.URLParams
  5230  	ctx_       context.Context
  5231  	header_    http.Header
  5232  }
  5233  
  5234  // Update: Updates a bucket. Changes to the bucket will be readable immediately
  5235  // after writing, but configuration changes may take time to propagate.
  5236  //
  5237  // - bucket: Name of a bucket.
  5238  func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
  5239  	c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5240  	c.bucket = bucket
  5241  	c.bucket2 = bucket2
  5242  	return c
  5243  }
  5244  
  5245  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  5246  // Makes the return of the bucket metadata conditional on whether the bucket's
  5247  // current metageneration matches the given value.
  5248  func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
  5249  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5250  	return c
  5251  }
  5252  
  5253  // IfMetagenerationNotMatch sets the optional parameter
  5254  // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  5255  // conditional on whether the bucket's current metageneration does not match
  5256  // the given value.
  5257  func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall {
  5258  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5259  	return c
  5260  }
  5261  
  5262  // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
  5263  // predefined set of access controls to this bucket.
  5264  //
  5265  // Possible values:
  5266  //
  5267  //	"authenticatedRead" - Project team owners get OWNER access, and
  5268  //
  5269  // allAuthenticatedUsers get READER access.
  5270  //
  5271  //	"private" - Project team owners get OWNER access.
  5272  //	"projectPrivate" - Project team members get access according to their
  5273  //
  5274  // roles.
  5275  //
  5276  //	"publicRead" - Project team owners get OWNER access, and allUsers get
  5277  //
  5278  // READER access.
  5279  //
  5280  //	"publicReadWrite" - Project team owners get OWNER access, and allUsers get
  5281  //
  5282  // WRITER access.
  5283  func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall {
  5284  	c.urlParams_.Set("predefinedAcl", predefinedAcl)
  5285  	return c
  5286  }
  5287  
  5288  // PredefinedDefaultObjectAcl sets the optional parameter
  5289  // "predefinedDefaultObjectAcl": Apply a predefined set of default object
  5290  // access controls to this bucket.
  5291  //
  5292  // Possible values:
  5293  //
  5294  //	"authenticatedRead" - Object owner gets OWNER access, and
  5295  //
  5296  // allAuthenticatedUsers get READER access.
  5297  //
  5298  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
  5299  //
  5300  // team owners get OWNER access.
  5301  //
  5302  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
  5303  //
  5304  // owners get READER access.
  5305  //
  5306  //	"private" - Object owner gets OWNER access.
  5307  //	"projectPrivate" - Object owner gets OWNER access, and project team
  5308  //
  5309  // members get access according to their roles.
  5310  //
  5311  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
  5312  //
  5313  // access.
  5314  func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
  5315  	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
  5316  	return c
  5317  }
  5318  
  5319  // Projection sets the optional parameter "projection": Set of properties to
  5320  // return. Defaults to full.
  5321  //
  5322  // Possible values:
  5323  //
  5324  //	"full" - Include all properties.
  5325  //	"noAcl" - Omit owner, acl and defaultObjectAcl properties.
  5326  func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
  5327  	c.urlParams_.Set("projection", projection)
  5328  	return c
  5329  }
  5330  
  5331  // UserProject sets the optional parameter "userProject": The project to be
  5332  // billed for this request. Required for Requester Pays buckets.
  5333  func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
  5334  	c.urlParams_.Set("userProject", userProject)
  5335  	return c
  5336  }
  5337  
  5338  // Fields allows partial responses to be retrieved. See
  5339  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5340  // details.
  5341  func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
  5342  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5343  	return c
  5344  }
  5345  
  5346  // Context sets the context to be used in this call's Do method.
  5347  func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
  5348  	c.ctx_ = ctx
  5349  	return c
  5350  }
  5351  
  5352  // Header returns a http.Header that can be modified by the caller to add
  5353  // headers to the request.
  5354  func (c *BucketsUpdateCall) Header() http.Header {
  5355  	if c.header_ == nil {
  5356  		c.header_ = make(http.Header)
  5357  	}
  5358  	return c.header_
  5359  }
  5360  
  5361  func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5362  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5363  	var body io.Reader = nil
  5364  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  5365  	if err != nil {
  5366  		return nil, err
  5367  	}
  5368  	c.urlParams_.Set("alt", alt)
  5369  	c.urlParams_.Set("prettyPrint", "false")
  5370  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  5371  	urls += "?" + c.urlParams_.Encode()
  5372  	req, err := http.NewRequest("PUT", urls, body)
  5373  	if err != nil {
  5374  		return nil, err
  5375  	}
  5376  	req.Header = reqHeaders
  5377  	googleapi.Expand(req.URL, map[string]string{
  5378  		"bucket": c.bucket,
  5379  	})
  5380  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5381  }
  5382  
  5383  // Do executes the "storage.buckets.update" call.
  5384  // Any non-2xx status code is an error. Response headers are in either
  5385  // *Bucket.ServerResponse.Header or (if a response was returned at all) in
  5386  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5387  // whether the returned error was because http.StatusNotModified was returned.
  5388  func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  5389  	gensupport.SetOptions(c.urlParams_, opts...)
  5390  	res, err := c.doRequest("json")
  5391  	if res != nil && res.StatusCode == http.StatusNotModified {
  5392  		if res.Body != nil {
  5393  			res.Body.Close()
  5394  		}
  5395  		return nil, gensupport.WrapError(&googleapi.Error{
  5396  			Code:   res.StatusCode,
  5397  			Header: res.Header,
  5398  		})
  5399  	}
  5400  	if err != nil {
  5401  		return nil, err
  5402  	}
  5403  	defer googleapi.CloseBody(res)
  5404  	if err := googleapi.CheckResponse(res); err != nil {
  5405  		return nil, gensupport.WrapError(err)
  5406  	}
  5407  	ret := &Bucket{
  5408  		ServerResponse: googleapi.ServerResponse{
  5409  			Header:         res.Header,
  5410  			HTTPStatusCode: res.StatusCode,
  5411  		},
  5412  	}
  5413  	target := &ret
  5414  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5415  		return nil, err
  5416  	}
  5417  	return ret, nil
  5418  }
  5419  
  5420  type ChannelsStopCall struct {
  5421  	s          *Service
  5422  	channel    *Channel
  5423  	urlParams_ gensupport.URLParams
  5424  	ctx_       context.Context
  5425  	header_    http.Header
  5426  }
  5427  
  5428  // Stop: Stop watching resources through this channel
  5429  func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
  5430  	c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5431  	c.channel = channel
  5432  	return c
  5433  }
  5434  
  5435  // Fields allows partial responses to be retrieved. See
  5436  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5437  // details.
  5438  func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
  5439  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5440  	return c
  5441  }
  5442  
  5443  // Context sets the context to be used in this call's Do method.
  5444  func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
  5445  	c.ctx_ = ctx
  5446  	return c
  5447  }
  5448  
  5449  // Header returns a http.Header that can be modified by the caller to add
  5450  // headers to the request.
  5451  func (c *ChannelsStopCall) Header() http.Header {
  5452  	if c.header_ == nil {
  5453  		c.header_ = make(http.Header)
  5454  	}
  5455  	return c.header_
  5456  }
  5457  
  5458  func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
  5459  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5460  	var body io.Reader = nil
  5461  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  5462  	if err != nil {
  5463  		return nil, err
  5464  	}
  5465  	c.urlParams_.Set("alt", alt)
  5466  	c.urlParams_.Set("prettyPrint", "false")
  5467  	urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
  5468  	urls += "?" + c.urlParams_.Encode()
  5469  	req, err := http.NewRequest("POST", urls, body)
  5470  	if err != nil {
  5471  		return nil, err
  5472  	}
  5473  	req.Header = reqHeaders
  5474  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5475  }
  5476  
  5477  // Do executes the "storage.channels.stop" call.
  5478  func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
  5479  	gensupport.SetOptions(c.urlParams_, opts...)
  5480  	res, err := c.doRequest("json")
  5481  	if err != nil {
  5482  		return err
  5483  	}
  5484  	defer googleapi.CloseBody(res)
  5485  	if err := googleapi.CheckResponse(res); err != nil {
  5486  		return gensupport.WrapError(err)
  5487  	}
  5488  	return nil
  5489  }
  5490  
  5491  type DefaultObjectAccessControlsDeleteCall struct {
  5492  	s          *Service
  5493  	bucket     string
  5494  	entity     string
  5495  	urlParams_ gensupport.URLParams
  5496  	ctx_       context.Context
  5497  	header_    http.Header
  5498  }
  5499  
  5500  // Delete: Permanently deletes the default object ACL entry for the specified
  5501  // entity on the specified bucket.
  5502  //
  5503  //   - bucket: Name of a bucket.
  5504  //   - entity: The entity holding the permission. Can be user-userId,
  5505  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  5506  //     allAuthenticatedUsers.
  5507  func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
  5508  	c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5509  	c.bucket = bucket
  5510  	c.entity = entity
  5511  	return c
  5512  }
  5513  
  5514  // UserProject sets the optional parameter "userProject": The project to be
  5515  // billed for this request. Required for Requester Pays buckets.
  5516  func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
  5517  	c.urlParams_.Set("userProject", userProject)
  5518  	return c
  5519  }
  5520  
  5521  // Fields allows partial responses to be retrieved. See
  5522  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5523  // details.
  5524  func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
  5525  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5526  	return c
  5527  }
  5528  
  5529  // Context sets the context to be used in this call's Do method.
  5530  func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
  5531  	c.ctx_ = ctx
  5532  	return c
  5533  }
  5534  
  5535  // Header returns a http.Header that can be modified by the caller to add
  5536  // headers to the request.
  5537  func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
  5538  	if c.header_ == nil {
  5539  		c.header_ = make(http.Header)
  5540  	}
  5541  	return c.header_
  5542  }
  5543  
  5544  func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5545  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5546  	var body io.Reader = nil
  5547  	c.urlParams_.Set("alt", alt)
  5548  	c.urlParams_.Set("prettyPrint", "false")
  5549  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  5550  	urls += "?" + c.urlParams_.Encode()
  5551  	req, err := http.NewRequest("DELETE", urls, body)
  5552  	if err != nil {
  5553  		return nil, err
  5554  	}
  5555  	req.Header = reqHeaders
  5556  	googleapi.Expand(req.URL, map[string]string{
  5557  		"bucket": c.bucket,
  5558  		"entity": c.entity,
  5559  	})
  5560  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5561  }
  5562  
  5563  // Do executes the "storage.defaultObjectAccessControls.delete" call.
  5564  func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5565  	gensupport.SetOptions(c.urlParams_, opts...)
  5566  	res, err := c.doRequest("json")
  5567  	if err != nil {
  5568  		return err
  5569  	}
  5570  	defer googleapi.CloseBody(res)
  5571  	if err := googleapi.CheckResponse(res); err != nil {
  5572  		return gensupport.WrapError(err)
  5573  	}
  5574  	return nil
  5575  }
  5576  
  5577  type DefaultObjectAccessControlsGetCall struct {
  5578  	s            *Service
  5579  	bucket       string
  5580  	entity       string
  5581  	urlParams_   gensupport.URLParams
  5582  	ifNoneMatch_ string
  5583  	ctx_         context.Context
  5584  	header_      http.Header
  5585  }
  5586  
  5587  // Get: Returns the default object ACL entry for the specified entity on the
  5588  // specified bucket.
  5589  //
  5590  //   - bucket: Name of a bucket.
  5591  //   - entity: The entity holding the permission. Can be user-userId,
  5592  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  5593  //     allAuthenticatedUsers.
  5594  func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
  5595  	c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5596  	c.bucket = bucket
  5597  	c.entity = entity
  5598  	return c
  5599  }
  5600  
  5601  // UserProject sets the optional parameter "userProject": The project to be
  5602  // billed for this request. Required for Requester Pays buckets.
  5603  func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
  5604  	c.urlParams_.Set("userProject", userProject)
  5605  	return c
  5606  }
  5607  
  5608  // Fields allows partial responses to be retrieved. See
  5609  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5610  // details.
  5611  func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
  5612  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5613  	return c
  5614  }
  5615  
  5616  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5617  // object's ETag matches the given value. This is useful for getting updates
  5618  // only after the object has changed since the last request.
  5619  func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
  5620  	c.ifNoneMatch_ = entityTag
  5621  	return c
  5622  }
  5623  
  5624  // Context sets the context to be used in this call's Do method.
  5625  func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
  5626  	c.ctx_ = ctx
  5627  	return c
  5628  }
  5629  
  5630  // Header returns a http.Header that can be modified by the caller to add
  5631  // headers to the request.
  5632  func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
  5633  	if c.header_ == nil {
  5634  		c.header_ = make(http.Header)
  5635  	}
  5636  	return c.header_
  5637  }
  5638  
  5639  func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  5640  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5641  	if c.ifNoneMatch_ != "" {
  5642  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5643  	}
  5644  	var body io.Reader = nil
  5645  	c.urlParams_.Set("alt", alt)
  5646  	c.urlParams_.Set("prettyPrint", "false")
  5647  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  5648  	urls += "?" + c.urlParams_.Encode()
  5649  	req, err := http.NewRequest("GET", urls, body)
  5650  	if err != nil {
  5651  		return nil, err
  5652  	}
  5653  	req.Header = reqHeaders
  5654  	googleapi.Expand(req.URL, map[string]string{
  5655  		"bucket": c.bucket,
  5656  		"entity": c.entity,
  5657  	})
  5658  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5659  }
  5660  
  5661  // Do executes the "storage.defaultObjectAccessControls.get" call.
  5662  // Any non-2xx status code is an error. Response headers are in either
  5663  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  5664  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5665  // check whether the returned error was because http.StatusNotModified was
  5666  // returned.
  5667  func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  5668  	gensupport.SetOptions(c.urlParams_, opts...)
  5669  	res, err := c.doRequest("json")
  5670  	if res != nil && res.StatusCode == http.StatusNotModified {
  5671  		if res.Body != nil {
  5672  			res.Body.Close()
  5673  		}
  5674  		return nil, gensupport.WrapError(&googleapi.Error{
  5675  			Code:   res.StatusCode,
  5676  			Header: res.Header,
  5677  		})
  5678  	}
  5679  	if err != nil {
  5680  		return nil, err
  5681  	}
  5682  	defer googleapi.CloseBody(res)
  5683  	if err := googleapi.CheckResponse(res); err != nil {
  5684  		return nil, gensupport.WrapError(err)
  5685  	}
  5686  	ret := &ObjectAccessControl{
  5687  		ServerResponse: googleapi.ServerResponse{
  5688  			Header:         res.Header,
  5689  			HTTPStatusCode: res.StatusCode,
  5690  		},
  5691  	}
  5692  	target := &ret
  5693  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5694  		return nil, err
  5695  	}
  5696  	return ret, nil
  5697  }
  5698  
  5699  type DefaultObjectAccessControlsInsertCall struct {
  5700  	s                   *Service
  5701  	bucket              string
  5702  	objectaccesscontrol *ObjectAccessControl
  5703  	urlParams_          gensupport.URLParams
  5704  	ctx_                context.Context
  5705  	header_             http.Header
  5706  }
  5707  
  5708  // Insert: Creates a new default object ACL entry on the specified bucket.
  5709  //
  5710  // - bucket: Name of a bucket.
  5711  func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
  5712  	c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5713  	c.bucket = bucket
  5714  	c.objectaccesscontrol = objectaccesscontrol
  5715  	return c
  5716  }
  5717  
  5718  // UserProject sets the optional parameter "userProject": The project to be
  5719  // billed for this request. Required for Requester Pays buckets.
  5720  func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
  5721  	c.urlParams_.Set("userProject", userProject)
  5722  	return c
  5723  }
  5724  
  5725  // Fields allows partial responses to be retrieved. See
  5726  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5727  // details.
  5728  func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
  5729  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5730  	return c
  5731  }
  5732  
  5733  // Context sets the context to be used in this call's Do method.
  5734  func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
  5735  	c.ctx_ = ctx
  5736  	return c
  5737  }
  5738  
  5739  // Header returns a http.Header that can be modified by the caller to add
  5740  // headers to the request.
  5741  func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
  5742  	if c.header_ == nil {
  5743  		c.header_ = make(http.Header)
  5744  	}
  5745  	return c.header_
  5746  }
  5747  
  5748  func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  5749  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5750  	var body io.Reader = nil
  5751  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  5752  	if err != nil {
  5753  		return nil, err
  5754  	}
  5755  	c.urlParams_.Set("alt", alt)
  5756  	c.urlParams_.Set("prettyPrint", "false")
  5757  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
  5758  	urls += "?" + c.urlParams_.Encode()
  5759  	req, err := http.NewRequest("POST", urls, body)
  5760  	if err != nil {
  5761  		return nil, err
  5762  	}
  5763  	req.Header = reqHeaders
  5764  	googleapi.Expand(req.URL, map[string]string{
  5765  		"bucket": c.bucket,
  5766  	})
  5767  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5768  }
  5769  
  5770  // Do executes the "storage.defaultObjectAccessControls.insert" call.
  5771  // Any non-2xx status code is an error. Response headers are in either
  5772  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  5773  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5774  // check whether the returned error was because http.StatusNotModified was
  5775  // returned.
  5776  func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  5777  	gensupport.SetOptions(c.urlParams_, opts...)
  5778  	res, err := c.doRequest("json")
  5779  	if res != nil && res.StatusCode == http.StatusNotModified {
  5780  		if res.Body != nil {
  5781  			res.Body.Close()
  5782  		}
  5783  		return nil, gensupport.WrapError(&googleapi.Error{
  5784  			Code:   res.StatusCode,
  5785  			Header: res.Header,
  5786  		})
  5787  	}
  5788  	if err != nil {
  5789  		return nil, err
  5790  	}
  5791  	defer googleapi.CloseBody(res)
  5792  	if err := googleapi.CheckResponse(res); err != nil {
  5793  		return nil, gensupport.WrapError(err)
  5794  	}
  5795  	ret := &ObjectAccessControl{
  5796  		ServerResponse: googleapi.ServerResponse{
  5797  			Header:         res.Header,
  5798  			HTTPStatusCode: res.StatusCode,
  5799  		},
  5800  	}
  5801  	target := &ret
  5802  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5803  		return nil, err
  5804  	}
  5805  	return ret, nil
  5806  }
  5807  
  5808  type DefaultObjectAccessControlsListCall struct {
  5809  	s            *Service
  5810  	bucket       string
  5811  	urlParams_   gensupport.URLParams
  5812  	ifNoneMatch_ string
  5813  	ctx_         context.Context
  5814  	header_      http.Header
  5815  }
  5816  
  5817  // List: Retrieves default object ACL entries on the specified bucket.
  5818  //
  5819  // - bucket: Name of a bucket.
  5820  func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
  5821  	c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5822  	c.bucket = bucket
  5823  	return c
  5824  }
  5825  
  5826  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  5827  // If present, only return default ACL listing if the bucket's current
  5828  // metageneration matches this value.
  5829  func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
  5830  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5831  	return c
  5832  }
  5833  
  5834  // IfMetagenerationNotMatch sets the optional parameter
  5835  // "ifMetagenerationNotMatch": If present, only return default ACL listing if
  5836  // the bucket's current metageneration does not match the given value.
  5837  func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
  5838  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5839  	return c
  5840  }
  5841  
  5842  // UserProject sets the optional parameter "userProject": The project to be
  5843  // billed for this request. Required for Requester Pays buckets.
  5844  func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
  5845  	c.urlParams_.Set("userProject", userProject)
  5846  	return c
  5847  }
  5848  
  5849  // Fields allows partial responses to be retrieved. See
  5850  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5851  // details.
  5852  func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
  5853  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5854  	return c
  5855  }
  5856  
  5857  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5858  // object's ETag matches the given value. This is useful for getting updates
  5859  // only after the object has changed since the last request.
  5860  func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
  5861  	c.ifNoneMatch_ = entityTag
  5862  	return c
  5863  }
  5864  
  5865  // Context sets the context to be used in this call's Do method.
  5866  func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
  5867  	c.ctx_ = ctx
  5868  	return c
  5869  }
  5870  
  5871  // Header returns a http.Header that can be modified by the caller to add
  5872  // headers to the request.
  5873  func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
  5874  	if c.header_ == nil {
  5875  		c.header_ = make(http.Header)
  5876  	}
  5877  	return c.header_
  5878  }
  5879  
  5880  func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  5881  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5882  	if c.ifNoneMatch_ != "" {
  5883  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5884  	}
  5885  	var body io.Reader = nil
  5886  	c.urlParams_.Set("alt", alt)
  5887  	c.urlParams_.Set("prettyPrint", "false")
  5888  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
  5889  	urls += "?" + c.urlParams_.Encode()
  5890  	req, err := http.NewRequest("GET", urls, body)
  5891  	if err != nil {
  5892  		return nil, err
  5893  	}
  5894  	req.Header = reqHeaders
  5895  	googleapi.Expand(req.URL, map[string]string{
  5896  		"bucket": c.bucket,
  5897  	})
  5898  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5899  }
  5900  
  5901  // Do executes the "storage.defaultObjectAccessControls.list" call.
  5902  // Any non-2xx status code is an error. Response headers are in either
  5903  // *ObjectAccessControls.ServerResponse.Header or (if a response was returned
  5904  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5905  // check whether the returned error was because http.StatusNotModified was
  5906  // returned.
  5907  func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
  5908  	gensupport.SetOptions(c.urlParams_, opts...)
  5909  	res, err := c.doRequest("json")
  5910  	if res != nil && res.StatusCode == http.StatusNotModified {
  5911  		if res.Body != nil {
  5912  			res.Body.Close()
  5913  		}
  5914  		return nil, gensupport.WrapError(&googleapi.Error{
  5915  			Code:   res.StatusCode,
  5916  			Header: res.Header,
  5917  		})
  5918  	}
  5919  	if err != nil {
  5920  		return nil, err
  5921  	}
  5922  	defer googleapi.CloseBody(res)
  5923  	if err := googleapi.CheckResponse(res); err != nil {
  5924  		return nil, gensupport.WrapError(err)
  5925  	}
  5926  	ret := &ObjectAccessControls{
  5927  		ServerResponse: googleapi.ServerResponse{
  5928  			Header:         res.Header,
  5929  			HTTPStatusCode: res.StatusCode,
  5930  		},
  5931  	}
  5932  	target := &ret
  5933  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5934  		return nil, err
  5935  	}
  5936  	return ret, nil
  5937  }
  5938  
  5939  type DefaultObjectAccessControlsPatchCall struct {
  5940  	s                   *Service
  5941  	bucket              string
  5942  	entity              string
  5943  	objectaccesscontrol *ObjectAccessControl
  5944  	urlParams_          gensupport.URLParams
  5945  	ctx_                context.Context
  5946  	header_             http.Header
  5947  }
  5948  
  5949  // Patch: Patches a default object ACL entry on the specified bucket.
  5950  //
  5951  //   - bucket: Name of a bucket.
  5952  //   - entity: The entity holding the permission. Can be user-userId,
  5953  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  5954  //     allAuthenticatedUsers.
  5955  func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
  5956  	c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5957  	c.bucket = bucket
  5958  	c.entity = entity
  5959  	c.objectaccesscontrol = objectaccesscontrol
  5960  	return c
  5961  }
  5962  
  5963  // UserProject sets the optional parameter "userProject": The project to be
  5964  // billed for this request. Required for Requester Pays buckets.
  5965  func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
  5966  	c.urlParams_.Set("userProject", userProject)
  5967  	return c
  5968  }
  5969  
  5970  // Fields allows partial responses to be retrieved. See
  5971  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5972  // details.
  5973  func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
  5974  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5975  	return c
  5976  }
  5977  
  5978  // Context sets the context to be used in this call's Do method.
  5979  func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
  5980  	c.ctx_ = ctx
  5981  	return c
  5982  }
  5983  
  5984  // Header returns a http.Header that can be modified by the caller to add
  5985  // headers to the request.
  5986  func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
  5987  	if c.header_ == nil {
  5988  		c.header_ = make(http.Header)
  5989  	}
  5990  	return c.header_
  5991  }
  5992  
  5993  func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  5994  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5995  	var body io.Reader = nil
  5996  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  5997  	if err != nil {
  5998  		return nil, err
  5999  	}
  6000  	c.urlParams_.Set("alt", alt)
  6001  	c.urlParams_.Set("prettyPrint", "false")
  6002  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  6003  	urls += "?" + c.urlParams_.Encode()
  6004  	req, err := http.NewRequest("PATCH", urls, body)
  6005  	if err != nil {
  6006  		return nil, err
  6007  	}
  6008  	req.Header = reqHeaders
  6009  	googleapi.Expand(req.URL, map[string]string{
  6010  		"bucket": c.bucket,
  6011  		"entity": c.entity,
  6012  	})
  6013  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6014  }
  6015  
  6016  // Do executes the "storage.defaultObjectAccessControls.patch" call.
  6017  // Any non-2xx status code is an error. Response headers are in either
  6018  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  6019  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6020  // check whether the returned error was because http.StatusNotModified was
  6021  // returned.
  6022  func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  6023  	gensupport.SetOptions(c.urlParams_, opts...)
  6024  	res, err := c.doRequest("json")
  6025  	if res != nil && res.StatusCode == http.StatusNotModified {
  6026  		if res.Body != nil {
  6027  			res.Body.Close()
  6028  		}
  6029  		return nil, gensupport.WrapError(&googleapi.Error{
  6030  			Code:   res.StatusCode,
  6031  			Header: res.Header,
  6032  		})
  6033  	}
  6034  	if err != nil {
  6035  		return nil, err
  6036  	}
  6037  	defer googleapi.CloseBody(res)
  6038  	if err := googleapi.CheckResponse(res); err != nil {
  6039  		return nil, gensupport.WrapError(err)
  6040  	}
  6041  	ret := &ObjectAccessControl{
  6042  		ServerResponse: googleapi.ServerResponse{
  6043  			Header:         res.Header,
  6044  			HTTPStatusCode: res.StatusCode,
  6045  		},
  6046  	}
  6047  	target := &ret
  6048  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6049  		return nil, err
  6050  	}
  6051  	return ret, nil
  6052  }
  6053  
  6054  type DefaultObjectAccessControlsUpdateCall struct {
  6055  	s                   *Service
  6056  	bucket              string
  6057  	entity              string
  6058  	objectaccesscontrol *ObjectAccessControl
  6059  	urlParams_          gensupport.URLParams
  6060  	ctx_                context.Context
  6061  	header_             http.Header
  6062  }
  6063  
  6064  // Update: Updates a default object ACL entry on the specified bucket.
  6065  //
  6066  //   - bucket: Name of a bucket.
  6067  //   - entity: The entity holding the permission. Can be user-userId,
  6068  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  6069  //     allAuthenticatedUsers.
  6070  func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
  6071  	c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6072  	c.bucket = bucket
  6073  	c.entity = entity
  6074  	c.objectaccesscontrol = objectaccesscontrol
  6075  	return c
  6076  }
  6077  
  6078  // UserProject sets the optional parameter "userProject": The project to be
  6079  // billed for this request. Required for Requester Pays buckets.
  6080  func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
  6081  	c.urlParams_.Set("userProject", userProject)
  6082  	return c
  6083  }
  6084  
  6085  // Fields allows partial responses to be retrieved. See
  6086  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6087  // details.
  6088  func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
  6089  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6090  	return c
  6091  }
  6092  
  6093  // Context sets the context to be used in this call's Do method.
  6094  func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
  6095  	c.ctx_ = ctx
  6096  	return c
  6097  }
  6098  
  6099  // Header returns a http.Header that can be modified by the caller to add
  6100  // headers to the request.
  6101  func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
  6102  	if c.header_ == nil {
  6103  		c.header_ = make(http.Header)
  6104  	}
  6105  	return c.header_
  6106  }
  6107  
  6108  func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6109  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6110  	var body io.Reader = nil
  6111  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  6112  	if err != nil {
  6113  		return nil, err
  6114  	}
  6115  	c.urlParams_.Set("alt", alt)
  6116  	c.urlParams_.Set("prettyPrint", "false")
  6117  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  6118  	urls += "?" + c.urlParams_.Encode()
  6119  	req, err := http.NewRequest("PUT", urls, body)
  6120  	if err != nil {
  6121  		return nil, err
  6122  	}
  6123  	req.Header = reqHeaders
  6124  	googleapi.Expand(req.URL, map[string]string{
  6125  		"bucket": c.bucket,
  6126  		"entity": c.entity,
  6127  	})
  6128  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6129  }
  6130  
  6131  // Do executes the "storage.defaultObjectAccessControls.update" call.
  6132  // Any non-2xx status code is an error. Response headers are in either
  6133  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  6134  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6135  // check whether the returned error was because http.StatusNotModified was
  6136  // returned.
  6137  func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  6138  	gensupport.SetOptions(c.urlParams_, opts...)
  6139  	res, err := c.doRequest("json")
  6140  	if res != nil && res.StatusCode == http.StatusNotModified {
  6141  		if res.Body != nil {
  6142  			res.Body.Close()
  6143  		}
  6144  		return nil, gensupport.WrapError(&googleapi.Error{
  6145  			Code:   res.StatusCode,
  6146  			Header: res.Header,
  6147  		})
  6148  	}
  6149  	if err != nil {
  6150  		return nil, err
  6151  	}
  6152  	defer googleapi.CloseBody(res)
  6153  	if err := googleapi.CheckResponse(res); err != nil {
  6154  		return nil, gensupport.WrapError(err)
  6155  	}
  6156  	ret := &ObjectAccessControl{
  6157  		ServerResponse: googleapi.ServerResponse{
  6158  			Header:         res.Header,
  6159  			HTTPStatusCode: res.StatusCode,
  6160  		},
  6161  	}
  6162  	target := &ret
  6163  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6164  		return nil, err
  6165  	}
  6166  	return ret, nil
  6167  }
  6168  
  6169  type FoldersDeleteCall struct {
  6170  	s          *Service
  6171  	bucket     string
  6172  	folder     string
  6173  	urlParams_ gensupport.URLParams
  6174  	ctx_       context.Context
  6175  	header_    http.Header
  6176  }
  6177  
  6178  // Delete: Permanently deletes a folder. Only applicable to buckets with
  6179  // hierarchical namespace enabled.
  6180  //
  6181  // - bucket: Name of the bucket in which the folder resides.
  6182  // - folder: Name of a folder.
  6183  func (r *FoldersService) Delete(bucket string, folder string) *FoldersDeleteCall {
  6184  	c := &FoldersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6185  	c.bucket = bucket
  6186  	c.folder = folder
  6187  	return c
  6188  }
  6189  
  6190  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  6191  // If set, only deletes the folder if its metageneration matches this value.
  6192  func (c *FoldersDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *FoldersDeleteCall {
  6193  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6194  	return c
  6195  }
  6196  
  6197  // IfMetagenerationNotMatch sets the optional parameter
  6198  // "ifMetagenerationNotMatch": If set, only deletes the folder if its
  6199  // metageneration does not match this value.
  6200  func (c *FoldersDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *FoldersDeleteCall {
  6201  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  6202  	return c
  6203  }
  6204  
  6205  // Fields allows partial responses to be retrieved. See
  6206  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6207  // details.
  6208  func (c *FoldersDeleteCall) Fields(s ...googleapi.Field) *FoldersDeleteCall {
  6209  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6210  	return c
  6211  }
  6212  
  6213  // Context sets the context to be used in this call's Do method.
  6214  func (c *FoldersDeleteCall) Context(ctx context.Context) *FoldersDeleteCall {
  6215  	c.ctx_ = ctx
  6216  	return c
  6217  }
  6218  
  6219  // Header returns a http.Header that can be modified by the caller to add
  6220  // headers to the request.
  6221  func (c *FoldersDeleteCall) Header() http.Header {
  6222  	if c.header_ == nil {
  6223  		c.header_ = make(http.Header)
  6224  	}
  6225  	return c.header_
  6226  }
  6227  
  6228  func (c *FoldersDeleteCall) doRequest(alt string) (*http.Response, error) {
  6229  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6230  	var body io.Reader = nil
  6231  	c.urlParams_.Set("alt", alt)
  6232  	c.urlParams_.Set("prettyPrint", "false")
  6233  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders/{folder}")
  6234  	urls += "?" + c.urlParams_.Encode()
  6235  	req, err := http.NewRequest("DELETE", urls, body)
  6236  	if err != nil {
  6237  		return nil, err
  6238  	}
  6239  	req.Header = reqHeaders
  6240  	googleapi.Expand(req.URL, map[string]string{
  6241  		"bucket": c.bucket,
  6242  		"folder": c.folder,
  6243  	})
  6244  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6245  }
  6246  
  6247  // Do executes the "storage.folders.delete" call.
  6248  func (c *FoldersDeleteCall) Do(opts ...googleapi.CallOption) error {
  6249  	gensupport.SetOptions(c.urlParams_, opts...)
  6250  	res, err := c.doRequest("json")
  6251  	if err != nil {
  6252  		return err
  6253  	}
  6254  	defer googleapi.CloseBody(res)
  6255  	if err := googleapi.CheckResponse(res); err != nil {
  6256  		return gensupport.WrapError(err)
  6257  	}
  6258  	return nil
  6259  }
  6260  
  6261  type FoldersGetCall struct {
  6262  	s            *Service
  6263  	bucket       string
  6264  	folder       string
  6265  	urlParams_   gensupport.URLParams
  6266  	ifNoneMatch_ string
  6267  	ctx_         context.Context
  6268  	header_      http.Header
  6269  }
  6270  
  6271  // Get: Returns metadata for the specified folder. Only applicable to buckets
  6272  // with hierarchical namespace enabled.
  6273  //
  6274  // - bucket: Name of the bucket in which the folder resides.
  6275  // - folder: Name of a folder.
  6276  func (r *FoldersService) Get(bucket string, folder string) *FoldersGetCall {
  6277  	c := &FoldersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6278  	c.bucket = bucket
  6279  	c.folder = folder
  6280  	return c
  6281  }
  6282  
  6283  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  6284  // Makes the return of the folder metadata conditional on whether the folder's
  6285  // current metageneration matches the given value.
  6286  func (c *FoldersGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *FoldersGetCall {
  6287  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6288  	return c
  6289  }
  6290  
  6291  // IfMetagenerationNotMatch sets the optional parameter
  6292  // "ifMetagenerationNotMatch": Makes the return of the folder metadata
  6293  // conditional on whether the folder's current metageneration does not match
  6294  // the given value.
  6295  func (c *FoldersGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *FoldersGetCall {
  6296  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  6297  	return c
  6298  }
  6299  
  6300  // Fields allows partial responses to be retrieved. See
  6301  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6302  // details.
  6303  func (c *FoldersGetCall) Fields(s ...googleapi.Field) *FoldersGetCall {
  6304  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6305  	return c
  6306  }
  6307  
  6308  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6309  // object's ETag matches the given value. This is useful for getting updates
  6310  // only after the object has changed since the last request.
  6311  func (c *FoldersGetCall) IfNoneMatch(entityTag string) *FoldersGetCall {
  6312  	c.ifNoneMatch_ = entityTag
  6313  	return c
  6314  }
  6315  
  6316  // Context sets the context to be used in this call's Do method.
  6317  func (c *FoldersGetCall) Context(ctx context.Context) *FoldersGetCall {
  6318  	c.ctx_ = ctx
  6319  	return c
  6320  }
  6321  
  6322  // Header returns a http.Header that can be modified by the caller to add
  6323  // headers to the request.
  6324  func (c *FoldersGetCall) Header() http.Header {
  6325  	if c.header_ == nil {
  6326  		c.header_ = make(http.Header)
  6327  	}
  6328  	return c.header_
  6329  }
  6330  
  6331  func (c *FoldersGetCall) doRequest(alt string) (*http.Response, error) {
  6332  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6333  	if c.ifNoneMatch_ != "" {
  6334  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6335  	}
  6336  	var body io.Reader = nil
  6337  	c.urlParams_.Set("alt", alt)
  6338  	c.urlParams_.Set("prettyPrint", "false")
  6339  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders/{folder}")
  6340  	urls += "?" + c.urlParams_.Encode()
  6341  	req, err := http.NewRequest("GET", urls, body)
  6342  	if err != nil {
  6343  		return nil, err
  6344  	}
  6345  	req.Header = reqHeaders
  6346  	googleapi.Expand(req.URL, map[string]string{
  6347  		"bucket": c.bucket,
  6348  		"folder": c.folder,
  6349  	})
  6350  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6351  }
  6352  
  6353  // Do executes the "storage.folders.get" call.
  6354  // Any non-2xx status code is an error. Response headers are in either
  6355  // *Folder.ServerResponse.Header or (if a response was returned at all) in
  6356  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6357  // whether the returned error was because http.StatusNotModified was returned.
  6358  func (c *FoldersGetCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  6359  	gensupport.SetOptions(c.urlParams_, opts...)
  6360  	res, err := c.doRequest("json")
  6361  	if res != nil && res.StatusCode == http.StatusNotModified {
  6362  		if res.Body != nil {
  6363  			res.Body.Close()
  6364  		}
  6365  		return nil, gensupport.WrapError(&googleapi.Error{
  6366  			Code:   res.StatusCode,
  6367  			Header: res.Header,
  6368  		})
  6369  	}
  6370  	if err != nil {
  6371  		return nil, err
  6372  	}
  6373  	defer googleapi.CloseBody(res)
  6374  	if err := googleapi.CheckResponse(res); err != nil {
  6375  		return nil, gensupport.WrapError(err)
  6376  	}
  6377  	ret := &Folder{
  6378  		ServerResponse: googleapi.ServerResponse{
  6379  			Header:         res.Header,
  6380  			HTTPStatusCode: res.StatusCode,
  6381  		},
  6382  	}
  6383  	target := &ret
  6384  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6385  		return nil, err
  6386  	}
  6387  	return ret, nil
  6388  }
  6389  
  6390  type FoldersInsertCall struct {
  6391  	s          *Service
  6392  	bucket     string
  6393  	folder     *Folder
  6394  	urlParams_ gensupport.URLParams
  6395  	ctx_       context.Context
  6396  	header_    http.Header
  6397  }
  6398  
  6399  // Insert: Creates a new folder. Only applicable to buckets with hierarchical
  6400  // namespace enabled.
  6401  //
  6402  // - bucket: Name of the bucket in which the folder resides.
  6403  func (r *FoldersService) Insert(bucket string, folder *Folder) *FoldersInsertCall {
  6404  	c := &FoldersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6405  	c.bucket = bucket
  6406  	c.folder = folder
  6407  	return c
  6408  }
  6409  
  6410  // Recursive sets the optional parameter "recursive": If true, any parent
  6411  // folder which doesn’t exist will be created automatically.
  6412  func (c *FoldersInsertCall) Recursive(recursive bool) *FoldersInsertCall {
  6413  	c.urlParams_.Set("recursive", fmt.Sprint(recursive))
  6414  	return c
  6415  }
  6416  
  6417  // Fields allows partial responses to be retrieved. See
  6418  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6419  // details.
  6420  func (c *FoldersInsertCall) Fields(s ...googleapi.Field) *FoldersInsertCall {
  6421  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6422  	return c
  6423  }
  6424  
  6425  // Context sets the context to be used in this call's Do method.
  6426  func (c *FoldersInsertCall) Context(ctx context.Context) *FoldersInsertCall {
  6427  	c.ctx_ = ctx
  6428  	return c
  6429  }
  6430  
  6431  // Header returns a http.Header that can be modified by the caller to add
  6432  // headers to the request.
  6433  func (c *FoldersInsertCall) Header() http.Header {
  6434  	if c.header_ == nil {
  6435  		c.header_ = make(http.Header)
  6436  	}
  6437  	return c.header_
  6438  }
  6439  
  6440  func (c *FoldersInsertCall) doRequest(alt string) (*http.Response, error) {
  6441  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6442  	var body io.Reader = nil
  6443  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  6444  	if err != nil {
  6445  		return nil, err
  6446  	}
  6447  	c.urlParams_.Set("alt", alt)
  6448  	c.urlParams_.Set("prettyPrint", "false")
  6449  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders")
  6450  	urls += "?" + c.urlParams_.Encode()
  6451  	req, err := http.NewRequest("POST", urls, body)
  6452  	if err != nil {
  6453  		return nil, err
  6454  	}
  6455  	req.Header = reqHeaders
  6456  	googleapi.Expand(req.URL, map[string]string{
  6457  		"bucket": c.bucket,
  6458  	})
  6459  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6460  }
  6461  
  6462  // Do executes the "storage.folders.insert" call.
  6463  // Any non-2xx status code is an error. Response headers are in either
  6464  // *Folder.ServerResponse.Header or (if a response was returned at all) in
  6465  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6466  // whether the returned error was because http.StatusNotModified was returned.
  6467  func (c *FoldersInsertCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  6468  	gensupport.SetOptions(c.urlParams_, opts...)
  6469  	res, err := c.doRequest("json")
  6470  	if res != nil && res.StatusCode == http.StatusNotModified {
  6471  		if res.Body != nil {
  6472  			res.Body.Close()
  6473  		}
  6474  		return nil, gensupport.WrapError(&googleapi.Error{
  6475  			Code:   res.StatusCode,
  6476  			Header: res.Header,
  6477  		})
  6478  	}
  6479  	if err != nil {
  6480  		return nil, err
  6481  	}
  6482  	defer googleapi.CloseBody(res)
  6483  	if err := googleapi.CheckResponse(res); err != nil {
  6484  		return nil, gensupport.WrapError(err)
  6485  	}
  6486  	ret := &Folder{
  6487  		ServerResponse: googleapi.ServerResponse{
  6488  			Header:         res.Header,
  6489  			HTTPStatusCode: res.StatusCode,
  6490  		},
  6491  	}
  6492  	target := &ret
  6493  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6494  		return nil, err
  6495  	}
  6496  	return ret, nil
  6497  }
  6498  
  6499  type FoldersListCall struct {
  6500  	s            *Service
  6501  	bucket       string
  6502  	urlParams_   gensupport.URLParams
  6503  	ifNoneMatch_ string
  6504  	ctx_         context.Context
  6505  	header_      http.Header
  6506  }
  6507  
  6508  // List: Retrieves a list of folders matching the criteria. Only applicable to
  6509  // buckets with hierarchical namespace enabled.
  6510  //
  6511  // - bucket: Name of the bucket in which to look for folders.
  6512  func (r *FoldersService) List(bucket string) *FoldersListCall {
  6513  	c := &FoldersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6514  	c.bucket = bucket
  6515  	return c
  6516  }
  6517  
  6518  // Delimiter sets the optional parameter "delimiter": Returns results in a
  6519  // directory-like mode. The only supported value is '/'. If set, items will
  6520  // only contain folders that either exactly match the prefix, or are one level
  6521  // below the prefix.
  6522  func (c *FoldersListCall) Delimiter(delimiter string) *FoldersListCall {
  6523  	c.urlParams_.Set("delimiter", delimiter)
  6524  	return c
  6525  }
  6526  
  6527  // EndOffset sets the optional parameter "endOffset": Filter results to folders
  6528  // whose names are lexicographically before endOffset. If startOffset is also
  6529  // set, the folders listed will have names between startOffset (inclusive) and
  6530  // endOffset (exclusive).
  6531  func (c *FoldersListCall) EndOffset(endOffset string) *FoldersListCall {
  6532  	c.urlParams_.Set("endOffset", endOffset)
  6533  	return c
  6534  }
  6535  
  6536  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  6537  // return in a single page of responses.
  6538  func (c *FoldersListCall) PageSize(pageSize int64) *FoldersListCall {
  6539  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6540  	return c
  6541  }
  6542  
  6543  // PageToken sets the optional parameter "pageToken": A previously-returned
  6544  // page token representing part of the larger set of results to view.
  6545  func (c *FoldersListCall) PageToken(pageToken string) *FoldersListCall {
  6546  	c.urlParams_.Set("pageToken", pageToken)
  6547  	return c
  6548  }
  6549  
  6550  // Prefix sets the optional parameter "prefix": Filter results to folders whose
  6551  // paths begin with this prefix. If set, the value must either be an empty
  6552  // string or end with a '/'.
  6553  func (c *FoldersListCall) Prefix(prefix string) *FoldersListCall {
  6554  	c.urlParams_.Set("prefix", prefix)
  6555  	return c
  6556  }
  6557  
  6558  // StartOffset sets the optional parameter "startOffset": Filter results to
  6559  // folders whose names are lexicographically equal to or after startOffset. If
  6560  // endOffset is also set, the folders listed will have names between
  6561  // startOffset (inclusive) and endOffset (exclusive).
  6562  func (c *FoldersListCall) StartOffset(startOffset string) *FoldersListCall {
  6563  	c.urlParams_.Set("startOffset", startOffset)
  6564  	return c
  6565  }
  6566  
  6567  // Fields allows partial responses to be retrieved. See
  6568  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6569  // details.
  6570  func (c *FoldersListCall) Fields(s ...googleapi.Field) *FoldersListCall {
  6571  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6572  	return c
  6573  }
  6574  
  6575  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6576  // object's ETag matches the given value. This is useful for getting updates
  6577  // only after the object has changed since the last request.
  6578  func (c *FoldersListCall) IfNoneMatch(entityTag string) *FoldersListCall {
  6579  	c.ifNoneMatch_ = entityTag
  6580  	return c
  6581  }
  6582  
  6583  // Context sets the context to be used in this call's Do method.
  6584  func (c *FoldersListCall) Context(ctx context.Context) *FoldersListCall {
  6585  	c.ctx_ = ctx
  6586  	return c
  6587  }
  6588  
  6589  // Header returns a http.Header that can be modified by the caller to add
  6590  // headers to the request.
  6591  func (c *FoldersListCall) Header() http.Header {
  6592  	if c.header_ == nil {
  6593  		c.header_ = make(http.Header)
  6594  	}
  6595  	return c.header_
  6596  }
  6597  
  6598  func (c *FoldersListCall) doRequest(alt string) (*http.Response, error) {
  6599  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6600  	if c.ifNoneMatch_ != "" {
  6601  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6602  	}
  6603  	var body io.Reader = nil
  6604  	c.urlParams_.Set("alt", alt)
  6605  	c.urlParams_.Set("prettyPrint", "false")
  6606  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders")
  6607  	urls += "?" + c.urlParams_.Encode()
  6608  	req, err := http.NewRequest("GET", urls, body)
  6609  	if err != nil {
  6610  		return nil, err
  6611  	}
  6612  	req.Header = reqHeaders
  6613  	googleapi.Expand(req.URL, map[string]string{
  6614  		"bucket": c.bucket,
  6615  	})
  6616  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6617  }
  6618  
  6619  // Do executes the "storage.folders.list" call.
  6620  // Any non-2xx status code is an error. Response headers are in either
  6621  // *Folders.ServerResponse.Header or (if a response was returned at all) in
  6622  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6623  // whether the returned error was because http.StatusNotModified was returned.
  6624  func (c *FoldersListCall) Do(opts ...googleapi.CallOption) (*Folders, error) {
  6625  	gensupport.SetOptions(c.urlParams_, opts...)
  6626  	res, err := c.doRequest("json")
  6627  	if res != nil && res.StatusCode == http.StatusNotModified {
  6628  		if res.Body != nil {
  6629  			res.Body.Close()
  6630  		}
  6631  		return nil, gensupport.WrapError(&googleapi.Error{
  6632  			Code:   res.StatusCode,
  6633  			Header: res.Header,
  6634  		})
  6635  	}
  6636  	if err != nil {
  6637  		return nil, err
  6638  	}
  6639  	defer googleapi.CloseBody(res)
  6640  	if err := googleapi.CheckResponse(res); err != nil {
  6641  		return nil, gensupport.WrapError(err)
  6642  	}
  6643  	ret := &Folders{
  6644  		ServerResponse: googleapi.ServerResponse{
  6645  			Header:         res.Header,
  6646  			HTTPStatusCode: res.StatusCode,
  6647  		},
  6648  	}
  6649  	target := &ret
  6650  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6651  		return nil, err
  6652  	}
  6653  	return ret, nil
  6654  }
  6655  
  6656  // Pages invokes f for each page of results.
  6657  // A non-nil error returned from f will halt the iteration.
  6658  // The provided context supersedes any context provided to the Context method.
  6659  func (c *FoldersListCall) Pages(ctx context.Context, f func(*Folders) error) error {
  6660  	c.ctx_ = ctx
  6661  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6662  	for {
  6663  		x, err := c.Do()
  6664  		if err != nil {
  6665  			return err
  6666  		}
  6667  		if err := f(x); err != nil {
  6668  			return err
  6669  		}
  6670  		if x.NextPageToken == "" {
  6671  			return nil
  6672  		}
  6673  		c.PageToken(x.NextPageToken)
  6674  	}
  6675  }
  6676  
  6677  type FoldersRenameCall struct {
  6678  	s                 *Service
  6679  	bucket            string
  6680  	sourceFolder      string
  6681  	destinationFolder string
  6682  	urlParams_        gensupport.URLParams
  6683  	ctx_              context.Context
  6684  	header_           http.Header
  6685  }
  6686  
  6687  // Rename: Renames a source folder to a destination folder. Only applicable to
  6688  // buckets with hierarchical namespace enabled.
  6689  //
  6690  // - bucket: Name of the bucket in which the folders are in.
  6691  // - destinationFolder: Name of the destination folder.
  6692  // - sourceFolder: Name of the source folder.
  6693  func (r *FoldersService) Rename(bucket string, sourceFolder string, destinationFolder string) *FoldersRenameCall {
  6694  	c := &FoldersRenameCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6695  	c.bucket = bucket
  6696  	c.sourceFolder = sourceFolder
  6697  	c.destinationFolder = destinationFolder
  6698  	return c
  6699  }
  6700  
  6701  // IfSourceMetagenerationMatch sets the optional parameter
  6702  // "ifSourceMetagenerationMatch": Makes the operation conditional on whether
  6703  // the source object's current metageneration matches the given value.
  6704  func (c *FoldersRenameCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *FoldersRenameCall {
  6705  	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
  6706  	return c
  6707  }
  6708  
  6709  // IfSourceMetagenerationNotMatch sets the optional parameter
  6710  // "ifSourceMetagenerationNotMatch": Makes the operation conditional on whether
  6711  // the source object's current metageneration does not match the given value.
  6712  func (c *FoldersRenameCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *FoldersRenameCall {
  6713  	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
  6714  	return c
  6715  }
  6716  
  6717  // Fields allows partial responses to be retrieved. See
  6718  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6719  // details.
  6720  func (c *FoldersRenameCall) Fields(s ...googleapi.Field) *FoldersRenameCall {
  6721  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6722  	return c
  6723  }
  6724  
  6725  // Context sets the context to be used in this call's Do method.
  6726  func (c *FoldersRenameCall) Context(ctx context.Context) *FoldersRenameCall {
  6727  	c.ctx_ = ctx
  6728  	return c
  6729  }
  6730  
  6731  // Header returns a http.Header that can be modified by the caller to add
  6732  // headers to the request.
  6733  func (c *FoldersRenameCall) Header() http.Header {
  6734  	if c.header_ == nil {
  6735  		c.header_ = make(http.Header)
  6736  	}
  6737  	return c.header_
  6738  }
  6739  
  6740  func (c *FoldersRenameCall) doRequest(alt string) (*http.Response, error) {
  6741  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6742  	var body io.Reader = nil
  6743  	c.urlParams_.Set("alt", alt)
  6744  	c.urlParams_.Set("prettyPrint", "false")
  6745  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/folders/{sourceFolder}/renameTo/folders/{destinationFolder}")
  6746  	urls += "?" + c.urlParams_.Encode()
  6747  	req, err := http.NewRequest("POST", urls, body)
  6748  	if err != nil {
  6749  		return nil, err
  6750  	}
  6751  	req.Header = reqHeaders
  6752  	googleapi.Expand(req.URL, map[string]string{
  6753  		"bucket":            c.bucket,
  6754  		"sourceFolder":      c.sourceFolder,
  6755  		"destinationFolder": c.destinationFolder,
  6756  	})
  6757  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6758  }
  6759  
  6760  // Do executes the "storage.folders.rename" call.
  6761  // Any non-2xx status code is an error. Response headers are in either
  6762  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  6763  // returned at all) in error.(*googleapi.Error).Header. Use
  6764  // googleapi.IsNotModified to check whether the returned error was because
  6765  // http.StatusNotModified was returned.
  6766  func (c *FoldersRenameCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6767  	gensupport.SetOptions(c.urlParams_, opts...)
  6768  	res, err := c.doRequest("json")
  6769  	if res != nil && res.StatusCode == http.StatusNotModified {
  6770  		if res.Body != nil {
  6771  			res.Body.Close()
  6772  		}
  6773  		return nil, gensupport.WrapError(&googleapi.Error{
  6774  			Code:   res.StatusCode,
  6775  			Header: res.Header,
  6776  		})
  6777  	}
  6778  	if err != nil {
  6779  		return nil, err
  6780  	}
  6781  	defer googleapi.CloseBody(res)
  6782  	if err := googleapi.CheckResponse(res); err != nil {
  6783  		return nil, gensupport.WrapError(err)
  6784  	}
  6785  	ret := &GoogleLongrunningOperation{
  6786  		ServerResponse: googleapi.ServerResponse{
  6787  			Header:         res.Header,
  6788  			HTTPStatusCode: res.StatusCode,
  6789  		},
  6790  	}
  6791  	target := &ret
  6792  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6793  		return nil, err
  6794  	}
  6795  	return ret, nil
  6796  }
  6797  
  6798  type ManagedFoldersDeleteCall struct {
  6799  	s             *Service
  6800  	bucket        string
  6801  	managedFolder string
  6802  	urlParams_    gensupport.URLParams
  6803  	ctx_          context.Context
  6804  	header_       http.Header
  6805  }
  6806  
  6807  // Delete: Permanently deletes a managed folder.
  6808  //
  6809  // - bucket: Name of the bucket containing the managed folder.
  6810  // - managedFolder: The managed folder name/path.
  6811  func (r *ManagedFoldersService) Delete(bucket string, managedFolder string) *ManagedFoldersDeleteCall {
  6812  	c := &ManagedFoldersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6813  	c.bucket = bucket
  6814  	c.managedFolder = managedFolder
  6815  	return c
  6816  }
  6817  
  6818  // AllowNonEmpty sets the optional parameter "allowNonEmpty": Allows the
  6819  // deletion of a managed folder even if it is not empty. A managed folder is
  6820  // empty if there are no objects or managed folders that it applies to. Callers
  6821  // must have storage.managedFolders.setIamPolicy permission.
  6822  func (c *ManagedFoldersDeleteCall) AllowNonEmpty(allowNonEmpty bool) *ManagedFoldersDeleteCall {
  6823  	c.urlParams_.Set("allowNonEmpty", fmt.Sprint(allowNonEmpty))
  6824  	return c
  6825  }
  6826  
  6827  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  6828  // If set, only deletes the managed folder if its metageneration matches this
  6829  // value.
  6830  func (c *ManagedFoldersDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ManagedFoldersDeleteCall {
  6831  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6832  	return c
  6833  }
  6834  
  6835  // IfMetagenerationNotMatch sets the optional parameter
  6836  // "ifMetagenerationNotMatch": If set, only deletes the managed folder if its
  6837  // metageneration does not match this value.
  6838  func (c *ManagedFoldersDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ManagedFoldersDeleteCall {
  6839  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  6840  	return c
  6841  }
  6842  
  6843  // Fields allows partial responses to be retrieved. See
  6844  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6845  // details.
  6846  func (c *ManagedFoldersDeleteCall) Fields(s ...googleapi.Field) *ManagedFoldersDeleteCall {
  6847  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6848  	return c
  6849  }
  6850  
  6851  // Context sets the context to be used in this call's Do method.
  6852  func (c *ManagedFoldersDeleteCall) Context(ctx context.Context) *ManagedFoldersDeleteCall {
  6853  	c.ctx_ = ctx
  6854  	return c
  6855  }
  6856  
  6857  // Header returns a http.Header that can be modified by the caller to add
  6858  // headers to the request.
  6859  func (c *ManagedFoldersDeleteCall) Header() http.Header {
  6860  	if c.header_ == nil {
  6861  		c.header_ = make(http.Header)
  6862  	}
  6863  	return c.header_
  6864  }
  6865  
  6866  func (c *ManagedFoldersDeleteCall) doRequest(alt string) (*http.Response, error) {
  6867  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6868  	var body io.Reader = nil
  6869  	c.urlParams_.Set("alt", alt)
  6870  	c.urlParams_.Set("prettyPrint", "false")
  6871  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}")
  6872  	urls += "?" + c.urlParams_.Encode()
  6873  	req, err := http.NewRequest("DELETE", urls, body)
  6874  	if err != nil {
  6875  		return nil, err
  6876  	}
  6877  	req.Header = reqHeaders
  6878  	googleapi.Expand(req.URL, map[string]string{
  6879  		"bucket":        c.bucket,
  6880  		"managedFolder": c.managedFolder,
  6881  	})
  6882  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6883  }
  6884  
  6885  // Do executes the "storage.managedFolders.delete" call.
  6886  func (c *ManagedFoldersDeleteCall) Do(opts ...googleapi.CallOption) error {
  6887  	gensupport.SetOptions(c.urlParams_, opts...)
  6888  	res, err := c.doRequest("json")
  6889  	if err != nil {
  6890  		return err
  6891  	}
  6892  	defer googleapi.CloseBody(res)
  6893  	if err := googleapi.CheckResponse(res); err != nil {
  6894  		return gensupport.WrapError(err)
  6895  	}
  6896  	return nil
  6897  }
  6898  
  6899  type ManagedFoldersGetCall struct {
  6900  	s             *Service
  6901  	bucket        string
  6902  	managedFolder string
  6903  	urlParams_    gensupport.URLParams
  6904  	ifNoneMatch_  string
  6905  	ctx_          context.Context
  6906  	header_       http.Header
  6907  }
  6908  
  6909  // Get: Returns metadata of the specified managed folder.
  6910  //
  6911  // - bucket: Name of the bucket containing the managed folder.
  6912  // - managedFolder: The managed folder name/path.
  6913  func (r *ManagedFoldersService) Get(bucket string, managedFolder string) *ManagedFoldersGetCall {
  6914  	c := &ManagedFoldersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6915  	c.bucket = bucket
  6916  	c.managedFolder = managedFolder
  6917  	return c
  6918  }
  6919  
  6920  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  6921  // Makes the return of the managed folder metadata conditional on whether the
  6922  // managed folder's current metageneration matches the given value.
  6923  func (c *ManagedFoldersGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ManagedFoldersGetCall {
  6924  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6925  	return c
  6926  }
  6927  
  6928  // IfMetagenerationNotMatch sets the optional parameter
  6929  // "ifMetagenerationNotMatch": Makes the return of the managed folder metadata
  6930  // conditional on whether the managed folder's current metageneration does not
  6931  // match the given value.
  6932  func (c *ManagedFoldersGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ManagedFoldersGetCall {
  6933  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  6934  	return c
  6935  }
  6936  
  6937  // Fields allows partial responses to be retrieved. See
  6938  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6939  // details.
  6940  func (c *ManagedFoldersGetCall) Fields(s ...googleapi.Field) *ManagedFoldersGetCall {
  6941  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6942  	return c
  6943  }
  6944  
  6945  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6946  // object's ETag matches the given value. This is useful for getting updates
  6947  // only after the object has changed since the last request.
  6948  func (c *ManagedFoldersGetCall) IfNoneMatch(entityTag string) *ManagedFoldersGetCall {
  6949  	c.ifNoneMatch_ = entityTag
  6950  	return c
  6951  }
  6952  
  6953  // Context sets the context to be used in this call's Do method.
  6954  func (c *ManagedFoldersGetCall) Context(ctx context.Context) *ManagedFoldersGetCall {
  6955  	c.ctx_ = ctx
  6956  	return c
  6957  }
  6958  
  6959  // Header returns a http.Header that can be modified by the caller to add
  6960  // headers to the request.
  6961  func (c *ManagedFoldersGetCall) Header() http.Header {
  6962  	if c.header_ == nil {
  6963  		c.header_ = make(http.Header)
  6964  	}
  6965  	return c.header_
  6966  }
  6967  
  6968  func (c *ManagedFoldersGetCall) doRequest(alt string) (*http.Response, error) {
  6969  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6970  	if c.ifNoneMatch_ != "" {
  6971  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6972  	}
  6973  	var body io.Reader = nil
  6974  	c.urlParams_.Set("alt", alt)
  6975  	c.urlParams_.Set("prettyPrint", "false")
  6976  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}")
  6977  	urls += "?" + c.urlParams_.Encode()
  6978  	req, err := http.NewRequest("GET", urls, body)
  6979  	if err != nil {
  6980  		return nil, err
  6981  	}
  6982  	req.Header = reqHeaders
  6983  	googleapi.Expand(req.URL, map[string]string{
  6984  		"bucket":        c.bucket,
  6985  		"managedFolder": c.managedFolder,
  6986  	})
  6987  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6988  }
  6989  
  6990  // Do executes the "storage.managedFolders.get" call.
  6991  // Any non-2xx status code is an error. Response headers are in either
  6992  // *ManagedFolder.ServerResponse.Header or (if a response was returned at all)
  6993  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6994  // whether the returned error was because http.StatusNotModified was returned.
  6995  func (c *ManagedFoldersGetCall) Do(opts ...googleapi.CallOption) (*ManagedFolder, error) {
  6996  	gensupport.SetOptions(c.urlParams_, opts...)
  6997  	res, err := c.doRequest("json")
  6998  	if res != nil && res.StatusCode == http.StatusNotModified {
  6999  		if res.Body != nil {
  7000  			res.Body.Close()
  7001  		}
  7002  		return nil, gensupport.WrapError(&googleapi.Error{
  7003  			Code:   res.StatusCode,
  7004  			Header: res.Header,
  7005  		})
  7006  	}
  7007  	if err != nil {
  7008  		return nil, err
  7009  	}
  7010  	defer googleapi.CloseBody(res)
  7011  	if err := googleapi.CheckResponse(res); err != nil {
  7012  		return nil, gensupport.WrapError(err)
  7013  	}
  7014  	ret := &ManagedFolder{
  7015  		ServerResponse: googleapi.ServerResponse{
  7016  			Header:         res.Header,
  7017  			HTTPStatusCode: res.StatusCode,
  7018  		},
  7019  	}
  7020  	target := &ret
  7021  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7022  		return nil, err
  7023  	}
  7024  	return ret, nil
  7025  }
  7026  
  7027  type ManagedFoldersGetIamPolicyCall struct {
  7028  	s             *Service
  7029  	bucket        string
  7030  	managedFolder string
  7031  	urlParams_    gensupport.URLParams
  7032  	ifNoneMatch_  string
  7033  	ctx_          context.Context
  7034  	header_       http.Header
  7035  }
  7036  
  7037  // GetIamPolicy: Returns an IAM policy for the specified managed folder.
  7038  //
  7039  // - bucket: Name of the bucket containing the managed folder.
  7040  // - managedFolder: The managed folder name/path.
  7041  func (r *ManagedFoldersService) GetIamPolicy(bucket string, managedFolder string) *ManagedFoldersGetIamPolicyCall {
  7042  	c := &ManagedFoldersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7043  	c.bucket = bucket
  7044  	c.managedFolder = managedFolder
  7045  	return c
  7046  }
  7047  
  7048  // OptionsRequestedPolicyVersion sets the optional parameter
  7049  // "optionsRequestedPolicyVersion": The IAM policy format version to be
  7050  // returned. If the optionsRequestedPolicyVersion is for an older version that
  7051  // doesn't support part of the requested IAM policy, the request fails.
  7052  func (c *ManagedFoldersGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ManagedFoldersGetIamPolicyCall {
  7053  	c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  7054  	return c
  7055  }
  7056  
  7057  // UserProject sets the optional parameter "userProject": The project to be
  7058  // billed for this request. Required for Requester Pays buckets.
  7059  func (c *ManagedFoldersGetIamPolicyCall) UserProject(userProject string) *ManagedFoldersGetIamPolicyCall {
  7060  	c.urlParams_.Set("userProject", userProject)
  7061  	return c
  7062  }
  7063  
  7064  // Fields allows partial responses to be retrieved. See
  7065  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7066  // details.
  7067  func (c *ManagedFoldersGetIamPolicyCall) Fields(s ...googleapi.Field) *ManagedFoldersGetIamPolicyCall {
  7068  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7069  	return c
  7070  }
  7071  
  7072  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7073  // object's ETag matches the given value. This is useful for getting updates
  7074  // only after the object has changed since the last request.
  7075  func (c *ManagedFoldersGetIamPolicyCall) IfNoneMatch(entityTag string) *ManagedFoldersGetIamPolicyCall {
  7076  	c.ifNoneMatch_ = entityTag
  7077  	return c
  7078  }
  7079  
  7080  // Context sets the context to be used in this call's Do method.
  7081  func (c *ManagedFoldersGetIamPolicyCall) Context(ctx context.Context) *ManagedFoldersGetIamPolicyCall {
  7082  	c.ctx_ = ctx
  7083  	return c
  7084  }
  7085  
  7086  // Header returns a http.Header that can be modified by the caller to add
  7087  // headers to the request.
  7088  func (c *ManagedFoldersGetIamPolicyCall) Header() http.Header {
  7089  	if c.header_ == nil {
  7090  		c.header_ = make(http.Header)
  7091  	}
  7092  	return c.header_
  7093  }
  7094  
  7095  func (c *ManagedFoldersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7096  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7097  	if c.ifNoneMatch_ != "" {
  7098  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7099  	}
  7100  	var body io.Reader = nil
  7101  	c.urlParams_.Set("alt", alt)
  7102  	c.urlParams_.Set("prettyPrint", "false")
  7103  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}/iam")
  7104  	urls += "?" + c.urlParams_.Encode()
  7105  	req, err := http.NewRequest("GET", urls, body)
  7106  	if err != nil {
  7107  		return nil, err
  7108  	}
  7109  	req.Header = reqHeaders
  7110  	googleapi.Expand(req.URL, map[string]string{
  7111  		"bucket":        c.bucket,
  7112  		"managedFolder": c.managedFolder,
  7113  	})
  7114  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7115  }
  7116  
  7117  // Do executes the "storage.managedFolders.getIamPolicy" call.
  7118  // Any non-2xx status code is an error. Response headers are in either
  7119  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  7120  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7121  // whether the returned error was because http.StatusNotModified was returned.
  7122  func (c *ManagedFoldersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7123  	gensupport.SetOptions(c.urlParams_, opts...)
  7124  	res, err := c.doRequest("json")
  7125  	if res != nil && res.StatusCode == http.StatusNotModified {
  7126  		if res.Body != nil {
  7127  			res.Body.Close()
  7128  		}
  7129  		return nil, gensupport.WrapError(&googleapi.Error{
  7130  			Code:   res.StatusCode,
  7131  			Header: res.Header,
  7132  		})
  7133  	}
  7134  	if err != nil {
  7135  		return nil, err
  7136  	}
  7137  	defer googleapi.CloseBody(res)
  7138  	if err := googleapi.CheckResponse(res); err != nil {
  7139  		return nil, gensupport.WrapError(err)
  7140  	}
  7141  	ret := &Policy{
  7142  		ServerResponse: googleapi.ServerResponse{
  7143  			Header:         res.Header,
  7144  			HTTPStatusCode: res.StatusCode,
  7145  		},
  7146  	}
  7147  	target := &ret
  7148  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7149  		return nil, err
  7150  	}
  7151  	return ret, nil
  7152  }
  7153  
  7154  type ManagedFoldersInsertCall struct {
  7155  	s             *Service
  7156  	bucket        string
  7157  	managedfolder *ManagedFolder
  7158  	urlParams_    gensupport.URLParams
  7159  	ctx_          context.Context
  7160  	header_       http.Header
  7161  }
  7162  
  7163  // Insert: Creates a new managed folder.
  7164  //
  7165  // - bucket: Name of the bucket containing the managed folder.
  7166  func (r *ManagedFoldersService) Insert(bucket string, managedfolder *ManagedFolder) *ManagedFoldersInsertCall {
  7167  	c := &ManagedFoldersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7168  	c.bucket = bucket
  7169  	c.managedfolder = managedfolder
  7170  	return c
  7171  }
  7172  
  7173  // Fields allows partial responses to be retrieved. See
  7174  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7175  // details.
  7176  func (c *ManagedFoldersInsertCall) Fields(s ...googleapi.Field) *ManagedFoldersInsertCall {
  7177  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7178  	return c
  7179  }
  7180  
  7181  // Context sets the context to be used in this call's Do method.
  7182  func (c *ManagedFoldersInsertCall) Context(ctx context.Context) *ManagedFoldersInsertCall {
  7183  	c.ctx_ = ctx
  7184  	return c
  7185  }
  7186  
  7187  // Header returns a http.Header that can be modified by the caller to add
  7188  // headers to the request.
  7189  func (c *ManagedFoldersInsertCall) Header() http.Header {
  7190  	if c.header_ == nil {
  7191  		c.header_ = make(http.Header)
  7192  	}
  7193  	return c.header_
  7194  }
  7195  
  7196  func (c *ManagedFoldersInsertCall) doRequest(alt string) (*http.Response, error) {
  7197  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7198  	var body io.Reader = nil
  7199  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedfolder)
  7200  	if err != nil {
  7201  		return nil, err
  7202  	}
  7203  	c.urlParams_.Set("alt", alt)
  7204  	c.urlParams_.Set("prettyPrint", "false")
  7205  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders")
  7206  	urls += "?" + c.urlParams_.Encode()
  7207  	req, err := http.NewRequest("POST", urls, body)
  7208  	if err != nil {
  7209  		return nil, err
  7210  	}
  7211  	req.Header = reqHeaders
  7212  	googleapi.Expand(req.URL, map[string]string{
  7213  		"bucket": c.bucket,
  7214  	})
  7215  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7216  }
  7217  
  7218  // Do executes the "storage.managedFolders.insert" call.
  7219  // Any non-2xx status code is an error. Response headers are in either
  7220  // *ManagedFolder.ServerResponse.Header or (if a response was returned at all)
  7221  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7222  // whether the returned error was because http.StatusNotModified was returned.
  7223  func (c *ManagedFoldersInsertCall) Do(opts ...googleapi.CallOption) (*ManagedFolder, error) {
  7224  	gensupport.SetOptions(c.urlParams_, opts...)
  7225  	res, err := c.doRequest("json")
  7226  	if res != nil && res.StatusCode == http.StatusNotModified {
  7227  		if res.Body != nil {
  7228  			res.Body.Close()
  7229  		}
  7230  		return nil, gensupport.WrapError(&googleapi.Error{
  7231  			Code:   res.StatusCode,
  7232  			Header: res.Header,
  7233  		})
  7234  	}
  7235  	if err != nil {
  7236  		return nil, err
  7237  	}
  7238  	defer googleapi.CloseBody(res)
  7239  	if err := googleapi.CheckResponse(res); err != nil {
  7240  		return nil, gensupport.WrapError(err)
  7241  	}
  7242  	ret := &ManagedFolder{
  7243  		ServerResponse: googleapi.ServerResponse{
  7244  			Header:         res.Header,
  7245  			HTTPStatusCode: res.StatusCode,
  7246  		},
  7247  	}
  7248  	target := &ret
  7249  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7250  		return nil, err
  7251  	}
  7252  	return ret, nil
  7253  }
  7254  
  7255  type ManagedFoldersListCall struct {
  7256  	s            *Service
  7257  	bucket       string
  7258  	urlParams_   gensupport.URLParams
  7259  	ifNoneMatch_ string
  7260  	ctx_         context.Context
  7261  	header_      http.Header
  7262  }
  7263  
  7264  // List: Lists managed folders in the given bucket.
  7265  //
  7266  // - bucket: Name of the bucket containing the managed folder.
  7267  func (r *ManagedFoldersService) List(bucket string) *ManagedFoldersListCall {
  7268  	c := &ManagedFoldersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7269  	c.bucket = bucket
  7270  	return c
  7271  }
  7272  
  7273  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  7274  // return in a single page of responses.
  7275  func (c *ManagedFoldersListCall) PageSize(pageSize int64) *ManagedFoldersListCall {
  7276  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7277  	return c
  7278  }
  7279  
  7280  // PageToken sets the optional parameter "pageToken": A previously-returned
  7281  // page token representing part of the larger set of results to view.
  7282  func (c *ManagedFoldersListCall) PageToken(pageToken string) *ManagedFoldersListCall {
  7283  	c.urlParams_.Set("pageToken", pageToken)
  7284  	return c
  7285  }
  7286  
  7287  // Prefix sets the optional parameter "prefix": The managed folder name/path
  7288  // prefix to filter the output list of results.
  7289  func (c *ManagedFoldersListCall) Prefix(prefix string) *ManagedFoldersListCall {
  7290  	c.urlParams_.Set("prefix", prefix)
  7291  	return c
  7292  }
  7293  
  7294  // Fields allows partial responses to be retrieved. See
  7295  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7296  // details.
  7297  func (c *ManagedFoldersListCall) Fields(s ...googleapi.Field) *ManagedFoldersListCall {
  7298  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7299  	return c
  7300  }
  7301  
  7302  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7303  // object's ETag matches the given value. This is useful for getting updates
  7304  // only after the object has changed since the last request.
  7305  func (c *ManagedFoldersListCall) IfNoneMatch(entityTag string) *ManagedFoldersListCall {
  7306  	c.ifNoneMatch_ = entityTag
  7307  	return c
  7308  }
  7309  
  7310  // Context sets the context to be used in this call's Do method.
  7311  func (c *ManagedFoldersListCall) Context(ctx context.Context) *ManagedFoldersListCall {
  7312  	c.ctx_ = ctx
  7313  	return c
  7314  }
  7315  
  7316  // Header returns a http.Header that can be modified by the caller to add
  7317  // headers to the request.
  7318  func (c *ManagedFoldersListCall) Header() http.Header {
  7319  	if c.header_ == nil {
  7320  		c.header_ = make(http.Header)
  7321  	}
  7322  	return c.header_
  7323  }
  7324  
  7325  func (c *ManagedFoldersListCall) doRequest(alt string) (*http.Response, error) {
  7326  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7327  	if c.ifNoneMatch_ != "" {
  7328  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7329  	}
  7330  	var body io.Reader = nil
  7331  	c.urlParams_.Set("alt", alt)
  7332  	c.urlParams_.Set("prettyPrint", "false")
  7333  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders")
  7334  	urls += "?" + c.urlParams_.Encode()
  7335  	req, err := http.NewRequest("GET", urls, body)
  7336  	if err != nil {
  7337  		return nil, err
  7338  	}
  7339  	req.Header = reqHeaders
  7340  	googleapi.Expand(req.URL, map[string]string{
  7341  		"bucket": c.bucket,
  7342  	})
  7343  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7344  }
  7345  
  7346  // Do executes the "storage.managedFolders.list" call.
  7347  // Any non-2xx status code is an error. Response headers are in either
  7348  // *ManagedFolders.ServerResponse.Header or (if a response was returned at all)
  7349  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7350  // whether the returned error was because http.StatusNotModified was returned.
  7351  func (c *ManagedFoldersListCall) Do(opts ...googleapi.CallOption) (*ManagedFolders, error) {
  7352  	gensupport.SetOptions(c.urlParams_, opts...)
  7353  	res, err := c.doRequest("json")
  7354  	if res != nil && res.StatusCode == http.StatusNotModified {
  7355  		if res.Body != nil {
  7356  			res.Body.Close()
  7357  		}
  7358  		return nil, gensupport.WrapError(&googleapi.Error{
  7359  			Code:   res.StatusCode,
  7360  			Header: res.Header,
  7361  		})
  7362  	}
  7363  	if err != nil {
  7364  		return nil, err
  7365  	}
  7366  	defer googleapi.CloseBody(res)
  7367  	if err := googleapi.CheckResponse(res); err != nil {
  7368  		return nil, gensupport.WrapError(err)
  7369  	}
  7370  	ret := &ManagedFolders{
  7371  		ServerResponse: googleapi.ServerResponse{
  7372  			Header:         res.Header,
  7373  			HTTPStatusCode: res.StatusCode,
  7374  		},
  7375  	}
  7376  	target := &ret
  7377  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7378  		return nil, err
  7379  	}
  7380  	return ret, nil
  7381  }
  7382  
  7383  // Pages invokes f for each page of results.
  7384  // A non-nil error returned from f will halt the iteration.
  7385  // The provided context supersedes any context provided to the Context method.
  7386  func (c *ManagedFoldersListCall) Pages(ctx context.Context, f func(*ManagedFolders) error) error {
  7387  	c.ctx_ = ctx
  7388  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7389  	for {
  7390  		x, err := c.Do()
  7391  		if err != nil {
  7392  			return err
  7393  		}
  7394  		if err := f(x); err != nil {
  7395  			return err
  7396  		}
  7397  		if x.NextPageToken == "" {
  7398  			return nil
  7399  		}
  7400  		c.PageToken(x.NextPageToken)
  7401  	}
  7402  }
  7403  
  7404  type ManagedFoldersSetIamPolicyCall struct {
  7405  	s             *Service
  7406  	bucket        string
  7407  	managedFolder string
  7408  	policy        *Policy
  7409  	urlParams_    gensupport.URLParams
  7410  	ctx_          context.Context
  7411  	header_       http.Header
  7412  }
  7413  
  7414  // SetIamPolicy: Updates an IAM policy for the specified managed folder.
  7415  //
  7416  // - bucket: Name of the bucket containing the managed folder.
  7417  // - managedFolder: The managed folder name/path.
  7418  func (r *ManagedFoldersService) SetIamPolicy(bucket string, managedFolder string, policy *Policy) *ManagedFoldersSetIamPolicyCall {
  7419  	c := &ManagedFoldersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7420  	c.bucket = bucket
  7421  	c.managedFolder = managedFolder
  7422  	c.policy = policy
  7423  	return c
  7424  }
  7425  
  7426  // UserProject sets the optional parameter "userProject": The project to be
  7427  // billed for this request. Required for Requester Pays buckets.
  7428  func (c *ManagedFoldersSetIamPolicyCall) UserProject(userProject string) *ManagedFoldersSetIamPolicyCall {
  7429  	c.urlParams_.Set("userProject", userProject)
  7430  	return c
  7431  }
  7432  
  7433  // Fields allows partial responses to be retrieved. See
  7434  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7435  // details.
  7436  func (c *ManagedFoldersSetIamPolicyCall) Fields(s ...googleapi.Field) *ManagedFoldersSetIamPolicyCall {
  7437  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7438  	return c
  7439  }
  7440  
  7441  // Context sets the context to be used in this call's Do method.
  7442  func (c *ManagedFoldersSetIamPolicyCall) Context(ctx context.Context) *ManagedFoldersSetIamPolicyCall {
  7443  	c.ctx_ = ctx
  7444  	return c
  7445  }
  7446  
  7447  // Header returns a http.Header that can be modified by the caller to add
  7448  // headers to the request.
  7449  func (c *ManagedFoldersSetIamPolicyCall) Header() http.Header {
  7450  	if c.header_ == nil {
  7451  		c.header_ = make(http.Header)
  7452  	}
  7453  	return c.header_
  7454  }
  7455  
  7456  func (c *ManagedFoldersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7457  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7458  	var body io.Reader = nil
  7459  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
  7460  	if err != nil {
  7461  		return nil, err
  7462  	}
  7463  	c.urlParams_.Set("alt", alt)
  7464  	c.urlParams_.Set("prettyPrint", "false")
  7465  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}/iam")
  7466  	urls += "?" + c.urlParams_.Encode()
  7467  	req, err := http.NewRequest("PUT", urls, body)
  7468  	if err != nil {
  7469  		return nil, err
  7470  	}
  7471  	req.Header = reqHeaders
  7472  	googleapi.Expand(req.URL, map[string]string{
  7473  		"bucket":        c.bucket,
  7474  		"managedFolder": c.managedFolder,
  7475  	})
  7476  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7477  }
  7478  
  7479  // Do executes the "storage.managedFolders.setIamPolicy" call.
  7480  // Any non-2xx status code is an error. Response headers are in either
  7481  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  7482  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7483  // whether the returned error was because http.StatusNotModified was returned.
  7484  func (c *ManagedFoldersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7485  	gensupport.SetOptions(c.urlParams_, opts...)
  7486  	res, err := c.doRequest("json")
  7487  	if res != nil && res.StatusCode == http.StatusNotModified {
  7488  		if res.Body != nil {
  7489  			res.Body.Close()
  7490  		}
  7491  		return nil, gensupport.WrapError(&googleapi.Error{
  7492  			Code:   res.StatusCode,
  7493  			Header: res.Header,
  7494  		})
  7495  	}
  7496  	if err != nil {
  7497  		return nil, err
  7498  	}
  7499  	defer googleapi.CloseBody(res)
  7500  	if err := googleapi.CheckResponse(res); err != nil {
  7501  		return nil, gensupport.WrapError(err)
  7502  	}
  7503  	ret := &Policy{
  7504  		ServerResponse: googleapi.ServerResponse{
  7505  			Header:         res.Header,
  7506  			HTTPStatusCode: res.StatusCode,
  7507  		},
  7508  	}
  7509  	target := &ret
  7510  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7511  		return nil, err
  7512  	}
  7513  	return ret, nil
  7514  }
  7515  
  7516  type ManagedFoldersTestIamPermissionsCall struct {
  7517  	s             *Service
  7518  	bucket        string
  7519  	managedFolder string
  7520  	urlParams_    gensupport.URLParams
  7521  	ifNoneMatch_  string
  7522  	ctx_          context.Context
  7523  	header_       http.Header
  7524  }
  7525  
  7526  // TestIamPermissions: Tests a set of permissions on the given managed folder
  7527  // to see which, if any, are held by the caller.
  7528  //
  7529  // - bucket: Name of the bucket containing the managed folder.
  7530  // - managedFolder: The managed folder name/path.
  7531  // - permissions: Permissions to test.
  7532  func (r *ManagedFoldersService) TestIamPermissions(bucket string, managedFolder string, permissions []string) *ManagedFoldersTestIamPermissionsCall {
  7533  	c := &ManagedFoldersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7534  	c.bucket = bucket
  7535  	c.managedFolder = managedFolder
  7536  	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
  7537  	return c
  7538  }
  7539  
  7540  // UserProject sets the optional parameter "userProject": The project to be
  7541  // billed for this request. Required for Requester Pays buckets.
  7542  func (c *ManagedFoldersTestIamPermissionsCall) UserProject(userProject string) *ManagedFoldersTestIamPermissionsCall {
  7543  	c.urlParams_.Set("userProject", userProject)
  7544  	return c
  7545  }
  7546  
  7547  // Fields allows partial responses to be retrieved. See
  7548  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7549  // details.
  7550  func (c *ManagedFoldersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ManagedFoldersTestIamPermissionsCall {
  7551  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7552  	return c
  7553  }
  7554  
  7555  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7556  // object's ETag matches the given value. This is useful for getting updates
  7557  // only after the object has changed since the last request.
  7558  func (c *ManagedFoldersTestIamPermissionsCall) IfNoneMatch(entityTag string) *ManagedFoldersTestIamPermissionsCall {
  7559  	c.ifNoneMatch_ = entityTag
  7560  	return c
  7561  }
  7562  
  7563  // Context sets the context to be used in this call's Do method.
  7564  func (c *ManagedFoldersTestIamPermissionsCall) Context(ctx context.Context) *ManagedFoldersTestIamPermissionsCall {
  7565  	c.ctx_ = ctx
  7566  	return c
  7567  }
  7568  
  7569  // Header returns a http.Header that can be modified by the caller to add
  7570  // headers to the request.
  7571  func (c *ManagedFoldersTestIamPermissionsCall) Header() http.Header {
  7572  	if c.header_ == nil {
  7573  		c.header_ = make(http.Header)
  7574  	}
  7575  	return c.header_
  7576  }
  7577  
  7578  func (c *ManagedFoldersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  7579  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7580  	if c.ifNoneMatch_ != "" {
  7581  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7582  	}
  7583  	var body io.Reader = nil
  7584  	c.urlParams_.Set("alt", alt)
  7585  	c.urlParams_.Set("prettyPrint", "false")
  7586  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions")
  7587  	urls += "?" + c.urlParams_.Encode()
  7588  	req, err := http.NewRequest("GET", urls, body)
  7589  	if err != nil {
  7590  		return nil, err
  7591  	}
  7592  	req.Header = reqHeaders
  7593  	googleapi.Expand(req.URL, map[string]string{
  7594  		"bucket":        c.bucket,
  7595  		"managedFolder": c.managedFolder,
  7596  	})
  7597  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7598  }
  7599  
  7600  // Do executes the "storage.managedFolders.testIamPermissions" call.
  7601  // Any non-2xx status code is an error. Response headers are in either
  7602  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  7603  // returned at all) in error.(*googleapi.Error).Header. Use
  7604  // googleapi.IsNotModified to check whether the returned error was because
  7605  // http.StatusNotModified was returned.
  7606  func (c *ManagedFoldersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  7607  	gensupport.SetOptions(c.urlParams_, opts...)
  7608  	res, err := c.doRequest("json")
  7609  	if res != nil && res.StatusCode == http.StatusNotModified {
  7610  		if res.Body != nil {
  7611  			res.Body.Close()
  7612  		}
  7613  		return nil, gensupport.WrapError(&googleapi.Error{
  7614  			Code:   res.StatusCode,
  7615  			Header: res.Header,
  7616  		})
  7617  	}
  7618  	if err != nil {
  7619  		return nil, err
  7620  	}
  7621  	defer googleapi.CloseBody(res)
  7622  	if err := googleapi.CheckResponse(res); err != nil {
  7623  		return nil, gensupport.WrapError(err)
  7624  	}
  7625  	ret := &TestIamPermissionsResponse{
  7626  		ServerResponse: googleapi.ServerResponse{
  7627  			Header:         res.Header,
  7628  			HTTPStatusCode: res.StatusCode,
  7629  		},
  7630  	}
  7631  	target := &ret
  7632  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7633  		return nil, err
  7634  	}
  7635  	return ret, nil
  7636  }
  7637  
  7638  type NotificationsDeleteCall struct {
  7639  	s            *Service
  7640  	bucket       string
  7641  	notification string
  7642  	urlParams_   gensupport.URLParams
  7643  	ctx_         context.Context
  7644  	header_      http.Header
  7645  }
  7646  
  7647  // Delete: Permanently deletes a notification subscription.
  7648  //
  7649  // - bucket: The parent bucket of the notification.
  7650  // - notification: ID of the notification to delete.
  7651  func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
  7652  	c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7653  	c.bucket = bucket
  7654  	c.notification = notification
  7655  	return c
  7656  }
  7657  
  7658  // UserProject sets the optional parameter "userProject": The project to be
  7659  // billed for this request. Required for Requester Pays buckets.
  7660  func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
  7661  	c.urlParams_.Set("userProject", userProject)
  7662  	return c
  7663  }
  7664  
  7665  // Fields allows partial responses to be retrieved. See
  7666  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7667  // details.
  7668  func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
  7669  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7670  	return c
  7671  }
  7672  
  7673  // Context sets the context to be used in this call's Do method.
  7674  func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
  7675  	c.ctx_ = ctx
  7676  	return c
  7677  }
  7678  
  7679  // Header returns a http.Header that can be modified by the caller to add
  7680  // headers to the request.
  7681  func (c *NotificationsDeleteCall) Header() http.Header {
  7682  	if c.header_ == nil {
  7683  		c.header_ = make(http.Header)
  7684  	}
  7685  	return c.header_
  7686  }
  7687  
  7688  func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7689  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7690  	var body io.Reader = nil
  7691  	c.urlParams_.Set("alt", alt)
  7692  	c.urlParams_.Set("prettyPrint", "false")
  7693  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
  7694  	urls += "?" + c.urlParams_.Encode()
  7695  	req, err := http.NewRequest("DELETE", urls, body)
  7696  	if err != nil {
  7697  		return nil, err
  7698  	}
  7699  	req.Header = reqHeaders
  7700  	googleapi.Expand(req.URL, map[string]string{
  7701  		"bucket":       c.bucket,
  7702  		"notification": c.notification,
  7703  	})
  7704  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7705  }
  7706  
  7707  // Do executes the "storage.notifications.delete" call.
  7708  func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7709  	gensupport.SetOptions(c.urlParams_, opts...)
  7710  	res, err := c.doRequest("json")
  7711  	if err != nil {
  7712  		return err
  7713  	}
  7714  	defer googleapi.CloseBody(res)
  7715  	if err := googleapi.CheckResponse(res); err != nil {
  7716  		return gensupport.WrapError(err)
  7717  	}
  7718  	return nil
  7719  }
  7720  
  7721  type NotificationsGetCall struct {
  7722  	s            *Service
  7723  	bucket       string
  7724  	notification string
  7725  	urlParams_   gensupport.URLParams
  7726  	ifNoneMatch_ string
  7727  	ctx_         context.Context
  7728  	header_      http.Header
  7729  }
  7730  
  7731  // Get: View a notification configuration.
  7732  //
  7733  // - bucket: The parent bucket of the notification.
  7734  // - notification: Notification ID.
  7735  func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
  7736  	c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7737  	c.bucket = bucket
  7738  	c.notification = notification
  7739  	return c
  7740  }
  7741  
  7742  // UserProject sets the optional parameter "userProject": The project to be
  7743  // billed for this request. Required for Requester Pays buckets.
  7744  func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
  7745  	c.urlParams_.Set("userProject", userProject)
  7746  	return c
  7747  }
  7748  
  7749  // Fields allows partial responses to be retrieved. See
  7750  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7751  // details.
  7752  func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
  7753  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7754  	return c
  7755  }
  7756  
  7757  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7758  // object's ETag matches the given value. This is useful for getting updates
  7759  // only after the object has changed since the last request.
  7760  func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
  7761  	c.ifNoneMatch_ = entityTag
  7762  	return c
  7763  }
  7764  
  7765  // Context sets the context to be used in this call's Do method.
  7766  func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
  7767  	c.ctx_ = ctx
  7768  	return c
  7769  }
  7770  
  7771  // Header returns a http.Header that can be modified by the caller to add
  7772  // headers to the request.
  7773  func (c *NotificationsGetCall) Header() http.Header {
  7774  	if c.header_ == nil {
  7775  		c.header_ = make(http.Header)
  7776  	}
  7777  	return c.header_
  7778  }
  7779  
  7780  func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
  7781  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7782  	if c.ifNoneMatch_ != "" {
  7783  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7784  	}
  7785  	var body io.Reader = nil
  7786  	c.urlParams_.Set("alt", alt)
  7787  	c.urlParams_.Set("prettyPrint", "false")
  7788  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
  7789  	urls += "?" + c.urlParams_.Encode()
  7790  	req, err := http.NewRequest("GET", urls, body)
  7791  	if err != nil {
  7792  		return nil, err
  7793  	}
  7794  	req.Header = reqHeaders
  7795  	googleapi.Expand(req.URL, map[string]string{
  7796  		"bucket":       c.bucket,
  7797  		"notification": c.notification,
  7798  	})
  7799  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7800  }
  7801  
  7802  // Do executes the "storage.notifications.get" call.
  7803  // Any non-2xx status code is an error. Response headers are in either
  7804  // *Notification.ServerResponse.Header or (if a response was returned at all)
  7805  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7806  // whether the returned error was because http.StatusNotModified was returned.
  7807  func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
  7808  	gensupport.SetOptions(c.urlParams_, opts...)
  7809  	res, err := c.doRequest("json")
  7810  	if res != nil && res.StatusCode == http.StatusNotModified {
  7811  		if res.Body != nil {
  7812  			res.Body.Close()
  7813  		}
  7814  		return nil, gensupport.WrapError(&googleapi.Error{
  7815  			Code:   res.StatusCode,
  7816  			Header: res.Header,
  7817  		})
  7818  	}
  7819  	if err != nil {
  7820  		return nil, err
  7821  	}
  7822  	defer googleapi.CloseBody(res)
  7823  	if err := googleapi.CheckResponse(res); err != nil {
  7824  		return nil, gensupport.WrapError(err)
  7825  	}
  7826  	ret := &Notification{
  7827  		ServerResponse: googleapi.ServerResponse{
  7828  			Header:         res.Header,
  7829  			HTTPStatusCode: res.StatusCode,
  7830  		},
  7831  	}
  7832  	target := &ret
  7833  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7834  		return nil, err
  7835  	}
  7836  	return ret, nil
  7837  }
  7838  
  7839  type NotificationsInsertCall struct {
  7840  	s            *Service
  7841  	bucket       string
  7842  	notification *Notification
  7843  	urlParams_   gensupport.URLParams
  7844  	ctx_         context.Context
  7845  	header_      http.Header
  7846  }
  7847  
  7848  // Insert: Creates a notification subscription for a given bucket.
  7849  //
  7850  // - bucket: The parent bucket of the notification.
  7851  func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
  7852  	c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7853  	c.bucket = bucket
  7854  	c.notification = notification
  7855  	return c
  7856  }
  7857  
  7858  // UserProject sets the optional parameter "userProject": The project to be
  7859  // billed for this request. Required for Requester Pays buckets.
  7860  func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
  7861  	c.urlParams_.Set("userProject", userProject)
  7862  	return c
  7863  }
  7864  
  7865  // Fields allows partial responses to be retrieved. See
  7866  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7867  // details.
  7868  func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
  7869  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7870  	return c
  7871  }
  7872  
  7873  // Context sets the context to be used in this call's Do method.
  7874  func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
  7875  	c.ctx_ = ctx
  7876  	return c
  7877  }
  7878  
  7879  // Header returns a http.Header that can be modified by the caller to add
  7880  // headers to the request.
  7881  func (c *NotificationsInsertCall) Header() http.Header {
  7882  	if c.header_ == nil {
  7883  		c.header_ = make(http.Header)
  7884  	}
  7885  	return c.header_
  7886  }
  7887  
  7888  func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
  7889  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7890  	var body io.Reader = nil
  7891  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
  7892  	if err != nil {
  7893  		return nil, err
  7894  	}
  7895  	c.urlParams_.Set("alt", alt)
  7896  	c.urlParams_.Set("prettyPrint", "false")
  7897  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
  7898  	urls += "?" + c.urlParams_.Encode()
  7899  	req, err := http.NewRequest("POST", urls, body)
  7900  	if err != nil {
  7901  		return nil, err
  7902  	}
  7903  	req.Header = reqHeaders
  7904  	googleapi.Expand(req.URL, map[string]string{
  7905  		"bucket": c.bucket,
  7906  	})
  7907  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7908  }
  7909  
  7910  // Do executes the "storage.notifications.insert" call.
  7911  // Any non-2xx status code is an error. Response headers are in either
  7912  // *Notification.ServerResponse.Header or (if a response was returned at all)
  7913  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7914  // whether the returned error was because http.StatusNotModified was returned.
  7915  func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
  7916  	gensupport.SetOptions(c.urlParams_, opts...)
  7917  	res, err := c.doRequest("json")
  7918  	if res != nil && res.StatusCode == http.StatusNotModified {
  7919  		if res.Body != nil {
  7920  			res.Body.Close()
  7921  		}
  7922  		return nil, gensupport.WrapError(&googleapi.Error{
  7923  			Code:   res.StatusCode,
  7924  			Header: res.Header,
  7925  		})
  7926  	}
  7927  	if err != nil {
  7928  		return nil, err
  7929  	}
  7930  	defer googleapi.CloseBody(res)
  7931  	if err := googleapi.CheckResponse(res); err != nil {
  7932  		return nil, gensupport.WrapError(err)
  7933  	}
  7934  	ret := &Notification{
  7935  		ServerResponse: googleapi.ServerResponse{
  7936  			Header:         res.Header,
  7937  			HTTPStatusCode: res.StatusCode,
  7938  		},
  7939  	}
  7940  	target := &ret
  7941  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7942  		return nil, err
  7943  	}
  7944  	return ret, nil
  7945  }
  7946  
  7947  type NotificationsListCall struct {
  7948  	s            *Service
  7949  	bucket       string
  7950  	urlParams_   gensupport.URLParams
  7951  	ifNoneMatch_ string
  7952  	ctx_         context.Context
  7953  	header_      http.Header
  7954  }
  7955  
  7956  // List: Retrieves a list of notification subscriptions for a given bucket.
  7957  //
  7958  // - bucket: Name of a Google Cloud Storage bucket.
  7959  func (r *NotificationsService) List(bucket string) *NotificationsListCall {
  7960  	c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7961  	c.bucket = bucket
  7962  	return c
  7963  }
  7964  
  7965  // UserProject sets the optional parameter "userProject": The project to be
  7966  // billed for this request. Required for Requester Pays buckets.
  7967  func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
  7968  	c.urlParams_.Set("userProject", userProject)
  7969  	return c
  7970  }
  7971  
  7972  // Fields allows partial responses to be retrieved. See
  7973  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7974  // details.
  7975  func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
  7976  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7977  	return c
  7978  }
  7979  
  7980  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7981  // object's ETag matches the given value. This is useful for getting updates
  7982  // only after the object has changed since the last request.
  7983  func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
  7984  	c.ifNoneMatch_ = entityTag
  7985  	return c
  7986  }
  7987  
  7988  // Context sets the context to be used in this call's Do method.
  7989  func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
  7990  	c.ctx_ = ctx
  7991  	return c
  7992  }
  7993  
  7994  // Header returns a http.Header that can be modified by the caller to add
  7995  // headers to the request.
  7996  func (c *NotificationsListCall) Header() http.Header {
  7997  	if c.header_ == nil {
  7998  		c.header_ = make(http.Header)
  7999  	}
  8000  	return c.header_
  8001  }
  8002  
  8003  func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
  8004  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8005  	if c.ifNoneMatch_ != "" {
  8006  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8007  	}
  8008  	var body io.Reader = nil
  8009  	c.urlParams_.Set("alt", alt)
  8010  	c.urlParams_.Set("prettyPrint", "false")
  8011  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
  8012  	urls += "?" + c.urlParams_.Encode()
  8013  	req, err := http.NewRequest("GET", urls, body)
  8014  	if err != nil {
  8015  		return nil, err
  8016  	}
  8017  	req.Header = reqHeaders
  8018  	googleapi.Expand(req.URL, map[string]string{
  8019  		"bucket": c.bucket,
  8020  	})
  8021  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8022  }
  8023  
  8024  // Do executes the "storage.notifications.list" call.
  8025  // Any non-2xx status code is an error. Response headers are in either
  8026  // *Notifications.ServerResponse.Header or (if a response was returned at all)
  8027  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8028  // whether the returned error was because http.StatusNotModified was returned.
  8029  func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
  8030  	gensupport.SetOptions(c.urlParams_, opts...)
  8031  	res, err := c.doRequest("json")
  8032  	if res != nil && res.StatusCode == http.StatusNotModified {
  8033  		if res.Body != nil {
  8034  			res.Body.Close()
  8035  		}
  8036  		return nil, gensupport.WrapError(&googleapi.Error{
  8037  			Code:   res.StatusCode,
  8038  			Header: res.Header,
  8039  		})
  8040  	}
  8041  	if err != nil {
  8042  		return nil, err
  8043  	}
  8044  	defer googleapi.CloseBody(res)
  8045  	if err := googleapi.CheckResponse(res); err != nil {
  8046  		return nil, gensupport.WrapError(err)
  8047  	}
  8048  	ret := &Notifications{
  8049  		ServerResponse: googleapi.ServerResponse{
  8050  			Header:         res.Header,
  8051  			HTTPStatusCode: res.StatusCode,
  8052  		},
  8053  	}
  8054  	target := &ret
  8055  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8056  		return nil, err
  8057  	}
  8058  	return ret, nil
  8059  }
  8060  
  8061  type ObjectAccessControlsDeleteCall struct {
  8062  	s          *Service
  8063  	bucket     string
  8064  	object     string
  8065  	entity     string
  8066  	urlParams_ gensupport.URLParams
  8067  	ctx_       context.Context
  8068  	header_    http.Header
  8069  }
  8070  
  8071  // Delete: Permanently deletes the ACL entry for the specified entity on the
  8072  // specified object.
  8073  //
  8074  //   - bucket: Name of a bucket.
  8075  //   - entity: The entity holding the permission. Can be user-userId,
  8076  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  8077  //     allAuthenticatedUsers.
  8078  //   - object: Name of the object. For information about how to URL encode object
  8079  //     names to be path safe, see Encoding URI Path Parts
  8080  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  8081  func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
  8082  	c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8083  	c.bucket = bucket
  8084  	c.object = object
  8085  	c.entity = entity
  8086  	return c
  8087  }
  8088  
  8089  // Generation sets the optional parameter "generation": If present, selects a
  8090  // specific revision of this object (as opposed to the latest version, the
  8091  // default).
  8092  func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall {
  8093  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  8094  	return c
  8095  }
  8096  
  8097  // UserProject sets the optional parameter "userProject": The project to be
  8098  // billed for this request. Required for Requester Pays buckets.
  8099  func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
  8100  	c.urlParams_.Set("userProject", userProject)
  8101  	return c
  8102  }
  8103  
  8104  // Fields allows partial responses to be retrieved. See
  8105  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8106  // details.
  8107  func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
  8108  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8109  	return c
  8110  }
  8111  
  8112  // Context sets the context to be used in this call's Do method.
  8113  func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
  8114  	c.ctx_ = ctx
  8115  	return c
  8116  }
  8117  
  8118  // Header returns a http.Header that can be modified by the caller to add
  8119  // headers to the request.
  8120  func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
  8121  	if c.header_ == nil {
  8122  		c.header_ = make(http.Header)
  8123  	}
  8124  	return c.header_
  8125  }
  8126  
  8127  func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8128  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8129  	var body io.Reader = nil
  8130  	c.urlParams_.Set("alt", alt)
  8131  	c.urlParams_.Set("prettyPrint", "false")
  8132  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  8133  	urls += "?" + c.urlParams_.Encode()
  8134  	req, err := http.NewRequest("DELETE", urls, body)
  8135  	if err != nil {
  8136  		return nil, err
  8137  	}
  8138  	req.Header = reqHeaders
  8139  	googleapi.Expand(req.URL, map[string]string{
  8140  		"bucket": c.bucket,
  8141  		"object": c.object,
  8142  		"entity": c.entity,
  8143  	})
  8144  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8145  }
  8146  
  8147  // Do executes the "storage.objectAccessControls.delete" call.
  8148  func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8149  	gensupport.SetOptions(c.urlParams_, opts...)
  8150  	res, err := c.doRequest("json")
  8151  	if err != nil {
  8152  		return err
  8153  	}
  8154  	defer googleapi.CloseBody(res)
  8155  	if err := googleapi.CheckResponse(res); err != nil {
  8156  		return gensupport.WrapError(err)
  8157  	}
  8158  	return nil
  8159  }
  8160  
  8161  type ObjectAccessControlsGetCall struct {
  8162  	s            *Service
  8163  	bucket       string
  8164  	object       string
  8165  	entity       string
  8166  	urlParams_   gensupport.URLParams
  8167  	ifNoneMatch_ string
  8168  	ctx_         context.Context
  8169  	header_      http.Header
  8170  }
  8171  
  8172  // Get: Returns the ACL entry for the specified entity on the specified object.
  8173  //
  8174  //   - bucket: Name of a bucket.
  8175  //   - entity: The entity holding the permission. Can be user-userId,
  8176  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  8177  //     allAuthenticatedUsers.
  8178  //   - object: Name of the object. For information about how to URL encode object
  8179  //     names to be path safe, see Encoding URI Path Parts
  8180  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  8181  func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
  8182  	c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8183  	c.bucket = bucket
  8184  	c.object = object
  8185  	c.entity = entity
  8186  	return c
  8187  }
  8188  
  8189  // Generation sets the optional parameter "generation": If present, selects a
  8190  // specific revision of this object (as opposed to the latest version, the
  8191  // default).
  8192  func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall {
  8193  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  8194  	return c
  8195  }
  8196  
  8197  // UserProject sets the optional parameter "userProject": The project to be
  8198  // billed for this request. Required for Requester Pays buckets.
  8199  func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
  8200  	c.urlParams_.Set("userProject", userProject)
  8201  	return c
  8202  }
  8203  
  8204  // Fields allows partial responses to be retrieved. See
  8205  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8206  // details.
  8207  func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
  8208  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8209  	return c
  8210  }
  8211  
  8212  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8213  // object's ETag matches the given value. This is useful for getting updates
  8214  // only after the object has changed since the last request.
  8215  func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
  8216  	c.ifNoneMatch_ = entityTag
  8217  	return c
  8218  }
  8219  
  8220  // Context sets the context to be used in this call's Do method.
  8221  func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
  8222  	c.ctx_ = ctx
  8223  	return c
  8224  }
  8225  
  8226  // Header returns a http.Header that can be modified by the caller to add
  8227  // headers to the request.
  8228  func (c *ObjectAccessControlsGetCall) Header() http.Header {
  8229  	if c.header_ == nil {
  8230  		c.header_ = make(http.Header)
  8231  	}
  8232  	return c.header_
  8233  }
  8234  
  8235  func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  8236  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8237  	if c.ifNoneMatch_ != "" {
  8238  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8239  	}
  8240  	var body io.Reader = nil
  8241  	c.urlParams_.Set("alt", alt)
  8242  	c.urlParams_.Set("prettyPrint", "false")
  8243  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  8244  	urls += "?" + c.urlParams_.Encode()
  8245  	req, err := http.NewRequest("GET", urls, body)
  8246  	if err != nil {
  8247  		return nil, err
  8248  	}
  8249  	req.Header = reqHeaders
  8250  	googleapi.Expand(req.URL, map[string]string{
  8251  		"bucket": c.bucket,
  8252  		"object": c.object,
  8253  		"entity": c.entity,
  8254  	})
  8255  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8256  }
  8257  
  8258  // Do executes the "storage.objectAccessControls.get" call.
  8259  // Any non-2xx status code is an error. Response headers are in either
  8260  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  8261  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8262  // check whether the returned error was because http.StatusNotModified was
  8263  // returned.
  8264  func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  8265  	gensupport.SetOptions(c.urlParams_, opts...)
  8266  	res, err := c.doRequest("json")
  8267  	if res != nil && res.StatusCode == http.StatusNotModified {
  8268  		if res.Body != nil {
  8269  			res.Body.Close()
  8270  		}
  8271  		return nil, gensupport.WrapError(&googleapi.Error{
  8272  			Code:   res.StatusCode,
  8273  			Header: res.Header,
  8274  		})
  8275  	}
  8276  	if err != nil {
  8277  		return nil, err
  8278  	}
  8279  	defer googleapi.CloseBody(res)
  8280  	if err := googleapi.CheckResponse(res); err != nil {
  8281  		return nil, gensupport.WrapError(err)
  8282  	}
  8283  	ret := &ObjectAccessControl{
  8284  		ServerResponse: googleapi.ServerResponse{
  8285  			Header:         res.Header,
  8286  			HTTPStatusCode: res.StatusCode,
  8287  		},
  8288  	}
  8289  	target := &ret
  8290  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8291  		return nil, err
  8292  	}
  8293  	return ret, nil
  8294  }
  8295  
  8296  type ObjectAccessControlsInsertCall struct {
  8297  	s                   *Service
  8298  	bucket              string
  8299  	object              string
  8300  	objectaccesscontrol *ObjectAccessControl
  8301  	urlParams_          gensupport.URLParams
  8302  	ctx_                context.Context
  8303  	header_             http.Header
  8304  }
  8305  
  8306  // Insert: Creates a new ACL entry on the specified object.
  8307  //
  8308  //   - bucket: Name of a bucket.
  8309  //   - object: Name of the object. For information about how to URL encode object
  8310  //     names to be path safe, see Encoding URI Path Parts
  8311  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  8312  func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
  8313  	c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8314  	c.bucket = bucket
  8315  	c.object = object
  8316  	c.objectaccesscontrol = objectaccesscontrol
  8317  	return c
  8318  }
  8319  
  8320  // Generation sets the optional parameter "generation": If present, selects a
  8321  // specific revision of this object (as opposed to the latest version, the
  8322  // default).
  8323  func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall {
  8324  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  8325  	return c
  8326  }
  8327  
  8328  // UserProject sets the optional parameter "userProject": The project to be
  8329  // billed for this request. Required for Requester Pays buckets.
  8330  func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
  8331  	c.urlParams_.Set("userProject", userProject)
  8332  	return c
  8333  }
  8334  
  8335  // Fields allows partial responses to be retrieved. See
  8336  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8337  // details.
  8338  func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
  8339  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8340  	return c
  8341  }
  8342  
  8343  // Context sets the context to be used in this call's Do method.
  8344  func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
  8345  	c.ctx_ = ctx
  8346  	return c
  8347  }
  8348  
  8349  // Header returns a http.Header that can be modified by the caller to add
  8350  // headers to the request.
  8351  func (c *ObjectAccessControlsInsertCall) Header() http.Header {
  8352  	if c.header_ == nil {
  8353  		c.header_ = make(http.Header)
  8354  	}
  8355  	return c.header_
  8356  }
  8357  
  8358  func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  8359  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8360  	var body io.Reader = nil
  8361  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  8362  	if err != nil {
  8363  		return nil, err
  8364  	}
  8365  	c.urlParams_.Set("alt", alt)
  8366  	c.urlParams_.Set("prettyPrint", "false")
  8367  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  8368  	urls += "?" + c.urlParams_.Encode()
  8369  	req, err := http.NewRequest("POST", urls, body)
  8370  	if err != nil {
  8371  		return nil, err
  8372  	}
  8373  	req.Header = reqHeaders
  8374  	googleapi.Expand(req.URL, map[string]string{
  8375  		"bucket": c.bucket,
  8376  		"object": c.object,
  8377  	})
  8378  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8379  }
  8380  
  8381  // Do executes the "storage.objectAccessControls.insert" call.
  8382  // Any non-2xx status code is an error. Response headers are in either
  8383  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  8384  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8385  // check whether the returned error was because http.StatusNotModified was
  8386  // returned.
  8387  func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  8388  	gensupport.SetOptions(c.urlParams_, opts...)
  8389  	res, err := c.doRequest("json")
  8390  	if res != nil && res.StatusCode == http.StatusNotModified {
  8391  		if res.Body != nil {
  8392  			res.Body.Close()
  8393  		}
  8394  		return nil, gensupport.WrapError(&googleapi.Error{
  8395  			Code:   res.StatusCode,
  8396  			Header: res.Header,
  8397  		})
  8398  	}
  8399  	if err != nil {
  8400  		return nil, err
  8401  	}
  8402  	defer googleapi.CloseBody(res)
  8403  	if err := googleapi.CheckResponse(res); err != nil {
  8404  		return nil, gensupport.WrapError(err)
  8405  	}
  8406  	ret := &ObjectAccessControl{
  8407  		ServerResponse: googleapi.ServerResponse{
  8408  			Header:         res.Header,
  8409  			HTTPStatusCode: res.StatusCode,
  8410  		},
  8411  	}
  8412  	target := &ret
  8413  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8414  		return nil, err
  8415  	}
  8416  	return ret, nil
  8417  }
  8418  
  8419  type ObjectAccessControlsListCall struct {
  8420  	s            *Service
  8421  	bucket       string
  8422  	object       string
  8423  	urlParams_   gensupport.URLParams
  8424  	ifNoneMatch_ string
  8425  	ctx_         context.Context
  8426  	header_      http.Header
  8427  }
  8428  
  8429  // List: Retrieves ACL entries on the specified object.
  8430  //
  8431  //   - bucket: Name of a bucket.
  8432  //   - object: Name of the object. For information about how to URL encode object
  8433  //     names to be path safe, see Encoding URI Path Parts
  8434  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  8435  func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
  8436  	c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8437  	c.bucket = bucket
  8438  	c.object = object
  8439  	return c
  8440  }
  8441  
  8442  // Generation sets the optional parameter "generation": If present, selects a
  8443  // specific revision of this object (as opposed to the latest version, the
  8444  // default).
  8445  func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall {
  8446  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  8447  	return c
  8448  }
  8449  
  8450  // UserProject sets the optional parameter "userProject": The project to be
  8451  // billed for this request. Required for Requester Pays buckets.
  8452  func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
  8453  	c.urlParams_.Set("userProject", userProject)
  8454  	return c
  8455  }
  8456  
  8457  // Fields allows partial responses to be retrieved. See
  8458  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8459  // details.
  8460  func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
  8461  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8462  	return c
  8463  }
  8464  
  8465  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8466  // object's ETag matches the given value. This is useful for getting updates
  8467  // only after the object has changed since the last request.
  8468  func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
  8469  	c.ifNoneMatch_ = entityTag
  8470  	return c
  8471  }
  8472  
  8473  // Context sets the context to be used in this call's Do method.
  8474  func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
  8475  	c.ctx_ = ctx
  8476  	return c
  8477  }
  8478  
  8479  // Header returns a http.Header that can be modified by the caller to add
  8480  // headers to the request.
  8481  func (c *ObjectAccessControlsListCall) Header() http.Header {
  8482  	if c.header_ == nil {
  8483  		c.header_ = make(http.Header)
  8484  	}
  8485  	return c.header_
  8486  }
  8487  
  8488  func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  8489  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8490  	if c.ifNoneMatch_ != "" {
  8491  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8492  	}
  8493  	var body io.Reader = nil
  8494  	c.urlParams_.Set("alt", alt)
  8495  	c.urlParams_.Set("prettyPrint", "false")
  8496  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  8497  	urls += "?" + c.urlParams_.Encode()
  8498  	req, err := http.NewRequest("GET", urls, body)
  8499  	if err != nil {
  8500  		return nil, err
  8501  	}
  8502  	req.Header = reqHeaders
  8503  	googleapi.Expand(req.URL, map[string]string{
  8504  		"bucket": c.bucket,
  8505  		"object": c.object,
  8506  	})
  8507  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8508  }
  8509  
  8510  // Do executes the "storage.objectAccessControls.list" call.
  8511  // Any non-2xx status code is an error. Response headers are in either
  8512  // *ObjectAccessControls.ServerResponse.Header or (if a response was returned
  8513  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8514  // check whether the returned error was because http.StatusNotModified was
  8515  // returned.
  8516  func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
  8517  	gensupport.SetOptions(c.urlParams_, opts...)
  8518  	res, err := c.doRequest("json")
  8519  	if res != nil && res.StatusCode == http.StatusNotModified {
  8520  		if res.Body != nil {
  8521  			res.Body.Close()
  8522  		}
  8523  		return nil, gensupport.WrapError(&googleapi.Error{
  8524  			Code:   res.StatusCode,
  8525  			Header: res.Header,
  8526  		})
  8527  	}
  8528  	if err != nil {
  8529  		return nil, err
  8530  	}
  8531  	defer googleapi.CloseBody(res)
  8532  	if err := googleapi.CheckResponse(res); err != nil {
  8533  		return nil, gensupport.WrapError(err)
  8534  	}
  8535  	ret := &ObjectAccessControls{
  8536  		ServerResponse: googleapi.ServerResponse{
  8537  			Header:         res.Header,
  8538  			HTTPStatusCode: res.StatusCode,
  8539  		},
  8540  	}
  8541  	target := &ret
  8542  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8543  		return nil, err
  8544  	}
  8545  	return ret, nil
  8546  }
  8547  
  8548  type ObjectAccessControlsPatchCall struct {
  8549  	s                   *Service
  8550  	bucket              string
  8551  	object              string
  8552  	entity              string
  8553  	objectaccesscontrol *ObjectAccessControl
  8554  	urlParams_          gensupport.URLParams
  8555  	ctx_                context.Context
  8556  	header_             http.Header
  8557  }
  8558  
  8559  // Patch: Patches an ACL entry on the specified object.
  8560  //
  8561  //   - bucket: Name of a bucket.
  8562  //   - entity: The entity holding the permission. Can be user-userId,
  8563  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  8564  //     allAuthenticatedUsers.
  8565  //   - object: Name of the object. For information about how to URL encode object
  8566  //     names to be path safe, see Encoding URI Path Parts
  8567  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  8568  func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
  8569  	c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8570  	c.bucket = bucket
  8571  	c.object = object
  8572  	c.entity = entity
  8573  	c.objectaccesscontrol = objectaccesscontrol
  8574  	return c
  8575  }
  8576  
  8577  // Generation sets the optional parameter "generation": If present, selects a
  8578  // specific revision of this object (as opposed to the latest version, the
  8579  // default).
  8580  func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall {
  8581  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  8582  	return c
  8583  }
  8584  
  8585  // UserProject sets the optional parameter "userProject": The project to be
  8586  // billed for this request. Required for Requester Pays buckets.
  8587  func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
  8588  	c.urlParams_.Set("userProject", userProject)
  8589  	return c
  8590  }
  8591  
  8592  // Fields allows partial responses to be retrieved. See
  8593  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8594  // details.
  8595  func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
  8596  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8597  	return c
  8598  }
  8599  
  8600  // Context sets the context to be used in this call's Do method.
  8601  func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
  8602  	c.ctx_ = ctx
  8603  	return c
  8604  }
  8605  
  8606  // Header returns a http.Header that can be modified by the caller to add
  8607  // headers to the request.
  8608  func (c *ObjectAccessControlsPatchCall) Header() http.Header {
  8609  	if c.header_ == nil {
  8610  		c.header_ = make(http.Header)
  8611  	}
  8612  	return c.header_
  8613  }
  8614  
  8615  func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  8616  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8617  	var body io.Reader = nil
  8618  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  8619  	if err != nil {
  8620  		return nil, err
  8621  	}
  8622  	c.urlParams_.Set("alt", alt)
  8623  	c.urlParams_.Set("prettyPrint", "false")
  8624  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  8625  	urls += "?" + c.urlParams_.Encode()
  8626  	req, err := http.NewRequest("PATCH", urls, body)
  8627  	if err != nil {
  8628  		return nil, err
  8629  	}
  8630  	req.Header = reqHeaders
  8631  	googleapi.Expand(req.URL, map[string]string{
  8632  		"bucket": c.bucket,
  8633  		"object": c.object,
  8634  		"entity": c.entity,
  8635  	})
  8636  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8637  }
  8638  
  8639  // Do executes the "storage.objectAccessControls.patch" call.
  8640  // Any non-2xx status code is an error. Response headers are in either
  8641  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  8642  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8643  // check whether the returned error was because http.StatusNotModified was
  8644  // returned.
  8645  func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  8646  	gensupport.SetOptions(c.urlParams_, opts...)
  8647  	res, err := c.doRequest("json")
  8648  	if res != nil && res.StatusCode == http.StatusNotModified {
  8649  		if res.Body != nil {
  8650  			res.Body.Close()
  8651  		}
  8652  		return nil, gensupport.WrapError(&googleapi.Error{
  8653  			Code:   res.StatusCode,
  8654  			Header: res.Header,
  8655  		})
  8656  	}
  8657  	if err != nil {
  8658  		return nil, err
  8659  	}
  8660  	defer googleapi.CloseBody(res)
  8661  	if err := googleapi.CheckResponse(res); err != nil {
  8662  		return nil, gensupport.WrapError(err)
  8663  	}
  8664  	ret := &ObjectAccessControl{
  8665  		ServerResponse: googleapi.ServerResponse{
  8666  			Header:         res.Header,
  8667  			HTTPStatusCode: res.StatusCode,
  8668  		},
  8669  	}
  8670  	target := &ret
  8671  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8672  		return nil, err
  8673  	}
  8674  	return ret, nil
  8675  }
  8676  
  8677  type ObjectAccessControlsUpdateCall struct {
  8678  	s                   *Service
  8679  	bucket              string
  8680  	object              string
  8681  	entity              string
  8682  	objectaccesscontrol *ObjectAccessControl
  8683  	urlParams_          gensupport.URLParams
  8684  	ctx_                context.Context
  8685  	header_             http.Header
  8686  }
  8687  
  8688  // Update: Updates an ACL entry on the specified object.
  8689  //
  8690  //   - bucket: Name of a bucket.
  8691  //   - entity: The entity holding the permission. Can be user-userId,
  8692  //     user-emailAddress, group-groupId, group-emailAddress, allUsers, or
  8693  //     allAuthenticatedUsers.
  8694  //   - object: Name of the object. For information about how to URL encode object
  8695  //     names to be path safe, see Encoding URI Path Parts
  8696  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  8697  func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
  8698  	c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8699  	c.bucket = bucket
  8700  	c.object = object
  8701  	c.entity = entity
  8702  	c.objectaccesscontrol = objectaccesscontrol
  8703  	return c
  8704  }
  8705  
  8706  // Generation sets the optional parameter "generation": If present, selects a
  8707  // specific revision of this object (as opposed to the latest version, the
  8708  // default).
  8709  func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall {
  8710  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  8711  	return c
  8712  }
  8713  
  8714  // UserProject sets the optional parameter "userProject": The project to be
  8715  // billed for this request. Required for Requester Pays buckets.
  8716  func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
  8717  	c.urlParams_.Set("userProject", userProject)
  8718  	return c
  8719  }
  8720  
  8721  // Fields allows partial responses to be retrieved. See
  8722  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8723  // details.
  8724  func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
  8725  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8726  	return c
  8727  }
  8728  
  8729  // Context sets the context to be used in this call's Do method.
  8730  func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
  8731  	c.ctx_ = ctx
  8732  	return c
  8733  }
  8734  
  8735  // Header returns a http.Header that can be modified by the caller to add
  8736  // headers to the request.
  8737  func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
  8738  	if c.header_ == nil {
  8739  		c.header_ = make(http.Header)
  8740  	}
  8741  	return c.header_
  8742  }
  8743  
  8744  func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8745  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8746  	var body io.Reader = nil
  8747  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  8748  	if err != nil {
  8749  		return nil, err
  8750  	}
  8751  	c.urlParams_.Set("alt", alt)
  8752  	c.urlParams_.Set("prettyPrint", "false")
  8753  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  8754  	urls += "?" + c.urlParams_.Encode()
  8755  	req, err := http.NewRequest("PUT", urls, body)
  8756  	if err != nil {
  8757  		return nil, err
  8758  	}
  8759  	req.Header = reqHeaders
  8760  	googleapi.Expand(req.URL, map[string]string{
  8761  		"bucket": c.bucket,
  8762  		"object": c.object,
  8763  		"entity": c.entity,
  8764  	})
  8765  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8766  }
  8767  
  8768  // Do executes the "storage.objectAccessControls.update" call.
  8769  // Any non-2xx status code is an error. Response headers are in either
  8770  // *ObjectAccessControl.ServerResponse.Header or (if a response was returned at
  8771  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8772  // check whether the returned error was because http.StatusNotModified was
  8773  // returned.
  8774  func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  8775  	gensupport.SetOptions(c.urlParams_, opts...)
  8776  	res, err := c.doRequest("json")
  8777  	if res != nil && res.StatusCode == http.StatusNotModified {
  8778  		if res.Body != nil {
  8779  			res.Body.Close()
  8780  		}
  8781  		return nil, gensupport.WrapError(&googleapi.Error{
  8782  			Code:   res.StatusCode,
  8783  			Header: res.Header,
  8784  		})
  8785  	}
  8786  	if err != nil {
  8787  		return nil, err
  8788  	}
  8789  	defer googleapi.CloseBody(res)
  8790  	if err := googleapi.CheckResponse(res); err != nil {
  8791  		return nil, gensupport.WrapError(err)
  8792  	}
  8793  	ret := &ObjectAccessControl{
  8794  		ServerResponse: googleapi.ServerResponse{
  8795  			Header:         res.Header,
  8796  			HTTPStatusCode: res.StatusCode,
  8797  		},
  8798  	}
  8799  	target := &ret
  8800  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8801  		return nil, err
  8802  	}
  8803  	return ret, nil
  8804  }
  8805  
  8806  type ObjectsBulkRestoreCall struct {
  8807  	s                         *Service
  8808  	bucket                    string
  8809  	bulkrestoreobjectsrequest *BulkRestoreObjectsRequest
  8810  	urlParams_                gensupport.URLParams
  8811  	ctx_                      context.Context
  8812  	header_                   http.Header
  8813  }
  8814  
  8815  // BulkRestore: Initiates a long-running bulk restore operation on the
  8816  // specified bucket.
  8817  //
  8818  // - bucket: Name of the bucket in which the object resides.
  8819  func (r *ObjectsService) BulkRestore(bucket string, bulkrestoreobjectsrequest *BulkRestoreObjectsRequest) *ObjectsBulkRestoreCall {
  8820  	c := &ObjectsBulkRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8821  	c.bucket = bucket
  8822  	c.bulkrestoreobjectsrequest = bulkrestoreobjectsrequest
  8823  	return c
  8824  }
  8825  
  8826  // Fields allows partial responses to be retrieved. See
  8827  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8828  // details.
  8829  func (c *ObjectsBulkRestoreCall) Fields(s ...googleapi.Field) *ObjectsBulkRestoreCall {
  8830  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8831  	return c
  8832  }
  8833  
  8834  // Context sets the context to be used in this call's Do method.
  8835  func (c *ObjectsBulkRestoreCall) Context(ctx context.Context) *ObjectsBulkRestoreCall {
  8836  	c.ctx_ = ctx
  8837  	return c
  8838  }
  8839  
  8840  // Header returns a http.Header that can be modified by the caller to add
  8841  // headers to the request.
  8842  func (c *ObjectsBulkRestoreCall) Header() http.Header {
  8843  	if c.header_ == nil {
  8844  		c.header_ = make(http.Header)
  8845  	}
  8846  	return c.header_
  8847  }
  8848  
  8849  func (c *ObjectsBulkRestoreCall) doRequest(alt string) (*http.Response, error) {
  8850  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8851  	var body io.Reader = nil
  8852  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkrestoreobjectsrequest)
  8853  	if err != nil {
  8854  		return nil, err
  8855  	}
  8856  	c.urlParams_.Set("alt", alt)
  8857  	c.urlParams_.Set("prettyPrint", "false")
  8858  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/bulkRestore")
  8859  	urls += "?" + c.urlParams_.Encode()
  8860  	req, err := http.NewRequest("POST", urls, body)
  8861  	if err != nil {
  8862  		return nil, err
  8863  	}
  8864  	req.Header = reqHeaders
  8865  	googleapi.Expand(req.URL, map[string]string{
  8866  		"bucket": c.bucket,
  8867  	})
  8868  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8869  }
  8870  
  8871  // Do executes the "storage.objects.bulkRestore" call.
  8872  // Any non-2xx status code is an error. Response headers are in either
  8873  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  8874  // returned at all) in error.(*googleapi.Error).Header. Use
  8875  // googleapi.IsNotModified to check whether the returned error was because
  8876  // http.StatusNotModified was returned.
  8877  func (c *ObjectsBulkRestoreCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  8878  	gensupport.SetOptions(c.urlParams_, opts...)
  8879  	res, err := c.doRequest("json")
  8880  	if res != nil && res.StatusCode == http.StatusNotModified {
  8881  		if res.Body != nil {
  8882  			res.Body.Close()
  8883  		}
  8884  		return nil, gensupport.WrapError(&googleapi.Error{
  8885  			Code:   res.StatusCode,
  8886  			Header: res.Header,
  8887  		})
  8888  	}
  8889  	if err != nil {
  8890  		return nil, err
  8891  	}
  8892  	defer googleapi.CloseBody(res)
  8893  	if err := googleapi.CheckResponse(res); err != nil {
  8894  		return nil, gensupport.WrapError(err)
  8895  	}
  8896  	ret := &GoogleLongrunningOperation{
  8897  		ServerResponse: googleapi.ServerResponse{
  8898  			Header:         res.Header,
  8899  			HTTPStatusCode: res.StatusCode,
  8900  		},
  8901  	}
  8902  	target := &ret
  8903  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8904  		return nil, err
  8905  	}
  8906  	return ret, nil
  8907  }
  8908  
  8909  type ObjectsComposeCall struct {
  8910  	s                 *Service
  8911  	destinationBucket string
  8912  	destinationObject string
  8913  	composerequest    *ComposeRequest
  8914  	urlParams_        gensupport.URLParams
  8915  	ctx_              context.Context
  8916  	header_           http.Header
  8917  }
  8918  
  8919  // Compose: Concatenates a list of existing objects into a new object in the
  8920  // same bucket.
  8921  //
  8922  //   - destinationBucket: Name of the bucket containing the source objects. The
  8923  //     destination object is stored in this bucket.
  8924  //   - destinationObject: Name of the new object. For information about how to
  8925  //     URL encode object names to be path safe, see Encoding URI Path Parts
  8926  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  8927  func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
  8928  	c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8929  	c.destinationBucket = destinationBucket
  8930  	c.destinationObject = destinationObject
  8931  	c.composerequest = composerequest
  8932  	return c
  8933  }
  8934  
  8935  // DestinationPredefinedAcl sets the optional parameter
  8936  // "destinationPredefinedAcl": Apply a predefined set of access controls to the
  8937  // destination object.
  8938  //
  8939  // Possible values:
  8940  //
  8941  //	"authenticatedRead" - Object owner gets OWNER access, and
  8942  //
  8943  // allAuthenticatedUsers get READER access.
  8944  //
  8945  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
  8946  //
  8947  // team owners get OWNER access.
  8948  //
  8949  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
  8950  //
  8951  // owners get READER access.
  8952  //
  8953  //	"private" - Object owner gets OWNER access.
  8954  //	"projectPrivate" - Object owner gets OWNER access, and project team
  8955  //
  8956  // members get access according to their roles.
  8957  //
  8958  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
  8959  //
  8960  // access.
  8961  func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
  8962  	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
  8963  	return c
  8964  }
  8965  
  8966  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
  8967  // operation conditional on whether the object's current generation matches the
  8968  // given value. Setting to 0 makes the operation succeed only if there are no
  8969  // live versions of the object.
  8970  func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
  8971  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  8972  	return c
  8973  }
  8974  
  8975  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  8976  // Makes the operation conditional on whether the object's current
  8977  // metageneration matches the given value.
  8978  func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall {
  8979  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  8980  	return c
  8981  }
  8982  
  8983  // KmsKeyName sets the optional parameter "kmsKeyName": Resource name of the
  8984  // Cloud KMS key, of the form
  8985  // projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that
  8986  // will be used to encrypt the object. Overrides the object metadata's
  8987  // kms_key_name value, if any.
  8988  func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall {
  8989  	c.urlParams_.Set("kmsKeyName", kmsKeyName)
  8990  	return c
  8991  }
  8992  
  8993  // UserProject sets the optional parameter "userProject": The project to be
  8994  // billed for this request. Required for Requester Pays buckets.
  8995  func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
  8996  	c.urlParams_.Set("userProject", userProject)
  8997  	return c
  8998  }
  8999  
  9000  // Fields allows partial responses to be retrieved. See
  9001  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9002  // details.
  9003  func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
  9004  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9005  	return c
  9006  }
  9007  
  9008  // Context sets the context to be used in this call's Do method.
  9009  func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
  9010  	c.ctx_ = ctx
  9011  	return c
  9012  }
  9013  
  9014  // Header returns a http.Header that can be modified by the caller to add
  9015  // headers to the request.
  9016  func (c *ObjectsComposeCall) Header() http.Header {
  9017  	if c.header_ == nil {
  9018  		c.header_ = make(http.Header)
  9019  	}
  9020  	return c.header_
  9021  }
  9022  
  9023  func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
  9024  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  9025  	var body io.Reader = nil
  9026  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
  9027  	if err != nil {
  9028  		return nil, err
  9029  	}
  9030  	c.urlParams_.Set("alt", alt)
  9031  	c.urlParams_.Set("prettyPrint", "false")
  9032  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
  9033  	urls += "?" + c.urlParams_.Encode()
  9034  	req, err := http.NewRequest("POST", urls, body)
  9035  	if err != nil {
  9036  		return nil, err
  9037  	}
  9038  	req.Header = reqHeaders
  9039  	googleapi.Expand(req.URL, map[string]string{
  9040  		"destinationBucket": c.destinationBucket,
  9041  		"destinationObject": c.destinationObject,
  9042  	})
  9043  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9044  }
  9045  
  9046  // Do executes the "storage.objects.compose" call.
  9047  // Any non-2xx status code is an error. Response headers are in either
  9048  // *Object.ServerResponse.Header or (if a response was returned at all) in
  9049  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9050  // whether the returned error was because http.StatusNotModified was returned.
  9051  func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  9052  	gensupport.SetOptions(c.urlParams_, opts...)
  9053  	res, err := c.doRequest("json")
  9054  	if res != nil && res.StatusCode == http.StatusNotModified {
  9055  		if res.Body != nil {
  9056  			res.Body.Close()
  9057  		}
  9058  		return nil, gensupport.WrapError(&googleapi.Error{
  9059  			Code:   res.StatusCode,
  9060  			Header: res.Header,
  9061  		})
  9062  	}
  9063  	if err != nil {
  9064  		return nil, err
  9065  	}
  9066  	defer googleapi.CloseBody(res)
  9067  	if err := googleapi.CheckResponse(res); err != nil {
  9068  		return nil, gensupport.WrapError(err)
  9069  	}
  9070  	ret := &Object{
  9071  		ServerResponse: googleapi.ServerResponse{
  9072  			Header:         res.Header,
  9073  			HTTPStatusCode: res.StatusCode,
  9074  		},
  9075  	}
  9076  	target := &ret
  9077  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9078  		return nil, err
  9079  	}
  9080  	return ret, nil
  9081  }
  9082  
  9083  type ObjectsCopyCall struct {
  9084  	s                 *Service
  9085  	sourceBucket      string
  9086  	sourceObject      string
  9087  	destinationBucket string
  9088  	destinationObject string
  9089  	object            *Object
  9090  	urlParams_        gensupport.URLParams
  9091  	ctx_              context.Context
  9092  	header_           http.Header
  9093  }
  9094  
  9095  // Copy: Copies a source object to a destination object. Optionally overrides
  9096  // metadata.
  9097  //
  9098  //   - destinationBucket: Name of the bucket in which to store the new object.
  9099  //     Overrides the provided object metadata's bucket value, if any.For
  9100  //     information about how to URL encode object names to be path safe, see
  9101  //     Encoding URI Path Parts
  9102  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  9103  //   - destinationObject: Name of the new object. Required when the object
  9104  //     metadata is not otherwise provided. Overrides the object metadata's name
  9105  //     value, if any.
  9106  //   - sourceBucket: Name of the bucket in which to find the source object.
  9107  //   - sourceObject: Name of the source object. For information about how to URL
  9108  //     encode object names to be path safe, see Encoding URI Path Parts
  9109  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  9110  func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
  9111  	c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9112  	c.sourceBucket = sourceBucket
  9113  	c.sourceObject = sourceObject
  9114  	c.destinationBucket = destinationBucket
  9115  	c.destinationObject = destinationObject
  9116  	c.object = object
  9117  	return c
  9118  }
  9119  
  9120  // DestinationKmsKeyName sets the optional parameter "destinationKmsKeyName":
  9121  // Resource name of the Cloud KMS key, of the form
  9122  // projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that
  9123  // will be used to encrypt the object. Overrides the object metadata's
  9124  // kms_key_name value, if any.
  9125  func (c *ObjectsCopyCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsCopyCall {
  9126  	c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
  9127  	return c
  9128  }
  9129  
  9130  // DestinationPredefinedAcl sets the optional parameter
  9131  // "destinationPredefinedAcl": Apply a predefined set of access controls to the
  9132  // destination object.
  9133  //
  9134  // Possible values:
  9135  //
  9136  //	"authenticatedRead" - Object owner gets OWNER access, and
  9137  //
  9138  // allAuthenticatedUsers get READER access.
  9139  //
  9140  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
  9141  //
  9142  // team owners get OWNER access.
  9143  //
  9144  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
  9145  //
  9146  // owners get READER access.
  9147  //
  9148  //	"private" - Object owner gets OWNER access.
  9149  //	"projectPrivate" - Object owner gets OWNER access, and project team
  9150  //
  9151  // members get access according to their roles.
  9152  //
  9153  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
  9154  //
  9155  // access.
  9156  func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
  9157  	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
  9158  	return c
  9159  }
  9160  
  9161  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
  9162  // operation conditional on whether the destination object's current generation
  9163  // matches the given value. Setting to 0 makes the operation succeed only if
  9164  // there are no live versions of the object.
  9165  func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
  9166  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  9167  	return c
  9168  }
  9169  
  9170  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
  9171  // Makes the operation conditional on whether the destination object's current
  9172  // generation does not match the given value. If no live object exists, the
  9173  // precondition fails. Setting to 0 makes the operation succeed only if there
  9174  // is a live version of the object.
  9175  func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
  9176  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  9177  	return c
  9178  }
  9179  
  9180  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  9181  // Makes the operation conditional on whether the destination object's current
  9182  // metageneration matches the given value.
  9183  func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
  9184  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  9185  	return c
  9186  }
  9187  
  9188  // IfMetagenerationNotMatch sets the optional parameter
  9189  // "ifMetagenerationNotMatch": Makes the operation conditional on whether the
  9190  // destination object's current metageneration does not match the given value.
  9191  func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall {
  9192  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  9193  	return c
  9194  }
  9195  
  9196  // IfSourceGenerationMatch sets the optional parameter
  9197  // "ifSourceGenerationMatch": Makes the operation conditional on whether the
  9198  // source object's current generation matches the given value.
  9199  func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
  9200  	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
  9201  	return c
  9202  }
  9203  
  9204  // IfSourceGenerationNotMatch sets the optional parameter
  9205  // "ifSourceGenerationNotMatch": Makes the operation conditional on whether the
  9206  // source object's current generation does not match the given value.
  9207  func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
  9208  	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
  9209  	return c
  9210  }
  9211  
  9212  // IfSourceMetagenerationMatch sets the optional parameter
  9213  // "ifSourceMetagenerationMatch": Makes the operation conditional on whether
  9214  // the source object's current metageneration matches the given value.
  9215  func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
  9216  	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
  9217  	return c
  9218  }
  9219  
  9220  // IfSourceMetagenerationNotMatch sets the optional parameter
  9221  // "ifSourceMetagenerationNotMatch": Makes the operation conditional on whether
  9222  // the source object's current metageneration does not match the given value.
  9223  func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
  9224  	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
  9225  	return c
  9226  }
  9227  
  9228  // Projection sets the optional parameter "projection": Set of properties to
  9229  // return. Defaults to noAcl, unless the object resource specifies the acl
  9230  // property, when it defaults to full.
  9231  //
  9232  // Possible values:
  9233  //
  9234  //	"full" - Include all properties.
  9235  //	"noAcl" - Omit the owner, acl property.
  9236  func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
  9237  	c.urlParams_.Set("projection", projection)
  9238  	return c
  9239  }
  9240  
  9241  // SourceGeneration sets the optional parameter "sourceGeneration": If present,
  9242  // selects a specific revision of the source object (as opposed to the latest
  9243  // version, the default).
  9244  func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall {
  9245  	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
  9246  	return c
  9247  }
  9248  
  9249  // UserProject sets the optional parameter "userProject": The project to be
  9250  // billed for this request. Required for Requester Pays buckets.
  9251  func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
  9252  	c.urlParams_.Set("userProject", userProject)
  9253  	return c
  9254  }
  9255  
  9256  // Fields allows partial responses to be retrieved. See
  9257  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9258  // details.
  9259  func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
  9260  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9261  	return c
  9262  }
  9263  
  9264  // Context sets the context to be used in this call's Do method.
  9265  func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
  9266  	c.ctx_ = ctx
  9267  	return c
  9268  }
  9269  
  9270  // Header returns a http.Header that can be modified by the caller to add
  9271  // headers to the request.
  9272  func (c *ObjectsCopyCall) Header() http.Header {
  9273  	if c.header_ == nil {
  9274  		c.header_ = make(http.Header)
  9275  	}
  9276  	return c.header_
  9277  }
  9278  
  9279  func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
  9280  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  9281  	var body io.Reader = nil
  9282  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
  9283  	if err != nil {
  9284  		return nil, err
  9285  	}
  9286  	c.urlParams_.Set("alt", alt)
  9287  	c.urlParams_.Set("prettyPrint", "false")
  9288  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
  9289  	urls += "?" + c.urlParams_.Encode()
  9290  	req, err := http.NewRequest("POST", urls, body)
  9291  	if err != nil {
  9292  		return nil, err
  9293  	}
  9294  	req.Header = reqHeaders
  9295  	googleapi.Expand(req.URL, map[string]string{
  9296  		"sourceBucket":      c.sourceBucket,
  9297  		"sourceObject":      c.sourceObject,
  9298  		"destinationBucket": c.destinationBucket,
  9299  		"destinationObject": c.destinationObject,
  9300  	})
  9301  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9302  }
  9303  
  9304  // Do executes the "storage.objects.copy" call.
  9305  // Any non-2xx status code is an error. Response headers are in either
  9306  // *Object.ServerResponse.Header or (if a response was returned at all) in
  9307  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9308  // whether the returned error was because http.StatusNotModified was returned.
  9309  func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  9310  	gensupport.SetOptions(c.urlParams_, opts...)
  9311  	res, err := c.doRequest("json")
  9312  	if res != nil && res.StatusCode == http.StatusNotModified {
  9313  		if res.Body != nil {
  9314  			res.Body.Close()
  9315  		}
  9316  		return nil, gensupport.WrapError(&googleapi.Error{
  9317  			Code:   res.StatusCode,
  9318  			Header: res.Header,
  9319  		})
  9320  	}
  9321  	if err != nil {
  9322  		return nil, err
  9323  	}
  9324  	defer googleapi.CloseBody(res)
  9325  	if err := googleapi.CheckResponse(res); err != nil {
  9326  		return nil, gensupport.WrapError(err)
  9327  	}
  9328  	ret := &Object{
  9329  		ServerResponse: googleapi.ServerResponse{
  9330  			Header:         res.Header,
  9331  			HTTPStatusCode: res.StatusCode,
  9332  		},
  9333  	}
  9334  	target := &ret
  9335  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9336  		return nil, err
  9337  	}
  9338  	return ret, nil
  9339  }
  9340  
  9341  type ObjectsDeleteCall struct {
  9342  	s          *Service
  9343  	bucket     string
  9344  	object     string
  9345  	urlParams_ gensupport.URLParams
  9346  	ctx_       context.Context
  9347  	header_    http.Header
  9348  }
  9349  
  9350  // Delete: Deletes an object and its metadata. Deletions are permanent if
  9351  // versioning is not enabled for the bucket, or if the generation parameter is
  9352  // used.
  9353  //
  9354  //   - bucket: Name of the bucket in which the object resides.
  9355  //   - object: Name of the object. For information about how to URL encode object
  9356  //     names to be path safe, see Encoding URI Path Parts
  9357  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  9358  func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
  9359  	c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9360  	c.bucket = bucket
  9361  	c.object = object
  9362  	return c
  9363  }
  9364  
  9365  // Generation sets the optional parameter "generation": If present, permanently
  9366  // deletes a specific revision of this object (as opposed to the latest
  9367  // version, the default).
  9368  func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
  9369  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  9370  	return c
  9371  }
  9372  
  9373  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
  9374  // operation conditional on whether the object's current generation matches the
  9375  // given value. Setting to 0 makes the operation succeed only if there are no
  9376  // live versions of the object.
  9377  func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
  9378  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  9379  	return c
  9380  }
  9381  
  9382  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
  9383  // Makes the operation conditional on whether the object's current generation
  9384  // does not match the given value. If no live object exists, the precondition
  9385  // fails. Setting to 0 makes the operation succeed only if there is a live
  9386  // version of the object.
  9387  func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
  9388  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  9389  	return c
  9390  }
  9391  
  9392  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  9393  // Makes the operation conditional on whether the object's current
  9394  // metageneration matches the given value.
  9395  func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall {
  9396  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  9397  	return c
  9398  }
  9399  
  9400  // IfMetagenerationNotMatch sets the optional parameter
  9401  // "ifMetagenerationNotMatch": Makes the operation conditional on whether the
  9402  // object's current metageneration does not match the given value.
  9403  func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
  9404  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  9405  	return c
  9406  }
  9407  
  9408  // UserProject sets the optional parameter "userProject": The project to be
  9409  // billed for this request. Required for Requester Pays buckets.
  9410  func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
  9411  	c.urlParams_.Set("userProject", userProject)
  9412  	return c
  9413  }
  9414  
  9415  // Fields allows partial responses to be retrieved. See
  9416  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9417  // details.
  9418  func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
  9419  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9420  	return c
  9421  }
  9422  
  9423  // Context sets the context to be used in this call's Do method.
  9424  func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
  9425  	c.ctx_ = ctx
  9426  	return c
  9427  }
  9428  
  9429  // Header returns a http.Header that can be modified by the caller to add
  9430  // headers to the request.
  9431  func (c *ObjectsDeleteCall) Header() http.Header {
  9432  	if c.header_ == nil {
  9433  		c.header_ = make(http.Header)
  9434  	}
  9435  	return c.header_
  9436  }
  9437  
  9438  func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9439  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9440  	var body io.Reader = nil
  9441  	c.urlParams_.Set("alt", alt)
  9442  	c.urlParams_.Set("prettyPrint", "false")
  9443  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  9444  	urls += "?" + c.urlParams_.Encode()
  9445  	req, err := http.NewRequest("DELETE", urls, body)
  9446  	if err != nil {
  9447  		return nil, err
  9448  	}
  9449  	req.Header = reqHeaders
  9450  	googleapi.Expand(req.URL, map[string]string{
  9451  		"bucket": c.bucket,
  9452  		"object": c.object,
  9453  	})
  9454  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9455  }
  9456  
  9457  // Do executes the "storage.objects.delete" call.
  9458  func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
  9459  	gensupport.SetOptions(c.urlParams_, opts...)
  9460  	res, err := c.doRequest("json")
  9461  	if err != nil {
  9462  		return err
  9463  	}
  9464  	defer googleapi.CloseBody(res)
  9465  	if err := googleapi.CheckResponse(res); err != nil {
  9466  		return gensupport.WrapError(err)
  9467  	}
  9468  	return nil
  9469  }
  9470  
  9471  type ObjectsGetCall struct {
  9472  	s            *Service
  9473  	bucket       string
  9474  	object       string
  9475  	urlParams_   gensupport.URLParams
  9476  	ifNoneMatch_ string
  9477  	ctx_         context.Context
  9478  	header_      http.Header
  9479  }
  9480  
  9481  // Get: Retrieves an object or its metadata.
  9482  //
  9483  //   - bucket: Name of the bucket in which the object resides.
  9484  //   - object: Name of the object. For information about how to URL encode object
  9485  //     names to be path safe, see Encoding URI Path Parts
  9486  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  9487  func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
  9488  	c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9489  	c.bucket = bucket
  9490  	c.object = object
  9491  	return c
  9492  }
  9493  
  9494  // Generation sets the optional parameter "generation": If present, selects a
  9495  // specific revision of this object (as opposed to the latest version, the
  9496  // default).
  9497  func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
  9498  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  9499  	return c
  9500  }
  9501  
  9502  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
  9503  // operation conditional on whether the object's current generation matches the
  9504  // given value. Setting to 0 makes the operation succeed only if there are no
  9505  // live versions of the object.
  9506  func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
  9507  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  9508  	return c
  9509  }
  9510  
  9511  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
  9512  // Makes the operation conditional on whether the object's current generation
  9513  // does not match the given value. If no live object exists, the precondition
  9514  // fails. Setting to 0 makes the operation succeed only if there is a live
  9515  // version of the object.
  9516  func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
  9517  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  9518  	return c
  9519  }
  9520  
  9521  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  9522  // Makes the operation conditional on whether the object's current
  9523  // metageneration matches the given value.
  9524  func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall {
  9525  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  9526  	return c
  9527  }
  9528  
  9529  // IfMetagenerationNotMatch sets the optional parameter
  9530  // "ifMetagenerationNotMatch": Makes the operation conditional on whether the
  9531  // object's current metageneration does not match the given value.
  9532  func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
  9533  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  9534  	return c
  9535  }
  9536  
  9537  // Projection sets the optional parameter "projection": Set of properties to
  9538  // return. Defaults to noAcl.
  9539  //
  9540  // Possible values:
  9541  //
  9542  //	"full" - Include all properties.
  9543  //	"noAcl" - Omit the owner, acl property.
  9544  func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
  9545  	c.urlParams_.Set("projection", projection)
  9546  	return c
  9547  }
  9548  
  9549  // SoftDeleted sets the optional parameter "softDeleted": If true, only
  9550  // soft-deleted object versions will be listed. The default is false. For more
  9551  // information, see Soft Delete.
  9552  func (c *ObjectsGetCall) SoftDeleted(softDeleted bool) *ObjectsGetCall {
  9553  	c.urlParams_.Set("softDeleted", fmt.Sprint(softDeleted))
  9554  	return c
  9555  }
  9556  
  9557  // UserProject sets the optional parameter "userProject": The project to be
  9558  // billed for this request. Required for Requester Pays buckets.
  9559  func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
  9560  	c.urlParams_.Set("userProject", userProject)
  9561  	return c
  9562  }
  9563  
  9564  // Fields allows partial responses to be retrieved. See
  9565  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9566  // details.
  9567  func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
  9568  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9569  	return c
  9570  }
  9571  
  9572  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  9573  // object's ETag matches the given value. This is useful for getting updates
  9574  // only after the object has changed since the last request.
  9575  func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
  9576  	c.ifNoneMatch_ = entityTag
  9577  	return c
  9578  }
  9579  
  9580  // Context sets the context to be used in this call's Do and Download methods.
  9581  func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
  9582  	c.ctx_ = ctx
  9583  	return c
  9584  }
  9585  
  9586  // Header returns a http.Header that can be modified by the caller to add
  9587  // headers to the request.
  9588  func (c *ObjectsGetCall) Header() http.Header {
  9589  	if c.header_ == nil {
  9590  		c.header_ = make(http.Header)
  9591  	}
  9592  	return c.header_
  9593  }
  9594  
  9595  func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
  9596  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9597  	if c.ifNoneMatch_ != "" {
  9598  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9599  	}
  9600  	var body io.Reader = nil
  9601  	c.urlParams_.Set("alt", alt)
  9602  	c.urlParams_.Set("prettyPrint", "false")
  9603  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  9604  	urls += "?" + c.urlParams_.Encode()
  9605  	req, err := http.NewRequest("GET", urls, body)
  9606  	if err != nil {
  9607  		return nil, err
  9608  	}
  9609  	req.Header = reqHeaders
  9610  	googleapi.Expand(req.URL, map[string]string{
  9611  		"bucket": c.bucket,
  9612  		"object": c.object,
  9613  	})
  9614  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9615  }
  9616  
  9617  // Download fetches the API endpoint's "media" value, instead of the normal
  9618  // API response value. If the returned error is nil, the Response is guaranteed to
  9619  // have a 2xx status code. Callers must close the Response.Body as usual.
  9620  func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  9621  	gensupport.SetOptions(c.urlParams_, opts...)
  9622  	res, err := c.doRequest("media")
  9623  	if err != nil {
  9624  		return nil, err
  9625  	}
  9626  	if err := googleapi.CheckMediaResponse(res); err != nil {
  9627  		res.Body.Close()
  9628  		return nil, gensupport.WrapError(err)
  9629  	}
  9630  	return res, nil
  9631  }
  9632  
  9633  // Do executes the "storage.objects.get" call.
  9634  // Any non-2xx status code is an error. Response headers are in either
  9635  // *Object.ServerResponse.Header or (if a response was returned at all) in
  9636  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9637  // whether the returned error was because http.StatusNotModified was returned.
  9638  func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  9639  	gensupport.SetOptions(c.urlParams_, opts...)
  9640  	res, err := c.doRequest("json")
  9641  	if res != nil && res.StatusCode == http.StatusNotModified {
  9642  		if res.Body != nil {
  9643  			res.Body.Close()
  9644  		}
  9645  		return nil, gensupport.WrapError(&googleapi.Error{
  9646  			Code:   res.StatusCode,
  9647  			Header: res.Header,
  9648  		})
  9649  	}
  9650  	if err != nil {
  9651  		return nil, err
  9652  	}
  9653  	defer googleapi.CloseBody(res)
  9654  	if err := googleapi.CheckResponse(res); err != nil {
  9655  		return nil, gensupport.WrapError(err)
  9656  	}
  9657  	ret := &Object{
  9658  		ServerResponse: googleapi.ServerResponse{
  9659  			Header:         res.Header,
  9660  			HTTPStatusCode: res.StatusCode,
  9661  		},
  9662  	}
  9663  	target := &ret
  9664  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9665  		return nil, err
  9666  	}
  9667  	return ret, nil
  9668  }
  9669  
  9670  type ObjectsGetIamPolicyCall struct {
  9671  	s            *Service
  9672  	bucket       string
  9673  	object       string
  9674  	urlParams_   gensupport.URLParams
  9675  	ifNoneMatch_ string
  9676  	ctx_         context.Context
  9677  	header_      http.Header
  9678  }
  9679  
  9680  // GetIamPolicy: Returns an IAM policy for the specified object.
  9681  //
  9682  //   - bucket: Name of the bucket in which the object resides.
  9683  //   - object: Name of the object. For information about how to URL encode object
  9684  //     names to be path safe, see Encoding URI Path Parts
  9685  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  9686  func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall {
  9687  	c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9688  	c.bucket = bucket
  9689  	c.object = object
  9690  	return c
  9691  }
  9692  
  9693  // Generation sets the optional parameter "generation": If present, selects a
  9694  // specific revision of this object (as opposed to the latest version, the
  9695  // default).
  9696  func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall {
  9697  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  9698  	return c
  9699  }
  9700  
  9701  // UserProject sets the optional parameter "userProject": The project to be
  9702  // billed for this request. Required for Requester Pays buckets.
  9703  func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
  9704  	c.urlParams_.Set("userProject", userProject)
  9705  	return c
  9706  }
  9707  
  9708  // Fields allows partial responses to be retrieved. See
  9709  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9710  // details.
  9711  func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall {
  9712  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9713  	return c
  9714  }
  9715  
  9716  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  9717  // object's ETag matches the given value. This is useful for getting updates
  9718  // only after the object has changed since the last request.
  9719  func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall {
  9720  	c.ifNoneMatch_ = entityTag
  9721  	return c
  9722  }
  9723  
  9724  // Context sets the context to be used in this call's Do method.
  9725  func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
  9726  	c.ctx_ = ctx
  9727  	return c
  9728  }
  9729  
  9730  // Header returns a http.Header that can be modified by the caller to add
  9731  // headers to the request.
  9732  func (c *ObjectsGetIamPolicyCall) Header() http.Header {
  9733  	if c.header_ == nil {
  9734  		c.header_ = make(http.Header)
  9735  	}
  9736  	return c.header_
  9737  }
  9738  
  9739  func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  9740  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9741  	if c.ifNoneMatch_ != "" {
  9742  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9743  	}
  9744  	var body io.Reader = nil
  9745  	c.urlParams_.Set("alt", alt)
  9746  	c.urlParams_.Set("prettyPrint", "false")
  9747  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
  9748  	urls += "?" + c.urlParams_.Encode()
  9749  	req, err := http.NewRequest("GET", urls, body)
  9750  	if err != nil {
  9751  		return nil, err
  9752  	}
  9753  	req.Header = reqHeaders
  9754  	googleapi.Expand(req.URL, map[string]string{
  9755  		"bucket": c.bucket,
  9756  		"object": c.object,
  9757  	})
  9758  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9759  }
  9760  
  9761  // Do executes the "storage.objects.getIamPolicy" call.
  9762  // Any non-2xx status code is an error. Response headers are in either
  9763  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  9764  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9765  // whether the returned error was because http.StatusNotModified was returned.
  9766  func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  9767  	gensupport.SetOptions(c.urlParams_, opts...)
  9768  	res, err := c.doRequest("json")
  9769  	if res != nil && res.StatusCode == http.StatusNotModified {
  9770  		if res.Body != nil {
  9771  			res.Body.Close()
  9772  		}
  9773  		return nil, gensupport.WrapError(&googleapi.Error{
  9774  			Code:   res.StatusCode,
  9775  			Header: res.Header,
  9776  		})
  9777  	}
  9778  	if err != nil {
  9779  		return nil, err
  9780  	}
  9781  	defer googleapi.CloseBody(res)
  9782  	if err := googleapi.CheckResponse(res); err != nil {
  9783  		return nil, gensupport.WrapError(err)
  9784  	}
  9785  	ret := &Policy{
  9786  		ServerResponse: googleapi.ServerResponse{
  9787  			Header:         res.Header,
  9788  			HTTPStatusCode: res.StatusCode,
  9789  		},
  9790  	}
  9791  	target := &ret
  9792  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9793  		return nil, err
  9794  	}
  9795  	return ret, nil
  9796  }
  9797  
  9798  type ObjectsInsertCall struct {
  9799  	s          *Service
  9800  	bucket     string
  9801  	object     *Object
  9802  	urlParams_ gensupport.URLParams
  9803  	mediaInfo_ *gensupport.MediaInfo
  9804  	retry      *gensupport.RetryConfig
  9805  	ctx_       context.Context
  9806  	header_    http.Header
  9807  }
  9808  
  9809  // Insert: Stores a new object and metadata.
  9810  //
  9811  //   - bucket: Name of the bucket in which to store the new object. Overrides the
  9812  //     provided object metadata's bucket value, if any.
  9813  func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
  9814  	c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9815  	c.bucket = bucket
  9816  	c.object = object
  9817  	return c
  9818  }
  9819  
  9820  // ContentEncoding sets the optional parameter "contentEncoding": If set, sets
  9821  // the contentEncoding property of the final object to this value. Setting this
  9822  // parameter is equivalent to setting the contentEncoding metadata property.
  9823  // This can be useful when uploading an object with uploadType=media to
  9824  // indicate the encoding of the content being uploaded.
  9825  func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall {
  9826  	c.urlParams_.Set("contentEncoding", contentEncoding)
  9827  	return c
  9828  }
  9829  
  9830  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
  9831  // operation conditional on whether the object's current generation matches the
  9832  // given value. Setting to 0 makes the operation succeed only if there are no
  9833  // live versions of the object.
  9834  func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
  9835  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  9836  	return c
  9837  }
  9838  
  9839  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
  9840  // Makes the operation conditional on whether the object's current generation
  9841  // does not match the given value. If no live object exists, the precondition
  9842  // fails. Setting to 0 makes the operation succeed only if there is a live
  9843  // version of the object.
  9844  func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
  9845  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  9846  	return c
  9847  }
  9848  
  9849  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
  9850  // Makes the operation conditional on whether the object's current
  9851  // metageneration matches the given value.
  9852  func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall {
  9853  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  9854  	return c
  9855  }
  9856  
  9857  // IfMetagenerationNotMatch sets the optional parameter
  9858  // "ifMetagenerationNotMatch": Makes the operation conditional on whether the
  9859  // object's current metageneration does not match the given value.
  9860  func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
  9861  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  9862  	return c
  9863  }
  9864  
  9865  // KmsKeyName sets the optional parameter "kmsKeyName": Resource name of the
  9866  // Cloud KMS key, of the form
  9867  // projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that
  9868  // will be used to encrypt the object. Overrides the object metadata's
  9869  // kms_key_name value, if any.
  9870  func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall {
  9871  	c.urlParams_.Set("kmsKeyName", kmsKeyName)
  9872  	return c
  9873  }
  9874  
  9875  // Name sets the optional parameter "name": Name of the object. Required when
  9876  // the object metadata is not otherwise provided. Overrides the object
  9877  // metadata's name value, if any. For information about how to URL encode
  9878  // object names to be path safe, see Encoding URI Path Parts
  9879  // (https://cloud.google.com/storage/docs/request-endpoints#encoding).
  9880  func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
  9881  	c.urlParams_.Set("name", name)
  9882  	return c
  9883  }
  9884  
  9885  // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
  9886  // predefined set of access controls to this object.
  9887  //
  9888  // Possible values:
  9889  //
  9890  //	"authenticatedRead" - Object owner gets OWNER access, and
  9891  //
  9892  // allAuthenticatedUsers get READER access.
  9893  //
  9894  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
  9895  //
  9896  // team owners get OWNER access.
  9897  //
  9898  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
  9899  //
  9900  // owners get READER access.
  9901  //
  9902  //	"private" - Object owner gets OWNER access.
  9903  //	"projectPrivate" - Object owner gets OWNER access, and project team
  9904  //
  9905  // members get access according to their roles.
  9906  //
  9907  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
  9908  //
  9909  // access.
  9910  func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
  9911  	c.urlParams_.Set("predefinedAcl", predefinedAcl)
  9912  	return c
  9913  }
  9914  
  9915  // Projection sets the optional parameter "projection": Set of properties to
  9916  // return. Defaults to noAcl, unless the object resource specifies the acl
  9917  // property, when it defaults to full.
  9918  //
  9919  // Possible values:
  9920  //
  9921  //	"full" - Include all properties.
  9922  //	"noAcl" - Omit the owner, acl property.
  9923  func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
  9924  	c.urlParams_.Set("projection", projection)
  9925  	return c
  9926  }
  9927  
  9928  // UserProject sets the optional parameter "userProject": The project to be
  9929  // billed for this request. Required for Requester Pays buckets.
  9930  func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
  9931  	c.urlParams_.Set("userProject", userProject)
  9932  	return c
  9933  }
  9934  
  9935  // Media specifies the media to upload in one or more chunks. The chunk size
  9936  // may be controlled by supplying a MediaOption generated by
  9937  // googleapi.ChunkSize. The chunk size defaults to
  9938  // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
  9939  // request will be determined by sniffing the contents of r, unless a
  9940  // MediaOption generated by googleapi.ContentType is supplied.
  9941  // At most one of Media and ResumableMedia may be set.
  9942  func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
  9943  	if ct := c.object.ContentType; ct != "" {
  9944  		options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
  9945  	}
  9946  	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  9947  	return c
  9948  }
  9949  
  9950  // ResumableMedia specifies the media to upload in chunks and can be canceled
  9951  // with ctx.
  9952  //
  9953  // Deprecated: use Media instead.
  9954  //
  9955  // At most one of Media and ResumableMedia may be set. mediaType identifies the
  9956  // MIME media type of the upload, such as "image/png". If mediaType is "", it
  9957  // will be auto-detected. The provided ctx will supersede any context
  9958  // previously provided to the Context method.
  9959  func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
  9960  	c.ctx_ = ctx
  9961  	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  9962  	return c
  9963  }
  9964  
  9965  // ProgressUpdater provides a callback function that will be called after every
  9966  // chunk. It should be a low-latency function in order to not slow down the
  9967  // upload operation. This should only be called when using ResumableMedia (as
  9968  // opposed to Media).
  9969  func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
  9970  	c.mediaInfo_.SetProgressUpdater(pu)
  9971  	return c
  9972  }
  9973  
  9974  // WithRetry causes the library to retry the initial request of the upload(for
  9975  // resumable uploads) or the entire upload (for multipart uploads) ifa
  9976  // transient error occurs. This is contingent on ChunkSize being > 0 (sothat
  9977  // the input data may be buffered). The backoff argument will be used
  9978  // todetermine exponential backoff timing, and the errorFunc is used to
  9979  // determinewhich errors are considered retryable. By default, exponetial
  9980  // backoff will beapplied using gax defaults, and the following errors are
  9981  // retried:
  9982  //
  9983  // - HTTP responses with codes 408, 429, 502, 503, and 504.
  9984  //
  9985  // - Transient network errors such as connection reset and
  9986  // io.ErrUnexpectedEOF.
  9987  //
  9988  // - Errors which are considered transient using the Temporary() interface.
  9989  //
  9990  // - Wrapped versions of these errors.
  9991  func (c *ObjectsInsertCall) WithRetry(bo *gax.Backoff, errorFunc func(err error) bool) *ObjectsInsertCall {
  9992  	c.retry = &gensupport.RetryConfig{
  9993  		Backoff:     bo,
  9994  		ShouldRetry: errorFunc,
  9995  	}
  9996  	return c
  9997  }
  9998  
  9999  // Fields allows partial responses to be retrieved. See
 10000  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 10001  // details.
 10002  func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
 10003  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 10004  	return c
 10005  }
 10006  
 10007  // Context sets the context to be used in this call's Do method.
 10008  // This context will supersede any context previously provided to the
 10009  // ResumableMedia method.
 10010  func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
 10011  	c.ctx_ = ctx
 10012  	return c
 10013  }
 10014  
 10015  // Header returns a http.Header that can be modified by the caller to add
 10016  // headers to the request.
 10017  func (c *ObjectsInsertCall) Header() http.Header {
 10018  	if c.header_ == nil {
 10019  		c.header_ = make(http.Header)
 10020  	}
 10021  	return c.header_
 10022  }
 10023  
 10024  func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
 10025  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
 10026  	var body io.Reader = nil
 10027  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
 10028  	if err != nil {
 10029  		return nil, err
 10030  	}
 10031  	c.urlParams_.Set("alt", alt)
 10032  	c.urlParams_.Set("prettyPrint", "false")
 10033  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
 10034  	if c.mediaInfo_ != nil {
 10035  		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1/b/{bucket}/o")
 10036  		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
 10037  	}
 10038  	if body == nil {
 10039  		body = new(bytes.Buffer)
 10040  		reqHeaders.Set("Content-Type", "application/json")
 10041  	}
 10042  	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
 10043  	defer cleanup()
 10044  	urls += "?" + c.urlParams_.Encode()
 10045  	req, err := http.NewRequest("POST", urls, body)
 10046  	if err != nil {
 10047  		return nil, err
 10048  	}
 10049  	req.Header = reqHeaders
 10050  	req.GetBody = getBody
 10051  	googleapi.Expand(req.URL, map[string]string{
 10052  		"bucket": c.bucket,
 10053  	})
 10054  	if c.retry != nil {
 10055  		return gensupport.SendRequestWithRetry(c.ctx_, c.s.client, req, c.retry)
 10056  	}
 10057  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 10058  }
 10059  
 10060  // Do executes the "storage.objects.insert" call.
 10061  // Any non-2xx status code is an error. Response headers are in either
 10062  // *Object.ServerResponse.Header or (if a response was returned at all) in
 10063  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 10064  // whether the returned error was because http.StatusNotModified was returned.
 10065  func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
 10066  	gensupport.SetOptions(c.urlParams_, opts...)
 10067  	res, err := c.doRequest("json")
 10068  	if res != nil && res.StatusCode == http.StatusNotModified {
 10069  		if res.Body != nil {
 10070  			res.Body.Close()
 10071  		}
 10072  		return nil, gensupport.WrapError(&googleapi.Error{
 10073  			Code:   res.StatusCode,
 10074  			Header: res.Header,
 10075  		})
 10076  	}
 10077  	if err != nil {
 10078  		return nil, err
 10079  	}
 10080  	defer googleapi.CloseBody(res)
 10081  	if err := googleapi.CheckResponse(res); err != nil {
 10082  		return nil, gensupport.WrapError(err)
 10083  	}
 10084  	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
 10085  	if rx != nil {
 10086  		rx.Client = c.s.client
 10087  		rx.UserAgent = c.s.userAgent()
 10088  		rx.Retry = c.retry
 10089  		ctx := c.ctx_
 10090  		if ctx == nil {
 10091  			ctx = context.TODO()
 10092  		}
 10093  		res, err = rx.Upload(ctx)
 10094  		if err != nil {
 10095  			return nil, err
 10096  		}
 10097  		defer res.Body.Close()
 10098  		if err := googleapi.CheckResponse(res); err != nil {
 10099  			return nil, gensupport.WrapError(err)
 10100  		}
 10101  	}
 10102  	ret := &Object{
 10103  		ServerResponse: googleapi.ServerResponse{
 10104  			Header:         res.Header,
 10105  			HTTPStatusCode: res.StatusCode,
 10106  		},
 10107  	}
 10108  	target := &ret
 10109  	if err := gensupport.DecodeResponse(target, res); err != nil {
 10110  		return nil, err
 10111  	}
 10112  	return ret, nil
 10113  }
 10114  
 10115  type ObjectsListCall struct {
 10116  	s            *Service
 10117  	bucket       string
 10118  	urlParams_   gensupport.URLParams
 10119  	ifNoneMatch_ string
 10120  	ctx_         context.Context
 10121  	header_      http.Header
 10122  }
 10123  
 10124  // List: Retrieves a list of objects matching the criteria.
 10125  //
 10126  // - bucket: Name of the bucket in which to look for objects.
 10127  func (r *ObjectsService) List(bucket string) *ObjectsListCall {
 10128  	c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 10129  	c.bucket = bucket
 10130  	return c
 10131  }
 10132  
 10133  // Delimiter sets the optional parameter "delimiter": Returns results in a
 10134  // directory-like mode. items will contain only objects whose names, aside from
 10135  // the prefix, do not contain delimiter. Objects whose names, aside from the
 10136  // prefix, contain delimiter will have their name, truncated after the
 10137  // delimiter, returned in prefixes. Duplicate prefixes are omitted.
 10138  func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
 10139  	c.urlParams_.Set("delimiter", delimiter)
 10140  	return c
 10141  }
 10142  
 10143  // EndOffset sets the optional parameter "endOffset": Filter results to objects
 10144  // whose names are lexicographically before endOffset. If startOffset is also
 10145  // set, the objects listed will have names between startOffset (inclusive) and
 10146  // endOffset (exclusive).
 10147  func (c *ObjectsListCall) EndOffset(endOffset string) *ObjectsListCall {
 10148  	c.urlParams_.Set("endOffset", endOffset)
 10149  	return c
 10150  }
 10151  
 10152  // IncludeFoldersAsPrefixes sets the optional parameter
 10153  // "includeFoldersAsPrefixes": Only applicable if delimiter is set to '/'. If
 10154  // true, will also include folders and managed folders (besides objects) in the
 10155  // returned prefixes.
 10156  func (c *ObjectsListCall) IncludeFoldersAsPrefixes(includeFoldersAsPrefixes bool) *ObjectsListCall {
 10157  	c.urlParams_.Set("includeFoldersAsPrefixes", fmt.Sprint(includeFoldersAsPrefixes))
 10158  	return c
 10159  }
 10160  
 10161  // IncludeTrailingDelimiter sets the optional parameter
 10162  // "includeTrailingDelimiter": If true, objects that end in exactly one
 10163  // instance of delimiter will have their metadata included in items in addition
 10164  // to prefixes.
 10165  func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall {
 10166  	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
 10167  	return c
 10168  }
 10169  
 10170  // MatchGlob sets the optional parameter "matchGlob": Filter results to objects
 10171  // and prefixes that match this glob pattern.
 10172  func (c *ObjectsListCall) MatchGlob(matchGlob string) *ObjectsListCall {
 10173  	c.urlParams_.Set("matchGlob", matchGlob)
 10174  	return c
 10175  }
 10176  
 10177  // MaxResults sets the optional parameter "maxResults": Maximum number of items
 10178  // plus prefixes to return in a single page of responses. As duplicate prefixes
 10179  // are omitted, fewer total results may be returned than requested. The service
 10180  // will use this parameter or 1,000 items, whichever is smaller.
 10181  func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
 10182  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
 10183  	return c
 10184  }
 10185  
 10186  // PageToken sets the optional parameter "pageToken": A previously-returned
 10187  // page token representing part of the larger set of results to view.
 10188  func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
 10189  	c.urlParams_.Set("pageToken", pageToken)
 10190  	return c
 10191  }
 10192  
 10193  // Prefix sets the optional parameter "prefix": Filter results to objects whose
 10194  // names begin with this prefix.
 10195  func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
 10196  	c.urlParams_.Set("prefix", prefix)
 10197  	return c
 10198  }
 10199  
 10200  // Projection sets the optional parameter "projection": Set of properties to
 10201  // return. Defaults to noAcl.
 10202  //
 10203  // Possible values:
 10204  //
 10205  //	"full" - Include all properties.
 10206  //	"noAcl" - Omit the owner, acl property.
 10207  func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
 10208  	c.urlParams_.Set("projection", projection)
 10209  	return c
 10210  }
 10211  
 10212  // SoftDeleted sets the optional parameter "softDeleted": If true, only
 10213  // soft-deleted object versions will be listed. The default is false. For more
 10214  // information, see Soft Delete.
 10215  func (c *ObjectsListCall) SoftDeleted(softDeleted bool) *ObjectsListCall {
 10216  	c.urlParams_.Set("softDeleted", fmt.Sprint(softDeleted))
 10217  	return c
 10218  }
 10219  
 10220  // StartOffset sets the optional parameter "startOffset": Filter results to
 10221  // objects whose names are lexicographically equal to or after startOffset. If
 10222  // endOffset is also set, the objects listed will have names between
 10223  // startOffset (inclusive) and endOffset (exclusive).
 10224  func (c *ObjectsListCall) StartOffset(startOffset string) *ObjectsListCall {
 10225  	c.urlParams_.Set("startOffset", startOffset)
 10226  	return c
 10227  }
 10228  
 10229  // UserProject sets the optional parameter "userProject": The project to be
 10230  // billed for this request. Required for Requester Pays buckets.
 10231  func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
 10232  	c.urlParams_.Set("userProject", userProject)
 10233  	return c
 10234  }
 10235  
 10236  // Versions sets the optional parameter "versions": If true, lists all versions
 10237  // of an object as distinct results. The default is false. For more
 10238  // information, see Object Versioning.
 10239  func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
 10240  	c.urlParams_.Set("versions", fmt.Sprint(versions))
 10241  	return c
 10242  }
 10243  
 10244  // Fields allows partial responses to be retrieved. See
 10245  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 10246  // details.
 10247  func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
 10248  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 10249  	return c
 10250  }
 10251  
 10252  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 10253  // object's ETag matches the given value. This is useful for getting updates
 10254  // only after the object has changed since the last request.
 10255  func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
 10256  	c.ifNoneMatch_ = entityTag
 10257  	return c
 10258  }
 10259  
 10260  // Context sets the context to be used in this call's Do method.
 10261  func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
 10262  	c.ctx_ = ctx
 10263  	return c
 10264  }
 10265  
 10266  // Header returns a http.Header that can be modified by the caller to add
 10267  // headers to the request.
 10268  func (c *ObjectsListCall) Header() http.Header {
 10269  	if c.header_ == nil {
 10270  		c.header_ = make(http.Header)
 10271  	}
 10272  	return c.header_
 10273  }
 10274  
 10275  func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
 10276  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 10277  	if c.ifNoneMatch_ != "" {
 10278  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 10279  	}
 10280  	var body io.Reader = nil
 10281  	c.urlParams_.Set("alt", alt)
 10282  	c.urlParams_.Set("prettyPrint", "false")
 10283  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
 10284  	urls += "?" + c.urlParams_.Encode()
 10285  	req, err := http.NewRequest("GET", urls, body)
 10286  	if err != nil {
 10287  		return nil, err
 10288  	}
 10289  	req.Header = reqHeaders
 10290  	googleapi.Expand(req.URL, map[string]string{
 10291  		"bucket": c.bucket,
 10292  	})
 10293  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 10294  }
 10295  
 10296  // Do executes the "storage.objects.list" call.
 10297  // Any non-2xx status code is an error. Response headers are in either
 10298  // *Objects.ServerResponse.Header or (if a response was returned at all) in
 10299  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 10300  // whether the returned error was because http.StatusNotModified was returned.
 10301  func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
 10302  	gensupport.SetOptions(c.urlParams_, opts...)
 10303  	res, err := c.doRequest("json")
 10304  	if res != nil && res.StatusCode == http.StatusNotModified {
 10305  		if res.Body != nil {
 10306  			res.Body.Close()
 10307  		}
 10308  		return nil, gensupport.WrapError(&googleapi.Error{
 10309  			Code:   res.StatusCode,
 10310  			Header: res.Header,
 10311  		})
 10312  	}
 10313  	if err != nil {
 10314  		return nil, err
 10315  	}
 10316  	defer googleapi.CloseBody(res)
 10317  	if err := googleapi.CheckResponse(res); err != nil {
 10318  		return nil, gensupport.WrapError(err)
 10319  	}
 10320  	ret := &Objects{
 10321  		ServerResponse: googleapi.ServerResponse{
 10322  			Header:         res.Header,
 10323  			HTTPStatusCode: res.StatusCode,
 10324  		},
 10325  	}
 10326  	target := &ret
 10327  	if err := gensupport.DecodeResponse(target, res); err != nil {
 10328  		return nil, err
 10329  	}
 10330  	return ret, nil
 10331  }
 10332  
 10333  // Pages invokes f for each page of results.
 10334  // A non-nil error returned from f will halt the iteration.
 10335  // The provided context supersedes any context provided to the Context method.
 10336  func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
 10337  	c.ctx_ = ctx
 10338  	defer c.PageToken(c.urlParams_.Get("pageToken"))
 10339  	for {
 10340  		x, err := c.Do()
 10341  		if err != nil {
 10342  			return err
 10343  		}
 10344  		if err := f(x); err != nil {
 10345  			return err
 10346  		}
 10347  		if x.NextPageToken == "" {
 10348  			return nil
 10349  		}
 10350  		c.PageToken(x.NextPageToken)
 10351  	}
 10352  }
 10353  
 10354  type ObjectsPatchCall struct {
 10355  	s          *Service
 10356  	bucket     string
 10357  	object     string
 10358  	object2    *Object
 10359  	urlParams_ gensupport.URLParams
 10360  	ctx_       context.Context
 10361  	header_    http.Header
 10362  }
 10363  
 10364  // Patch: Patches an object's metadata.
 10365  //
 10366  //   - bucket: Name of the bucket in which the object resides.
 10367  //   - object: Name of the object. For information about how to URL encode object
 10368  //     names to be path safe, see Encoding URI Path Parts
 10369  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
 10370  func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
 10371  	c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 10372  	c.bucket = bucket
 10373  	c.object = object
 10374  	c.object2 = object2
 10375  	return c
 10376  }
 10377  
 10378  // Generation sets the optional parameter "generation": If present, selects a
 10379  // specific revision of this object (as opposed to the latest version, the
 10380  // default).
 10381  func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
 10382  	c.urlParams_.Set("generation", fmt.Sprint(generation))
 10383  	return c
 10384  }
 10385  
 10386  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
 10387  // operation conditional on whether the object's current generation matches the
 10388  // given value. Setting to 0 makes the operation succeed only if there are no
 10389  // live versions of the object.
 10390  func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
 10391  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
 10392  	return c
 10393  }
 10394  
 10395  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
 10396  // Makes the operation conditional on whether the object's current generation
 10397  // does not match the given value. If no live object exists, the precondition
 10398  // fails. Setting to 0 makes the operation succeed only if there is a live
 10399  // version of the object.
 10400  func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
 10401  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
 10402  	return c
 10403  }
 10404  
 10405  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
 10406  // Makes the operation conditional on whether the object's current
 10407  // metageneration matches the given value.
 10408  func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall {
 10409  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
 10410  	return c
 10411  }
 10412  
 10413  // IfMetagenerationNotMatch sets the optional parameter
 10414  // "ifMetagenerationNotMatch": Makes the operation conditional on whether the
 10415  // object's current metageneration does not match the given value.
 10416  func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
 10417  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
 10418  	return c
 10419  }
 10420  
 10421  // OverrideUnlockedRetention sets the optional parameter
 10422  // "overrideUnlockedRetention": Must be true to remove the retention
 10423  // configuration, reduce its unlocked retention period, or change its mode from
 10424  // unlocked to locked.
 10425  func (c *ObjectsPatchCall) OverrideUnlockedRetention(overrideUnlockedRetention bool) *ObjectsPatchCall {
 10426  	c.urlParams_.Set("overrideUnlockedRetention", fmt.Sprint(overrideUnlockedRetention))
 10427  	return c
 10428  }
 10429  
 10430  // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
 10431  // predefined set of access controls to this object.
 10432  //
 10433  // Possible values:
 10434  //
 10435  //	"authenticatedRead" - Object owner gets OWNER access, and
 10436  //
 10437  // allAuthenticatedUsers get READER access.
 10438  //
 10439  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
 10440  //
 10441  // team owners get OWNER access.
 10442  //
 10443  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
 10444  //
 10445  // owners get READER access.
 10446  //
 10447  //	"private" - Object owner gets OWNER access.
 10448  //	"projectPrivate" - Object owner gets OWNER access, and project team
 10449  //
 10450  // members get access according to their roles.
 10451  //
 10452  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
 10453  //
 10454  // access.
 10455  func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
 10456  	c.urlParams_.Set("predefinedAcl", predefinedAcl)
 10457  	return c
 10458  }
 10459  
 10460  // Projection sets the optional parameter "projection": Set of properties to
 10461  // return. Defaults to full.
 10462  //
 10463  // Possible values:
 10464  //
 10465  //	"full" - Include all properties.
 10466  //	"noAcl" - Omit the owner, acl property.
 10467  func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
 10468  	c.urlParams_.Set("projection", projection)
 10469  	return c
 10470  }
 10471  
 10472  // UserProject sets the optional parameter "userProject": The project to be
 10473  // billed for this request, for Requester Pays buckets.
 10474  func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
 10475  	c.urlParams_.Set("userProject", userProject)
 10476  	return c
 10477  }
 10478  
 10479  // Fields allows partial responses to be retrieved. See
 10480  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 10481  // details.
 10482  func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
 10483  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 10484  	return c
 10485  }
 10486  
 10487  // Context sets the context to be used in this call's Do method.
 10488  func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
 10489  	c.ctx_ = ctx
 10490  	return c
 10491  }
 10492  
 10493  // Header returns a http.Header that can be modified by the caller to add
 10494  // headers to the request.
 10495  func (c *ObjectsPatchCall) Header() http.Header {
 10496  	if c.header_ == nil {
 10497  		c.header_ = make(http.Header)
 10498  	}
 10499  	return c.header_
 10500  }
 10501  
 10502  func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
 10503  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
 10504  	var body io.Reader = nil
 10505  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
 10506  	if err != nil {
 10507  		return nil, err
 10508  	}
 10509  	c.urlParams_.Set("alt", alt)
 10510  	c.urlParams_.Set("prettyPrint", "false")
 10511  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
 10512  	urls += "?" + c.urlParams_.Encode()
 10513  	req, err := http.NewRequest("PATCH", urls, body)
 10514  	if err != nil {
 10515  		return nil, err
 10516  	}
 10517  	req.Header = reqHeaders
 10518  	googleapi.Expand(req.URL, map[string]string{
 10519  		"bucket": c.bucket,
 10520  		"object": c.object,
 10521  	})
 10522  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 10523  }
 10524  
 10525  // Do executes the "storage.objects.patch" call.
 10526  // Any non-2xx status code is an error. Response headers are in either
 10527  // *Object.ServerResponse.Header or (if a response was returned at all) in
 10528  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 10529  // whether the returned error was because http.StatusNotModified was returned.
 10530  func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
 10531  	gensupport.SetOptions(c.urlParams_, opts...)
 10532  	res, err := c.doRequest("json")
 10533  	if res != nil && res.StatusCode == http.StatusNotModified {
 10534  		if res.Body != nil {
 10535  			res.Body.Close()
 10536  		}
 10537  		return nil, gensupport.WrapError(&googleapi.Error{
 10538  			Code:   res.StatusCode,
 10539  			Header: res.Header,
 10540  		})
 10541  	}
 10542  	if err != nil {
 10543  		return nil, err
 10544  	}
 10545  	defer googleapi.CloseBody(res)
 10546  	if err := googleapi.CheckResponse(res); err != nil {
 10547  		return nil, gensupport.WrapError(err)
 10548  	}
 10549  	ret := &Object{
 10550  		ServerResponse: googleapi.ServerResponse{
 10551  			Header:         res.Header,
 10552  			HTTPStatusCode: res.StatusCode,
 10553  		},
 10554  	}
 10555  	target := &ret
 10556  	if err := gensupport.DecodeResponse(target, res); err != nil {
 10557  		return nil, err
 10558  	}
 10559  	return ret, nil
 10560  }
 10561  
 10562  type ObjectsRestoreCall struct {
 10563  	s          *Service
 10564  	bucket     string
 10565  	object     string
 10566  	urlParams_ gensupport.URLParams
 10567  	ctx_       context.Context
 10568  	header_    http.Header
 10569  }
 10570  
 10571  // Restore: Restores a soft-deleted object.
 10572  //
 10573  //   - bucket: Name of the bucket in which the object resides.
 10574  //   - generation: Selects a specific revision of this object.
 10575  //   - object: Name of the object. For information about how to URL encode object
 10576  //     names to be path safe, see Encoding URI Path Parts.
 10577  func (r *ObjectsService) Restore(bucket string, object string, generation int64) *ObjectsRestoreCall {
 10578  	c := &ObjectsRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 10579  	c.bucket = bucket
 10580  	c.object = object
 10581  	c.urlParams_.Set("generation", fmt.Sprint(generation))
 10582  	return c
 10583  }
 10584  
 10585  // CopySourceAcl sets the optional parameter "copySourceAcl": If true, copies
 10586  // the source object's ACL; otherwise, uses the bucket's default object ACL.
 10587  // The default is false.
 10588  func (c *ObjectsRestoreCall) CopySourceAcl(copySourceAcl bool) *ObjectsRestoreCall {
 10589  	c.urlParams_.Set("copySourceAcl", fmt.Sprint(copySourceAcl))
 10590  	return c
 10591  }
 10592  
 10593  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
 10594  // operation conditional on whether the object's one live generation matches
 10595  // the given value. Setting to 0 makes the operation succeed only if there are
 10596  // no live versions of the object.
 10597  func (c *ObjectsRestoreCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRestoreCall {
 10598  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
 10599  	return c
 10600  }
 10601  
 10602  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
 10603  // Makes the operation conditional on whether none of the object's live
 10604  // generations match the given value. If no live object exists, the
 10605  // precondition fails. Setting to 0 makes the operation succeed only if there
 10606  // is a live version of the object.
 10607  func (c *ObjectsRestoreCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRestoreCall {
 10608  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
 10609  	return c
 10610  }
 10611  
 10612  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
 10613  // Makes the operation conditional on whether the object's one live
 10614  // metageneration matches the given value.
 10615  func (c *ObjectsRestoreCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRestoreCall {
 10616  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
 10617  	return c
 10618  }
 10619  
 10620  // IfMetagenerationNotMatch sets the optional parameter
 10621  // "ifMetagenerationNotMatch": Makes the operation conditional on whether none
 10622  // of the object's live metagenerations match the given value.
 10623  func (c *ObjectsRestoreCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRestoreCall {
 10624  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
 10625  	return c
 10626  }
 10627  
 10628  // Projection sets the optional parameter "projection": Set of properties to
 10629  // return. Defaults to full.
 10630  //
 10631  // Possible values:
 10632  //
 10633  //	"full" - Include all properties.
 10634  //	"noAcl" - Omit the owner, acl property.
 10635  func (c *ObjectsRestoreCall) Projection(projection string) *ObjectsRestoreCall {
 10636  	c.urlParams_.Set("projection", projection)
 10637  	return c
 10638  }
 10639  
 10640  // UserProject sets the optional parameter "userProject": The project to be
 10641  // billed for this request. Required for Requester Pays buckets.
 10642  func (c *ObjectsRestoreCall) UserProject(userProject string) *ObjectsRestoreCall {
 10643  	c.urlParams_.Set("userProject", userProject)
 10644  	return c
 10645  }
 10646  
 10647  // Fields allows partial responses to be retrieved. See
 10648  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 10649  // details.
 10650  func (c *ObjectsRestoreCall) Fields(s ...googleapi.Field) *ObjectsRestoreCall {
 10651  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 10652  	return c
 10653  }
 10654  
 10655  // Context sets the context to be used in this call's Do method.
 10656  func (c *ObjectsRestoreCall) Context(ctx context.Context) *ObjectsRestoreCall {
 10657  	c.ctx_ = ctx
 10658  	return c
 10659  }
 10660  
 10661  // Header returns a http.Header that can be modified by the caller to add
 10662  // headers to the request.
 10663  func (c *ObjectsRestoreCall) Header() http.Header {
 10664  	if c.header_ == nil {
 10665  		c.header_ = make(http.Header)
 10666  	}
 10667  	return c.header_
 10668  }
 10669  
 10670  func (c *ObjectsRestoreCall) doRequest(alt string) (*http.Response, error) {
 10671  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 10672  	var body io.Reader = nil
 10673  	c.urlParams_.Set("alt", alt)
 10674  	c.urlParams_.Set("prettyPrint", "false")
 10675  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/restore")
 10676  	urls += "?" + c.urlParams_.Encode()
 10677  	req, err := http.NewRequest("POST", urls, body)
 10678  	if err != nil {
 10679  		return nil, err
 10680  	}
 10681  	req.Header = reqHeaders
 10682  	googleapi.Expand(req.URL, map[string]string{
 10683  		"bucket": c.bucket,
 10684  		"object": c.object,
 10685  	})
 10686  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 10687  }
 10688  
 10689  // Do executes the "storage.objects.restore" call.
 10690  // Any non-2xx status code is an error. Response headers are in either
 10691  // *Object.ServerResponse.Header or (if a response was returned at all) in
 10692  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 10693  // whether the returned error was because http.StatusNotModified was returned.
 10694  func (c *ObjectsRestoreCall) Do(opts ...googleapi.CallOption) (*Object, error) {
 10695  	gensupport.SetOptions(c.urlParams_, opts...)
 10696  	res, err := c.doRequest("json")
 10697  	if res != nil && res.StatusCode == http.StatusNotModified {
 10698  		if res.Body != nil {
 10699  			res.Body.Close()
 10700  		}
 10701  		return nil, gensupport.WrapError(&googleapi.Error{
 10702  			Code:   res.StatusCode,
 10703  			Header: res.Header,
 10704  		})
 10705  	}
 10706  	if err != nil {
 10707  		return nil, err
 10708  	}
 10709  	defer googleapi.CloseBody(res)
 10710  	if err := googleapi.CheckResponse(res); err != nil {
 10711  		return nil, gensupport.WrapError(err)
 10712  	}
 10713  	ret := &Object{
 10714  		ServerResponse: googleapi.ServerResponse{
 10715  			Header:         res.Header,
 10716  			HTTPStatusCode: res.StatusCode,
 10717  		},
 10718  	}
 10719  	target := &ret
 10720  	if err := gensupport.DecodeResponse(target, res); err != nil {
 10721  		return nil, err
 10722  	}
 10723  	return ret, nil
 10724  }
 10725  
 10726  type ObjectsRewriteCall struct {
 10727  	s                 *Service
 10728  	sourceBucket      string
 10729  	sourceObject      string
 10730  	destinationBucket string
 10731  	destinationObject string
 10732  	object            *Object
 10733  	urlParams_        gensupport.URLParams
 10734  	ctx_              context.Context
 10735  	header_           http.Header
 10736  }
 10737  
 10738  // Rewrite: Rewrites a source object to a destination object. Optionally
 10739  // overrides metadata.
 10740  //
 10741  //   - destinationBucket: Name of the bucket in which to store the new object.
 10742  //     Overrides the provided object metadata's bucket value, if any.
 10743  //   - destinationObject: Name of the new object. Required when the object
 10744  //     metadata is not otherwise provided. Overrides the object metadata's name
 10745  //     value, if any. For information about how to URL encode object names to be
 10746  //     path safe, see Encoding URI Path Parts
 10747  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
 10748  //   - sourceBucket: Name of the bucket in which to find the source object.
 10749  //   - sourceObject: Name of the source object. For information about how to URL
 10750  //     encode object names to be path safe, see Encoding URI Path Parts
 10751  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
 10752  func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall {
 10753  	c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 10754  	c.sourceBucket = sourceBucket
 10755  	c.sourceObject = sourceObject
 10756  	c.destinationBucket = destinationBucket
 10757  	c.destinationObject = destinationObject
 10758  	c.object = object
 10759  	return c
 10760  }
 10761  
 10762  // DestinationKmsKeyName sets the optional parameter "destinationKmsKeyName":
 10763  // Resource name of the Cloud KMS key, of the form
 10764  // projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that
 10765  // will be used to encrypt the object. Overrides the object metadata's
 10766  // kms_key_name value, if any.
 10767  func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall {
 10768  	c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
 10769  	return c
 10770  }
 10771  
 10772  // DestinationPredefinedAcl sets the optional parameter
 10773  // "destinationPredefinedAcl": Apply a predefined set of access controls to the
 10774  // destination object.
 10775  //
 10776  // Possible values:
 10777  //
 10778  //	"authenticatedRead" - Object owner gets OWNER access, and
 10779  //
 10780  // allAuthenticatedUsers get READER access.
 10781  //
 10782  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
 10783  //
 10784  // team owners get OWNER access.
 10785  //
 10786  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
 10787  //
 10788  // owners get READER access.
 10789  //
 10790  //	"private" - Object owner gets OWNER access.
 10791  //	"projectPrivate" - Object owner gets OWNER access, and project team
 10792  //
 10793  // members get access according to their roles.
 10794  //
 10795  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
 10796  //
 10797  // access.
 10798  func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
 10799  	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
 10800  	return c
 10801  }
 10802  
 10803  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
 10804  // operation conditional on whether the object's current generation matches the
 10805  // given value. Setting to 0 makes the operation succeed only if there are no
 10806  // live versions of the object.
 10807  func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
 10808  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
 10809  	return c
 10810  }
 10811  
 10812  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
 10813  // Makes the operation conditional on whether the object's current generation
 10814  // does not match the given value. If no live object exists, the precondition
 10815  // fails. Setting to 0 makes the operation succeed only if there is a live
 10816  // version of the object.
 10817  func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
 10818  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
 10819  	return c
 10820  }
 10821  
 10822  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
 10823  // Makes the operation conditional on whether the destination object's current
 10824  // metageneration matches the given value.
 10825  func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
 10826  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
 10827  	return c
 10828  }
 10829  
 10830  // IfMetagenerationNotMatch sets the optional parameter
 10831  // "ifMetagenerationNotMatch": Makes the operation conditional on whether the
 10832  // destination object's current metageneration does not match the given value.
 10833  func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall {
 10834  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
 10835  	return c
 10836  }
 10837  
 10838  // IfSourceGenerationMatch sets the optional parameter
 10839  // "ifSourceGenerationMatch": Makes the operation conditional on whether the
 10840  // source object's current generation matches the given value.
 10841  func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
 10842  	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
 10843  	return c
 10844  }
 10845  
 10846  // IfSourceGenerationNotMatch sets the optional parameter
 10847  // "ifSourceGenerationNotMatch": Makes the operation conditional on whether the
 10848  // source object's current generation does not match the given value.
 10849  func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
 10850  	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
 10851  	return c
 10852  }
 10853  
 10854  // IfSourceMetagenerationMatch sets the optional parameter
 10855  // "ifSourceMetagenerationMatch": Makes the operation conditional on whether
 10856  // the source object's current metageneration matches the given value.
 10857  func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
 10858  	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
 10859  	return c
 10860  }
 10861  
 10862  // IfSourceMetagenerationNotMatch sets the optional parameter
 10863  // "ifSourceMetagenerationNotMatch": Makes the operation conditional on whether
 10864  // the source object's current metageneration does not match the given value.
 10865  func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
 10866  	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
 10867  	return c
 10868  }
 10869  
 10870  // MaxBytesRewrittenPerCall sets the optional parameter
 10871  // "maxBytesRewrittenPerCall": The maximum number of bytes that will be
 10872  // rewritten per rewrite request. Most callers shouldn't need to specify this
 10873  // parameter - it is primarily in place to support testing. If specified the
 10874  // value must be an integral multiple of 1 MiB (1048576). Also, this only
 10875  // applies to requests where the source and destination span locations and/or
 10876  // storage classes. Finally, this value must not change across rewrite calls
 10877  // else you'll get an error that the rewriteToken is invalid.
 10878  func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall {
 10879  	c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall))
 10880  	return c
 10881  }
 10882  
 10883  // Projection sets the optional parameter "projection": Set of properties to
 10884  // return. Defaults to noAcl, unless the object resource specifies the acl
 10885  // property, when it defaults to full.
 10886  //
 10887  // Possible values:
 10888  //
 10889  //	"full" - Include all properties.
 10890  //	"noAcl" - Omit the owner, acl property.
 10891  func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall {
 10892  	c.urlParams_.Set("projection", projection)
 10893  	return c
 10894  }
 10895  
 10896  // RewriteToken sets the optional parameter "rewriteToken": Include this field
 10897  // (from the previous rewrite response) on each rewrite request after the first
 10898  // one, until the rewrite response 'done' flag is true. Calls that provide a
 10899  // rewriteToken can omit all other request fields, but if included those fields
 10900  // must match the values provided in the first rewrite request.
 10901  func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall {
 10902  	c.urlParams_.Set("rewriteToken", rewriteToken)
 10903  	return c
 10904  }
 10905  
 10906  // SourceGeneration sets the optional parameter "sourceGeneration": If present,
 10907  // selects a specific revision of the source object (as opposed to the latest
 10908  // version, the default).
 10909  func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall {
 10910  	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
 10911  	return c
 10912  }
 10913  
 10914  // UserProject sets the optional parameter "userProject": The project to be
 10915  // billed for this request. Required for Requester Pays buckets.
 10916  func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
 10917  	c.urlParams_.Set("userProject", userProject)
 10918  	return c
 10919  }
 10920  
 10921  // Fields allows partial responses to be retrieved. See
 10922  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 10923  // details.
 10924  func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall {
 10925  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 10926  	return c
 10927  }
 10928  
 10929  // Context sets the context to be used in this call's Do method.
 10930  func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
 10931  	c.ctx_ = ctx
 10932  	return c
 10933  }
 10934  
 10935  // Header returns a http.Header that can be modified by the caller to add
 10936  // headers to the request.
 10937  func (c *ObjectsRewriteCall) Header() http.Header {
 10938  	if c.header_ == nil {
 10939  		c.header_ = make(http.Header)
 10940  	}
 10941  	return c.header_
 10942  }
 10943  
 10944  func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
 10945  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
 10946  	var body io.Reader = nil
 10947  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
 10948  	if err != nil {
 10949  		return nil, err
 10950  	}
 10951  	c.urlParams_.Set("alt", alt)
 10952  	c.urlParams_.Set("prettyPrint", "false")
 10953  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}")
 10954  	urls += "?" + c.urlParams_.Encode()
 10955  	req, err := http.NewRequest("POST", urls, body)
 10956  	if err != nil {
 10957  		return nil, err
 10958  	}
 10959  	req.Header = reqHeaders
 10960  	googleapi.Expand(req.URL, map[string]string{
 10961  		"sourceBucket":      c.sourceBucket,
 10962  		"sourceObject":      c.sourceObject,
 10963  		"destinationBucket": c.destinationBucket,
 10964  		"destinationObject": c.destinationObject,
 10965  	})
 10966  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 10967  }
 10968  
 10969  // Do executes the "storage.objects.rewrite" call.
 10970  // Any non-2xx status code is an error. Response headers are in either
 10971  // *RewriteResponse.ServerResponse.Header or (if a response was returned at
 10972  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
 10973  // check whether the returned error was because http.StatusNotModified was
 10974  // returned.
 10975  func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) {
 10976  	gensupport.SetOptions(c.urlParams_, opts...)
 10977  	res, err := c.doRequest("json")
 10978  	if res != nil && res.StatusCode == http.StatusNotModified {
 10979  		if res.Body != nil {
 10980  			res.Body.Close()
 10981  		}
 10982  		return nil, gensupport.WrapError(&googleapi.Error{
 10983  			Code:   res.StatusCode,
 10984  			Header: res.Header,
 10985  		})
 10986  	}
 10987  	if err != nil {
 10988  		return nil, err
 10989  	}
 10990  	defer googleapi.CloseBody(res)
 10991  	if err := googleapi.CheckResponse(res); err != nil {
 10992  		return nil, gensupport.WrapError(err)
 10993  	}
 10994  	ret := &RewriteResponse{
 10995  		ServerResponse: googleapi.ServerResponse{
 10996  			Header:         res.Header,
 10997  			HTTPStatusCode: res.StatusCode,
 10998  		},
 10999  	}
 11000  	target := &ret
 11001  	if err := gensupport.DecodeResponse(target, res); err != nil {
 11002  		return nil, err
 11003  	}
 11004  	return ret, nil
 11005  }
 11006  
 11007  type ObjectsSetIamPolicyCall struct {
 11008  	s          *Service
 11009  	bucket     string
 11010  	object     string
 11011  	policy     *Policy
 11012  	urlParams_ gensupport.URLParams
 11013  	ctx_       context.Context
 11014  	header_    http.Header
 11015  }
 11016  
 11017  // SetIamPolicy: Updates an IAM policy for the specified object.
 11018  //
 11019  //   - bucket: Name of the bucket in which the object resides.
 11020  //   - object: Name of the object. For information about how to URL encode object
 11021  //     names to be path safe, see Encoding URI Path Parts
 11022  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
 11023  func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall {
 11024  	c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 11025  	c.bucket = bucket
 11026  	c.object = object
 11027  	c.policy = policy
 11028  	return c
 11029  }
 11030  
 11031  // Generation sets the optional parameter "generation": If present, selects a
 11032  // specific revision of this object (as opposed to the latest version, the
 11033  // default).
 11034  func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall {
 11035  	c.urlParams_.Set("generation", fmt.Sprint(generation))
 11036  	return c
 11037  }
 11038  
 11039  // UserProject sets the optional parameter "userProject": The project to be
 11040  // billed for this request. Required for Requester Pays buckets.
 11041  func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
 11042  	c.urlParams_.Set("userProject", userProject)
 11043  	return c
 11044  }
 11045  
 11046  // Fields allows partial responses to be retrieved. See
 11047  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 11048  // details.
 11049  func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall {
 11050  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 11051  	return c
 11052  }
 11053  
 11054  // Context sets the context to be used in this call's Do method.
 11055  func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
 11056  	c.ctx_ = ctx
 11057  	return c
 11058  }
 11059  
 11060  // Header returns a http.Header that can be modified by the caller to add
 11061  // headers to the request.
 11062  func (c *ObjectsSetIamPolicyCall) Header() http.Header {
 11063  	if c.header_ == nil {
 11064  		c.header_ = make(http.Header)
 11065  	}
 11066  	return c.header_
 11067  }
 11068  
 11069  func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
 11070  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
 11071  	var body io.Reader = nil
 11072  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
 11073  	if err != nil {
 11074  		return nil, err
 11075  	}
 11076  	c.urlParams_.Set("alt", alt)
 11077  	c.urlParams_.Set("prettyPrint", "false")
 11078  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
 11079  	urls += "?" + c.urlParams_.Encode()
 11080  	req, err := http.NewRequest("PUT", urls, body)
 11081  	if err != nil {
 11082  		return nil, err
 11083  	}
 11084  	req.Header = reqHeaders
 11085  	googleapi.Expand(req.URL, map[string]string{
 11086  		"bucket": c.bucket,
 11087  		"object": c.object,
 11088  	})
 11089  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 11090  }
 11091  
 11092  // Do executes the "storage.objects.setIamPolicy" call.
 11093  // Any non-2xx status code is an error. Response headers are in either
 11094  // *Policy.ServerResponse.Header or (if a response was returned at all) in
 11095  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 11096  // whether the returned error was because http.StatusNotModified was returned.
 11097  func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
 11098  	gensupport.SetOptions(c.urlParams_, opts...)
 11099  	res, err := c.doRequest("json")
 11100  	if res != nil && res.StatusCode == http.StatusNotModified {
 11101  		if res.Body != nil {
 11102  			res.Body.Close()
 11103  		}
 11104  		return nil, gensupport.WrapError(&googleapi.Error{
 11105  			Code:   res.StatusCode,
 11106  			Header: res.Header,
 11107  		})
 11108  	}
 11109  	if err != nil {
 11110  		return nil, err
 11111  	}
 11112  	defer googleapi.CloseBody(res)
 11113  	if err := googleapi.CheckResponse(res); err != nil {
 11114  		return nil, gensupport.WrapError(err)
 11115  	}
 11116  	ret := &Policy{
 11117  		ServerResponse: googleapi.ServerResponse{
 11118  			Header:         res.Header,
 11119  			HTTPStatusCode: res.StatusCode,
 11120  		},
 11121  	}
 11122  	target := &ret
 11123  	if err := gensupport.DecodeResponse(target, res); err != nil {
 11124  		return nil, err
 11125  	}
 11126  	return ret, nil
 11127  }
 11128  
 11129  type ObjectsTestIamPermissionsCall struct {
 11130  	s            *Service
 11131  	bucket       string
 11132  	object       string
 11133  	urlParams_   gensupport.URLParams
 11134  	ifNoneMatch_ string
 11135  	ctx_         context.Context
 11136  	header_      http.Header
 11137  }
 11138  
 11139  // TestIamPermissions: Tests a set of permissions on the given object to see
 11140  // which, if any, are held by the caller.
 11141  //
 11142  //   - bucket: Name of the bucket in which the object resides.
 11143  //   - object: Name of the object. For information about how to URL encode object
 11144  //     names to be path safe, see Encoding URI Path Parts
 11145  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
 11146  //   - permissions: Permissions to test.
 11147  func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall {
 11148  	c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 11149  	c.bucket = bucket
 11150  	c.object = object
 11151  	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
 11152  	return c
 11153  }
 11154  
 11155  // Generation sets the optional parameter "generation": If present, selects a
 11156  // specific revision of this object (as opposed to the latest version, the
 11157  // default).
 11158  func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall {
 11159  	c.urlParams_.Set("generation", fmt.Sprint(generation))
 11160  	return c
 11161  }
 11162  
 11163  // UserProject sets the optional parameter "userProject": The project to be
 11164  // billed for this request. Required for Requester Pays buckets.
 11165  func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
 11166  	c.urlParams_.Set("userProject", userProject)
 11167  	return c
 11168  }
 11169  
 11170  // Fields allows partial responses to be retrieved. See
 11171  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 11172  // details.
 11173  func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall {
 11174  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 11175  	return c
 11176  }
 11177  
 11178  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 11179  // object's ETag matches the given value. This is useful for getting updates
 11180  // only after the object has changed since the last request.
 11181  func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall {
 11182  	c.ifNoneMatch_ = entityTag
 11183  	return c
 11184  }
 11185  
 11186  // Context sets the context to be used in this call's Do method.
 11187  func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
 11188  	c.ctx_ = ctx
 11189  	return c
 11190  }
 11191  
 11192  // Header returns a http.Header that can be modified by the caller to add
 11193  // headers to the request.
 11194  func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
 11195  	if c.header_ == nil {
 11196  		c.header_ = make(http.Header)
 11197  	}
 11198  	return c.header_
 11199  }
 11200  
 11201  func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
 11202  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 11203  	if c.ifNoneMatch_ != "" {
 11204  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 11205  	}
 11206  	var body io.Reader = nil
 11207  	c.urlParams_.Set("alt", alt)
 11208  	c.urlParams_.Set("prettyPrint", "false")
 11209  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions")
 11210  	urls += "?" + c.urlParams_.Encode()
 11211  	req, err := http.NewRequest("GET", urls, body)
 11212  	if err != nil {
 11213  		return nil, err
 11214  	}
 11215  	req.Header = reqHeaders
 11216  	googleapi.Expand(req.URL, map[string]string{
 11217  		"bucket": c.bucket,
 11218  		"object": c.object,
 11219  	})
 11220  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 11221  }
 11222  
 11223  // Do executes the "storage.objects.testIamPermissions" call.
 11224  // Any non-2xx status code is an error. Response headers are in either
 11225  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
 11226  // returned at all) in error.(*googleapi.Error).Header. Use
 11227  // googleapi.IsNotModified to check whether the returned error was because
 11228  // http.StatusNotModified was returned.
 11229  func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
 11230  	gensupport.SetOptions(c.urlParams_, opts...)
 11231  	res, err := c.doRequest("json")
 11232  	if res != nil && res.StatusCode == http.StatusNotModified {
 11233  		if res.Body != nil {
 11234  			res.Body.Close()
 11235  		}
 11236  		return nil, gensupport.WrapError(&googleapi.Error{
 11237  			Code:   res.StatusCode,
 11238  			Header: res.Header,
 11239  		})
 11240  	}
 11241  	if err != nil {
 11242  		return nil, err
 11243  	}
 11244  	defer googleapi.CloseBody(res)
 11245  	if err := googleapi.CheckResponse(res); err != nil {
 11246  		return nil, gensupport.WrapError(err)
 11247  	}
 11248  	ret := &TestIamPermissionsResponse{
 11249  		ServerResponse: googleapi.ServerResponse{
 11250  			Header:         res.Header,
 11251  			HTTPStatusCode: res.StatusCode,
 11252  		},
 11253  	}
 11254  	target := &ret
 11255  	if err := gensupport.DecodeResponse(target, res); err != nil {
 11256  		return nil, err
 11257  	}
 11258  	return ret, nil
 11259  }
 11260  
 11261  type ObjectsUpdateCall struct {
 11262  	s          *Service
 11263  	bucket     string
 11264  	object     string
 11265  	object2    *Object
 11266  	urlParams_ gensupport.URLParams
 11267  	ctx_       context.Context
 11268  	header_    http.Header
 11269  }
 11270  
 11271  // Update: Updates an object's metadata.
 11272  //
 11273  //   - bucket: Name of the bucket in which the object resides.
 11274  //   - object: Name of the object. For information about how to URL encode object
 11275  //     names to be path safe, see Encoding URI Path Parts
 11276  //     (https://cloud.google.com/storage/docs/request-endpoints#encoding).
 11277  func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
 11278  	c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 11279  	c.bucket = bucket
 11280  	c.object = object
 11281  	c.object2 = object2
 11282  	return c
 11283  }
 11284  
 11285  // Generation sets the optional parameter "generation": If present, selects a
 11286  // specific revision of this object (as opposed to the latest version, the
 11287  // default).
 11288  func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
 11289  	c.urlParams_.Set("generation", fmt.Sprint(generation))
 11290  	return c
 11291  }
 11292  
 11293  // IfGenerationMatch sets the optional parameter "ifGenerationMatch": Makes the
 11294  // operation conditional on whether the object's current generation matches the
 11295  // given value. Setting to 0 makes the operation succeed only if there are no
 11296  // live versions of the object.
 11297  func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
 11298  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
 11299  	return c
 11300  }
 11301  
 11302  // IfGenerationNotMatch sets the optional parameter "ifGenerationNotMatch":
 11303  // Makes the operation conditional on whether the object's current generation
 11304  // does not match the given value. If no live object exists, the precondition
 11305  // fails. Setting to 0 makes the operation succeed only if there is a live
 11306  // version of the object.
 11307  func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
 11308  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
 11309  	return c
 11310  }
 11311  
 11312  // IfMetagenerationMatch sets the optional parameter "ifMetagenerationMatch":
 11313  // Makes the operation conditional on whether the object's current
 11314  // metageneration matches the given value.
 11315  func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall {
 11316  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
 11317  	return c
 11318  }
 11319  
 11320  // IfMetagenerationNotMatch sets the optional parameter
 11321  // "ifMetagenerationNotMatch": Makes the operation conditional on whether the
 11322  // object's current metageneration does not match the given value.
 11323  func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
 11324  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
 11325  	return c
 11326  }
 11327  
 11328  // OverrideUnlockedRetention sets the optional parameter
 11329  // "overrideUnlockedRetention": Must be true to remove the retention
 11330  // configuration, reduce its unlocked retention period, or change its mode from
 11331  // unlocked to locked.
 11332  func (c *ObjectsUpdateCall) OverrideUnlockedRetention(overrideUnlockedRetention bool) *ObjectsUpdateCall {
 11333  	c.urlParams_.Set("overrideUnlockedRetention", fmt.Sprint(overrideUnlockedRetention))
 11334  	return c
 11335  }
 11336  
 11337  // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
 11338  // predefined set of access controls to this object.
 11339  //
 11340  // Possible values:
 11341  //
 11342  //	"authenticatedRead" - Object owner gets OWNER access, and
 11343  //
 11344  // allAuthenticatedUsers get READER access.
 11345  //
 11346  //	"bucketOwnerFullControl" - Object owner gets OWNER access, and project
 11347  //
 11348  // team owners get OWNER access.
 11349  //
 11350  //	"bucketOwnerRead" - Object owner gets OWNER access, and project team
 11351  //
 11352  // owners get READER access.
 11353  //
 11354  //	"private" - Object owner gets OWNER access.
 11355  //	"projectPrivate" - Object owner gets OWNER access, and project team
 11356  //
 11357  // members get access according to their roles.
 11358  //
 11359  //	"publicRead" - Object owner gets OWNER access, and allUsers get READER
 11360  //
 11361  // access.
 11362  func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
 11363  	c.urlParams_.Set("predefinedAcl", predefinedAcl)
 11364  	return c
 11365  }
 11366  
 11367  // Projection sets the optional parameter "projection": Set of properties to
 11368  // return. Defaults to full.
 11369  //
 11370  // Possible values:
 11371  //
 11372  //	"full" - Include all properties.
 11373  //	"noAcl" - Omit the owner, acl property.
 11374  func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
 11375  	c.urlParams_.Set("projection", projection)
 11376  	return c
 11377  }
 11378  
 11379  // UserProject sets the optional parameter "userProject": The project to be
 11380  // billed for this request. Required for Requester Pays buckets.
 11381  func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
 11382  	c.urlParams_.Set("userProject", userProject)
 11383  	return c
 11384  }
 11385  
 11386  // Fields allows partial responses to be retrieved. See
 11387  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 11388  // details.
 11389  func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
 11390  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 11391  	return c
 11392  }
 11393  
 11394  // Context sets the context to be used in this call's Do method.
 11395  func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
 11396  	c.ctx_ = ctx
 11397  	return c
 11398  }
 11399  
 11400  // Header returns a http.Header that can be modified by the caller to add
 11401  // headers to the request.
 11402  func (c *ObjectsUpdateCall) Header() http.Header {
 11403  	if c.header_ == nil {
 11404  		c.header_ = make(http.Header)
 11405  	}
 11406  	return c.header_
 11407  }
 11408  
 11409  func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
 11410  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
 11411  	var body io.Reader = nil
 11412  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
 11413  	if err != nil {
 11414  		return nil, err
 11415  	}
 11416  	c.urlParams_.Set("alt", alt)
 11417  	c.urlParams_.Set("prettyPrint", "false")
 11418  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
 11419  	urls += "?" + c.urlParams_.Encode()
 11420  	req, err := http.NewRequest("PUT", urls, body)
 11421  	if err != nil {
 11422  		return nil, err
 11423  	}
 11424  	req.Header = reqHeaders
 11425  	googleapi.Expand(req.URL, map[string]string{
 11426  		"bucket": c.bucket,
 11427  		"object": c.object,
 11428  	})
 11429  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 11430  }
 11431  
 11432  // Do executes the "storage.objects.update" call.
 11433  // Any non-2xx status code is an error. Response headers are in either
 11434  // *Object.ServerResponse.Header or (if a response was returned at all) in
 11435  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 11436  // whether the returned error was because http.StatusNotModified was returned.
 11437  func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
 11438  	gensupport.SetOptions(c.urlParams_, opts...)
 11439  	res, err := c.doRequest("json")
 11440  	if res != nil && res.StatusCode == http.StatusNotModified {
 11441  		if res.Body != nil {
 11442  			res.Body.Close()
 11443  		}
 11444  		return nil, gensupport.WrapError(&googleapi.Error{
 11445  			Code:   res.StatusCode,
 11446  			Header: res.Header,
 11447  		})
 11448  	}
 11449  	if err != nil {
 11450  		return nil, err
 11451  	}
 11452  	defer googleapi.CloseBody(res)
 11453  	if err := googleapi.CheckResponse(res); err != nil {
 11454  		return nil, gensupport.WrapError(err)
 11455  	}
 11456  	ret := &Object{
 11457  		ServerResponse: googleapi.ServerResponse{
 11458  			Header:         res.Header,
 11459  			HTTPStatusCode: res.StatusCode,
 11460  		},
 11461  	}
 11462  	target := &ret
 11463  	if err := gensupport.DecodeResponse(target, res); err != nil {
 11464  		return nil, err
 11465  	}
 11466  	return ret, nil
 11467  }
 11468  
 11469  type ObjectsWatchAllCall struct {
 11470  	s          *Service
 11471  	bucket     string
 11472  	channel    *Channel
 11473  	urlParams_ gensupport.URLParams
 11474  	ctx_       context.Context
 11475  	header_    http.Header
 11476  }
 11477  
 11478  // WatchAll: Watch for changes on all objects in a bucket.
 11479  //
 11480  // - bucket: Name of the bucket in which to look for objects.
 11481  func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
 11482  	c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 11483  	c.bucket = bucket
 11484  	c.channel = channel
 11485  	return c
 11486  }
 11487  
 11488  // Delimiter sets the optional parameter "delimiter": Returns results in a
 11489  // directory-like mode. items will contain only objects whose names, aside from
 11490  // the prefix, do not contain delimiter. Objects whose names, aside from the
 11491  // prefix, contain delimiter will have their name, truncated after the
 11492  // delimiter, returned in prefixes. Duplicate prefixes are omitted.
 11493  func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
 11494  	c.urlParams_.Set("delimiter", delimiter)
 11495  	return c
 11496  }
 11497  
 11498  // EndOffset sets the optional parameter "endOffset": Filter results to objects
 11499  // whose names are lexicographically before endOffset. If startOffset is also
 11500  // set, the objects listed will have names between startOffset (inclusive) and
 11501  // endOffset (exclusive).
 11502  func (c *ObjectsWatchAllCall) EndOffset(endOffset string) *ObjectsWatchAllCall {
 11503  	c.urlParams_.Set("endOffset", endOffset)
 11504  	return c
 11505  }
 11506  
 11507  // IncludeTrailingDelimiter sets the optional parameter
 11508  // "includeTrailingDelimiter": If true, objects that end in exactly one
 11509  // instance of delimiter will have their metadata included in items in addition
 11510  // to prefixes.
 11511  func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall {
 11512  	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
 11513  	return c
 11514  }
 11515  
 11516  // MaxResults sets the optional parameter "maxResults": Maximum number of items
 11517  // plus prefixes to return in a single page of responses. As duplicate prefixes
 11518  // are omitted, fewer total results may be returned than requested. The service
 11519  // will use this parameter or 1,000 items, whichever is smaller.
 11520  func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
 11521  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
 11522  	return c
 11523  }
 11524  
 11525  // PageToken sets the optional parameter "pageToken": A previously-returned
 11526  // page token representing part of the larger set of results to view.
 11527  func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
 11528  	c.urlParams_.Set("pageToken", pageToken)
 11529  	return c
 11530  }
 11531  
 11532  // Prefix sets the optional parameter "prefix": Filter results to objects whose
 11533  // names begin with this prefix.
 11534  func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
 11535  	c.urlParams_.Set("prefix", prefix)
 11536  	return c
 11537  }
 11538  
 11539  // Projection sets the optional parameter "projection": Set of properties to
 11540  // return. Defaults to noAcl.
 11541  //
 11542  // Possible values:
 11543  //
 11544  //	"full" - Include all properties.
 11545  //	"noAcl" - Omit the owner, acl property.
 11546  func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
 11547  	c.urlParams_.Set("projection", projection)
 11548  	return c
 11549  }
 11550  
 11551  // StartOffset sets the optional parameter "startOffset": Filter results to
 11552  // objects whose names are lexicographically equal to or after startOffset. If
 11553  // endOffset is also set, the objects listed will have names between
 11554  // startOffset (inclusive) and endOffset (exclusive).
 11555  func (c *ObjectsWatchAllCall) StartOffset(startOffset string) *ObjectsWatchAllCall {
 11556  	c.urlParams_.Set("startOffset", startOffset)
 11557  	return c
 11558  }
 11559  
 11560  // UserProject sets the optional parameter "userProject": The project to be
 11561  // billed for this request. Required for Requester Pays buckets.
 11562  func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
 11563  	c.urlParams_.Set("userProject", userProject)
 11564  	return c
 11565  }
 11566  
 11567  // Versions sets the optional parameter "versions": If true, lists all versions
 11568  // of an object as distinct results. The default is false. For more
 11569  // information, see Object Versioning.
 11570  func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
 11571  	c.urlParams_.Set("versions", fmt.Sprint(versions))
 11572  	return c
 11573  }
 11574  
 11575  // Fields allows partial responses to be retrieved. See
 11576  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 11577  // details.
 11578  func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
 11579  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 11580  	return c
 11581  }
 11582  
 11583  // Context sets the context to be used in this call's Do method.
 11584  func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
 11585  	c.ctx_ = ctx
 11586  	return c
 11587  }
 11588  
 11589  // Header returns a http.Header that can be modified by the caller to add
 11590  // headers to the request.
 11591  func (c *ObjectsWatchAllCall) Header() http.Header {
 11592  	if c.header_ == nil {
 11593  		c.header_ = make(http.Header)
 11594  	}
 11595  	return c.header_
 11596  }
 11597  
 11598  func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
 11599  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
 11600  	var body io.Reader = nil
 11601  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
 11602  	if err != nil {
 11603  		return nil, err
 11604  	}
 11605  	c.urlParams_.Set("alt", alt)
 11606  	c.urlParams_.Set("prettyPrint", "false")
 11607  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
 11608  	urls += "?" + c.urlParams_.Encode()
 11609  	req, err := http.NewRequest("POST", urls, body)
 11610  	if err != nil {
 11611  		return nil, err
 11612  	}
 11613  	req.Header = reqHeaders
 11614  	googleapi.Expand(req.URL, map[string]string{
 11615  		"bucket": c.bucket,
 11616  	})
 11617  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 11618  }
 11619  
 11620  // Do executes the "storage.objects.watchAll" call.
 11621  // Any non-2xx status code is an error. Response headers are in either
 11622  // *Channel.ServerResponse.Header or (if a response was returned at all) in
 11623  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 11624  // whether the returned error was because http.StatusNotModified was returned.
 11625  func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
 11626  	gensupport.SetOptions(c.urlParams_, opts...)
 11627  	res, err := c.doRequest("json")
 11628  	if res != nil && res.StatusCode == http.StatusNotModified {
 11629  		if res.Body != nil {
 11630  			res.Body.Close()
 11631  		}
 11632  		return nil, gensupport.WrapError(&googleapi.Error{
 11633  			Code:   res.StatusCode,
 11634  			Header: res.Header,
 11635  		})
 11636  	}
 11637  	if err != nil {
 11638  		return nil, err
 11639  	}
 11640  	defer googleapi.CloseBody(res)
 11641  	if err := googleapi.CheckResponse(res); err != nil {
 11642  		return nil, gensupport.WrapError(err)
 11643  	}
 11644  	ret := &Channel{
 11645  		ServerResponse: googleapi.ServerResponse{
 11646  			Header:         res.Header,
 11647  			HTTPStatusCode: res.StatusCode,
 11648  		},
 11649  	}
 11650  	target := &ret
 11651  	if err := gensupport.DecodeResponse(target, res); err != nil {
 11652  		return nil, err
 11653  	}
 11654  	return ret, nil
 11655  }
 11656  
 11657  type OperationsCancelCall struct {
 11658  	s           *Service
 11659  	bucket      string
 11660  	operationId string
 11661  	urlParams_  gensupport.URLParams
 11662  	ctx_        context.Context
 11663  	header_     http.Header
 11664  }
 11665  
 11666  // Cancel: Starts asynchronous cancellation on a long-running operation. The
 11667  // server makes a best effort to cancel the operation, but success is not
 11668  // guaranteed.
 11669  //
 11670  // - bucket: The parent bucket of the operation resource.
 11671  // - operationId: The ID of the operation resource.
 11672  func (r *OperationsService) Cancel(bucket string, operationId string) *OperationsCancelCall {
 11673  	c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 11674  	c.bucket = bucket
 11675  	c.operationId = operationId
 11676  	return c
 11677  }
 11678  
 11679  // Fields allows partial responses to be retrieved. See
 11680  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 11681  // details.
 11682  func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
 11683  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 11684  	return c
 11685  }
 11686  
 11687  // Context sets the context to be used in this call's Do method.
 11688  func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
 11689  	c.ctx_ = ctx
 11690  	return c
 11691  }
 11692  
 11693  // Header returns a http.Header that can be modified by the caller to add
 11694  // headers to the request.
 11695  func (c *OperationsCancelCall) Header() http.Header {
 11696  	if c.header_ == nil {
 11697  		c.header_ = make(http.Header)
 11698  	}
 11699  	return c.header_
 11700  }
 11701  
 11702  func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
 11703  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 11704  	var body io.Reader = nil
 11705  	c.urlParams_.Set("alt", alt)
 11706  	c.urlParams_.Set("prettyPrint", "false")
 11707  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/operations/{operationId}/cancel")
 11708  	urls += "?" + c.urlParams_.Encode()
 11709  	req, err := http.NewRequest("POST", urls, body)
 11710  	if err != nil {
 11711  		return nil, err
 11712  	}
 11713  	req.Header = reqHeaders
 11714  	googleapi.Expand(req.URL, map[string]string{
 11715  		"bucket":      c.bucket,
 11716  		"operationId": c.operationId,
 11717  	})
 11718  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 11719  }
 11720  
 11721  // Do executes the "storage.buckets.operations.cancel" call.
 11722  func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) error {
 11723  	gensupport.SetOptions(c.urlParams_, opts...)
 11724  	res, err := c.doRequest("json")
 11725  	if err != nil {
 11726  		return err
 11727  	}
 11728  	defer googleapi.CloseBody(res)
 11729  	if err := googleapi.CheckResponse(res); err != nil {
 11730  		return gensupport.WrapError(err)
 11731  	}
 11732  	return nil
 11733  }
 11734  
 11735  type OperationsGetCall struct {
 11736  	s            *Service
 11737  	bucket       string
 11738  	operationId  string
 11739  	urlParams_   gensupport.URLParams
 11740  	ifNoneMatch_ string
 11741  	ctx_         context.Context
 11742  	header_      http.Header
 11743  }
 11744  
 11745  // Get: Gets the latest state of a long-running operation.
 11746  //
 11747  // - bucket: The parent bucket of the operation resource.
 11748  // - operationId: The ID of the operation resource.
 11749  func (r *OperationsService) Get(bucket string, operationId string) *OperationsGetCall {
 11750  	c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 11751  	c.bucket = bucket
 11752  	c.operationId = operationId
 11753  	return c
 11754  }
 11755  
 11756  // Fields allows partial responses to be retrieved. See
 11757  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 11758  // details.
 11759  func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
 11760  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 11761  	return c
 11762  }
 11763  
 11764  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 11765  // object's ETag matches the given value. This is useful for getting updates
 11766  // only after the object has changed since the last request.
 11767  func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
 11768  	c.ifNoneMatch_ = entityTag
 11769  	return c
 11770  }
 11771  
 11772  // Context sets the context to be used in this call's Do method.
 11773  func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
 11774  	c.ctx_ = ctx
 11775  	return c
 11776  }
 11777  
 11778  // Header returns a http.Header that can be modified by the caller to add
 11779  // headers to the request.
 11780  func (c *OperationsGetCall) Header() http.Header {
 11781  	if c.header_ == nil {
 11782  		c.header_ = make(http.Header)
 11783  	}
 11784  	return c.header_
 11785  }
 11786  
 11787  func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
 11788  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 11789  	if c.ifNoneMatch_ != "" {
 11790  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 11791  	}
 11792  	var body io.Reader = nil
 11793  	c.urlParams_.Set("alt", alt)
 11794  	c.urlParams_.Set("prettyPrint", "false")
 11795  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/operations/{operationId}")
 11796  	urls += "?" + c.urlParams_.Encode()
 11797  	req, err := http.NewRequest("GET", urls, body)
 11798  	if err != nil {
 11799  		return nil, err
 11800  	}
 11801  	req.Header = reqHeaders
 11802  	googleapi.Expand(req.URL, map[string]string{
 11803  		"bucket":      c.bucket,
 11804  		"operationId": c.operationId,
 11805  	})
 11806  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 11807  }
 11808  
 11809  // Do executes the "storage.buckets.operations.get" call.
 11810  // Any non-2xx status code is an error. Response headers are in either
 11811  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
 11812  // returned at all) in error.(*googleapi.Error).Header. Use
 11813  // googleapi.IsNotModified to check whether the returned error was because
 11814  // http.StatusNotModified was returned.
 11815  func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
 11816  	gensupport.SetOptions(c.urlParams_, opts...)
 11817  	res, err := c.doRequest("json")
 11818  	if res != nil && res.StatusCode == http.StatusNotModified {
 11819  		if res.Body != nil {
 11820  			res.Body.Close()
 11821  		}
 11822  		return nil, gensupport.WrapError(&googleapi.Error{
 11823  			Code:   res.StatusCode,
 11824  			Header: res.Header,
 11825  		})
 11826  	}
 11827  	if err != nil {
 11828  		return nil, err
 11829  	}
 11830  	defer googleapi.CloseBody(res)
 11831  	if err := googleapi.CheckResponse(res); err != nil {
 11832  		return nil, gensupport.WrapError(err)
 11833  	}
 11834  	ret := &GoogleLongrunningOperation{
 11835  		ServerResponse: googleapi.ServerResponse{
 11836  			Header:         res.Header,
 11837  			HTTPStatusCode: res.StatusCode,
 11838  		},
 11839  	}
 11840  	target := &ret
 11841  	if err := gensupport.DecodeResponse(target, res); err != nil {
 11842  		return nil, err
 11843  	}
 11844  	return ret, nil
 11845  }
 11846  
 11847  type OperationsListCall struct {
 11848  	s            *Service
 11849  	bucket       string
 11850  	urlParams_   gensupport.URLParams
 11851  	ifNoneMatch_ string
 11852  	ctx_         context.Context
 11853  	header_      http.Header
 11854  }
 11855  
 11856  // List: Lists operations that match the specified filter in the request.
 11857  //
 11858  // - bucket: Name of the bucket in which to look for operations.
 11859  func (r *OperationsService) List(bucket string) *OperationsListCall {
 11860  	c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 11861  	c.bucket = bucket
 11862  	return c
 11863  }
 11864  
 11865  // Filter sets the optional parameter "filter": A filter to narrow down results
 11866  // to a preferred subset. The filtering language is documented in more detail
 11867  // in AIP-160 (https://google.aip.dev/160).
 11868  func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
 11869  	c.urlParams_.Set("filter", filter)
 11870  	return c
 11871  }
 11872  
 11873  // PageSize sets the optional parameter "pageSize": Maximum number of items to
 11874  // return in a single page of responses. Fewer total results may be returned
 11875  // than requested. The service uses this parameter or 100 items, whichever is
 11876  // smaller.
 11877  func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
 11878  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
 11879  	return c
 11880  }
 11881  
 11882  // PageToken sets the optional parameter "pageToken": A previously-returned
 11883  // page token representing part of the larger set of results to view.
 11884  func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
 11885  	c.urlParams_.Set("pageToken", pageToken)
 11886  	return c
 11887  }
 11888  
 11889  // Fields allows partial responses to be retrieved. See
 11890  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 11891  // details.
 11892  func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
 11893  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 11894  	return c
 11895  }
 11896  
 11897  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 11898  // object's ETag matches the given value. This is useful for getting updates
 11899  // only after the object has changed since the last request.
 11900  func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
 11901  	c.ifNoneMatch_ = entityTag
 11902  	return c
 11903  }
 11904  
 11905  // Context sets the context to be used in this call's Do method.
 11906  func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
 11907  	c.ctx_ = ctx
 11908  	return c
 11909  }
 11910  
 11911  // Header returns a http.Header that can be modified by the caller to add
 11912  // headers to the request.
 11913  func (c *OperationsListCall) Header() http.Header {
 11914  	if c.header_ == nil {
 11915  		c.header_ = make(http.Header)
 11916  	}
 11917  	return c.header_
 11918  }
 11919  
 11920  func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
 11921  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 11922  	if c.ifNoneMatch_ != "" {
 11923  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 11924  	}
 11925  	var body io.Reader = nil
 11926  	c.urlParams_.Set("alt", alt)
 11927  	c.urlParams_.Set("prettyPrint", "false")
 11928  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/operations")
 11929  	urls += "?" + c.urlParams_.Encode()
 11930  	req, err := http.NewRequest("GET", urls, body)
 11931  	if err != nil {
 11932  		return nil, err
 11933  	}
 11934  	req.Header = reqHeaders
 11935  	googleapi.Expand(req.URL, map[string]string{
 11936  		"bucket": c.bucket,
 11937  	})
 11938  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 11939  }
 11940  
 11941  // Do executes the "storage.buckets.operations.list" call.
 11942  // Any non-2xx status code is an error. Response headers are in either
 11943  // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
 11944  // response was returned at all) in error.(*googleapi.Error).Header. Use
 11945  // googleapi.IsNotModified to check whether the returned error was because
 11946  // http.StatusNotModified was returned.
 11947  func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
 11948  	gensupport.SetOptions(c.urlParams_, opts...)
 11949  	res, err := c.doRequest("json")
 11950  	if res != nil && res.StatusCode == http.StatusNotModified {
 11951  		if res.Body != nil {
 11952  			res.Body.Close()
 11953  		}
 11954  		return nil, gensupport.WrapError(&googleapi.Error{
 11955  			Code:   res.StatusCode,
 11956  			Header: res.Header,
 11957  		})
 11958  	}
 11959  	if err != nil {
 11960  		return nil, err
 11961  	}
 11962  	defer googleapi.CloseBody(res)
 11963  	if err := googleapi.CheckResponse(res); err != nil {
 11964  		return nil, gensupport.WrapError(err)
 11965  	}
 11966  	ret := &GoogleLongrunningListOperationsResponse{
 11967  		ServerResponse: googleapi.ServerResponse{
 11968  			Header:         res.Header,
 11969  			HTTPStatusCode: res.StatusCode,
 11970  		},
 11971  	}
 11972  	target := &ret
 11973  	if err := gensupport.DecodeResponse(target, res); err != nil {
 11974  		return nil, err
 11975  	}
 11976  	return ret, nil
 11977  }
 11978  
 11979  // Pages invokes f for each page of results.
 11980  // A non-nil error returned from f will halt the iteration.
 11981  // The provided context supersedes any context provided to the Context method.
 11982  func (c *OperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
 11983  	c.ctx_ = ctx
 11984  	defer c.PageToken(c.urlParams_.Get("pageToken"))
 11985  	for {
 11986  		x, err := c.Do()
 11987  		if err != nil {
 11988  			return err
 11989  		}
 11990  		if err := f(x); err != nil {
 11991  			return err
 11992  		}
 11993  		if x.NextPageToken == "" {
 11994  			return nil
 11995  		}
 11996  		c.PageToken(x.NextPageToken)
 11997  	}
 11998  }
 11999  
 12000  type ProjectsHmacKeysCreateCall struct {
 12001  	s          *Service
 12002  	projectId  string
 12003  	urlParams_ gensupport.URLParams
 12004  	ctx_       context.Context
 12005  	header_    http.Header
 12006  }
 12007  
 12008  // Create: Creates a new HMAC key for the specified service account.
 12009  //
 12010  // - projectId: Project ID owning the service account.
 12011  // - serviceAccountEmail: Email address of the service account.
 12012  func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall {
 12013  	c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 12014  	c.projectId = projectId
 12015  	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
 12016  	return c
 12017  }
 12018  
 12019  // UserProject sets the optional parameter "userProject": The project to be
 12020  // billed for this request.
 12021  func (c *ProjectsHmacKeysCreateCall) UserProject(userProject string) *ProjectsHmacKeysCreateCall {
 12022  	c.urlParams_.Set("userProject", userProject)
 12023  	return c
 12024  }
 12025  
 12026  // Fields allows partial responses to be retrieved. See
 12027  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 12028  // details.
 12029  func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall {
 12030  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 12031  	return c
 12032  }
 12033  
 12034  // Context sets the context to be used in this call's Do method.
 12035  func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall {
 12036  	c.ctx_ = ctx
 12037  	return c
 12038  }
 12039  
 12040  // Header returns a http.Header that can be modified by the caller to add
 12041  // headers to the request.
 12042  func (c *ProjectsHmacKeysCreateCall) Header() http.Header {
 12043  	if c.header_ == nil {
 12044  		c.header_ = make(http.Header)
 12045  	}
 12046  	return c.header_
 12047  }
 12048  
 12049  func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) {
 12050  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 12051  	var body io.Reader = nil
 12052  	c.urlParams_.Set("alt", alt)
 12053  	c.urlParams_.Set("prettyPrint", "false")
 12054  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
 12055  	urls += "?" + c.urlParams_.Encode()
 12056  	req, err := http.NewRequest("POST", urls, body)
 12057  	if err != nil {
 12058  		return nil, err
 12059  	}
 12060  	req.Header = reqHeaders
 12061  	googleapi.Expand(req.URL, map[string]string{
 12062  		"projectId": c.projectId,
 12063  	})
 12064  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 12065  }
 12066  
 12067  // Do executes the "storage.projects.hmacKeys.create" call.
 12068  // Any non-2xx status code is an error. Response headers are in either
 12069  // *HmacKey.ServerResponse.Header or (if a response was returned at all) in
 12070  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 12071  // whether the returned error was because http.StatusNotModified was returned.
 12072  func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) {
 12073  	gensupport.SetOptions(c.urlParams_, opts...)
 12074  	res, err := c.doRequest("json")
 12075  	if res != nil && res.StatusCode == http.StatusNotModified {
 12076  		if res.Body != nil {
 12077  			res.Body.Close()
 12078  		}
 12079  		return nil, gensupport.WrapError(&googleapi.Error{
 12080  			Code:   res.StatusCode,
 12081  			Header: res.Header,
 12082  		})
 12083  	}
 12084  	if err != nil {
 12085  		return nil, err
 12086  	}
 12087  	defer googleapi.CloseBody(res)
 12088  	if err := googleapi.CheckResponse(res); err != nil {
 12089  		return nil, gensupport.WrapError(err)
 12090  	}
 12091  	ret := &HmacKey{
 12092  		ServerResponse: googleapi.ServerResponse{
 12093  			Header:         res.Header,
 12094  			HTTPStatusCode: res.StatusCode,
 12095  		},
 12096  	}
 12097  	target := &ret
 12098  	if err := gensupport.DecodeResponse(target, res); err != nil {
 12099  		return nil, err
 12100  	}
 12101  	return ret, nil
 12102  }
 12103  
 12104  type ProjectsHmacKeysDeleteCall struct {
 12105  	s          *Service
 12106  	projectId  string
 12107  	accessId   string
 12108  	urlParams_ gensupport.URLParams
 12109  	ctx_       context.Context
 12110  	header_    http.Header
 12111  }
 12112  
 12113  // Delete: Deletes an HMAC key.
 12114  //
 12115  // - accessId: Name of the HMAC key to be deleted.
 12116  // - projectId: Project ID owning the requested key.
 12117  func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall {
 12118  	c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 12119  	c.projectId = projectId
 12120  	c.accessId = accessId
 12121  	return c
 12122  }
 12123  
 12124  // UserProject sets the optional parameter "userProject": The project to be
 12125  // billed for this request.
 12126  func (c *ProjectsHmacKeysDeleteCall) UserProject(userProject string) *ProjectsHmacKeysDeleteCall {
 12127  	c.urlParams_.Set("userProject", userProject)
 12128  	return c
 12129  }
 12130  
 12131  // Fields allows partial responses to be retrieved. See
 12132  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 12133  // details.
 12134  func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall {
 12135  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 12136  	return c
 12137  }
 12138  
 12139  // Context sets the context to be used in this call's Do method.
 12140  func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall {
 12141  	c.ctx_ = ctx
 12142  	return c
 12143  }
 12144  
 12145  // Header returns a http.Header that can be modified by the caller to add
 12146  // headers to the request.
 12147  func (c *ProjectsHmacKeysDeleteCall) Header() http.Header {
 12148  	if c.header_ == nil {
 12149  		c.header_ = make(http.Header)
 12150  	}
 12151  	return c.header_
 12152  }
 12153  
 12154  func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
 12155  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 12156  	var body io.Reader = nil
 12157  	c.urlParams_.Set("alt", alt)
 12158  	c.urlParams_.Set("prettyPrint", "false")
 12159  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
 12160  	urls += "?" + c.urlParams_.Encode()
 12161  	req, err := http.NewRequest("DELETE", urls, body)
 12162  	if err != nil {
 12163  		return nil, err
 12164  	}
 12165  	req.Header = reqHeaders
 12166  	googleapi.Expand(req.URL, map[string]string{
 12167  		"projectId": c.projectId,
 12168  		"accessId":  c.accessId,
 12169  	})
 12170  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 12171  }
 12172  
 12173  // Do executes the "storage.projects.hmacKeys.delete" call.
 12174  func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
 12175  	gensupport.SetOptions(c.urlParams_, opts...)
 12176  	res, err := c.doRequest("json")
 12177  	if err != nil {
 12178  		return err
 12179  	}
 12180  	defer googleapi.CloseBody(res)
 12181  	if err := googleapi.CheckResponse(res); err != nil {
 12182  		return gensupport.WrapError(err)
 12183  	}
 12184  	return nil
 12185  }
 12186  
 12187  type ProjectsHmacKeysGetCall struct {
 12188  	s            *Service
 12189  	projectId    string
 12190  	accessId     string
 12191  	urlParams_   gensupport.URLParams
 12192  	ifNoneMatch_ string
 12193  	ctx_         context.Context
 12194  	header_      http.Header
 12195  }
 12196  
 12197  // Get: Retrieves an HMAC key's metadata
 12198  //
 12199  // - accessId: Name of the HMAC key.
 12200  // - projectId: Project ID owning the service account of the requested key.
 12201  func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall {
 12202  	c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 12203  	c.projectId = projectId
 12204  	c.accessId = accessId
 12205  	return c
 12206  }
 12207  
 12208  // UserProject sets the optional parameter "userProject": The project to be
 12209  // billed for this request.
 12210  func (c *ProjectsHmacKeysGetCall) UserProject(userProject string) *ProjectsHmacKeysGetCall {
 12211  	c.urlParams_.Set("userProject", userProject)
 12212  	return c
 12213  }
 12214  
 12215  // Fields allows partial responses to be retrieved. See
 12216  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 12217  // details.
 12218  func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall {
 12219  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 12220  	return c
 12221  }
 12222  
 12223  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 12224  // object's ETag matches the given value. This is useful for getting updates
 12225  // only after the object has changed since the last request.
 12226  func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall {
 12227  	c.ifNoneMatch_ = entityTag
 12228  	return c
 12229  }
 12230  
 12231  // Context sets the context to be used in this call's Do method.
 12232  func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall {
 12233  	c.ctx_ = ctx
 12234  	return c
 12235  }
 12236  
 12237  // Header returns a http.Header that can be modified by the caller to add
 12238  // headers to the request.
 12239  func (c *ProjectsHmacKeysGetCall) Header() http.Header {
 12240  	if c.header_ == nil {
 12241  		c.header_ = make(http.Header)
 12242  	}
 12243  	return c.header_
 12244  }
 12245  
 12246  func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) {
 12247  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 12248  	if c.ifNoneMatch_ != "" {
 12249  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 12250  	}
 12251  	var body io.Reader = nil
 12252  	c.urlParams_.Set("alt", alt)
 12253  	c.urlParams_.Set("prettyPrint", "false")
 12254  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
 12255  	urls += "?" + c.urlParams_.Encode()
 12256  	req, err := http.NewRequest("GET", urls, body)
 12257  	if err != nil {
 12258  		return nil, err
 12259  	}
 12260  	req.Header = reqHeaders
 12261  	googleapi.Expand(req.URL, map[string]string{
 12262  		"projectId": c.projectId,
 12263  		"accessId":  c.accessId,
 12264  	})
 12265  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 12266  }
 12267  
 12268  // Do executes the "storage.projects.hmacKeys.get" call.
 12269  // Any non-2xx status code is an error. Response headers are in either
 12270  // *HmacKeyMetadata.ServerResponse.Header or (if a response was returned at
 12271  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
 12272  // check whether the returned error was because http.StatusNotModified was
 12273  // returned.
 12274  func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
 12275  	gensupport.SetOptions(c.urlParams_, opts...)
 12276  	res, err := c.doRequest("json")
 12277  	if res != nil && res.StatusCode == http.StatusNotModified {
 12278  		if res.Body != nil {
 12279  			res.Body.Close()
 12280  		}
 12281  		return nil, gensupport.WrapError(&googleapi.Error{
 12282  			Code:   res.StatusCode,
 12283  			Header: res.Header,
 12284  		})
 12285  	}
 12286  	if err != nil {
 12287  		return nil, err
 12288  	}
 12289  	defer googleapi.CloseBody(res)
 12290  	if err := googleapi.CheckResponse(res); err != nil {
 12291  		return nil, gensupport.WrapError(err)
 12292  	}
 12293  	ret := &HmacKeyMetadata{
 12294  		ServerResponse: googleapi.ServerResponse{
 12295  			Header:         res.Header,
 12296  			HTTPStatusCode: res.StatusCode,
 12297  		},
 12298  	}
 12299  	target := &ret
 12300  	if err := gensupport.DecodeResponse(target, res); err != nil {
 12301  		return nil, err
 12302  	}
 12303  	return ret, nil
 12304  }
 12305  
 12306  type ProjectsHmacKeysListCall struct {
 12307  	s            *Service
 12308  	projectId    string
 12309  	urlParams_   gensupport.URLParams
 12310  	ifNoneMatch_ string
 12311  	ctx_         context.Context
 12312  	header_      http.Header
 12313  }
 12314  
 12315  // List: Retrieves a list of HMAC keys matching the criteria.
 12316  //
 12317  // - projectId: Name of the project in which to look for HMAC keys.
 12318  func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall {
 12319  	c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 12320  	c.projectId = projectId
 12321  	return c
 12322  }
 12323  
 12324  // MaxResults sets the optional parameter "maxResults": Maximum number of items
 12325  // to return in a single page of responses. The service uses this parameter or
 12326  // 250 items, whichever is smaller. The max number of items per page will also
 12327  // be limited by the number of distinct service accounts in the response. If
 12328  // the number of service accounts in a single response is too high, the page
 12329  // will truncated and a next page token will be returned.
 12330  func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall {
 12331  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
 12332  	return c
 12333  }
 12334  
 12335  // PageToken sets the optional parameter "pageToken": A previously-returned
 12336  // page token representing part of the larger set of results to view.
 12337  func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall {
 12338  	c.urlParams_.Set("pageToken", pageToken)
 12339  	return c
 12340  }
 12341  
 12342  // ServiceAccountEmail sets the optional parameter "serviceAccountEmail": If
 12343  // present, only keys for the given service account are returned.
 12344  func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall {
 12345  	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
 12346  	return c
 12347  }
 12348  
 12349  // ShowDeletedKeys sets the optional parameter "showDeletedKeys": Whether or
 12350  // not to show keys in the DELETED state.
 12351  func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall {
 12352  	c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys))
 12353  	return c
 12354  }
 12355  
 12356  // UserProject sets the optional parameter "userProject": The project to be
 12357  // billed for this request.
 12358  func (c *ProjectsHmacKeysListCall) UserProject(userProject string) *ProjectsHmacKeysListCall {
 12359  	c.urlParams_.Set("userProject", userProject)
 12360  	return c
 12361  }
 12362  
 12363  // Fields allows partial responses to be retrieved. See
 12364  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 12365  // details.
 12366  func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall {
 12367  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 12368  	return c
 12369  }
 12370  
 12371  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 12372  // object's ETag matches the given value. This is useful for getting updates
 12373  // only after the object has changed since the last request.
 12374  func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall {
 12375  	c.ifNoneMatch_ = entityTag
 12376  	return c
 12377  }
 12378  
 12379  // Context sets the context to be used in this call's Do method.
 12380  func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall {
 12381  	c.ctx_ = ctx
 12382  	return c
 12383  }
 12384  
 12385  // Header returns a http.Header that can be modified by the caller to add
 12386  // headers to the request.
 12387  func (c *ProjectsHmacKeysListCall) Header() http.Header {
 12388  	if c.header_ == nil {
 12389  		c.header_ = make(http.Header)
 12390  	}
 12391  	return c.header_
 12392  }
 12393  
 12394  func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) {
 12395  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 12396  	if c.ifNoneMatch_ != "" {
 12397  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 12398  	}
 12399  	var body io.Reader = nil
 12400  	c.urlParams_.Set("alt", alt)
 12401  	c.urlParams_.Set("prettyPrint", "false")
 12402  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
 12403  	urls += "?" + c.urlParams_.Encode()
 12404  	req, err := http.NewRequest("GET", urls, body)
 12405  	if err != nil {
 12406  		return nil, err
 12407  	}
 12408  	req.Header = reqHeaders
 12409  	googleapi.Expand(req.URL, map[string]string{
 12410  		"projectId": c.projectId,
 12411  	})
 12412  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 12413  }
 12414  
 12415  // Do executes the "storage.projects.hmacKeys.list" call.
 12416  // Any non-2xx status code is an error. Response headers are in either
 12417  // *HmacKeysMetadata.ServerResponse.Header or (if a response was returned at
 12418  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
 12419  // check whether the returned error was because http.StatusNotModified was
 12420  // returned.
 12421  func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) {
 12422  	gensupport.SetOptions(c.urlParams_, opts...)
 12423  	res, err := c.doRequest("json")
 12424  	if res != nil && res.StatusCode == http.StatusNotModified {
 12425  		if res.Body != nil {
 12426  			res.Body.Close()
 12427  		}
 12428  		return nil, gensupport.WrapError(&googleapi.Error{
 12429  			Code:   res.StatusCode,
 12430  			Header: res.Header,
 12431  		})
 12432  	}
 12433  	if err != nil {
 12434  		return nil, err
 12435  	}
 12436  	defer googleapi.CloseBody(res)
 12437  	if err := googleapi.CheckResponse(res); err != nil {
 12438  		return nil, gensupport.WrapError(err)
 12439  	}
 12440  	ret := &HmacKeysMetadata{
 12441  		ServerResponse: googleapi.ServerResponse{
 12442  			Header:         res.Header,
 12443  			HTTPStatusCode: res.StatusCode,
 12444  		},
 12445  	}
 12446  	target := &ret
 12447  	if err := gensupport.DecodeResponse(target, res); err != nil {
 12448  		return nil, err
 12449  	}
 12450  	return ret, nil
 12451  }
 12452  
 12453  // Pages invokes f for each page of results.
 12454  // A non-nil error returned from f will halt the iteration.
 12455  // The provided context supersedes any context provided to the Context method.
 12456  func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error {
 12457  	c.ctx_ = ctx
 12458  	defer c.PageToken(c.urlParams_.Get("pageToken"))
 12459  	for {
 12460  		x, err := c.Do()
 12461  		if err != nil {
 12462  			return err
 12463  		}
 12464  		if err := f(x); err != nil {
 12465  			return err
 12466  		}
 12467  		if x.NextPageToken == "" {
 12468  			return nil
 12469  		}
 12470  		c.PageToken(x.NextPageToken)
 12471  	}
 12472  }
 12473  
 12474  type ProjectsHmacKeysUpdateCall struct {
 12475  	s               *Service
 12476  	projectId       string
 12477  	accessId        string
 12478  	hmackeymetadata *HmacKeyMetadata
 12479  	urlParams_      gensupport.URLParams
 12480  	ctx_            context.Context
 12481  	header_         http.Header
 12482  }
 12483  
 12484  // Update: Updates the state of an HMAC key. See the HMAC Key resource
 12485  // descriptor for valid states.
 12486  //
 12487  // - accessId: Name of the HMAC key being updated.
 12488  // - projectId: Project ID owning the service account of the updated key.
 12489  func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall {
 12490  	c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 12491  	c.projectId = projectId
 12492  	c.accessId = accessId
 12493  	c.hmackeymetadata = hmackeymetadata
 12494  	return c
 12495  }
 12496  
 12497  // UserProject sets the optional parameter "userProject": The project to be
 12498  // billed for this request.
 12499  func (c *ProjectsHmacKeysUpdateCall) UserProject(userProject string) *ProjectsHmacKeysUpdateCall {
 12500  	c.urlParams_.Set("userProject", userProject)
 12501  	return c
 12502  }
 12503  
 12504  // Fields allows partial responses to be retrieved. See
 12505  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 12506  // details.
 12507  func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall {
 12508  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 12509  	return c
 12510  }
 12511  
 12512  // Context sets the context to be used in this call's Do method.
 12513  func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall {
 12514  	c.ctx_ = ctx
 12515  	return c
 12516  }
 12517  
 12518  // Header returns a http.Header that can be modified by the caller to add
 12519  // headers to the request.
 12520  func (c *ProjectsHmacKeysUpdateCall) Header() http.Header {
 12521  	if c.header_ == nil {
 12522  		c.header_ = make(http.Header)
 12523  	}
 12524  	return c.header_
 12525  }
 12526  
 12527  func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) {
 12528  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
 12529  	var body io.Reader = nil
 12530  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata)
 12531  	if err != nil {
 12532  		return nil, err
 12533  	}
 12534  	c.urlParams_.Set("alt", alt)
 12535  	c.urlParams_.Set("prettyPrint", "false")
 12536  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
 12537  	urls += "?" + c.urlParams_.Encode()
 12538  	req, err := http.NewRequest("PUT", urls, body)
 12539  	if err != nil {
 12540  		return nil, err
 12541  	}
 12542  	req.Header = reqHeaders
 12543  	googleapi.Expand(req.URL, map[string]string{
 12544  		"projectId": c.projectId,
 12545  		"accessId":  c.accessId,
 12546  	})
 12547  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 12548  }
 12549  
 12550  // Do executes the "storage.projects.hmacKeys.update" call.
 12551  // Any non-2xx status code is an error. Response headers are in either
 12552  // *HmacKeyMetadata.ServerResponse.Header or (if a response was returned at
 12553  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
 12554  // check whether the returned error was because http.StatusNotModified was
 12555  // returned.
 12556  func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
 12557  	gensupport.SetOptions(c.urlParams_, opts...)
 12558  	res, err := c.doRequest("json")
 12559  	if res != nil && res.StatusCode == http.StatusNotModified {
 12560  		if res.Body != nil {
 12561  			res.Body.Close()
 12562  		}
 12563  		return nil, gensupport.WrapError(&googleapi.Error{
 12564  			Code:   res.StatusCode,
 12565  			Header: res.Header,
 12566  		})
 12567  	}
 12568  	if err != nil {
 12569  		return nil, err
 12570  	}
 12571  	defer googleapi.CloseBody(res)
 12572  	if err := googleapi.CheckResponse(res); err != nil {
 12573  		return nil, gensupport.WrapError(err)
 12574  	}
 12575  	ret := &HmacKeyMetadata{
 12576  		ServerResponse: googleapi.ServerResponse{
 12577  			Header:         res.Header,
 12578  			HTTPStatusCode: res.StatusCode,
 12579  		},
 12580  	}
 12581  	target := &ret
 12582  	if err := gensupport.DecodeResponse(target, res); err != nil {
 12583  		return nil, err
 12584  	}
 12585  	return ret, nil
 12586  }
 12587  
 12588  type ProjectsServiceAccountGetCall struct {
 12589  	s            *Service
 12590  	projectId    string
 12591  	urlParams_   gensupport.URLParams
 12592  	ifNoneMatch_ string
 12593  	ctx_         context.Context
 12594  	header_      http.Header
 12595  }
 12596  
 12597  // Get: Get the email address of this project's Google Cloud Storage service
 12598  // account.
 12599  //
 12600  // - projectId: Project ID.
 12601  func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
 12602  	c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 12603  	c.projectId = projectId
 12604  	return c
 12605  }
 12606  
 12607  // UserProject sets the optional parameter "userProject": The project to be
 12608  // billed for this request.
 12609  func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall {
 12610  	c.urlParams_.Set("userProject", userProject)
 12611  	return c
 12612  }
 12613  
 12614  // Fields allows partial responses to be retrieved. See
 12615  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 12616  // details.
 12617  func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
 12618  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 12619  	return c
 12620  }
 12621  
 12622  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 12623  // object's ETag matches the given value. This is useful for getting updates
 12624  // only after the object has changed since the last request.
 12625  func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
 12626  	c.ifNoneMatch_ = entityTag
 12627  	return c
 12628  }
 12629  
 12630  // Context sets the context to be used in this call's Do method.
 12631  func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
 12632  	c.ctx_ = ctx
 12633  	return c
 12634  }
 12635  
 12636  // Header returns a http.Header that can be modified by the caller to add
 12637  // headers to the request.
 12638  func (c *ProjectsServiceAccountGetCall) Header() http.Header {
 12639  	if c.header_ == nil {
 12640  		c.header_ = make(http.Header)
 12641  	}
 12642  	return c.header_
 12643  }
 12644  
 12645  func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
 12646  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 12647  	if c.ifNoneMatch_ != "" {
 12648  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 12649  	}
 12650  	var body io.Reader = nil
 12651  	c.urlParams_.Set("alt", alt)
 12652  	c.urlParams_.Set("prettyPrint", "false")
 12653  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
 12654  	urls += "?" + c.urlParams_.Encode()
 12655  	req, err := http.NewRequest("GET", urls, body)
 12656  	if err != nil {
 12657  		return nil, err
 12658  	}
 12659  	req.Header = reqHeaders
 12660  	googleapi.Expand(req.URL, map[string]string{
 12661  		"projectId": c.projectId,
 12662  	})
 12663  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 12664  }
 12665  
 12666  // Do executes the "storage.projects.serviceAccount.get" call.
 12667  // Any non-2xx status code is an error. Response headers are in either
 12668  // *ServiceAccount.ServerResponse.Header or (if a response was returned at all)
 12669  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 12670  // whether the returned error was because http.StatusNotModified was returned.
 12671  func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
 12672  	gensupport.SetOptions(c.urlParams_, opts...)
 12673  	res, err := c.doRequest("json")
 12674  	if res != nil && res.StatusCode == http.StatusNotModified {
 12675  		if res.Body != nil {
 12676  			res.Body.Close()
 12677  		}
 12678  		return nil, gensupport.WrapError(&googleapi.Error{
 12679  			Code:   res.StatusCode,
 12680  			Header: res.Header,
 12681  		})
 12682  	}
 12683  	if err != nil {
 12684  		return nil, err
 12685  	}
 12686  	defer googleapi.CloseBody(res)
 12687  	if err := googleapi.CheckResponse(res); err != nil {
 12688  		return nil, gensupport.WrapError(err)
 12689  	}
 12690  	ret := &ServiceAccount{
 12691  		ServerResponse: googleapi.ServerResponse{
 12692  			Header:         res.Header,
 12693  			HTTPStatusCode: res.StatusCode,
 12694  		},
 12695  	}
 12696  	target := &ret
 12697  	if err := gensupport.DecodeResponse(target, res); err != nil {
 12698  		return nil, err
 12699  	}
 12700  	return ret, nil
 12701  }
 12702  

View as plain text