...

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

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

     1  // Copyright 2020 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package storage provides access to the Cloud Storage JSON API.
     8  //
     9  // This package is DEPRECATED. Use package cloud.google.com/go/storage instead.
    10  //
    11  // For product documentation, see: https://developers.google.com/storage/docs/json_api/
    12  //
    13  // # Creating a client
    14  //
    15  // Usage example:
    16  //
    17  //	import "google.golang.org/api/storage/v1beta2"
    18  //	...
    19  //	ctx := context.Background()
    20  //	storageService, err := storage.NewService(ctx)
    21  //
    22  // In this example, Google Application Default Credentials are used for authentication.
    23  //
    24  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    25  //
    26  // # Other authentication options
    27  //
    28  // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
    29  //
    30  //	storageService, err := storage.NewService(ctx, option.WithScopes(storage.DevstorageReadWriteScope))
    31  //
    32  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    33  //
    34  //	storageService, err := storage.NewService(ctx, option.WithAPIKey("AIza..."))
    35  //
    36  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    37  //
    38  //	config := &oauth2.Config{...}
    39  //	// ...
    40  //	token, err := config.Exchange(ctx, ...)
    41  //	storageService, err := storage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    42  //
    43  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    44  package storage // import "google.golang.org/api/storage/v1beta2"
    45  
    46  import (
    47  	"bytes"
    48  	"context"
    49  	"encoding/json"
    50  	"errors"
    51  	"fmt"
    52  	"io"
    53  	"net/http"
    54  	"net/url"
    55  	"strconv"
    56  	"strings"
    57  
    58  	googleapi "google.golang.org/api/googleapi"
    59  	gensupport "google.golang.org/api/internal/gensupport"
    60  	option "google.golang.org/api/option"
    61  	internaloption "google.golang.org/api/option/internaloption"
    62  	htransport "google.golang.org/api/transport/http"
    63  )
    64  
    65  // Always reference these packages, just in case the auto-generated code
    66  // below doesn't.
    67  var _ = bytes.NewBuffer
    68  var _ = strconv.Itoa
    69  var _ = fmt.Sprintf
    70  var _ = json.NewDecoder
    71  var _ = io.Copy
    72  var _ = url.Parse
    73  var _ = gensupport.MarshalJSON
    74  var _ = googleapi.Version
    75  var _ = errors.New
    76  var _ = strings.Replace
    77  var _ = context.Canceled
    78  var _ = internaloption.WithDefaultEndpoint
    79  
    80  const apiId = "storage:v1beta2"
    81  const apiName = "storage"
    82  const apiVersion = "v1beta2"
    83  const basePath = "https://storage.googleapis.com/storage/v1beta2/"
    84  
    85  // OAuth2 scopes used by this API.
    86  const (
    87  	// Manage your data and permissions in Google Cloud Storage
    88  	DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
    89  
    90  	// View your data in Google Cloud Storage
    91  	DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
    92  
    93  	// Manage your data in Google Cloud Storage
    94  	DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
    95  )
    96  
    97  // NewService creates a new Service.
    98  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    99  	scopesOption := option.WithScopes(
   100  		"https://www.googleapis.com/auth/devstorage.full_control",
   101  		"https://www.googleapis.com/auth/devstorage.read_only",
   102  		"https://www.googleapis.com/auth/devstorage.read_write",
   103  	)
   104  	// NOTE: prepend, so we don't override user-specified scopes.
   105  	opts = append([]option.ClientOption{scopesOption}, opts...)
   106  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   107  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	s, err := New(client)
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	if endpoint != "" {
   116  		s.BasePath = endpoint
   117  	}
   118  	return s, nil
   119  }
   120  
   121  // New creates a new Service. It uses the provided http.Client for requests.
   122  //
   123  // Deprecated: please use NewService instead.
   124  // To provide a custom HTTP client, use option.WithHTTPClient.
   125  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   126  func New(client *http.Client) (*Service, error) {
   127  	if client == nil {
   128  		return nil, errors.New("client is nil")
   129  	}
   130  	s := &Service{client: client, BasePath: basePath}
   131  	s.BucketAccessControls = NewBucketAccessControlsService(s)
   132  	s.Buckets = NewBucketsService(s)
   133  	s.Channels = NewChannelsService(s)
   134  	s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
   135  	s.ObjectAccessControls = NewObjectAccessControlsService(s)
   136  	s.Objects = NewObjectsService(s)
   137  	return s, nil
   138  }
   139  
   140  type Service struct {
   141  	client    *http.Client
   142  	BasePath  string // API endpoint base URL
   143  	UserAgent string // optional additional User-Agent fragment
   144  
   145  	BucketAccessControls *BucketAccessControlsService
   146  
   147  	Buckets *BucketsService
   148  
   149  	Channels *ChannelsService
   150  
   151  	DefaultObjectAccessControls *DefaultObjectAccessControlsService
   152  
   153  	ObjectAccessControls *ObjectAccessControlsService
   154  
   155  	Objects *ObjectsService
   156  }
   157  
   158  func (s *Service) userAgent() string {
   159  	if s.UserAgent == "" {
   160  		return googleapi.UserAgent
   161  	}
   162  	return googleapi.UserAgent + " " + s.UserAgent
   163  }
   164  
   165  func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
   166  	rs := &BucketAccessControlsService{s: s}
   167  	return rs
   168  }
   169  
   170  type BucketAccessControlsService struct {
   171  	s *Service
   172  }
   173  
   174  func NewBucketsService(s *Service) *BucketsService {
   175  	rs := &BucketsService{s: s}
   176  	return rs
   177  }
   178  
   179  type BucketsService struct {
   180  	s *Service
   181  }
   182  
   183  func NewChannelsService(s *Service) *ChannelsService {
   184  	rs := &ChannelsService{s: s}
   185  	return rs
   186  }
   187  
   188  type ChannelsService struct {
   189  	s *Service
   190  }
   191  
   192  func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
   193  	rs := &DefaultObjectAccessControlsService{s: s}
   194  	return rs
   195  }
   196  
   197  type DefaultObjectAccessControlsService struct {
   198  	s *Service
   199  }
   200  
   201  func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
   202  	rs := &ObjectAccessControlsService{s: s}
   203  	return rs
   204  }
   205  
   206  type ObjectAccessControlsService struct {
   207  	s *Service
   208  }
   209  
   210  func NewObjectsService(s *Service) *ObjectsService {
   211  	rs := &ObjectsService{s: s}
   212  	return rs
   213  }
   214  
   215  type ObjectsService struct {
   216  	s *Service
   217  }
   218  
   219  // Bucket: A bucket.
   220  type Bucket struct {
   221  	// Acl: Access controls on the bucket.
   222  	Acl []*BucketAccessControl `json:"acl,omitempty"`
   223  
   224  	// Cors: The bucket's Cross-Origin Resource Sharing (CORS)
   225  	// configuration.
   226  	Cors []*BucketCors `json:"cors,omitempty"`
   227  
   228  	// DefaultObjectAcl: Default access controls to apply to new objects
   229  	// when no ACL is provided.
   230  	DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
   231  
   232  	// Etag: HTTP 1.1 Entity tag for the bucket.
   233  	Etag string `json:"etag,omitempty"`
   234  
   235  	// Id: The ID of the bucket.
   236  	Id string `json:"id,omitempty"`
   237  
   238  	// Kind: The kind of item this is. For buckets, this is always
   239  	// storage#bucket.
   240  	Kind string `json:"kind,omitempty"`
   241  
   242  	// Lifecycle: The bucket's lifecycle configuration. See object lifecycle
   243  	// management for more information.
   244  	Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
   245  
   246  	// Location: The location of the bucket. Object data for objects in the
   247  	// bucket resides in physical storage within this region. Typical values
   248  	// are US and EU. Defaults to US. See the developer's guide for the
   249  	// authoritative list.
   250  	Location string `json:"location,omitempty"`
   251  
   252  	// Logging: The bucket's logging configuration, which defines the
   253  	// destination bucket and optional name prefix for the current bucket's
   254  	// logs.
   255  	Logging *BucketLogging `json:"logging,omitempty"`
   256  
   257  	// Metageneration: The metadata generation of this bucket.
   258  	Metageneration int64 `json:"metageneration,omitempty,string"`
   259  
   260  	// Name: The name of the bucket.
   261  	Name string `json:"name,omitempty"`
   262  
   263  	// Owner: The owner of the bucket. This is always the project team's
   264  	// owner group.
   265  	Owner *BucketOwner `json:"owner,omitempty"`
   266  
   267  	// SelfLink: The URI of this bucket.
   268  	SelfLink string `json:"selfLink,omitempty"`
   269  
   270  	// StorageClass: The bucket's storage class. This defines how objects in
   271  	// the bucket are stored and determines the SLA and the cost of storage.
   272  	// Typical values are STANDARD and DURABLE_REDUCED_AVAILABILITY.
   273  	// Defaults to STANDARD. See the developer's guide for the authoritative
   274  	// list.
   275  	StorageClass string `json:"storageClass,omitempty"`
   276  
   277  	// TimeCreated: Creation time of the bucket in RFC 3339 format.
   278  	TimeCreated string `json:"timeCreated,omitempty"`
   279  
   280  	// Versioning: The bucket's versioning configuration.
   281  	Versioning *BucketVersioning `json:"versioning,omitempty"`
   282  
   283  	// Website: The bucket's website configuration.
   284  	Website *BucketWebsite `json:"website,omitempty"`
   285  
   286  	// ServerResponse contains the HTTP response code and headers from the
   287  	// server.
   288  	googleapi.ServerResponse `json:"-"`
   289  
   290  	// ForceSendFields is a list of field names (e.g. "Acl") to
   291  	// unconditionally include in API requests. By default, fields with
   292  	// empty values are omitted from API requests. However, any non-pointer,
   293  	// non-interface field appearing in ForceSendFields will be sent to the
   294  	// server regardless of whether the field is empty or not. This may be
   295  	// used to include empty fields in Patch requests.
   296  	ForceSendFields []string `json:"-"`
   297  
   298  	// NullFields is a list of field names (e.g. "Acl") to include in API
   299  	// requests with the JSON null value. By default, fields with empty
   300  	// values are omitted from API requests. However, any field with an
   301  	// empty value appearing in NullFields will be sent to the server as
   302  	// null. It is an error if a field in this list has a non-empty value.
   303  	// This may be used to include null fields in Patch requests.
   304  	NullFields []string `json:"-"`
   305  }
   306  
   307  func (s *Bucket) MarshalJSON() ([]byte, error) {
   308  	type NoMethod Bucket
   309  	raw := NoMethod(*s)
   310  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   311  }
   312  
   313  type BucketCors struct {
   314  	// MaxAgeSeconds: The value, in seconds, to return in the
   315  	// Access-Control-Max-Age header used in preflight responses.
   316  	MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
   317  
   318  	// Method: The list of HTTP methods on which to include CORS response
   319  	// headers: GET, OPTIONS, POST, etc. Note, "*" is permitted in the list
   320  	// of methods, and means "any method".
   321  	Method []string `json:"method,omitempty"`
   322  
   323  	// Origin: The list of Origins eligible to receive CORS response
   324  	// headers. Note: "*" is permitted in the list of origins, and means
   325  	// "any Origin".
   326  	Origin []string `json:"origin,omitempty"`
   327  
   328  	// ResponseHeader: The list of HTTP headers other than the simple
   329  	// response headers to give permission for the user-agent to share
   330  	// across domains.
   331  	ResponseHeader []string `json:"responseHeader,omitempty"`
   332  
   333  	// ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
   334  	// unconditionally include in API requests. By default, fields with
   335  	// empty values are omitted from API requests. However, any non-pointer,
   336  	// non-interface field appearing in ForceSendFields will be sent to the
   337  	// server regardless of whether the field is empty or not. This may be
   338  	// used to include empty fields in Patch requests.
   339  	ForceSendFields []string `json:"-"`
   340  
   341  	// NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
   342  	// in API requests with the JSON null value. By default, fields with
   343  	// empty values are omitted from API requests. However, any field with
   344  	// an empty value appearing in NullFields will be sent to the server as
   345  	// null. It is an error if a field in this list has a non-empty value.
   346  	// This may be used to include null fields in Patch requests.
   347  	NullFields []string `json:"-"`
   348  }
   349  
   350  func (s *BucketCors) MarshalJSON() ([]byte, error) {
   351  	type NoMethod BucketCors
   352  	raw := NoMethod(*s)
   353  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   354  }
   355  
   356  // BucketLifecycle: The bucket's lifecycle configuration. See object
   357  // lifecycle management for more information.
   358  type BucketLifecycle struct {
   359  	// Rule: A lifecycle management rule, which is made of an action to take
   360  	// and the condition(s) under which the action will be taken.
   361  	Rule []*BucketLifecycleRule `json:"rule,omitempty"`
   362  
   363  	// ForceSendFields is a list of field names (e.g. "Rule") to
   364  	// unconditionally include in API requests. By default, fields with
   365  	// empty values are omitted from API requests. However, any non-pointer,
   366  	// non-interface field appearing in ForceSendFields will be sent to the
   367  	// server regardless of whether the field is empty or not. This may be
   368  	// used to include empty fields in Patch requests.
   369  	ForceSendFields []string `json:"-"`
   370  
   371  	// NullFields is a list of field names (e.g. "Rule") to include in API
   372  	// requests with the JSON null value. By default, fields with empty
   373  	// values are omitted from API requests. However, any field with an
   374  	// empty value appearing in NullFields will be sent to the server as
   375  	// null. It is an error if a field in this list has a non-empty value.
   376  	// This may be used to include null fields in Patch requests.
   377  	NullFields []string `json:"-"`
   378  }
   379  
   380  func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
   381  	type NoMethod BucketLifecycle
   382  	raw := NoMethod(*s)
   383  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   384  }
   385  
   386  type BucketLifecycleRule struct {
   387  	// Action: The action to take.
   388  	Action *BucketLifecycleRuleAction `json:"action,omitempty"`
   389  
   390  	// Condition: The condition(s) under which the action will be taken.
   391  	Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
   392  
   393  	// ForceSendFields is a list of field names (e.g. "Action") to
   394  	// unconditionally include in API requests. By default, fields with
   395  	// empty values are omitted from API requests. However, any non-pointer,
   396  	// non-interface field appearing in ForceSendFields will be sent to the
   397  	// server regardless of whether the field is empty or not. This may be
   398  	// used to include empty fields in Patch requests.
   399  	ForceSendFields []string `json:"-"`
   400  
   401  	// NullFields is a list of field names (e.g. "Action") to include in API
   402  	// requests with the JSON null value. By default, fields with empty
   403  	// values are omitted from API requests. However, any field with an
   404  	// empty value appearing in NullFields will be sent to the server as
   405  	// null. It is an error if a field in this list has a non-empty value.
   406  	// This may be used to include null fields in Patch requests.
   407  	NullFields []string `json:"-"`
   408  }
   409  
   410  func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
   411  	type NoMethod BucketLifecycleRule
   412  	raw := NoMethod(*s)
   413  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   414  }
   415  
   416  // BucketLifecycleRuleAction: The action to take.
   417  type BucketLifecycleRuleAction struct {
   418  	// Type: Type of the action. Currently only Delete is supported.
   419  	Type string `json:"type,omitempty"`
   420  
   421  	// ForceSendFields is a list of field names (e.g. "Type") to
   422  	// unconditionally include in API requests. By default, fields with
   423  	// empty values are omitted from API requests. However, any non-pointer,
   424  	// non-interface field appearing in ForceSendFields will be sent to the
   425  	// server regardless of whether the field is empty or not. This may be
   426  	// used to include empty fields in Patch requests.
   427  	ForceSendFields []string `json:"-"`
   428  
   429  	// NullFields is a list of field names (e.g. "Type") to include in API
   430  	// requests with the JSON null value. By default, fields with empty
   431  	// values are omitted from API requests. However, any field with an
   432  	// empty value appearing in NullFields will be sent to the server as
   433  	// null. It is an error if a field in this list has a non-empty value.
   434  	// This may be used to include null fields in Patch requests.
   435  	NullFields []string `json:"-"`
   436  }
   437  
   438  func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
   439  	type NoMethod BucketLifecycleRuleAction
   440  	raw := NoMethod(*s)
   441  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   442  }
   443  
   444  // BucketLifecycleRuleCondition: The condition(s) under which the action
   445  // will be taken.
   446  type BucketLifecycleRuleCondition struct {
   447  	// Age: Age of an object (in days). This condition is satisfied when an
   448  	// object reaches the specified age.
   449  	Age int64 `json:"age,omitempty"`
   450  
   451  	// CreatedBefore: A date in RFC 3339 format with only the date part,
   452  	// e.g. "2013-01-15". This condition is satisfied when an object is
   453  	// created before midnight of the specified date in UTC.
   454  	CreatedBefore string `json:"createdBefore,omitempty"`
   455  
   456  	// IsLive: Relevant only for versioned objects. If the value is true,
   457  	// this condition matches live objects; if the value is false, it
   458  	// matches archived objects.
   459  	IsLive *bool `json:"isLive,omitempty"`
   460  
   461  	// NumNewerVersions: Relevant only for versioned objects. If the value
   462  	// is N, this condition is satisfied when there are at least N versions
   463  	// (including the live version) newer than this version of the object.
   464  	NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
   465  
   466  	// ForceSendFields is a list of field names (e.g. "Age") to
   467  	// unconditionally include in API requests. By default, fields with
   468  	// empty values are omitted from API requests. However, any non-pointer,
   469  	// non-interface field appearing in ForceSendFields will be sent to the
   470  	// server regardless of whether the field is empty or not. This may be
   471  	// used to include empty fields in Patch requests.
   472  	ForceSendFields []string `json:"-"`
   473  
   474  	// NullFields is a list of field names (e.g. "Age") to include in API
   475  	// requests with the JSON null value. By default, fields with empty
   476  	// values are omitted from API requests. However, any field with an
   477  	// empty value appearing in NullFields will be sent to the server as
   478  	// null. It is an error if a field in this list has a non-empty value.
   479  	// This may be used to include null fields in Patch requests.
   480  	NullFields []string `json:"-"`
   481  }
   482  
   483  func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
   484  	type NoMethod BucketLifecycleRuleCondition
   485  	raw := NoMethod(*s)
   486  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   487  }
   488  
   489  // BucketLogging: The bucket's logging configuration, which defines the
   490  // destination bucket and optional name prefix for the current bucket's
   491  // logs.
   492  type BucketLogging struct {
   493  	// LogBucket: The destination bucket where the current bucket's logs
   494  	// should be placed.
   495  	LogBucket string `json:"logBucket,omitempty"`
   496  
   497  	// LogObjectPrefix: A prefix for log object names.
   498  	LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
   499  
   500  	// ForceSendFields is a list of field names (e.g. "LogBucket") to
   501  	// unconditionally include in API requests. By default, fields with
   502  	// empty values are omitted from API requests. However, any non-pointer,
   503  	// non-interface field appearing in ForceSendFields will be sent to the
   504  	// server regardless of whether the field is empty or not. This may be
   505  	// used to include empty fields in Patch requests.
   506  	ForceSendFields []string `json:"-"`
   507  
   508  	// NullFields is a list of field names (e.g. "LogBucket") to include in
   509  	// API requests with the JSON null value. By default, fields with empty
   510  	// values are omitted from API requests. However, any field with an
   511  	// empty value appearing in NullFields will be sent to the server as
   512  	// null. It is an error if a field in this list has a non-empty value.
   513  	// This may be used to include null fields in Patch requests.
   514  	NullFields []string `json:"-"`
   515  }
   516  
   517  func (s *BucketLogging) MarshalJSON() ([]byte, error) {
   518  	type NoMethod BucketLogging
   519  	raw := NoMethod(*s)
   520  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   521  }
   522  
   523  // BucketOwner: The owner of the bucket. This is always the project
   524  // team's owner group.
   525  type BucketOwner struct {
   526  	// Entity: The entity, in the form group-groupId.
   527  	Entity string `json:"entity,omitempty"`
   528  
   529  	// EntityId: The ID for the entity.
   530  	EntityId string `json:"entityId,omitempty"`
   531  
   532  	// ForceSendFields is a list of field names (e.g. "Entity") to
   533  	// unconditionally include in API requests. By default, fields with
   534  	// empty values are omitted from API requests. However, any non-pointer,
   535  	// non-interface field appearing in ForceSendFields will be sent to the
   536  	// server regardless of whether the field is empty or not. This may be
   537  	// used to include empty fields in Patch requests.
   538  	ForceSendFields []string `json:"-"`
   539  
   540  	// NullFields is a list of field names (e.g. "Entity") to include in API
   541  	// requests with the JSON null value. By default, fields with empty
   542  	// values are omitted from API requests. However, any field with an
   543  	// empty value appearing in NullFields will be sent to the server as
   544  	// null. It is an error if a field in this list has a non-empty value.
   545  	// This may be used to include null fields in Patch requests.
   546  	NullFields []string `json:"-"`
   547  }
   548  
   549  func (s *BucketOwner) MarshalJSON() ([]byte, error) {
   550  	type NoMethod BucketOwner
   551  	raw := NoMethod(*s)
   552  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   553  }
   554  
   555  // BucketVersioning: The bucket's versioning configuration.
   556  type BucketVersioning struct {
   557  	// Enabled: While set to true, versioning is fully enabled for this
   558  	// bucket.
   559  	Enabled bool `json:"enabled,omitempty"`
   560  
   561  	// ForceSendFields is a list of field names (e.g. "Enabled") to
   562  	// unconditionally include in API requests. By default, fields with
   563  	// empty values are omitted from API requests. However, any non-pointer,
   564  	// non-interface field appearing in ForceSendFields will be sent to the
   565  	// server regardless of whether the field is empty or not. This may be
   566  	// used to include empty fields in Patch requests.
   567  	ForceSendFields []string `json:"-"`
   568  
   569  	// NullFields is a list of field names (e.g. "Enabled") to include in
   570  	// API requests with the JSON null value. By default, fields with empty
   571  	// values are omitted from API requests. However, any field with an
   572  	// empty value appearing in NullFields will be sent to the server as
   573  	// null. It is an error if a field in this list has a non-empty value.
   574  	// This may be used to include null fields in Patch requests.
   575  	NullFields []string `json:"-"`
   576  }
   577  
   578  func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
   579  	type NoMethod BucketVersioning
   580  	raw := NoMethod(*s)
   581  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   582  }
   583  
   584  // BucketWebsite: The bucket's website configuration.
   585  type BucketWebsite struct {
   586  	// MainPageSuffix: Behaves as the bucket's directory index where missing
   587  	// objects are treated as potential directories.
   588  	MainPageSuffix string `json:"mainPageSuffix,omitempty"`
   589  
   590  	// NotFoundPage: The custom object to return when a requested resource
   591  	// is not found.
   592  	NotFoundPage string `json:"notFoundPage,omitempty"`
   593  
   594  	// ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
   595  	// unconditionally include in API requests. By default, fields with
   596  	// empty values are omitted from API requests. However, any non-pointer,
   597  	// non-interface field appearing in ForceSendFields will be sent to the
   598  	// server regardless of whether the field is empty or not. This may be
   599  	// used to include empty fields in Patch requests.
   600  	ForceSendFields []string `json:"-"`
   601  
   602  	// NullFields is a list of field names (e.g. "MainPageSuffix") to
   603  	// include in API requests with the JSON null value. By default, fields
   604  	// with empty values are omitted from API requests. However, any field
   605  	// with an empty value appearing in NullFields will be sent to the
   606  	// server as null. It is an error if a field in this list has a
   607  	// non-empty value. This may be used to include null fields in Patch
   608  	// requests.
   609  	NullFields []string `json:"-"`
   610  }
   611  
   612  func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
   613  	type NoMethod BucketWebsite
   614  	raw := NoMethod(*s)
   615  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   616  }
   617  
   618  // BucketAccessControl: An access-control entry.
   619  type BucketAccessControl struct {
   620  	// Bucket: The name of the bucket.
   621  	Bucket string `json:"bucket,omitempty"`
   622  
   623  	// Domain: The domain associated with the entity, if any.
   624  	Domain string `json:"domain,omitempty"`
   625  
   626  	// Email: The email address associated with the entity, if any.
   627  	Email string `json:"email,omitempty"`
   628  
   629  	// Entity: The entity holding the permission, in one of the following
   630  	// forms:
   631  	// - user-userId
   632  	// - user-email
   633  	// - group-groupId
   634  	// - group-email
   635  	// - domain-domain
   636  	// - allUsers
   637  	// - allAuthenticatedUsers Examples:
   638  	// - The user liz@example.com would be user-liz@example.com.
   639  	// - The group example@googlegroups.com would be
   640  	// group-example@googlegroups.com.
   641  	// - To refer to all members of the Google Apps for Business domain
   642  	// example.com, the entity would be domain-example.com.
   643  	Entity string `json:"entity,omitempty"`
   644  
   645  	// EntityId: The ID for the entity, if any.
   646  	EntityId string `json:"entityId,omitempty"`
   647  
   648  	// Etag: HTTP 1.1 Entity tag for the access-control entry.
   649  	Etag string `json:"etag,omitempty"`
   650  
   651  	// Id: The ID of the access-control entry.
   652  	Id string `json:"id,omitempty"`
   653  
   654  	// Kind: The kind of item this is. For bucket access control entries,
   655  	// this is always storage#bucketAccessControl.
   656  	Kind string `json:"kind,omitempty"`
   657  
   658  	// Role: The access permission for the entity. Can be READER, WRITER, or
   659  	// OWNER.
   660  	Role string `json:"role,omitempty"`
   661  
   662  	// SelfLink: The link to this access-control entry.
   663  	SelfLink string `json:"selfLink,omitempty"`
   664  
   665  	// ServerResponse contains the HTTP response code and headers from the
   666  	// server.
   667  	googleapi.ServerResponse `json:"-"`
   668  
   669  	// ForceSendFields is a list of field names (e.g. "Bucket") to
   670  	// unconditionally include in API requests. By default, fields with
   671  	// empty values are omitted from API requests. However, any non-pointer,
   672  	// non-interface field appearing in ForceSendFields will be sent to the
   673  	// server regardless of whether the field is empty or not. This may be
   674  	// used to include empty fields in Patch requests.
   675  	ForceSendFields []string `json:"-"`
   676  
   677  	// NullFields is a list of field names (e.g. "Bucket") to include in API
   678  	// requests with the JSON null value. By default, fields with empty
   679  	// values are omitted from API requests. However, any field with an
   680  	// empty value appearing in NullFields will be sent to the server as
   681  	// null. It is an error if a field in this list has a non-empty value.
   682  	// This may be used to include null fields in Patch requests.
   683  	NullFields []string `json:"-"`
   684  }
   685  
   686  func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
   687  	type NoMethod BucketAccessControl
   688  	raw := NoMethod(*s)
   689  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   690  }
   691  
   692  // BucketAccessControls: An access-control list.
   693  type BucketAccessControls struct {
   694  	// Items: The list of items.
   695  	Items []*BucketAccessControl `json:"items,omitempty"`
   696  
   697  	// Kind: The kind of item this is. For lists of bucket access control
   698  	// entries, this is always storage#bucketAccessControls.
   699  	Kind string `json:"kind,omitempty"`
   700  
   701  	// ServerResponse contains the HTTP response code and headers from the
   702  	// server.
   703  	googleapi.ServerResponse `json:"-"`
   704  
   705  	// ForceSendFields is a list of field names (e.g. "Items") to
   706  	// unconditionally include in API requests. By default, fields with
   707  	// empty values are omitted from API requests. However, any non-pointer,
   708  	// non-interface field appearing in ForceSendFields will be sent to the
   709  	// server regardless of whether the field is empty or not. This may be
   710  	// used to include empty fields in Patch requests.
   711  	ForceSendFields []string `json:"-"`
   712  
   713  	// NullFields is a list of field names (e.g. "Items") to include in API
   714  	// requests with the JSON null value. By default, fields with empty
   715  	// values are omitted from API requests. However, any field with an
   716  	// empty value appearing in NullFields will be sent to the server as
   717  	// null. It is an error if a field in this list has a non-empty value.
   718  	// This may be used to include null fields in Patch requests.
   719  	NullFields []string `json:"-"`
   720  }
   721  
   722  func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
   723  	type NoMethod BucketAccessControls
   724  	raw := NoMethod(*s)
   725  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   726  }
   727  
   728  // Buckets: A list of buckets.
   729  type Buckets struct {
   730  	// Items: The list of items.
   731  	Items []*Bucket `json:"items,omitempty"`
   732  
   733  	// Kind: The kind of item this is. For lists of buckets, this is always
   734  	// storage#buckets.
   735  	Kind string `json:"kind,omitempty"`
   736  
   737  	// NextPageToken: The continuation token, used to page through large
   738  	// result sets. Provide this value in a subsequent request to return the
   739  	// next page of results.
   740  	NextPageToken string `json:"nextPageToken,omitempty"`
   741  
   742  	// ServerResponse contains the HTTP response code and headers from the
   743  	// server.
   744  	googleapi.ServerResponse `json:"-"`
   745  
   746  	// ForceSendFields is a list of field names (e.g. "Items") to
   747  	// unconditionally include in API requests. By default, fields with
   748  	// empty values are omitted from API requests. However, any non-pointer,
   749  	// non-interface field appearing in ForceSendFields will be sent to the
   750  	// server regardless of whether the field is empty or not. This may be
   751  	// used to include empty fields in Patch requests.
   752  	ForceSendFields []string `json:"-"`
   753  
   754  	// NullFields is a list of field names (e.g. "Items") to include in API
   755  	// requests with the JSON null value. By default, fields with empty
   756  	// values are omitted from API requests. However, any field with an
   757  	// empty value appearing in NullFields will be sent to the server as
   758  	// null. It is an error if a field in this list has a non-empty value.
   759  	// This may be used to include null fields in Patch requests.
   760  	NullFields []string `json:"-"`
   761  }
   762  
   763  func (s *Buckets) MarshalJSON() ([]byte, error) {
   764  	type NoMethod Buckets
   765  	raw := NoMethod(*s)
   766  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   767  }
   768  
   769  // Channel: An notification channel used to watch for resource changes.
   770  type Channel struct {
   771  	// Address: The address where notifications are delivered for this
   772  	// channel.
   773  	Address string `json:"address,omitempty"`
   774  
   775  	// Expiration: Date and time of notification channel expiration,
   776  	// expressed as a Unix timestamp, in milliseconds. Optional.
   777  	Expiration int64 `json:"expiration,omitempty,string"`
   778  
   779  	// Id: A UUID or similar unique string that identifies this channel.
   780  	Id string `json:"id,omitempty"`
   781  
   782  	// Kind: Identifies this as a notification channel used to watch for
   783  	// changes to a resource, which is "api#channel".
   784  	Kind string `json:"kind,omitempty"`
   785  
   786  	// Params: Additional parameters controlling delivery channel behavior.
   787  	// Optional.
   788  	Params map[string]string `json:"params,omitempty"`
   789  
   790  	// Payload: A Boolean value to indicate whether payload is wanted.
   791  	// Optional.
   792  	Payload bool `json:"payload,omitempty"`
   793  
   794  	// ResourceId: An opaque ID that identifies the resource being watched
   795  	// on this channel. Stable across different API versions.
   796  	ResourceId string `json:"resourceId,omitempty"`
   797  
   798  	// ResourceUri: A version-specific identifier for the watched resource.
   799  	ResourceUri string `json:"resourceUri,omitempty"`
   800  
   801  	// Token: An arbitrary string delivered to the target address with each
   802  	// notification delivered over this channel. Optional.
   803  	Token string `json:"token,omitempty"`
   804  
   805  	// Type: The type of delivery mechanism used for this channel.
   806  	Type string `json:"type,omitempty"`
   807  
   808  	// ServerResponse contains the HTTP response code and headers from the
   809  	// server.
   810  	googleapi.ServerResponse `json:"-"`
   811  
   812  	// ForceSendFields is a list of field names (e.g. "Address") to
   813  	// unconditionally include in API requests. By default, fields with
   814  	// empty values are omitted from API requests. However, any non-pointer,
   815  	// non-interface field appearing in ForceSendFields will be sent to the
   816  	// server regardless of whether the field is empty or not. This may be
   817  	// used to include empty fields in Patch requests.
   818  	ForceSendFields []string `json:"-"`
   819  
   820  	// NullFields is a list of field names (e.g. "Address") to include in
   821  	// API requests with the JSON null value. By default, fields with empty
   822  	// values are omitted from API requests. However, any field with an
   823  	// empty value appearing in NullFields will be sent to the server as
   824  	// null. It is an error if a field in this list has a non-empty value.
   825  	// This may be used to include null fields in Patch requests.
   826  	NullFields []string `json:"-"`
   827  }
   828  
   829  func (s *Channel) MarshalJSON() ([]byte, error) {
   830  	type NoMethod Channel
   831  	raw := NoMethod(*s)
   832  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   833  }
   834  
   835  // ComposeRequest: A Compose request.
   836  type ComposeRequest struct {
   837  	// Destination: Properties of the resulting object
   838  	Destination *Object `json:"destination,omitempty"`
   839  
   840  	// Kind: The kind of item this is.
   841  	Kind string `json:"kind,omitempty"`
   842  
   843  	// SourceObjects: The list of source objects that will be concatenated
   844  	// into a single object.
   845  	SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
   846  
   847  	// ForceSendFields is a list of field names (e.g. "Destination") to
   848  	// unconditionally include in API requests. By default, fields with
   849  	// empty values are omitted from API requests. However, any non-pointer,
   850  	// non-interface field appearing in ForceSendFields will be sent to the
   851  	// server regardless of whether the field is empty or not. This may be
   852  	// used to include empty fields in Patch requests.
   853  	ForceSendFields []string `json:"-"`
   854  
   855  	// NullFields is a list of field names (e.g. "Destination") to include
   856  	// in API requests with the JSON null value. By default, fields with
   857  	// empty values are omitted from API requests. However, any field with
   858  	// an empty value appearing in NullFields will be sent to the server as
   859  	// null. It is an error if a field in this list has a non-empty value.
   860  	// This may be used to include null fields in Patch requests.
   861  	NullFields []string `json:"-"`
   862  }
   863  
   864  func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
   865  	type NoMethod ComposeRequest
   866  	raw := NoMethod(*s)
   867  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   868  }
   869  
   870  type ComposeRequestSourceObjects struct {
   871  	// Generation: The generation of this object to use as the source.
   872  	Generation int64 `json:"generation,omitempty,string"`
   873  
   874  	// Name: The source object's name. All source objects must reside in the
   875  	// same bucket.
   876  	Name string `json:"name,omitempty"`
   877  
   878  	// ObjectPreconditions: Conditions that must be met for this operation
   879  	// to execute.
   880  	ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
   881  
   882  	// ForceSendFields is a list of field names (e.g. "Generation") to
   883  	// unconditionally include in API requests. By default, fields with
   884  	// empty values are omitted from API requests. However, any non-pointer,
   885  	// non-interface field appearing in ForceSendFields will be sent to the
   886  	// server regardless of whether the field is empty or not. This may be
   887  	// used to include empty fields in Patch requests.
   888  	ForceSendFields []string `json:"-"`
   889  
   890  	// NullFields is a list of field names (e.g. "Generation") to include in
   891  	// API requests with the JSON null value. By default, fields with empty
   892  	// values are omitted from API requests. However, any field with an
   893  	// empty value appearing in NullFields will be sent to the server as
   894  	// null. It is an error if a field in this list has a non-empty value.
   895  	// This may be used to include null fields in Patch requests.
   896  	NullFields []string `json:"-"`
   897  }
   898  
   899  func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
   900  	type NoMethod ComposeRequestSourceObjects
   901  	raw := NoMethod(*s)
   902  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   903  }
   904  
   905  // ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
   906  // be met for this operation to execute.
   907  type ComposeRequestSourceObjectsObjectPreconditions struct {
   908  	// IfGenerationMatch: Only perform the composition if the generation of
   909  	// the source object that would be used matches this value. If this
   910  	// value and a generation are both specified, they must be the same
   911  	// value or the call will fail.
   912  	IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
   913  
   914  	// ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
   915  	// to unconditionally include in API requests. By default, fields with
   916  	// empty values are omitted from API requests. However, any non-pointer,
   917  	// non-interface field appearing in ForceSendFields will be sent to the
   918  	// server regardless of whether the field is empty or not. This may be
   919  	// used to include empty fields in Patch requests.
   920  	ForceSendFields []string `json:"-"`
   921  
   922  	// NullFields is a list of field names (e.g. "IfGenerationMatch") to
   923  	// include in API requests with the JSON null value. By default, fields
   924  	// with empty values are omitted from API requests. However, any field
   925  	// with an empty value appearing in NullFields will be sent to the
   926  	// server as null. It is an error if a field in this list has a
   927  	// non-empty value. This may be used to include null fields in Patch
   928  	// requests.
   929  	NullFields []string `json:"-"`
   930  }
   931  
   932  func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
   933  	type NoMethod ComposeRequestSourceObjectsObjectPreconditions
   934  	raw := NoMethod(*s)
   935  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   936  }
   937  
   938  // Object: An object.
   939  type Object struct {
   940  	// Acl: Access controls on the object.
   941  	Acl []*ObjectAccessControl `json:"acl,omitempty"`
   942  
   943  	// Bucket: The bucket containing this object.
   944  	Bucket string `json:"bucket,omitempty"`
   945  
   946  	// CacheControl: Cache-Control directive for the object data.
   947  	CacheControl string `json:"cacheControl,omitempty"`
   948  
   949  	// ComponentCount: Number of underlying components that make up this
   950  	// object. Components are accumulated by compose operations and are
   951  	// limited to a count of 32.
   952  	ComponentCount int64 `json:"componentCount,omitempty"`
   953  
   954  	// ContentDisposition: Content-Disposition of the object data.
   955  	ContentDisposition string `json:"contentDisposition,omitempty"`
   956  
   957  	// ContentEncoding: Content-Encoding of the object data.
   958  	ContentEncoding string `json:"contentEncoding,omitempty"`
   959  
   960  	// ContentLanguage: Content-Language of the object data.
   961  	ContentLanguage string `json:"contentLanguage,omitempty"`
   962  
   963  	// ContentType: Content-Type of the object data.
   964  	ContentType string `json:"contentType,omitempty"`
   965  
   966  	// Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
   967  	// encoded using base64.
   968  	Crc32c string `json:"crc32c,omitempty"`
   969  
   970  	// Etag: HTTP 1.1 Entity tag for the object.
   971  	Etag string `json:"etag,omitempty"`
   972  
   973  	// Generation: The content generation of this object. Used for object
   974  	// versioning.
   975  	Generation int64 `json:"generation,omitempty,string"`
   976  
   977  	// Id: The ID of the object.
   978  	Id string `json:"id,omitempty"`
   979  
   980  	// Kind: The kind of item this is. For objects, this is always
   981  	// storage#object.
   982  	Kind string `json:"kind,omitempty"`
   983  
   984  	// Md5Hash: MD5 hash of the data; encoded using base64.
   985  	Md5Hash string `json:"md5Hash,omitempty"`
   986  
   987  	// MediaLink: Media download link.
   988  	MediaLink string `json:"mediaLink,omitempty"`
   989  
   990  	// Metadata: User-provided metadata, in key/value pairs.
   991  	Metadata map[string]string `json:"metadata,omitempty"`
   992  
   993  	// Metageneration: The generation of the metadata for this object at
   994  	// this generation. Used for metadata versioning. Has no meaning outside
   995  	// of the context of this generation.
   996  	Metageneration int64 `json:"metageneration,omitempty,string"`
   997  
   998  	// Name: The name of this object. Required if not specified by URL
   999  	// parameter.
  1000  	Name string `json:"name,omitempty"`
  1001  
  1002  	// Owner: The owner of the object. This will always be the uploader of
  1003  	// the object.
  1004  	Owner *ObjectOwner `json:"owner,omitempty"`
  1005  
  1006  	// SelfLink: The link to this object.
  1007  	SelfLink string `json:"selfLink,omitempty"`
  1008  
  1009  	// Size: Content-Length of the data in bytes.
  1010  	Size uint64 `json:"size,omitempty,string"`
  1011  
  1012  	// StorageClass: Storage class of the object.
  1013  	StorageClass string `json:"storageClass,omitempty"`
  1014  
  1015  	// TimeDeleted: Deletion time of the object in RFC 3339 format. Will be
  1016  	// returned if and only if this version of the object has been deleted.
  1017  	TimeDeleted string `json:"timeDeleted,omitempty"`
  1018  
  1019  	// Updated: Modification time of the object metadata in RFC 3339 format.
  1020  	Updated string `json:"updated,omitempty"`
  1021  
  1022  	// ServerResponse contains the HTTP response code and headers from the
  1023  	// server.
  1024  	googleapi.ServerResponse `json:"-"`
  1025  
  1026  	// ForceSendFields is a list of field names (e.g. "Acl") to
  1027  	// unconditionally include in API requests. By default, fields with
  1028  	// empty values are omitted from API requests. However, any non-pointer,
  1029  	// non-interface field appearing in ForceSendFields will be sent to the
  1030  	// server regardless of whether the field is empty or not. This may be
  1031  	// used to include empty fields in Patch requests.
  1032  	ForceSendFields []string `json:"-"`
  1033  
  1034  	// NullFields is a list of field names (e.g. "Acl") to include in API
  1035  	// requests with the JSON null value. By default, fields with empty
  1036  	// values are omitted from API requests. However, any field with an
  1037  	// empty value appearing in NullFields will be sent to the server as
  1038  	// null. It is an error if a field in this list has a non-empty value.
  1039  	// This may be used to include null fields in Patch requests.
  1040  	NullFields []string `json:"-"`
  1041  }
  1042  
  1043  func (s *Object) MarshalJSON() ([]byte, error) {
  1044  	type NoMethod Object
  1045  	raw := NoMethod(*s)
  1046  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1047  }
  1048  
  1049  // ObjectOwner: The owner of the object. This will always be the
  1050  // uploader of the object.
  1051  type ObjectOwner struct {
  1052  	// Entity: The entity, in the form user-userId.
  1053  	Entity string `json:"entity,omitempty"`
  1054  
  1055  	// EntityId: The ID for the entity.
  1056  	EntityId string `json:"entityId,omitempty"`
  1057  
  1058  	// ForceSendFields is a list of field names (e.g. "Entity") to
  1059  	// unconditionally include in API requests. By default, fields with
  1060  	// empty values are omitted from API requests. However, any non-pointer,
  1061  	// non-interface field appearing in ForceSendFields will be sent to the
  1062  	// server regardless of whether the field is empty or not. This may be
  1063  	// used to include empty fields in Patch requests.
  1064  	ForceSendFields []string `json:"-"`
  1065  
  1066  	// NullFields is a list of field names (e.g. "Entity") to include in API
  1067  	// requests with the JSON null value. By default, fields with empty
  1068  	// values are omitted from API requests. However, any field with an
  1069  	// empty value appearing in NullFields will be sent to the server as
  1070  	// null. It is an error if a field in this list has a non-empty value.
  1071  	// This may be used to include null fields in Patch requests.
  1072  	NullFields []string `json:"-"`
  1073  }
  1074  
  1075  func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
  1076  	type NoMethod ObjectOwner
  1077  	raw := NoMethod(*s)
  1078  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1079  }
  1080  
  1081  // ObjectAccessControl: An access-control entry.
  1082  type ObjectAccessControl struct {
  1083  	// Bucket: The name of the bucket.
  1084  	Bucket string `json:"bucket,omitempty"`
  1085  
  1086  	// Domain: The domain associated with the entity, if any.
  1087  	Domain string `json:"domain,omitempty"`
  1088  
  1089  	// Email: The email address associated with the entity, if any.
  1090  	Email string `json:"email,omitempty"`
  1091  
  1092  	// Entity: The entity holding the permission, in one of the following
  1093  	// forms:
  1094  	// - user-userId
  1095  	// - user-email
  1096  	// - group-groupId
  1097  	// - group-email
  1098  	// - domain-domain
  1099  	// - allUsers
  1100  	// - allAuthenticatedUsers Examples:
  1101  	// - The user liz@example.com would be user-liz@example.com.
  1102  	// - The group example@googlegroups.com would be
  1103  	// group-example@googlegroups.com.
  1104  	// - To refer to all members of the Google Apps for Business domain
  1105  	// example.com, the entity would be domain-example.com.
  1106  	Entity string `json:"entity,omitempty"`
  1107  
  1108  	// EntityId: The ID for the entity, if any.
  1109  	EntityId string `json:"entityId,omitempty"`
  1110  
  1111  	// Etag: HTTP 1.1 Entity tag for the access-control entry.
  1112  	Etag string `json:"etag,omitempty"`
  1113  
  1114  	// Generation: The content generation of the object.
  1115  	Generation int64 `json:"generation,omitempty,string"`
  1116  
  1117  	// Id: The ID of the access-control entry.
  1118  	Id string `json:"id,omitempty"`
  1119  
  1120  	// Kind: The kind of item this is. For object access control entries,
  1121  	// this is always storage#objectAccessControl.
  1122  	Kind string `json:"kind,omitempty"`
  1123  
  1124  	// Object: The name of the object.
  1125  	Object string `json:"object,omitempty"`
  1126  
  1127  	// Role: The access permission for the entity. Can be READER or OWNER.
  1128  	Role string `json:"role,omitempty"`
  1129  
  1130  	// SelfLink: The link to this access-control entry.
  1131  	SelfLink string `json:"selfLink,omitempty"`
  1132  
  1133  	// ServerResponse contains the HTTP response code and headers from the
  1134  	// server.
  1135  	googleapi.ServerResponse `json:"-"`
  1136  
  1137  	// ForceSendFields is a list of field names (e.g. "Bucket") to
  1138  	// unconditionally include in API requests. By default, fields with
  1139  	// empty values are omitted from API requests. However, any non-pointer,
  1140  	// non-interface field appearing in ForceSendFields will be sent to the
  1141  	// server regardless of whether the field is empty or not. This may be
  1142  	// used to include empty fields in Patch requests.
  1143  	ForceSendFields []string `json:"-"`
  1144  
  1145  	// NullFields is a list of field names (e.g. "Bucket") to include in API
  1146  	// requests with the JSON null value. By default, fields with empty
  1147  	// values are omitted from API requests. However, any field with an
  1148  	// empty value appearing in NullFields will be sent to the server as
  1149  	// null. It is an error if a field in this list has a non-empty value.
  1150  	// This may be used to include null fields in Patch requests.
  1151  	NullFields []string `json:"-"`
  1152  }
  1153  
  1154  func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
  1155  	type NoMethod ObjectAccessControl
  1156  	raw := NoMethod(*s)
  1157  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1158  }
  1159  
  1160  // ObjectAccessControls: An access-control list.
  1161  type ObjectAccessControls struct {
  1162  	// Items: The list of items.
  1163  	Items []interface{} `json:"items,omitempty"`
  1164  
  1165  	// Kind: The kind of item this is. For lists of object access control
  1166  	// entries, this is always storage#objectAccessControls.
  1167  	Kind string `json:"kind,omitempty"`
  1168  
  1169  	// ServerResponse contains the HTTP response code and headers from the
  1170  	// server.
  1171  	googleapi.ServerResponse `json:"-"`
  1172  
  1173  	// ForceSendFields is a list of field names (e.g. "Items") to
  1174  	// unconditionally include in API requests. By default, fields with
  1175  	// empty values are omitted from API requests. However, any non-pointer,
  1176  	// non-interface field appearing in ForceSendFields will be sent to the
  1177  	// server regardless of whether the field is empty or not. This may be
  1178  	// used to include empty fields in Patch requests.
  1179  	ForceSendFields []string `json:"-"`
  1180  
  1181  	// NullFields is a list of field names (e.g. "Items") to include in API
  1182  	// requests with the JSON null value. By default, fields with empty
  1183  	// values are omitted from API requests. However, any field with an
  1184  	// empty value appearing in NullFields will be sent to the server as
  1185  	// null. It is an error if a field in this list has a non-empty value.
  1186  	// This may be used to include null fields in Patch requests.
  1187  	NullFields []string `json:"-"`
  1188  }
  1189  
  1190  func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
  1191  	type NoMethod ObjectAccessControls
  1192  	raw := NoMethod(*s)
  1193  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1194  }
  1195  
  1196  // Objects: A list of objects.
  1197  type Objects struct {
  1198  	// Items: The list of items.
  1199  	Items []*Object `json:"items,omitempty"`
  1200  
  1201  	// Kind: The kind of item this is. For lists of objects, this is always
  1202  	// storage#objects.
  1203  	Kind string `json:"kind,omitempty"`
  1204  
  1205  	// NextPageToken: The continuation token, used to page through large
  1206  	// result sets. Provide this value in a subsequent request to return the
  1207  	// next page of results.
  1208  	NextPageToken string `json:"nextPageToken,omitempty"`
  1209  
  1210  	// Prefixes: The list of prefixes of objects matching-but-not-listed up
  1211  	// to and including the requested delimiter.
  1212  	Prefixes []string `json:"prefixes,omitempty"`
  1213  
  1214  	// ServerResponse contains the HTTP response code and headers from the
  1215  	// server.
  1216  	googleapi.ServerResponse `json:"-"`
  1217  
  1218  	// ForceSendFields is a list of field names (e.g. "Items") to
  1219  	// unconditionally include in API requests. By default, fields with
  1220  	// empty values are omitted from API requests. However, any non-pointer,
  1221  	// non-interface field appearing in ForceSendFields will be sent to the
  1222  	// server regardless of whether the field is empty or not. This may be
  1223  	// used to include empty fields in Patch requests.
  1224  	ForceSendFields []string `json:"-"`
  1225  
  1226  	// NullFields is a list of field names (e.g. "Items") to include in API
  1227  	// requests with the JSON null value. By default, fields with empty
  1228  	// values are omitted from API requests. However, any field with an
  1229  	// empty value appearing in NullFields will be sent to the server as
  1230  	// null. It is an error if a field in this list has a non-empty value.
  1231  	// This may be used to include null fields in Patch requests.
  1232  	NullFields []string `json:"-"`
  1233  }
  1234  
  1235  func (s *Objects) MarshalJSON() ([]byte, error) {
  1236  	type NoMethod Objects
  1237  	raw := NoMethod(*s)
  1238  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1239  }
  1240  
  1241  // method id "storage.bucketAccessControls.delete":
  1242  
  1243  type BucketAccessControlsDeleteCall struct {
  1244  	s          *Service
  1245  	bucket     string
  1246  	entity     string
  1247  	urlParams_ gensupport.URLParams
  1248  	ctx_       context.Context
  1249  	header_    http.Header
  1250  }
  1251  
  1252  // Delete: Permanently deletes the ACL entry for the specified entity on
  1253  // the specified bucket.
  1254  func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
  1255  	c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1256  	c.bucket = bucket
  1257  	c.entity = entity
  1258  	return c
  1259  }
  1260  
  1261  // Fields allows partial responses to be retrieved. See
  1262  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1263  // for more information.
  1264  func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
  1265  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1266  	return c
  1267  }
  1268  
  1269  // Context sets the context to be used in this call's Do method. Any
  1270  // pending HTTP request will be aborted if the provided context is
  1271  // canceled.
  1272  func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
  1273  	c.ctx_ = ctx
  1274  	return c
  1275  }
  1276  
  1277  // Header returns an http.Header that can be modified by the caller to
  1278  // add HTTP headers to the request.
  1279  func (c *BucketAccessControlsDeleteCall) Header() http.Header {
  1280  	if c.header_ == nil {
  1281  		c.header_ = make(http.Header)
  1282  	}
  1283  	return c.header_
  1284  }
  1285  
  1286  func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1287  	reqHeaders := make(http.Header)
  1288  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  1289  	for k, v := range c.header_ {
  1290  		reqHeaders[k] = v
  1291  	}
  1292  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1293  	var body io.Reader = nil
  1294  	c.urlParams_.Set("alt", alt)
  1295  	c.urlParams_.Set("prettyPrint", "false")
  1296  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1297  	urls += "?" + c.urlParams_.Encode()
  1298  	req, err := http.NewRequest("DELETE", urls, body)
  1299  	if err != nil {
  1300  		return nil, err
  1301  	}
  1302  	req.Header = reqHeaders
  1303  	googleapi.Expand(req.URL, map[string]string{
  1304  		"bucket": c.bucket,
  1305  		"entity": c.entity,
  1306  	})
  1307  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1308  }
  1309  
  1310  // Do executes the "storage.bucketAccessControls.delete" call.
  1311  func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1312  	gensupport.SetOptions(c.urlParams_, opts...)
  1313  	res, err := c.doRequest("json")
  1314  	if err != nil {
  1315  		return err
  1316  	}
  1317  	defer googleapi.CloseBody(res)
  1318  	if err := googleapi.CheckResponse(res); err != nil {
  1319  		return err
  1320  	}
  1321  	return nil
  1322  	// {
  1323  	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
  1324  	//   "httpMethod": "DELETE",
  1325  	//   "id": "storage.bucketAccessControls.delete",
  1326  	//   "parameterOrder": [
  1327  	//     "bucket",
  1328  	//     "entity"
  1329  	//   ],
  1330  	//   "parameters": {
  1331  	//     "bucket": {
  1332  	//       "description": "Name of a bucket.",
  1333  	//       "location": "path",
  1334  	//       "required": true,
  1335  	//       "type": "string"
  1336  	//     },
  1337  	//     "entity": {
  1338  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1339  	//       "location": "path",
  1340  	//       "required": true,
  1341  	//       "type": "string"
  1342  	//     }
  1343  	//   },
  1344  	//   "path": "b/{bucket}/acl/{entity}",
  1345  	//   "scopes": [
  1346  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  1347  	//   ]
  1348  	// }
  1349  
  1350  }
  1351  
  1352  // method id "storage.bucketAccessControls.get":
  1353  
  1354  type BucketAccessControlsGetCall struct {
  1355  	s            *Service
  1356  	bucket       string
  1357  	entity       string
  1358  	urlParams_   gensupport.URLParams
  1359  	ifNoneMatch_ string
  1360  	ctx_         context.Context
  1361  	header_      http.Header
  1362  }
  1363  
  1364  // Get: Returns the ACL entry for the specified entity on the specified
  1365  // bucket.
  1366  func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
  1367  	c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1368  	c.bucket = bucket
  1369  	c.entity = entity
  1370  	return c
  1371  }
  1372  
  1373  // Fields allows partial responses to be retrieved. See
  1374  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1375  // for more information.
  1376  func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
  1377  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1378  	return c
  1379  }
  1380  
  1381  // IfNoneMatch sets the optional parameter which makes the operation
  1382  // fail if the object's ETag matches the given value. This is useful for
  1383  // getting updates only after the object has changed since the last
  1384  // request. Use googleapi.IsNotModified to check whether the response
  1385  // error from Do is the result of In-None-Match.
  1386  func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
  1387  	c.ifNoneMatch_ = entityTag
  1388  	return c
  1389  }
  1390  
  1391  // Context sets the context to be used in this call's Do method. Any
  1392  // pending HTTP request will be aborted if the provided context is
  1393  // canceled.
  1394  func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
  1395  	c.ctx_ = ctx
  1396  	return c
  1397  }
  1398  
  1399  // Header returns an http.Header that can be modified by the caller to
  1400  // add HTTP headers to the request.
  1401  func (c *BucketAccessControlsGetCall) Header() http.Header {
  1402  	if c.header_ == nil {
  1403  		c.header_ = make(http.Header)
  1404  	}
  1405  	return c.header_
  1406  }
  1407  
  1408  func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  1409  	reqHeaders := make(http.Header)
  1410  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  1411  	for k, v := range c.header_ {
  1412  		reqHeaders[k] = v
  1413  	}
  1414  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1415  	if c.ifNoneMatch_ != "" {
  1416  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1417  	}
  1418  	var body io.Reader = nil
  1419  	c.urlParams_.Set("alt", alt)
  1420  	c.urlParams_.Set("prettyPrint", "false")
  1421  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1422  	urls += "?" + c.urlParams_.Encode()
  1423  	req, err := http.NewRequest("GET", urls, body)
  1424  	if err != nil {
  1425  		return nil, err
  1426  	}
  1427  	req.Header = reqHeaders
  1428  	googleapi.Expand(req.URL, map[string]string{
  1429  		"bucket": c.bucket,
  1430  		"entity": c.entity,
  1431  	})
  1432  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1433  }
  1434  
  1435  // Do executes the "storage.bucketAccessControls.get" call.
  1436  // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1437  // non-2xx status code is an error. Response headers are in either
  1438  // *BucketAccessControl.ServerResponse.Header or (if a response was
  1439  // returned at all) in error.(*googleapi.Error).Header. Use
  1440  // googleapi.IsNotModified to check whether the returned error was
  1441  // because http.StatusNotModified was returned.
  1442  func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1443  	gensupport.SetOptions(c.urlParams_, opts...)
  1444  	res, err := c.doRequest("json")
  1445  	if res != nil && res.StatusCode == http.StatusNotModified {
  1446  		if res.Body != nil {
  1447  			res.Body.Close()
  1448  		}
  1449  		return nil, &googleapi.Error{
  1450  			Code:   res.StatusCode,
  1451  			Header: res.Header,
  1452  		}
  1453  	}
  1454  	if err != nil {
  1455  		return nil, err
  1456  	}
  1457  	defer googleapi.CloseBody(res)
  1458  	if err := googleapi.CheckResponse(res); err != nil {
  1459  		return nil, err
  1460  	}
  1461  	ret := &BucketAccessControl{
  1462  		ServerResponse: googleapi.ServerResponse{
  1463  			Header:         res.Header,
  1464  			HTTPStatusCode: res.StatusCode,
  1465  		},
  1466  	}
  1467  	target := &ret
  1468  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1469  		return nil, err
  1470  	}
  1471  	return ret, nil
  1472  	// {
  1473  	//   "description": "Returns the ACL entry for the specified entity on the specified bucket.",
  1474  	//   "httpMethod": "GET",
  1475  	//   "id": "storage.bucketAccessControls.get",
  1476  	//   "parameterOrder": [
  1477  	//     "bucket",
  1478  	//     "entity"
  1479  	//   ],
  1480  	//   "parameters": {
  1481  	//     "bucket": {
  1482  	//       "description": "Name of a bucket.",
  1483  	//       "location": "path",
  1484  	//       "required": true,
  1485  	//       "type": "string"
  1486  	//     },
  1487  	//     "entity": {
  1488  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1489  	//       "location": "path",
  1490  	//       "required": true,
  1491  	//       "type": "string"
  1492  	//     }
  1493  	//   },
  1494  	//   "path": "b/{bucket}/acl/{entity}",
  1495  	//   "response": {
  1496  	//     "$ref": "BucketAccessControl"
  1497  	//   },
  1498  	//   "scopes": [
  1499  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  1500  	//   ]
  1501  	// }
  1502  
  1503  }
  1504  
  1505  // method id "storage.bucketAccessControls.insert":
  1506  
  1507  type BucketAccessControlsInsertCall struct {
  1508  	s                   *Service
  1509  	bucket              string
  1510  	bucketaccesscontrol *BucketAccessControl
  1511  	urlParams_          gensupport.URLParams
  1512  	ctx_                context.Context
  1513  	header_             http.Header
  1514  }
  1515  
  1516  // Insert: Creates a new ACL entry on the specified bucket.
  1517  func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
  1518  	c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1519  	c.bucket = bucket
  1520  	c.bucketaccesscontrol = bucketaccesscontrol
  1521  	return c
  1522  }
  1523  
  1524  // Fields allows partial responses to be retrieved. See
  1525  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1526  // for more information.
  1527  func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
  1528  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1529  	return c
  1530  }
  1531  
  1532  // Context sets the context to be used in this call's Do method. Any
  1533  // pending HTTP request will be aborted if the provided context is
  1534  // canceled.
  1535  func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
  1536  	c.ctx_ = ctx
  1537  	return c
  1538  }
  1539  
  1540  // Header returns an http.Header that can be modified by the caller to
  1541  // add HTTP headers to the request.
  1542  func (c *BucketAccessControlsInsertCall) Header() http.Header {
  1543  	if c.header_ == nil {
  1544  		c.header_ = make(http.Header)
  1545  	}
  1546  	return c.header_
  1547  }
  1548  
  1549  func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  1550  	reqHeaders := make(http.Header)
  1551  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  1552  	for k, v := range c.header_ {
  1553  		reqHeaders[k] = v
  1554  	}
  1555  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1556  	var body io.Reader = nil
  1557  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  1558  	if err != nil {
  1559  		return nil, err
  1560  	}
  1561  	reqHeaders.Set("Content-Type", "application/json")
  1562  	c.urlParams_.Set("alt", alt)
  1563  	c.urlParams_.Set("prettyPrint", "false")
  1564  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  1565  	urls += "?" + c.urlParams_.Encode()
  1566  	req, err := http.NewRequest("POST", urls, body)
  1567  	if err != nil {
  1568  		return nil, err
  1569  	}
  1570  	req.Header = reqHeaders
  1571  	googleapi.Expand(req.URL, map[string]string{
  1572  		"bucket": c.bucket,
  1573  	})
  1574  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1575  }
  1576  
  1577  // Do executes the "storage.bucketAccessControls.insert" call.
  1578  // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1579  // non-2xx status code is an error. Response headers are in either
  1580  // *BucketAccessControl.ServerResponse.Header or (if a response was
  1581  // returned at all) in error.(*googleapi.Error).Header. Use
  1582  // googleapi.IsNotModified to check whether the returned error was
  1583  // because http.StatusNotModified was returned.
  1584  func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1585  	gensupport.SetOptions(c.urlParams_, opts...)
  1586  	res, err := c.doRequest("json")
  1587  	if res != nil && res.StatusCode == http.StatusNotModified {
  1588  		if res.Body != nil {
  1589  			res.Body.Close()
  1590  		}
  1591  		return nil, &googleapi.Error{
  1592  			Code:   res.StatusCode,
  1593  			Header: res.Header,
  1594  		}
  1595  	}
  1596  	if err != nil {
  1597  		return nil, err
  1598  	}
  1599  	defer googleapi.CloseBody(res)
  1600  	if err := googleapi.CheckResponse(res); err != nil {
  1601  		return nil, err
  1602  	}
  1603  	ret := &BucketAccessControl{
  1604  		ServerResponse: googleapi.ServerResponse{
  1605  			Header:         res.Header,
  1606  			HTTPStatusCode: res.StatusCode,
  1607  		},
  1608  	}
  1609  	target := &ret
  1610  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1611  		return nil, err
  1612  	}
  1613  	return ret, nil
  1614  	// {
  1615  	//   "description": "Creates a new ACL entry on the specified bucket.",
  1616  	//   "httpMethod": "POST",
  1617  	//   "id": "storage.bucketAccessControls.insert",
  1618  	//   "parameterOrder": [
  1619  	//     "bucket"
  1620  	//   ],
  1621  	//   "parameters": {
  1622  	//     "bucket": {
  1623  	//       "description": "Name of a bucket.",
  1624  	//       "location": "path",
  1625  	//       "required": true,
  1626  	//       "type": "string"
  1627  	//     }
  1628  	//   },
  1629  	//   "path": "b/{bucket}/acl",
  1630  	//   "request": {
  1631  	//     "$ref": "BucketAccessControl"
  1632  	//   },
  1633  	//   "response": {
  1634  	//     "$ref": "BucketAccessControl"
  1635  	//   },
  1636  	//   "scopes": [
  1637  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  1638  	//   ]
  1639  	// }
  1640  
  1641  }
  1642  
  1643  // method id "storage.bucketAccessControls.list":
  1644  
  1645  type BucketAccessControlsListCall struct {
  1646  	s            *Service
  1647  	bucket       string
  1648  	urlParams_   gensupport.URLParams
  1649  	ifNoneMatch_ string
  1650  	ctx_         context.Context
  1651  	header_      http.Header
  1652  }
  1653  
  1654  // List: Retrieves ACL entries on the specified bucket.
  1655  func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
  1656  	c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1657  	c.bucket = bucket
  1658  	return c
  1659  }
  1660  
  1661  // Fields allows partial responses to be retrieved. See
  1662  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1663  // for more information.
  1664  func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
  1665  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1666  	return c
  1667  }
  1668  
  1669  // IfNoneMatch sets the optional parameter which makes the operation
  1670  // fail if the object's ETag matches the given value. This is useful for
  1671  // getting updates only after the object has changed since the last
  1672  // request. Use googleapi.IsNotModified to check whether the response
  1673  // error from Do is the result of In-None-Match.
  1674  func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
  1675  	c.ifNoneMatch_ = entityTag
  1676  	return c
  1677  }
  1678  
  1679  // Context sets the context to be used in this call's Do method. Any
  1680  // pending HTTP request will be aborted if the provided context is
  1681  // canceled.
  1682  func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
  1683  	c.ctx_ = ctx
  1684  	return c
  1685  }
  1686  
  1687  // Header returns an http.Header that can be modified by the caller to
  1688  // add HTTP headers to the request.
  1689  func (c *BucketAccessControlsListCall) Header() http.Header {
  1690  	if c.header_ == nil {
  1691  		c.header_ = make(http.Header)
  1692  	}
  1693  	return c.header_
  1694  }
  1695  
  1696  func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  1697  	reqHeaders := make(http.Header)
  1698  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  1699  	for k, v := range c.header_ {
  1700  		reqHeaders[k] = v
  1701  	}
  1702  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1703  	if c.ifNoneMatch_ != "" {
  1704  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1705  	}
  1706  	var body io.Reader = nil
  1707  	c.urlParams_.Set("alt", alt)
  1708  	c.urlParams_.Set("prettyPrint", "false")
  1709  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  1710  	urls += "?" + c.urlParams_.Encode()
  1711  	req, err := http.NewRequest("GET", urls, body)
  1712  	if err != nil {
  1713  		return nil, err
  1714  	}
  1715  	req.Header = reqHeaders
  1716  	googleapi.Expand(req.URL, map[string]string{
  1717  		"bucket": c.bucket,
  1718  	})
  1719  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1720  }
  1721  
  1722  // Do executes the "storage.bucketAccessControls.list" call.
  1723  // Exactly one of *BucketAccessControls or error will be non-nil. Any
  1724  // non-2xx status code is an error. Response headers are in either
  1725  // *BucketAccessControls.ServerResponse.Header or (if a response was
  1726  // returned at all) in error.(*googleapi.Error).Header. Use
  1727  // googleapi.IsNotModified to check whether the returned error was
  1728  // because http.StatusNotModified was returned.
  1729  func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
  1730  	gensupport.SetOptions(c.urlParams_, opts...)
  1731  	res, err := c.doRequest("json")
  1732  	if res != nil && res.StatusCode == http.StatusNotModified {
  1733  		if res.Body != nil {
  1734  			res.Body.Close()
  1735  		}
  1736  		return nil, &googleapi.Error{
  1737  			Code:   res.StatusCode,
  1738  			Header: res.Header,
  1739  		}
  1740  	}
  1741  	if err != nil {
  1742  		return nil, err
  1743  	}
  1744  	defer googleapi.CloseBody(res)
  1745  	if err := googleapi.CheckResponse(res); err != nil {
  1746  		return nil, err
  1747  	}
  1748  	ret := &BucketAccessControls{
  1749  		ServerResponse: googleapi.ServerResponse{
  1750  			Header:         res.Header,
  1751  			HTTPStatusCode: res.StatusCode,
  1752  		},
  1753  	}
  1754  	target := &ret
  1755  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1756  		return nil, err
  1757  	}
  1758  	return ret, nil
  1759  	// {
  1760  	//   "description": "Retrieves ACL entries on the specified bucket.",
  1761  	//   "httpMethod": "GET",
  1762  	//   "id": "storage.bucketAccessControls.list",
  1763  	//   "parameterOrder": [
  1764  	//     "bucket"
  1765  	//   ],
  1766  	//   "parameters": {
  1767  	//     "bucket": {
  1768  	//       "description": "Name of a bucket.",
  1769  	//       "location": "path",
  1770  	//       "required": true,
  1771  	//       "type": "string"
  1772  	//     }
  1773  	//   },
  1774  	//   "path": "b/{bucket}/acl",
  1775  	//   "response": {
  1776  	//     "$ref": "BucketAccessControls"
  1777  	//   },
  1778  	//   "scopes": [
  1779  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  1780  	//   ]
  1781  	// }
  1782  
  1783  }
  1784  
  1785  // method id "storage.bucketAccessControls.patch":
  1786  
  1787  type BucketAccessControlsPatchCall struct {
  1788  	s                   *Service
  1789  	bucket              string
  1790  	entity              string
  1791  	bucketaccesscontrol *BucketAccessControl
  1792  	urlParams_          gensupport.URLParams
  1793  	ctx_                context.Context
  1794  	header_             http.Header
  1795  }
  1796  
  1797  // Patch: Updates an ACL entry on the specified bucket. This method
  1798  // supports patch semantics.
  1799  func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
  1800  	c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1801  	c.bucket = bucket
  1802  	c.entity = entity
  1803  	c.bucketaccesscontrol = bucketaccesscontrol
  1804  	return c
  1805  }
  1806  
  1807  // Fields allows partial responses to be retrieved. See
  1808  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1809  // for more information.
  1810  func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
  1811  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1812  	return c
  1813  }
  1814  
  1815  // Context sets the context to be used in this call's Do method. Any
  1816  // pending HTTP request will be aborted if the provided context is
  1817  // canceled.
  1818  func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
  1819  	c.ctx_ = ctx
  1820  	return c
  1821  }
  1822  
  1823  // Header returns an http.Header that can be modified by the caller to
  1824  // add HTTP headers to the request.
  1825  func (c *BucketAccessControlsPatchCall) Header() http.Header {
  1826  	if c.header_ == nil {
  1827  		c.header_ = make(http.Header)
  1828  	}
  1829  	return c.header_
  1830  }
  1831  
  1832  func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  1833  	reqHeaders := make(http.Header)
  1834  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  1835  	for k, v := range c.header_ {
  1836  		reqHeaders[k] = v
  1837  	}
  1838  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1839  	var body io.Reader = nil
  1840  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  1841  	if err != nil {
  1842  		return nil, err
  1843  	}
  1844  	reqHeaders.Set("Content-Type", "application/json")
  1845  	c.urlParams_.Set("alt", alt)
  1846  	c.urlParams_.Set("prettyPrint", "false")
  1847  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1848  	urls += "?" + c.urlParams_.Encode()
  1849  	req, err := http.NewRequest("PATCH", urls, body)
  1850  	if err != nil {
  1851  		return nil, err
  1852  	}
  1853  	req.Header = reqHeaders
  1854  	googleapi.Expand(req.URL, map[string]string{
  1855  		"bucket": c.bucket,
  1856  		"entity": c.entity,
  1857  	})
  1858  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1859  }
  1860  
  1861  // Do executes the "storage.bucketAccessControls.patch" call.
  1862  // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1863  // non-2xx status code is an error. Response headers are in either
  1864  // *BucketAccessControl.ServerResponse.Header or (if a response was
  1865  // returned at all) in error.(*googleapi.Error).Header. Use
  1866  // googleapi.IsNotModified to check whether the returned error was
  1867  // because http.StatusNotModified was returned.
  1868  func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1869  	gensupport.SetOptions(c.urlParams_, opts...)
  1870  	res, err := c.doRequest("json")
  1871  	if res != nil && res.StatusCode == http.StatusNotModified {
  1872  		if res.Body != nil {
  1873  			res.Body.Close()
  1874  		}
  1875  		return nil, &googleapi.Error{
  1876  			Code:   res.StatusCode,
  1877  			Header: res.Header,
  1878  		}
  1879  	}
  1880  	if err != nil {
  1881  		return nil, err
  1882  	}
  1883  	defer googleapi.CloseBody(res)
  1884  	if err := googleapi.CheckResponse(res); err != nil {
  1885  		return nil, err
  1886  	}
  1887  	ret := &BucketAccessControl{
  1888  		ServerResponse: googleapi.ServerResponse{
  1889  			Header:         res.Header,
  1890  			HTTPStatusCode: res.StatusCode,
  1891  		},
  1892  	}
  1893  	target := &ret
  1894  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1895  		return nil, err
  1896  	}
  1897  	return ret, nil
  1898  	// {
  1899  	//   "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.",
  1900  	//   "httpMethod": "PATCH",
  1901  	//   "id": "storage.bucketAccessControls.patch",
  1902  	//   "parameterOrder": [
  1903  	//     "bucket",
  1904  	//     "entity"
  1905  	//   ],
  1906  	//   "parameters": {
  1907  	//     "bucket": {
  1908  	//       "description": "Name of a bucket.",
  1909  	//       "location": "path",
  1910  	//       "required": true,
  1911  	//       "type": "string"
  1912  	//     },
  1913  	//     "entity": {
  1914  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1915  	//       "location": "path",
  1916  	//       "required": true,
  1917  	//       "type": "string"
  1918  	//     }
  1919  	//   },
  1920  	//   "path": "b/{bucket}/acl/{entity}",
  1921  	//   "request": {
  1922  	//     "$ref": "BucketAccessControl"
  1923  	//   },
  1924  	//   "response": {
  1925  	//     "$ref": "BucketAccessControl"
  1926  	//   },
  1927  	//   "scopes": [
  1928  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  1929  	//   ]
  1930  	// }
  1931  
  1932  }
  1933  
  1934  // method id "storage.bucketAccessControls.update":
  1935  
  1936  type BucketAccessControlsUpdateCall struct {
  1937  	s                   *Service
  1938  	bucket              string
  1939  	entity              string
  1940  	bucketaccesscontrol *BucketAccessControl
  1941  	urlParams_          gensupport.URLParams
  1942  	ctx_                context.Context
  1943  	header_             http.Header
  1944  }
  1945  
  1946  // Update: Updates an ACL entry on the specified bucket.
  1947  func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
  1948  	c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1949  	c.bucket = bucket
  1950  	c.entity = entity
  1951  	c.bucketaccesscontrol = bucketaccesscontrol
  1952  	return c
  1953  }
  1954  
  1955  // Fields allows partial responses to be retrieved. See
  1956  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1957  // for more information.
  1958  func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
  1959  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1960  	return c
  1961  }
  1962  
  1963  // Context sets the context to be used in this call's Do method. Any
  1964  // pending HTTP request will be aborted if the provided context is
  1965  // canceled.
  1966  func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
  1967  	c.ctx_ = ctx
  1968  	return c
  1969  }
  1970  
  1971  // Header returns an http.Header that can be modified by the caller to
  1972  // add HTTP headers to the request.
  1973  func (c *BucketAccessControlsUpdateCall) Header() http.Header {
  1974  	if c.header_ == nil {
  1975  		c.header_ = make(http.Header)
  1976  	}
  1977  	return c.header_
  1978  }
  1979  
  1980  func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1981  	reqHeaders := make(http.Header)
  1982  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  1983  	for k, v := range c.header_ {
  1984  		reqHeaders[k] = v
  1985  	}
  1986  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1987  	var body io.Reader = nil
  1988  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  1989  	if err != nil {
  1990  		return nil, err
  1991  	}
  1992  	reqHeaders.Set("Content-Type", "application/json")
  1993  	c.urlParams_.Set("alt", alt)
  1994  	c.urlParams_.Set("prettyPrint", "false")
  1995  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1996  	urls += "?" + c.urlParams_.Encode()
  1997  	req, err := http.NewRequest("PUT", urls, body)
  1998  	if err != nil {
  1999  		return nil, err
  2000  	}
  2001  	req.Header = reqHeaders
  2002  	googleapi.Expand(req.URL, map[string]string{
  2003  		"bucket": c.bucket,
  2004  		"entity": c.entity,
  2005  	})
  2006  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2007  }
  2008  
  2009  // Do executes the "storage.bucketAccessControls.update" call.
  2010  // Exactly one of *BucketAccessControl or error will be non-nil. Any
  2011  // non-2xx status code is an error. Response headers are in either
  2012  // *BucketAccessControl.ServerResponse.Header or (if a response was
  2013  // returned at all) in error.(*googleapi.Error).Header. Use
  2014  // googleapi.IsNotModified to check whether the returned error was
  2015  // because http.StatusNotModified was returned.
  2016  func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  2017  	gensupport.SetOptions(c.urlParams_, opts...)
  2018  	res, err := c.doRequest("json")
  2019  	if res != nil && res.StatusCode == http.StatusNotModified {
  2020  		if res.Body != nil {
  2021  			res.Body.Close()
  2022  		}
  2023  		return nil, &googleapi.Error{
  2024  			Code:   res.StatusCode,
  2025  			Header: res.Header,
  2026  		}
  2027  	}
  2028  	if err != nil {
  2029  		return nil, err
  2030  	}
  2031  	defer googleapi.CloseBody(res)
  2032  	if err := googleapi.CheckResponse(res); err != nil {
  2033  		return nil, err
  2034  	}
  2035  	ret := &BucketAccessControl{
  2036  		ServerResponse: googleapi.ServerResponse{
  2037  			Header:         res.Header,
  2038  			HTTPStatusCode: res.StatusCode,
  2039  		},
  2040  	}
  2041  	target := &ret
  2042  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2043  		return nil, err
  2044  	}
  2045  	return ret, nil
  2046  	// {
  2047  	//   "description": "Updates an ACL entry on the specified bucket.",
  2048  	//   "httpMethod": "PUT",
  2049  	//   "id": "storage.bucketAccessControls.update",
  2050  	//   "parameterOrder": [
  2051  	//     "bucket",
  2052  	//     "entity"
  2053  	//   ],
  2054  	//   "parameters": {
  2055  	//     "bucket": {
  2056  	//       "description": "Name of a bucket.",
  2057  	//       "location": "path",
  2058  	//       "required": true,
  2059  	//       "type": "string"
  2060  	//     },
  2061  	//     "entity": {
  2062  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  2063  	//       "location": "path",
  2064  	//       "required": true,
  2065  	//       "type": "string"
  2066  	//     }
  2067  	//   },
  2068  	//   "path": "b/{bucket}/acl/{entity}",
  2069  	//   "request": {
  2070  	//     "$ref": "BucketAccessControl"
  2071  	//   },
  2072  	//   "response": {
  2073  	//     "$ref": "BucketAccessControl"
  2074  	//   },
  2075  	//   "scopes": [
  2076  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  2077  	//   ]
  2078  	// }
  2079  
  2080  }
  2081  
  2082  // method id "storage.buckets.delete":
  2083  
  2084  type BucketsDeleteCall struct {
  2085  	s          *Service
  2086  	bucket     string
  2087  	urlParams_ gensupport.URLParams
  2088  	ctx_       context.Context
  2089  	header_    http.Header
  2090  }
  2091  
  2092  // Delete: Permanently deletes an empty bucket.
  2093  func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
  2094  	c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2095  	c.bucket = bucket
  2096  	return c
  2097  }
  2098  
  2099  // IfMetagenerationMatch sets the optional parameter
  2100  // "ifMetagenerationMatch": Makes the return of the bucket metadata
  2101  // conditional on whether the bucket's current metageneration matches
  2102  // the given value.
  2103  func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsDeleteCall {
  2104  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  2105  	return c
  2106  }
  2107  
  2108  // IfMetagenerationNotMatch sets the optional parameter
  2109  // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  2110  // conditional on whether the bucket's current metageneration does not
  2111  // match the given value.
  2112  func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsDeleteCall {
  2113  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  2114  	return c
  2115  }
  2116  
  2117  // Fields allows partial responses to be retrieved. See
  2118  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2119  // for more information.
  2120  func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
  2121  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2122  	return c
  2123  }
  2124  
  2125  // Context sets the context to be used in this call's Do method. Any
  2126  // pending HTTP request will be aborted if the provided context is
  2127  // canceled.
  2128  func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
  2129  	c.ctx_ = ctx
  2130  	return c
  2131  }
  2132  
  2133  // Header returns an http.Header that can be modified by the caller to
  2134  // add HTTP headers to the request.
  2135  func (c *BucketsDeleteCall) Header() http.Header {
  2136  	if c.header_ == nil {
  2137  		c.header_ = make(http.Header)
  2138  	}
  2139  	return c.header_
  2140  }
  2141  
  2142  func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2143  	reqHeaders := make(http.Header)
  2144  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  2145  	for k, v := range c.header_ {
  2146  		reqHeaders[k] = v
  2147  	}
  2148  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2149  	var body io.Reader = nil
  2150  	c.urlParams_.Set("alt", alt)
  2151  	c.urlParams_.Set("prettyPrint", "false")
  2152  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  2153  	urls += "?" + c.urlParams_.Encode()
  2154  	req, err := http.NewRequest("DELETE", urls, body)
  2155  	if err != nil {
  2156  		return nil, err
  2157  	}
  2158  	req.Header = reqHeaders
  2159  	googleapi.Expand(req.URL, map[string]string{
  2160  		"bucket": c.bucket,
  2161  	})
  2162  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2163  }
  2164  
  2165  // Do executes the "storage.buckets.delete" call.
  2166  func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2167  	gensupport.SetOptions(c.urlParams_, opts...)
  2168  	res, err := c.doRequest("json")
  2169  	if err != nil {
  2170  		return err
  2171  	}
  2172  	defer googleapi.CloseBody(res)
  2173  	if err := googleapi.CheckResponse(res); err != nil {
  2174  		return err
  2175  	}
  2176  	return nil
  2177  	// {
  2178  	//   "description": "Permanently deletes an empty bucket.",
  2179  	//   "httpMethod": "DELETE",
  2180  	//   "id": "storage.buckets.delete",
  2181  	//   "parameterOrder": [
  2182  	//     "bucket"
  2183  	//   ],
  2184  	//   "parameters": {
  2185  	//     "bucket": {
  2186  	//       "description": "Name of a bucket.",
  2187  	//       "location": "path",
  2188  	//       "required": true,
  2189  	//       "type": "string"
  2190  	//     },
  2191  	//     "ifMetagenerationMatch": {
  2192  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  2193  	//       "format": "uint64",
  2194  	//       "location": "query",
  2195  	//       "type": "string"
  2196  	//     },
  2197  	//     "ifMetagenerationNotMatch": {
  2198  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  2199  	//       "format": "uint64",
  2200  	//       "location": "query",
  2201  	//       "type": "string"
  2202  	//     }
  2203  	//   },
  2204  	//   "path": "b/{bucket}",
  2205  	//   "scopes": [
  2206  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  2207  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  2208  	//   ]
  2209  	// }
  2210  
  2211  }
  2212  
  2213  // method id "storage.buckets.get":
  2214  
  2215  type BucketsGetCall struct {
  2216  	s            *Service
  2217  	bucket       string
  2218  	urlParams_   gensupport.URLParams
  2219  	ifNoneMatch_ string
  2220  	ctx_         context.Context
  2221  	header_      http.Header
  2222  }
  2223  
  2224  // Get: Returns metadata for the specified bucket.
  2225  func (r *BucketsService) Get(bucket string) *BucketsGetCall {
  2226  	c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2227  	c.bucket = bucket
  2228  	return c
  2229  }
  2230  
  2231  // IfMetagenerationMatch sets the optional parameter
  2232  // "ifMetagenerationMatch": Makes the return of the bucket metadata
  2233  // conditional on whether the bucket's current metageneration matches
  2234  // the given value.
  2235  func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsGetCall {
  2236  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  2237  	return c
  2238  }
  2239  
  2240  // IfMetagenerationNotMatch sets the optional parameter
  2241  // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  2242  // conditional on whether the bucket's current metageneration does not
  2243  // match the given value.
  2244  func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsGetCall {
  2245  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  2246  	return c
  2247  }
  2248  
  2249  // Projection sets the optional parameter "projection": Set of
  2250  // properties to return. Defaults to noAcl.
  2251  //
  2252  // Possible values:
  2253  //
  2254  //	"full" - Include all properties.
  2255  //	"noAcl" - Omit acl and defaultObjectAcl properties.
  2256  func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
  2257  	c.urlParams_.Set("projection", projection)
  2258  	return c
  2259  }
  2260  
  2261  // Fields allows partial responses to be retrieved. See
  2262  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2263  // for more information.
  2264  func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
  2265  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2266  	return c
  2267  }
  2268  
  2269  // IfNoneMatch sets the optional parameter which makes the operation
  2270  // fail if the object's ETag matches the given value. This is useful for
  2271  // getting updates only after the object has changed since the last
  2272  // request. Use googleapi.IsNotModified to check whether the response
  2273  // error from Do is the result of In-None-Match.
  2274  func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
  2275  	c.ifNoneMatch_ = entityTag
  2276  	return c
  2277  }
  2278  
  2279  // Context sets the context to be used in this call's Do method. Any
  2280  // pending HTTP request will be aborted if the provided context is
  2281  // canceled.
  2282  func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
  2283  	c.ctx_ = ctx
  2284  	return c
  2285  }
  2286  
  2287  // Header returns an http.Header that can be modified by the caller to
  2288  // add HTTP headers to the request.
  2289  func (c *BucketsGetCall) Header() http.Header {
  2290  	if c.header_ == nil {
  2291  		c.header_ = make(http.Header)
  2292  	}
  2293  	return c.header_
  2294  }
  2295  
  2296  func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
  2297  	reqHeaders := make(http.Header)
  2298  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  2299  	for k, v := range c.header_ {
  2300  		reqHeaders[k] = v
  2301  	}
  2302  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2303  	if c.ifNoneMatch_ != "" {
  2304  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2305  	}
  2306  	var body io.Reader = nil
  2307  	c.urlParams_.Set("alt", alt)
  2308  	c.urlParams_.Set("prettyPrint", "false")
  2309  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  2310  	urls += "?" + c.urlParams_.Encode()
  2311  	req, err := http.NewRequest("GET", urls, body)
  2312  	if err != nil {
  2313  		return nil, err
  2314  	}
  2315  	req.Header = reqHeaders
  2316  	googleapi.Expand(req.URL, map[string]string{
  2317  		"bucket": c.bucket,
  2318  	})
  2319  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2320  }
  2321  
  2322  // Do executes the "storage.buckets.get" call.
  2323  // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  2324  // code is an error. Response headers are in either
  2325  // *Bucket.ServerResponse.Header or (if a response was returned at all)
  2326  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2327  // check whether the returned error was because http.StatusNotModified
  2328  // was returned.
  2329  func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  2330  	gensupport.SetOptions(c.urlParams_, opts...)
  2331  	res, err := c.doRequest("json")
  2332  	if res != nil && res.StatusCode == http.StatusNotModified {
  2333  		if res.Body != nil {
  2334  			res.Body.Close()
  2335  		}
  2336  		return nil, &googleapi.Error{
  2337  			Code:   res.StatusCode,
  2338  			Header: res.Header,
  2339  		}
  2340  	}
  2341  	if err != nil {
  2342  		return nil, err
  2343  	}
  2344  	defer googleapi.CloseBody(res)
  2345  	if err := googleapi.CheckResponse(res); err != nil {
  2346  		return nil, err
  2347  	}
  2348  	ret := &Bucket{
  2349  		ServerResponse: googleapi.ServerResponse{
  2350  			Header:         res.Header,
  2351  			HTTPStatusCode: res.StatusCode,
  2352  		},
  2353  	}
  2354  	target := &ret
  2355  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2356  		return nil, err
  2357  	}
  2358  	return ret, nil
  2359  	// {
  2360  	//   "description": "Returns metadata for the specified bucket.",
  2361  	//   "httpMethod": "GET",
  2362  	//   "id": "storage.buckets.get",
  2363  	//   "parameterOrder": [
  2364  	//     "bucket"
  2365  	//   ],
  2366  	//   "parameters": {
  2367  	//     "bucket": {
  2368  	//       "description": "Name of a bucket.",
  2369  	//       "location": "path",
  2370  	//       "required": true,
  2371  	//       "type": "string"
  2372  	//     },
  2373  	//     "ifMetagenerationMatch": {
  2374  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  2375  	//       "format": "uint64",
  2376  	//       "location": "query",
  2377  	//       "type": "string"
  2378  	//     },
  2379  	//     "ifMetagenerationNotMatch": {
  2380  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  2381  	//       "format": "uint64",
  2382  	//       "location": "query",
  2383  	//       "type": "string"
  2384  	//     },
  2385  	//     "projection": {
  2386  	//       "description": "Set of properties to return. Defaults to noAcl.",
  2387  	//       "enum": [
  2388  	//         "full",
  2389  	//         "noAcl"
  2390  	//       ],
  2391  	//       "enumDescriptions": [
  2392  	//         "Include all properties.",
  2393  	//         "Omit acl and defaultObjectAcl properties."
  2394  	//       ],
  2395  	//       "location": "query",
  2396  	//       "type": "string"
  2397  	//     }
  2398  	//   },
  2399  	//   "path": "b/{bucket}",
  2400  	//   "response": {
  2401  	//     "$ref": "Bucket"
  2402  	//   },
  2403  	//   "scopes": [
  2404  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  2405  	//     "https://www.googleapis.com/auth/devstorage.read_only",
  2406  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  2407  	//   ]
  2408  	// }
  2409  
  2410  }
  2411  
  2412  // method id "storage.buckets.insert":
  2413  
  2414  type BucketsInsertCall struct {
  2415  	s          *Service
  2416  	bucket     *Bucket
  2417  	urlParams_ gensupport.URLParams
  2418  	ctx_       context.Context
  2419  	header_    http.Header
  2420  }
  2421  
  2422  // Insert: Creates a new bucket.
  2423  func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
  2424  	c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2425  	c.urlParams_.Set("project", projectid)
  2426  	c.bucket = bucket
  2427  	return c
  2428  }
  2429  
  2430  // Projection sets the optional parameter "projection": Set of
  2431  // properties to return. Defaults to noAcl, unless the bucket resource
  2432  // specifies acl or defaultObjectAcl properties, when it defaults to
  2433  // full.
  2434  //
  2435  // Possible values:
  2436  //
  2437  //	"full" - Include all properties.
  2438  //	"noAcl" - Omit acl and defaultObjectAcl properties.
  2439  func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
  2440  	c.urlParams_.Set("projection", projection)
  2441  	return c
  2442  }
  2443  
  2444  // Fields allows partial responses to be retrieved. See
  2445  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2446  // for more information.
  2447  func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
  2448  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2449  	return c
  2450  }
  2451  
  2452  // Context sets the context to be used in this call's Do method. Any
  2453  // pending HTTP request will be aborted if the provided context is
  2454  // canceled.
  2455  func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
  2456  	c.ctx_ = ctx
  2457  	return c
  2458  }
  2459  
  2460  // Header returns an http.Header that can be modified by the caller to
  2461  // add HTTP headers to the request.
  2462  func (c *BucketsInsertCall) Header() http.Header {
  2463  	if c.header_ == nil {
  2464  		c.header_ = make(http.Header)
  2465  	}
  2466  	return c.header_
  2467  }
  2468  
  2469  func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  2470  	reqHeaders := make(http.Header)
  2471  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  2472  	for k, v := range c.header_ {
  2473  		reqHeaders[k] = v
  2474  	}
  2475  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2476  	var body io.Reader = nil
  2477  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
  2478  	if err != nil {
  2479  		return nil, err
  2480  	}
  2481  	reqHeaders.Set("Content-Type", "application/json")
  2482  	c.urlParams_.Set("alt", alt)
  2483  	c.urlParams_.Set("prettyPrint", "false")
  2484  	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  2485  	urls += "?" + c.urlParams_.Encode()
  2486  	req, err := http.NewRequest("POST", urls, body)
  2487  	if err != nil {
  2488  		return nil, err
  2489  	}
  2490  	req.Header = reqHeaders
  2491  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2492  }
  2493  
  2494  // Do executes the "storage.buckets.insert" call.
  2495  // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  2496  // code is an error. Response headers are in either
  2497  // *Bucket.ServerResponse.Header or (if a response was returned at all)
  2498  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2499  // check whether the returned error was because http.StatusNotModified
  2500  // was returned.
  2501  func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  2502  	gensupport.SetOptions(c.urlParams_, opts...)
  2503  	res, err := c.doRequest("json")
  2504  	if res != nil && res.StatusCode == http.StatusNotModified {
  2505  		if res.Body != nil {
  2506  			res.Body.Close()
  2507  		}
  2508  		return nil, &googleapi.Error{
  2509  			Code:   res.StatusCode,
  2510  			Header: res.Header,
  2511  		}
  2512  	}
  2513  	if err != nil {
  2514  		return nil, err
  2515  	}
  2516  	defer googleapi.CloseBody(res)
  2517  	if err := googleapi.CheckResponse(res); err != nil {
  2518  		return nil, err
  2519  	}
  2520  	ret := &Bucket{
  2521  		ServerResponse: googleapi.ServerResponse{
  2522  			Header:         res.Header,
  2523  			HTTPStatusCode: res.StatusCode,
  2524  		},
  2525  	}
  2526  	target := &ret
  2527  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2528  		return nil, err
  2529  	}
  2530  	return ret, nil
  2531  	// {
  2532  	//   "description": "Creates a new bucket.",
  2533  	//   "httpMethod": "POST",
  2534  	//   "id": "storage.buckets.insert",
  2535  	//   "parameterOrder": [
  2536  	//     "project"
  2537  	//   ],
  2538  	//   "parameters": {
  2539  	//     "project": {
  2540  	//       "description": "A valid API project identifier.",
  2541  	//       "location": "query",
  2542  	//       "required": true,
  2543  	//       "type": "string"
  2544  	//     },
  2545  	//     "projection": {
  2546  	//       "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
  2547  	//       "enum": [
  2548  	//         "full",
  2549  	//         "noAcl"
  2550  	//       ],
  2551  	//       "enumDescriptions": [
  2552  	//         "Include all properties.",
  2553  	//         "Omit acl and defaultObjectAcl properties."
  2554  	//       ],
  2555  	//       "location": "query",
  2556  	//       "type": "string"
  2557  	//     }
  2558  	//   },
  2559  	//   "path": "b",
  2560  	//   "request": {
  2561  	//     "$ref": "Bucket"
  2562  	//   },
  2563  	//   "response": {
  2564  	//     "$ref": "Bucket"
  2565  	//   },
  2566  	//   "scopes": [
  2567  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  2568  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  2569  	//   ]
  2570  	// }
  2571  
  2572  }
  2573  
  2574  // method id "storage.buckets.list":
  2575  
  2576  type BucketsListCall struct {
  2577  	s            *Service
  2578  	urlParams_   gensupport.URLParams
  2579  	ifNoneMatch_ string
  2580  	ctx_         context.Context
  2581  	header_      http.Header
  2582  }
  2583  
  2584  // List: Retrieves a list of buckets for a given project.
  2585  func (r *BucketsService) List(projectid string) *BucketsListCall {
  2586  	c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2587  	c.urlParams_.Set("project", projectid)
  2588  	return c
  2589  }
  2590  
  2591  // MaxResults sets the optional parameter "maxResults": Maximum number
  2592  // of buckets to return.
  2593  func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
  2594  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2595  	return c
  2596  }
  2597  
  2598  // PageToken sets the optional parameter "pageToken": A
  2599  // previously-returned page token representing part of the larger set of
  2600  // results to view.
  2601  func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
  2602  	c.urlParams_.Set("pageToken", pageToken)
  2603  	return c
  2604  }
  2605  
  2606  // Projection sets the optional parameter "projection": Set of
  2607  // properties to return. Defaults to noAcl.
  2608  //
  2609  // Possible values:
  2610  //
  2611  //	"full" - Include all properties.
  2612  //	"noAcl" - Omit acl and defaultObjectAcl properties.
  2613  func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
  2614  	c.urlParams_.Set("projection", projection)
  2615  	return c
  2616  }
  2617  
  2618  // Fields allows partial responses to be retrieved. See
  2619  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2620  // for more information.
  2621  func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
  2622  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2623  	return c
  2624  }
  2625  
  2626  // IfNoneMatch sets the optional parameter which makes the operation
  2627  // fail if the object's ETag matches the given value. This is useful for
  2628  // getting updates only after the object has changed since the last
  2629  // request. Use googleapi.IsNotModified to check whether the response
  2630  // error from Do is the result of In-None-Match.
  2631  func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
  2632  	c.ifNoneMatch_ = entityTag
  2633  	return c
  2634  }
  2635  
  2636  // Context sets the context to be used in this call's Do method. Any
  2637  // pending HTTP request will be aborted if the provided context is
  2638  // canceled.
  2639  func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
  2640  	c.ctx_ = ctx
  2641  	return c
  2642  }
  2643  
  2644  // Header returns an http.Header that can be modified by the caller to
  2645  // add HTTP headers to the request.
  2646  func (c *BucketsListCall) Header() http.Header {
  2647  	if c.header_ == nil {
  2648  		c.header_ = make(http.Header)
  2649  	}
  2650  	return c.header_
  2651  }
  2652  
  2653  func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
  2654  	reqHeaders := make(http.Header)
  2655  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  2656  	for k, v := range c.header_ {
  2657  		reqHeaders[k] = v
  2658  	}
  2659  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2660  	if c.ifNoneMatch_ != "" {
  2661  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2662  	}
  2663  	var body io.Reader = nil
  2664  	c.urlParams_.Set("alt", alt)
  2665  	c.urlParams_.Set("prettyPrint", "false")
  2666  	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  2667  	urls += "?" + c.urlParams_.Encode()
  2668  	req, err := http.NewRequest("GET", urls, body)
  2669  	if err != nil {
  2670  		return nil, err
  2671  	}
  2672  	req.Header = reqHeaders
  2673  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2674  }
  2675  
  2676  // Do executes the "storage.buckets.list" call.
  2677  // Exactly one of *Buckets or error will be non-nil. Any non-2xx status
  2678  // code is an error. Response headers are in either
  2679  // *Buckets.ServerResponse.Header or (if a response was returned at all)
  2680  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2681  // check whether the returned error was because http.StatusNotModified
  2682  // was returned.
  2683  func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
  2684  	gensupport.SetOptions(c.urlParams_, opts...)
  2685  	res, err := c.doRequest("json")
  2686  	if res != nil && res.StatusCode == http.StatusNotModified {
  2687  		if res.Body != nil {
  2688  			res.Body.Close()
  2689  		}
  2690  		return nil, &googleapi.Error{
  2691  			Code:   res.StatusCode,
  2692  			Header: res.Header,
  2693  		}
  2694  	}
  2695  	if err != nil {
  2696  		return nil, err
  2697  	}
  2698  	defer googleapi.CloseBody(res)
  2699  	if err := googleapi.CheckResponse(res); err != nil {
  2700  		return nil, err
  2701  	}
  2702  	ret := &Buckets{
  2703  		ServerResponse: googleapi.ServerResponse{
  2704  			Header:         res.Header,
  2705  			HTTPStatusCode: res.StatusCode,
  2706  		},
  2707  	}
  2708  	target := &ret
  2709  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2710  		return nil, err
  2711  	}
  2712  	return ret, nil
  2713  	// {
  2714  	//   "description": "Retrieves a list of buckets for a given project.",
  2715  	//   "httpMethod": "GET",
  2716  	//   "id": "storage.buckets.list",
  2717  	//   "parameterOrder": [
  2718  	//     "project"
  2719  	//   ],
  2720  	//   "parameters": {
  2721  	//     "maxResults": {
  2722  	//       "description": "Maximum number of buckets to return.",
  2723  	//       "format": "uint32",
  2724  	//       "location": "query",
  2725  	//       "minimum": "0",
  2726  	//       "type": "integer"
  2727  	//     },
  2728  	//     "pageToken": {
  2729  	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
  2730  	//       "location": "query",
  2731  	//       "type": "string"
  2732  	//     },
  2733  	//     "project": {
  2734  	//       "description": "A valid API project identifier.",
  2735  	//       "location": "query",
  2736  	//       "required": true,
  2737  	//       "type": "string"
  2738  	//     },
  2739  	//     "projection": {
  2740  	//       "description": "Set of properties to return. Defaults to noAcl.",
  2741  	//       "enum": [
  2742  	//         "full",
  2743  	//         "noAcl"
  2744  	//       ],
  2745  	//       "enumDescriptions": [
  2746  	//         "Include all properties.",
  2747  	//         "Omit acl and defaultObjectAcl properties."
  2748  	//       ],
  2749  	//       "location": "query",
  2750  	//       "type": "string"
  2751  	//     }
  2752  	//   },
  2753  	//   "path": "b",
  2754  	//   "response": {
  2755  	//     "$ref": "Buckets"
  2756  	//   },
  2757  	//   "scopes": [
  2758  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  2759  	//     "https://www.googleapis.com/auth/devstorage.read_only",
  2760  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  2761  	//   ]
  2762  	// }
  2763  
  2764  }
  2765  
  2766  // Pages invokes f for each page of results.
  2767  // A non-nil error returned from f will halt the iteration.
  2768  // The provided context supersedes any context provided to the Context method.
  2769  func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
  2770  	c.ctx_ = ctx
  2771  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2772  	for {
  2773  		x, err := c.Do()
  2774  		if err != nil {
  2775  			return err
  2776  		}
  2777  		if err := f(x); err != nil {
  2778  			return err
  2779  		}
  2780  		if x.NextPageToken == "" {
  2781  			return nil
  2782  		}
  2783  		c.PageToken(x.NextPageToken)
  2784  	}
  2785  }
  2786  
  2787  // method id "storage.buckets.patch":
  2788  
  2789  type BucketsPatchCall struct {
  2790  	s          *Service
  2791  	bucket     string
  2792  	bucket2    *Bucket
  2793  	urlParams_ gensupport.URLParams
  2794  	ctx_       context.Context
  2795  	header_    http.Header
  2796  }
  2797  
  2798  // Patch: Updates a bucket. This method supports patch semantics.
  2799  func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
  2800  	c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2801  	c.bucket = bucket
  2802  	c.bucket2 = bucket2
  2803  	return c
  2804  }
  2805  
  2806  // IfMetagenerationMatch sets the optional parameter
  2807  // "ifMetagenerationMatch": Makes the return of the bucket metadata
  2808  // conditional on whether the bucket's current metageneration matches
  2809  // the given value.
  2810  func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsPatchCall {
  2811  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  2812  	return c
  2813  }
  2814  
  2815  // IfMetagenerationNotMatch sets the optional parameter
  2816  // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  2817  // conditional on whether the bucket's current metageneration does not
  2818  // match the given value.
  2819  func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsPatchCall {
  2820  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  2821  	return c
  2822  }
  2823  
  2824  // Projection sets the optional parameter "projection": Set of
  2825  // properties to return. Defaults to full.
  2826  //
  2827  // Possible values:
  2828  //
  2829  //	"full" - Include all properties.
  2830  //	"noAcl" - Omit acl and defaultObjectAcl properties.
  2831  func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
  2832  	c.urlParams_.Set("projection", projection)
  2833  	return c
  2834  }
  2835  
  2836  // Fields allows partial responses to be retrieved. See
  2837  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2838  // for more information.
  2839  func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
  2840  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2841  	return c
  2842  }
  2843  
  2844  // Context sets the context to be used in this call's Do method. Any
  2845  // pending HTTP request will be aborted if the provided context is
  2846  // canceled.
  2847  func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
  2848  	c.ctx_ = ctx
  2849  	return c
  2850  }
  2851  
  2852  // Header returns an http.Header that can be modified by the caller to
  2853  // add HTTP headers to the request.
  2854  func (c *BucketsPatchCall) Header() http.Header {
  2855  	if c.header_ == nil {
  2856  		c.header_ = make(http.Header)
  2857  	}
  2858  	return c.header_
  2859  }
  2860  
  2861  func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  2862  	reqHeaders := make(http.Header)
  2863  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  2864  	for k, v := range c.header_ {
  2865  		reqHeaders[k] = v
  2866  	}
  2867  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2868  	var body io.Reader = nil
  2869  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  2870  	if err != nil {
  2871  		return nil, err
  2872  	}
  2873  	reqHeaders.Set("Content-Type", "application/json")
  2874  	c.urlParams_.Set("alt", alt)
  2875  	c.urlParams_.Set("prettyPrint", "false")
  2876  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  2877  	urls += "?" + c.urlParams_.Encode()
  2878  	req, err := http.NewRequest("PATCH", urls, body)
  2879  	if err != nil {
  2880  		return nil, err
  2881  	}
  2882  	req.Header = reqHeaders
  2883  	googleapi.Expand(req.URL, map[string]string{
  2884  		"bucket": c.bucket,
  2885  	})
  2886  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2887  }
  2888  
  2889  // Do executes the "storage.buckets.patch" call.
  2890  // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  2891  // code is an error. Response headers are in either
  2892  // *Bucket.ServerResponse.Header or (if a response was returned at all)
  2893  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2894  // check whether the returned error was because http.StatusNotModified
  2895  // was returned.
  2896  func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  2897  	gensupport.SetOptions(c.urlParams_, opts...)
  2898  	res, err := c.doRequest("json")
  2899  	if res != nil && res.StatusCode == http.StatusNotModified {
  2900  		if res.Body != nil {
  2901  			res.Body.Close()
  2902  		}
  2903  		return nil, &googleapi.Error{
  2904  			Code:   res.StatusCode,
  2905  			Header: res.Header,
  2906  		}
  2907  	}
  2908  	if err != nil {
  2909  		return nil, err
  2910  	}
  2911  	defer googleapi.CloseBody(res)
  2912  	if err := googleapi.CheckResponse(res); err != nil {
  2913  		return nil, err
  2914  	}
  2915  	ret := &Bucket{
  2916  		ServerResponse: googleapi.ServerResponse{
  2917  			Header:         res.Header,
  2918  			HTTPStatusCode: res.StatusCode,
  2919  		},
  2920  	}
  2921  	target := &ret
  2922  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2923  		return nil, err
  2924  	}
  2925  	return ret, nil
  2926  	// {
  2927  	//   "description": "Updates a bucket. This method supports patch semantics.",
  2928  	//   "httpMethod": "PATCH",
  2929  	//   "id": "storage.buckets.patch",
  2930  	//   "parameterOrder": [
  2931  	//     "bucket"
  2932  	//   ],
  2933  	//   "parameters": {
  2934  	//     "bucket": {
  2935  	//       "description": "Name of a bucket.",
  2936  	//       "location": "path",
  2937  	//       "required": true,
  2938  	//       "type": "string"
  2939  	//     },
  2940  	//     "ifMetagenerationMatch": {
  2941  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  2942  	//       "format": "uint64",
  2943  	//       "location": "query",
  2944  	//       "type": "string"
  2945  	//     },
  2946  	//     "ifMetagenerationNotMatch": {
  2947  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  2948  	//       "format": "uint64",
  2949  	//       "location": "query",
  2950  	//       "type": "string"
  2951  	//     },
  2952  	//     "projection": {
  2953  	//       "description": "Set of properties to return. Defaults to full.",
  2954  	//       "enum": [
  2955  	//         "full",
  2956  	//         "noAcl"
  2957  	//       ],
  2958  	//       "enumDescriptions": [
  2959  	//         "Include all properties.",
  2960  	//         "Omit acl and defaultObjectAcl properties."
  2961  	//       ],
  2962  	//       "location": "query",
  2963  	//       "type": "string"
  2964  	//     }
  2965  	//   },
  2966  	//   "path": "b/{bucket}",
  2967  	//   "request": {
  2968  	//     "$ref": "Bucket"
  2969  	//   },
  2970  	//   "response": {
  2971  	//     "$ref": "Bucket"
  2972  	//   },
  2973  	//   "scopes": [
  2974  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  2975  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  2976  	//   ]
  2977  	// }
  2978  
  2979  }
  2980  
  2981  // method id "storage.buckets.update":
  2982  
  2983  type BucketsUpdateCall struct {
  2984  	s          *Service
  2985  	bucket     string
  2986  	bucket2    *Bucket
  2987  	urlParams_ gensupport.URLParams
  2988  	ctx_       context.Context
  2989  	header_    http.Header
  2990  }
  2991  
  2992  // Update: Updates a bucket.
  2993  func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
  2994  	c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2995  	c.bucket = bucket
  2996  	c.bucket2 = bucket2
  2997  	return c
  2998  }
  2999  
  3000  // IfMetagenerationMatch sets the optional parameter
  3001  // "ifMetagenerationMatch": Makes the return of the bucket metadata
  3002  // conditional on whether the bucket's current metageneration matches
  3003  // the given value.
  3004  func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsUpdateCall {
  3005  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  3006  	return c
  3007  }
  3008  
  3009  // IfMetagenerationNotMatch sets the optional parameter
  3010  // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  3011  // conditional on whether the bucket's current metageneration does not
  3012  // match the given value.
  3013  func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsUpdateCall {
  3014  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  3015  	return c
  3016  }
  3017  
  3018  // Projection sets the optional parameter "projection": Set of
  3019  // properties to return. Defaults to full.
  3020  //
  3021  // Possible values:
  3022  //
  3023  //	"full" - Include all properties.
  3024  //	"noAcl" - Omit acl and defaultObjectAcl properties.
  3025  func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
  3026  	c.urlParams_.Set("projection", projection)
  3027  	return c
  3028  }
  3029  
  3030  // Fields allows partial responses to be retrieved. See
  3031  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3032  // for more information.
  3033  func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
  3034  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3035  	return c
  3036  }
  3037  
  3038  // Context sets the context to be used in this call's Do method. Any
  3039  // pending HTTP request will be aborted if the provided context is
  3040  // canceled.
  3041  func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
  3042  	c.ctx_ = ctx
  3043  	return c
  3044  }
  3045  
  3046  // Header returns an http.Header that can be modified by the caller to
  3047  // add HTTP headers to the request.
  3048  func (c *BucketsUpdateCall) Header() http.Header {
  3049  	if c.header_ == nil {
  3050  		c.header_ = make(http.Header)
  3051  	}
  3052  	return c.header_
  3053  }
  3054  
  3055  func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3056  	reqHeaders := make(http.Header)
  3057  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  3058  	for k, v := range c.header_ {
  3059  		reqHeaders[k] = v
  3060  	}
  3061  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3062  	var body io.Reader = nil
  3063  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  3064  	if err != nil {
  3065  		return nil, err
  3066  	}
  3067  	reqHeaders.Set("Content-Type", "application/json")
  3068  	c.urlParams_.Set("alt", alt)
  3069  	c.urlParams_.Set("prettyPrint", "false")
  3070  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  3071  	urls += "?" + c.urlParams_.Encode()
  3072  	req, err := http.NewRequest("PUT", urls, body)
  3073  	if err != nil {
  3074  		return nil, err
  3075  	}
  3076  	req.Header = reqHeaders
  3077  	googleapi.Expand(req.URL, map[string]string{
  3078  		"bucket": c.bucket,
  3079  	})
  3080  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3081  }
  3082  
  3083  // Do executes the "storage.buckets.update" call.
  3084  // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  3085  // code is an error. Response headers are in either
  3086  // *Bucket.ServerResponse.Header or (if a response was returned at all)
  3087  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3088  // check whether the returned error was because http.StatusNotModified
  3089  // was returned.
  3090  func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  3091  	gensupport.SetOptions(c.urlParams_, opts...)
  3092  	res, err := c.doRequest("json")
  3093  	if res != nil && res.StatusCode == http.StatusNotModified {
  3094  		if res.Body != nil {
  3095  			res.Body.Close()
  3096  		}
  3097  		return nil, &googleapi.Error{
  3098  			Code:   res.StatusCode,
  3099  			Header: res.Header,
  3100  		}
  3101  	}
  3102  	if err != nil {
  3103  		return nil, err
  3104  	}
  3105  	defer googleapi.CloseBody(res)
  3106  	if err := googleapi.CheckResponse(res); err != nil {
  3107  		return nil, err
  3108  	}
  3109  	ret := &Bucket{
  3110  		ServerResponse: googleapi.ServerResponse{
  3111  			Header:         res.Header,
  3112  			HTTPStatusCode: res.StatusCode,
  3113  		},
  3114  	}
  3115  	target := &ret
  3116  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3117  		return nil, err
  3118  	}
  3119  	return ret, nil
  3120  	// {
  3121  	//   "description": "Updates a bucket.",
  3122  	//   "httpMethod": "PUT",
  3123  	//   "id": "storage.buckets.update",
  3124  	//   "parameterOrder": [
  3125  	//     "bucket"
  3126  	//   ],
  3127  	//   "parameters": {
  3128  	//     "bucket": {
  3129  	//       "description": "Name of a bucket.",
  3130  	//       "location": "path",
  3131  	//       "required": true,
  3132  	//       "type": "string"
  3133  	//     },
  3134  	//     "ifMetagenerationMatch": {
  3135  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  3136  	//       "format": "uint64",
  3137  	//       "location": "query",
  3138  	//       "type": "string"
  3139  	//     },
  3140  	//     "ifMetagenerationNotMatch": {
  3141  	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  3142  	//       "format": "uint64",
  3143  	//       "location": "query",
  3144  	//       "type": "string"
  3145  	//     },
  3146  	//     "projection": {
  3147  	//       "description": "Set of properties to return. Defaults to full.",
  3148  	//       "enum": [
  3149  	//         "full",
  3150  	//         "noAcl"
  3151  	//       ],
  3152  	//       "enumDescriptions": [
  3153  	//         "Include all properties.",
  3154  	//         "Omit acl and defaultObjectAcl properties."
  3155  	//       ],
  3156  	//       "location": "query",
  3157  	//       "type": "string"
  3158  	//     }
  3159  	//   },
  3160  	//   "path": "b/{bucket}",
  3161  	//   "request": {
  3162  	//     "$ref": "Bucket"
  3163  	//   },
  3164  	//   "response": {
  3165  	//     "$ref": "Bucket"
  3166  	//   },
  3167  	//   "scopes": [
  3168  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  3169  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  3170  	//   ]
  3171  	// }
  3172  
  3173  }
  3174  
  3175  // method id "storage.channels.stop":
  3176  
  3177  type ChannelsStopCall struct {
  3178  	s          *Service
  3179  	channel    *Channel
  3180  	urlParams_ gensupport.URLParams
  3181  	ctx_       context.Context
  3182  	header_    http.Header
  3183  }
  3184  
  3185  // Stop: Stop watching resources through this channel
  3186  func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
  3187  	c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3188  	c.channel = channel
  3189  	return c
  3190  }
  3191  
  3192  // Fields allows partial responses to be retrieved. See
  3193  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3194  // for more information.
  3195  func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
  3196  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3197  	return c
  3198  }
  3199  
  3200  // Context sets the context to be used in this call's Do method. Any
  3201  // pending HTTP request will be aborted if the provided context is
  3202  // canceled.
  3203  func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
  3204  	c.ctx_ = ctx
  3205  	return c
  3206  }
  3207  
  3208  // Header returns an http.Header that can be modified by the caller to
  3209  // add HTTP headers to the request.
  3210  func (c *ChannelsStopCall) Header() http.Header {
  3211  	if c.header_ == nil {
  3212  		c.header_ = make(http.Header)
  3213  	}
  3214  	return c.header_
  3215  }
  3216  
  3217  func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
  3218  	reqHeaders := make(http.Header)
  3219  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  3220  	for k, v := range c.header_ {
  3221  		reqHeaders[k] = v
  3222  	}
  3223  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3224  	var body io.Reader = nil
  3225  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  3226  	if err != nil {
  3227  		return nil, err
  3228  	}
  3229  	reqHeaders.Set("Content-Type", "application/json")
  3230  	c.urlParams_.Set("alt", alt)
  3231  	c.urlParams_.Set("prettyPrint", "false")
  3232  	urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
  3233  	urls += "?" + c.urlParams_.Encode()
  3234  	req, err := http.NewRequest("POST", urls, body)
  3235  	if err != nil {
  3236  		return nil, err
  3237  	}
  3238  	req.Header = reqHeaders
  3239  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3240  }
  3241  
  3242  // Do executes the "storage.channels.stop" call.
  3243  func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
  3244  	gensupport.SetOptions(c.urlParams_, opts...)
  3245  	res, err := c.doRequest("json")
  3246  	if err != nil {
  3247  		return err
  3248  	}
  3249  	defer googleapi.CloseBody(res)
  3250  	if err := googleapi.CheckResponse(res); err != nil {
  3251  		return err
  3252  	}
  3253  	return nil
  3254  	// {
  3255  	//   "description": "Stop watching resources through this channel",
  3256  	//   "httpMethod": "POST",
  3257  	//   "id": "storage.channels.stop",
  3258  	//   "path": "channels/stop",
  3259  	//   "request": {
  3260  	//     "$ref": "Channel",
  3261  	//     "parameterName": "resource"
  3262  	//   },
  3263  	//   "scopes": [
  3264  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  3265  	//     "https://www.googleapis.com/auth/devstorage.read_only",
  3266  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  3267  	//   ]
  3268  	// }
  3269  
  3270  }
  3271  
  3272  // method id "storage.defaultObjectAccessControls.delete":
  3273  
  3274  type DefaultObjectAccessControlsDeleteCall struct {
  3275  	s          *Service
  3276  	bucket     string
  3277  	entity     string
  3278  	urlParams_ gensupport.URLParams
  3279  	ctx_       context.Context
  3280  	header_    http.Header
  3281  }
  3282  
  3283  // Delete: Permanently deletes the default object ACL entry for the
  3284  // specified entity on the specified bucket.
  3285  func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
  3286  	c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3287  	c.bucket = bucket
  3288  	c.entity = entity
  3289  	return c
  3290  }
  3291  
  3292  // Fields allows partial responses to be retrieved. See
  3293  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3294  // for more information.
  3295  func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
  3296  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3297  	return c
  3298  }
  3299  
  3300  // Context sets the context to be used in this call's Do method. Any
  3301  // pending HTTP request will be aborted if the provided context is
  3302  // canceled.
  3303  func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
  3304  	c.ctx_ = ctx
  3305  	return c
  3306  }
  3307  
  3308  // Header returns an http.Header that can be modified by the caller to
  3309  // add HTTP headers to the request.
  3310  func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
  3311  	if c.header_ == nil {
  3312  		c.header_ = make(http.Header)
  3313  	}
  3314  	return c.header_
  3315  }
  3316  
  3317  func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3318  	reqHeaders := make(http.Header)
  3319  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  3320  	for k, v := range c.header_ {
  3321  		reqHeaders[k] = v
  3322  	}
  3323  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3324  	var body io.Reader = nil
  3325  	c.urlParams_.Set("alt", alt)
  3326  	c.urlParams_.Set("prettyPrint", "false")
  3327  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  3328  	urls += "?" + c.urlParams_.Encode()
  3329  	req, err := http.NewRequest("DELETE", urls, body)
  3330  	if err != nil {
  3331  		return nil, err
  3332  	}
  3333  	req.Header = reqHeaders
  3334  	googleapi.Expand(req.URL, map[string]string{
  3335  		"bucket": c.bucket,
  3336  		"entity": c.entity,
  3337  	})
  3338  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3339  }
  3340  
  3341  // Do executes the "storage.defaultObjectAccessControls.delete" call.
  3342  func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  3343  	gensupport.SetOptions(c.urlParams_, opts...)
  3344  	res, err := c.doRequest("json")
  3345  	if err != nil {
  3346  		return err
  3347  	}
  3348  	defer googleapi.CloseBody(res)
  3349  	if err := googleapi.CheckResponse(res); err != nil {
  3350  		return err
  3351  	}
  3352  	return nil
  3353  	// {
  3354  	//   "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
  3355  	//   "httpMethod": "DELETE",
  3356  	//   "id": "storage.defaultObjectAccessControls.delete",
  3357  	//   "parameterOrder": [
  3358  	//     "bucket",
  3359  	//     "entity"
  3360  	//   ],
  3361  	//   "parameters": {
  3362  	//     "bucket": {
  3363  	//       "description": "Name of a bucket.",
  3364  	//       "location": "path",
  3365  	//       "required": true,
  3366  	//       "type": "string"
  3367  	//     },
  3368  	//     "entity": {
  3369  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3370  	//       "location": "path",
  3371  	//       "required": true,
  3372  	//       "type": "string"
  3373  	//     }
  3374  	//   },
  3375  	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
  3376  	//   "scopes": [
  3377  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  3378  	//   ]
  3379  	// }
  3380  
  3381  }
  3382  
  3383  // method id "storage.defaultObjectAccessControls.get":
  3384  
  3385  type DefaultObjectAccessControlsGetCall struct {
  3386  	s            *Service
  3387  	bucket       string
  3388  	entity       string
  3389  	urlParams_   gensupport.URLParams
  3390  	ifNoneMatch_ string
  3391  	ctx_         context.Context
  3392  	header_      http.Header
  3393  }
  3394  
  3395  // Get: Returns the default object ACL entry for the specified entity on
  3396  // the specified bucket.
  3397  func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
  3398  	c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3399  	c.bucket = bucket
  3400  	c.entity = entity
  3401  	return c
  3402  }
  3403  
  3404  // Fields allows partial responses to be retrieved. See
  3405  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3406  // for more information.
  3407  func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
  3408  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3409  	return c
  3410  }
  3411  
  3412  // IfNoneMatch sets the optional parameter which makes the operation
  3413  // fail if the object's ETag matches the given value. This is useful for
  3414  // getting updates only after the object has changed since the last
  3415  // request. Use googleapi.IsNotModified to check whether the response
  3416  // error from Do is the result of In-None-Match.
  3417  func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
  3418  	c.ifNoneMatch_ = entityTag
  3419  	return c
  3420  }
  3421  
  3422  // Context sets the context to be used in this call's Do method. Any
  3423  // pending HTTP request will be aborted if the provided context is
  3424  // canceled.
  3425  func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
  3426  	c.ctx_ = ctx
  3427  	return c
  3428  }
  3429  
  3430  // Header returns an http.Header that can be modified by the caller to
  3431  // add HTTP headers to the request.
  3432  func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
  3433  	if c.header_ == nil {
  3434  		c.header_ = make(http.Header)
  3435  	}
  3436  	return c.header_
  3437  }
  3438  
  3439  func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  3440  	reqHeaders := make(http.Header)
  3441  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  3442  	for k, v := range c.header_ {
  3443  		reqHeaders[k] = v
  3444  	}
  3445  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3446  	if c.ifNoneMatch_ != "" {
  3447  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3448  	}
  3449  	var body io.Reader = nil
  3450  	c.urlParams_.Set("alt", alt)
  3451  	c.urlParams_.Set("prettyPrint", "false")
  3452  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  3453  	urls += "?" + c.urlParams_.Encode()
  3454  	req, err := http.NewRequest("GET", urls, body)
  3455  	if err != nil {
  3456  		return nil, err
  3457  	}
  3458  	req.Header = reqHeaders
  3459  	googleapi.Expand(req.URL, map[string]string{
  3460  		"bucket": c.bucket,
  3461  		"entity": c.entity,
  3462  	})
  3463  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3464  }
  3465  
  3466  // Do executes the "storage.defaultObjectAccessControls.get" call.
  3467  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3468  // non-2xx status code is an error. Response headers are in either
  3469  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3470  // returned at all) in error.(*googleapi.Error).Header. Use
  3471  // googleapi.IsNotModified to check whether the returned error was
  3472  // because http.StatusNotModified was returned.
  3473  func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  3474  	gensupport.SetOptions(c.urlParams_, opts...)
  3475  	res, err := c.doRequest("json")
  3476  	if res != nil && res.StatusCode == http.StatusNotModified {
  3477  		if res.Body != nil {
  3478  			res.Body.Close()
  3479  		}
  3480  		return nil, &googleapi.Error{
  3481  			Code:   res.StatusCode,
  3482  			Header: res.Header,
  3483  		}
  3484  	}
  3485  	if err != nil {
  3486  		return nil, err
  3487  	}
  3488  	defer googleapi.CloseBody(res)
  3489  	if err := googleapi.CheckResponse(res); err != nil {
  3490  		return nil, err
  3491  	}
  3492  	ret := &ObjectAccessControl{
  3493  		ServerResponse: googleapi.ServerResponse{
  3494  			Header:         res.Header,
  3495  			HTTPStatusCode: res.StatusCode,
  3496  		},
  3497  	}
  3498  	target := &ret
  3499  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3500  		return nil, err
  3501  	}
  3502  	return ret, nil
  3503  	// {
  3504  	//   "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
  3505  	//   "httpMethod": "GET",
  3506  	//   "id": "storage.defaultObjectAccessControls.get",
  3507  	//   "parameterOrder": [
  3508  	//     "bucket",
  3509  	//     "entity"
  3510  	//   ],
  3511  	//   "parameters": {
  3512  	//     "bucket": {
  3513  	//       "description": "Name of a bucket.",
  3514  	//       "location": "path",
  3515  	//       "required": true,
  3516  	//       "type": "string"
  3517  	//     },
  3518  	//     "entity": {
  3519  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3520  	//       "location": "path",
  3521  	//       "required": true,
  3522  	//       "type": "string"
  3523  	//     }
  3524  	//   },
  3525  	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
  3526  	//   "response": {
  3527  	//     "$ref": "ObjectAccessControl"
  3528  	//   },
  3529  	//   "scopes": [
  3530  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  3531  	//   ]
  3532  	// }
  3533  
  3534  }
  3535  
  3536  // method id "storage.defaultObjectAccessControls.insert":
  3537  
  3538  type DefaultObjectAccessControlsInsertCall struct {
  3539  	s                   *Service
  3540  	bucket              string
  3541  	objectaccesscontrol *ObjectAccessControl
  3542  	urlParams_          gensupport.URLParams
  3543  	ctx_                context.Context
  3544  	header_             http.Header
  3545  }
  3546  
  3547  // Insert: Creates a new default object ACL entry on the specified
  3548  // bucket.
  3549  func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
  3550  	c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3551  	c.bucket = bucket
  3552  	c.objectaccesscontrol = objectaccesscontrol
  3553  	return c
  3554  }
  3555  
  3556  // Fields allows partial responses to be retrieved. See
  3557  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3558  // for more information.
  3559  func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
  3560  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3561  	return c
  3562  }
  3563  
  3564  // Context sets the context to be used in this call's Do method. Any
  3565  // pending HTTP request will be aborted if the provided context is
  3566  // canceled.
  3567  func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
  3568  	c.ctx_ = ctx
  3569  	return c
  3570  }
  3571  
  3572  // Header returns an http.Header that can be modified by the caller to
  3573  // add HTTP headers to the request.
  3574  func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
  3575  	if c.header_ == nil {
  3576  		c.header_ = make(http.Header)
  3577  	}
  3578  	return c.header_
  3579  }
  3580  
  3581  func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  3582  	reqHeaders := make(http.Header)
  3583  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  3584  	for k, v := range c.header_ {
  3585  		reqHeaders[k] = v
  3586  	}
  3587  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3588  	var body io.Reader = nil
  3589  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  3590  	if err != nil {
  3591  		return nil, err
  3592  	}
  3593  	reqHeaders.Set("Content-Type", "application/json")
  3594  	c.urlParams_.Set("alt", alt)
  3595  	c.urlParams_.Set("prettyPrint", "false")
  3596  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
  3597  	urls += "?" + c.urlParams_.Encode()
  3598  	req, err := http.NewRequest("POST", urls, body)
  3599  	if err != nil {
  3600  		return nil, err
  3601  	}
  3602  	req.Header = reqHeaders
  3603  	googleapi.Expand(req.URL, map[string]string{
  3604  		"bucket": c.bucket,
  3605  	})
  3606  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3607  }
  3608  
  3609  // Do executes the "storage.defaultObjectAccessControls.insert" call.
  3610  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3611  // non-2xx status code is an error. Response headers are in either
  3612  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3613  // returned at all) in error.(*googleapi.Error).Header. Use
  3614  // googleapi.IsNotModified to check whether the returned error was
  3615  // because http.StatusNotModified was returned.
  3616  func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, 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, &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, err
  3634  	}
  3635  	ret := &ObjectAccessControl{
  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  	//   "description": "Creates a new default object ACL entry on the specified bucket.",
  3648  	//   "httpMethod": "POST",
  3649  	//   "id": "storage.defaultObjectAccessControls.insert",
  3650  	//   "parameterOrder": [
  3651  	//     "bucket"
  3652  	//   ],
  3653  	//   "parameters": {
  3654  	//     "bucket": {
  3655  	//       "description": "Name of a bucket.",
  3656  	//       "location": "path",
  3657  	//       "required": true,
  3658  	//       "type": "string"
  3659  	//     }
  3660  	//   },
  3661  	//   "path": "b/{bucket}/defaultObjectAcl",
  3662  	//   "request": {
  3663  	//     "$ref": "ObjectAccessControl"
  3664  	//   },
  3665  	//   "response": {
  3666  	//     "$ref": "ObjectAccessControl"
  3667  	//   },
  3668  	//   "scopes": [
  3669  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  3670  	//   ]
  3671  	// }
  3672  
  3673  }
  3674  
  3675  // method id "storage.defaultObjectAccessControls.list":
  3676  
  3677  type DefaultObjectAccessControlsListCall struct {
  3678  	s            *Service
  3679  	bucket       string
  3680  	urlParams_   gensupport.URLParams
  3681  	ifNoneMatch_ string
  3682  	ctx_         context.Context
  3683  	header_      http.Header
  3684  }
  3685  
  3686  // List: Retrieves default object ACL entries on the specified bucket.
  3687  func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
  3688  	c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3689  	c.bucket = bucket
  3690  	return c
  3691  }
  3692  
  3693  // IfMetagenerationMatch sets the optional parameter
  3694  // "ifMetagenerationMatch": If present, only return default ACL listing
  3695  // if the bucket's current metageneration matches this value.
  3696  func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
  3697  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  3698  	return c
  3699  }
  3700  
  3701  // IfMetagenerationNotMatch sets the optional parameter
  3702  // "ifMetagenerationNotMatch": If present, only return default ACL
  3703  // listing if the bucket's current metageneration does not match the
  3704  // given value.
  3705  func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
  3706  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  3707  	return c
  3708  }
  3709  
  3710  // Fields allows partial responses to be retrieved. See
  3711  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3712  // for more information.
  3713  func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
  3714  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3715  	return c
  3716  }
  3717  
  3718  // IfNoneMatch sets the optional parameter which makes the operation
  3719  // fail if the object's ETag matches the given value. This is useful for
  3720  // getting updates only after the object has changed since the last
  3721  // request. Use googleapi.IsNotModified to check whether the response
  3722  // error from Do is the result of In-None-Match.
  3723  func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
  3724  	c.ifNoneMatch_ = entityTag
  3725  	return c
  3726  }
  3727  
  3728  // Context sets the context to be used in this call's Do method. Any
  3729  // pending HTTP request will be aborted if the provided context is
  3730  // canceled.
  3731  func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
  3732  	c.ctx_ = ctx
  3733  	return c
  3734  }
  3735  
  3736  // Header returns an http.Header that can be modified by the caller to
  3737  // add HTTP headers to the request.
  3738  func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
  3739  	if c.header_ == nil {
  3740  		c.header_ = make(http.Header)
  3741  	}
  3742  	return c.header_
  3743  }
  3744  
  3745  func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  3746  	reqHeaders := make(http.Header)
  3747  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  3748  	for k, v := range c.header_ {
  3749  		reqHeaders[k] = v
  3750  	}
  3751  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3752  	if c.ifNoneMatch_ != "" {
  3753  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3754  	}
  3755  	var body io.Reader = nil
  3756  	c.urlParams_.Set("alt", alt)
  3757  	c.urlParams_.Set("prettyPrint", "false")
  3758  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
  3759  	urls += "?" + c.urlParams_.Encode()
  3760  	req, err := http.NewRequest("GET", urls, body)
  3761  	if err != nil {
  3762  		return nil, err
  3763  	}
  3764  	req.Header = reqHeaders
  3765  	googleapi.Expand(req.URL, map[string]string{
  3766  		"bucket": c.bucket,
  3767  	})
  3768  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3769  }
  3770  
  3771  // Do executes the "storage.defaultObjectAccessControls.list" call.
  3772  // Exactly one of *ObjectAccessControls or error will be non-nil. Any
  3773  // non-2xx status code is an error. Response headers are in either
  3774  // *ObjectAccessControls.ServerResponse.Header or (if a response was
  3775  // returned at all) in error.(*googleapi.Error).Header. Use
  3776  // googleapi.IsNotModified to check whether the returned error was
  3777  // because http.StatusNotModified was returned.
  3778  func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
  3779  	gensupport.SetOptions(c.urlParams_, opts...)
  3780  	res, err := c.doRequest("json")
  3781  	if res != nil && res.StatusCode == http.StatusNotModified {
  3782  		if res.Body != nil {
  3783  			res.Body.Close()
  3784  		}
  3785  		return nil, &googleapi.Error{
  3786  			Code:   res.StatusCode,
  3787  			Header: res.Header,
  3788  		}
  3789  	}
  3790  	if err != nil {
  3791  		return nil, err
  3792  	}
  3793  	defer googleapi.CloseBody(res)
  3794  	if err := googleapi.CheckResponse(res); err != nil {
  3795  		return nil, err
  3796  	}
  3797  	ret := &ObjectAccessControls{
  3798  		ServerResponse: googleapi.ServerResponse{
  3799  			Header:         res.Header,
  3800  			HTTPStatusCode: res.StatusCode,
  3801  		},
  3802  	}
  3803  	target := &ret
  3804  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3805  		return nil, err
  3806  	}
  3807  	return ret, nil
  3808  	// {
  3809  	//   "description": "Retrieves default object ACL entries on the specified bucket.",
  3810  	//   "httpMethod": "GET",
  3811  	//   "id": "storage.defaultObjectAccessControls.list",
  3812  	//   "parameterOrder": [
  3813  	//     "bucket"
  3814  	//   ],
  3815  	//   "parameters": {
  3816  	//     "bucket": {
  3817  	//       "description": "Name of a bucket.",
  3818  	//       "location": "path",
  3819  	//       "required": true,
  3820  	//       "type": "string"
  3821  	//     },
  3822  	//     "ifMetagenerationMatch": {
  3823  	//       "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
  3824  	//       "format": "int64",
  3825  	//       "location": "query",
  3826  	//       "type": "string"
  3827  	//     },
  3828  	//     "ifMetagenerationNotMatch": {
  3829  	//       "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
  3830  	//       "format": "int64",
  3831  	//       "location": "query",
  3832  	//       "type": "string"
  3833  	//     }
  3834  	//   },
  3835  	//   "path": "b/{bucket}/defaultObjectAcl",
  3836  	//   "response": {
  3837  	//     "$ref": "ObjectAccessControls"
  3838  	//   },
  3839  	//   "scopes": [
  3840  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  3841  	//   ]
  3842  	// }
  3843  
  3844  }
  3845  
  3846  // method id "storage.defaultObjectAccessControls.patch":
  3847  
  3848  type DefaultObjectAccessControlsPatchCall struct {
  3849  	s                   *Service
  3850  	bucket              string
  3851  	entity              string
  3852  	objectaccesscontrol *ObjectAccessControl
  3853  	urlParams_          gensupport.URLParams
  3854  	ctx_                context.Context
  3855  	header_             http.Header
  3856  }
  3857  
  3858  // Patch: Updates a default object ACL entry on the specified bucket.
  3859  // This method supports patch semantics.
  3860  func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
  3861  	c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3862  	c.bucket = bucket
  3863  	c.entity = entity
  3864  	c.objectaccesscontrol = objectaccesscontrol
  3865  	return c
  3866  }
  3867  
  3868  // Fields allows partial responses to be retrieved. See
  3869  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3870  // for more information.
  3871  func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
  3872  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3873  	return c
  3874  }
  3875  
  3876  // Context sets the context to be used in this call's Do method. Any
  3877  // pending HTTP request will be aborted if the provided context is
  3878  // canceled.
  3879  func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
  3880  	c.ctx_ = ctx
  3881  	return c
  3882  }
  3883  
  3884  // Header returns an http.Header that can be modified by the caller to
  3885  // add HTTP headers to the request.
  3886  func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
  3887  	if c.header_ == nil {
  3888  		c.header_ = make(http.Header)
  3889  	}
  3890  	return c.header_
  3891  }
  3892  
  3893  func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  3894  	reqHeaders := make(http.Header)
  3895  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  3896  	for k, v := range c.header_ {
  3897  		reqHeaders[k] = v
  3898  	}
  3899  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3900  	var body io.Reader = nil
  3901  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  3902  	if err != nil {
  3903  		return nil, err
  3904  	}
  3905  	reqHeaders.Set("Content-Type", "application/json")
  3906  	c.urlParams_.Set("alt", alt)
  3907  	c.urlParams_.Set("prettyPrint", "false")
  3908  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  3909  	urls += "?" + c.urlParams_.Encode()
  3910  	req, err := http.NewRequest("PATCH", urls, body)
  3911  	if err != nil {
  3912  		return nil, err
  3913  	}
  3914  	req.Header = reqHeaders
  3915  	googleapi.Expand(req.URL, map[string]string{
  3916  		"bucket": c.bucket,
  3917  		"entity": c.entity,
  3918  	})
  3919  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3920  }
  3921  
  3922  // Do executes the "storage.defaultObjectAccessControls.patch" call.
  3923  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3924  // non-2xx status code is an error. Response headers are in either
  3925  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3926  // returned at all) in error.(*googleapi.Error).Header. Use
  3927  // googleapi.IsNotModified to check whether the returned error was
  3928  // because http.StatusNotModified was returned.
  3929  func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  3930  	gensupport.SetOptions(c.urlParams_, opts...)
  3931  	res, err := c.doRequest("json")
  3932  	if res != nil && res.StatusCode == http.StatusNotModified {
  3933  		if res.Body != nil {
  3934  			res.Body.Close()
  3935  		}
  3936  		return nil, &googleapi.Error{
  3937  			Code:   res.StatusCode,
  3938  			Header: res.Header,
  3939  		}
  3940  	}
  3941  	if err != nil {
  3942  		return nil, err
  3943  	}
  3944  	defer googleapi.CloseBody(res)
  3945  	if err := googleapi.CheckResponse(res); err != nil {
  3946  		return nil, err
  3947  	}
  3948  	ret := &ObjectAccessControl{
  3949  		ServerResponse: googleapi.ServerResponse{
  3950  			Header:         res.Header,
  3951  			HTTPStatusCode: res.StatusCode,
  3952  		},
  3953  	}
  3954  	target := &ret
  3955  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3956  		return nil, err
  3957  	}
  3958  	return ret, nil
  3959  	// {
  3960  	//   "description": "Updates a default object ACL entry on the specified bucket. This method supports patch semantics.",
  3961  	//   "httpMethod": "PATCH",
  3962  	//   "id": "storage.defaultObjectAccessControls.patch",
  3963  	//   "parameterOrder": [
  3964  	//     "bucket",
  3965  	//     "entity"
  3966  	//   ],
  3967  	//   "parameters": {
  3968  	//     "bucket": {
  3969  	//       "description": "Name of a bucket.",
  3970  	//       "location": "path",
  3971  	//       "required": true,
  3972  	//       "type": "string"
  3973  	//     },
  3974  	//     "entity": {
  3975  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3976  	//       "location": "path",
  3977  	//       "required": true,
  3978  	//       "type": "string"
  3979  	//     }
  3980  	//   },
  3981  	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
  3982  	//   "request": {
  3983  	//     "$ref": "ObjectAccessControl"
  3984  	//   },
  3985  	//   "response": {
  3986  	//     "$ref": "ObjectAccessControl"
  3987  	//   },
  3988  	//   "scopes": [
  3989  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  3990  	//   ]
  3991  	// }
  3992  
  3993  }
  3994  
  3995  // method id "storage.defaultObjectAccessControls.update":
  3996  
  3997  type DefaultObjectAccessControlsUpdateCall struct {
  3998  	s                   *Service
  3999  	bucket              string
  4000  	entity              string
  4001  	objectaccesscontrol *ObjectAccessControl
  4002  	urlParams_          gensupport.URLParams
  4003  	ctx_                context.Context
  4004  	header_             http.Header
  4005  }
  4006  
  4007  // Update: Updates a default object ACL entry on the specified bucket.
  4008  func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
  4009  	c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4010  	c.bucket = bucket
  4011  	c.entity = entity
  4012  	c.objectaccesscontrol = objectaccesscontrol
  4013  	return c
  4014  }
  4015  
  4016  // Fields allows partial responses to be retrieved. See
  4017  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4018  // for more information.
  4019  func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
  4020  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4021  	return c
  4022  }
  4023  
  4024  // Context sets the context to be used in this call's Do method. Any
  4025  // pending HTTP request will be aborted if the provided context is
  4026  // canceled.
  4027  func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
  4028  	c.ctx_ = ctx
  4029  	return c
  4030  }
  4031  
  4032  // Header returns an http.Header that can be modified by the caller to
  4033  // add HTTP headers to the request.
  4034  func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
  4035  	if c.header_ == nil {
  4036  		c.header_ = make(http.Header)
  4037  	}
  4038  	return c.header_
  4039  }
  4040  
  4041  func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4042  	reqHeaders := make(http.Header)
  4043  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  4044  	for k, v := range c.header_ {
  4045  		reqHeaders[k] = v
  4046  	}
  4047  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4048  	var body io.Reader = nil
  4049  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  4050  	if err != nil {
  4051  		return nil, err
  4052  	}
  4053  	reqHeaders.Set("Content-Type", "application/json")
  4054  	c.urlParams_.Set("alt", alt)
  4055  	c.urlParams_.Set("prettyPrint", "false")
  4056  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  4057  	urls += "?" + c.urlParams_.Encode()
  4058  	req, err := http.NewRequest("PUT", urls, body)
  4059  	if err != nil {
  4060  		return nil, err
  4061  	}
  4062  	req.Header = reqHeaders
  4063  	googleapi.Expand(req.URL, map[string]string{
  4064  		"bucket": c.bucket,
  4065  		"entity": c.entity,
  4066  	})
  4067  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4068  }
  4069  
  4070  // Do executes the "storage.defaultObjectAccessControls.update" call.
  4071  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  4072  // non-2xx status code is an error. Response headers are in either
  4073  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  4074  // returned at all) in error.(*googleapi.Error).Header. Use
  4075  // googleapi.IsNotModified to check whether the returned error was
  4076  // because http.StatusNotModified was returned.
  4077  func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  4078  	gensupport.SetOptions(c.urlParams_, opts...)
  4079  	res, err := c.doRequest("json")
  4080  	if res != nil && res.StatusCode == http.StatusNotModified {
  4081  		if res.Body != nil {
  4082  			res.Body.Close()
  4083  		}
  4084  		return nil, &googleapi.Error{
  4085  			Code:   res.StatusCode,
  4086  			Header: res.Header,
  4087  		}
  4088  	}
  4089  	if err != nil {
  4090  		return nil, err
  4091  	}
  4092  	defer googleapi.CloseBody(res)
  4093  	if err := googleapi.CheckResponse(res); err != nil {
  4094  		return nil, err
  4095  	}
  4096  	ret := &ObjectAccessControl{
  4097  		ServerResponse: googleapi.ServerResponse{
  4098  			Header:         res.Header,
  4099  			HTTPStatusCode: res.StatusCode,
  4100  		},
  4101  	}
  4102  	target := &ret
  4103  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4104  		return nil, err
  4105  	}
  4106  	return ret, nil
  4107  	// {
  4108  	//   "description": "Updates a default object ACL entry on the specified bucket.",
  4109  	//   "httpMethod": "PUT",
  4110  	//   "id": "storage.defaultObjectAccessControls.update",
  4111  	//   "parameterOrder": [
  4112  	//     "bucket",
  4113  	//     "entity"
  4114  	//   ],
  4115  	//   "parameters": {
  4116  	//     "bucket": {
  4117  	//       "description": "Name of a bucket.",
  4118  	//       "location": "path",
  4119  	//       "required": true,
  4120  	//       "type": "string"
  4121  	//     },
  4122  	//     "entity": {
  4123  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  4124  	//       "location": "path",
  4125  	//       "required": true,
  4126  	//       "type": "string"
  4127  	//     }
  4128  	//   },
  4129  	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
  4130  	//   "request": {
  4131  	//     "$ref": "ObjectAccessControl"
  4132  	//   },
  4133  	//   "response": {
  4134  	//     "$ref": "ObjectAccessControl"
  4135  	//   },
  4136  	//   "scopes": [
  4137  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  4138  	//   ]
  4139  	// }
  4140  
  4141  }
  4142  
  4143  // method id "storage.objectAccessControls.delete":
  4144  
  4145  type ObjectAccessControlsDeleteCall struct {
  4146  	s          *Service
  4147  	bucket     string
  4148  	object     string
  4149  	entity     string
  4150  	urlParams_ gensupport.URLParams
  4151  	ctx_       context.Context
  4152  	header_    http.Header
  4153  }
  4154  
  4155  // Delete: Permanently deletes the ACL entry for the specified entity on
  4156  // the specified object.
  4157  func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
  4158  	c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4159  	c.bucket = bucket
  4160  	c.object = object
  4161  	c.entity = entity
  4162  	return c
  4163  }
  4164  
  4165  // Generation sets the optional parameter "generation": If present,
  4166  // selects a specific revision of this object (as opposed to the latest
  4167  // version, the default).
  4168  func (c *ObjectAccessControlsDeleteCall) Generation(generation uint64) *ObjectAccessControlsDeleteCall {
  4169  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  4170  	return c
  4171  }
  4172  
  4173  // Fields allows partial responses to be retrieved. See
  4174  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4175  // for more information.
  4176  func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
  4177  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4178  	return c
  4179  }
  4180  
  4181  // Context sets the context to be used in this call's Do method. Any
  4182  // pending HTTP request will be aborted if the provided context is
  4183  // canceled.
  4184  func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
  4185  	c.ctx_ = ctx
  4186  	return c
  4187  }
  4188  
  4189  // Header returns an http.Header that can be modified by the caller to
  4190  // add HTTP headers to the request.
  4191  func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
  4192  	if c.header_ == nil {
  4193  		c.header_ = make(http.Header)
  4194  	}
  4195  	return c.header_
  4196  }
  4197  
  4198  func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4199  	reqHeaders := make(http.Header)
  4200  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  4201  	for k, v := range c.header_ {
  4202  		reqHeaders[k] = v
  4203  	}
  4204  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4205  	var body io.Reader = nil
  4206  	c.urlParams_.Set("alt", alt)
  4207  	c.urlParams_.Set("prettyPrint", "false")
  4208  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  4209  	urls += "?" + c.urlParams_.Encode()
  4210  	req, err := http.NewRequest("DELETE", urls, body)
  4211  	if err != nil {
  4212  		return nil, err
  4213  	}
  4214  	req.Header = reqHeaders
  4215  	googleapi.Expand(req.URL, map[string]string{
  4216  		"bucket": c.bucket,
  4217  		"object": c.object,
  4218  		"entity": c.entity,
  4219  	})
  4220  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4221  }
  4222  
  4223  // Do executes the "storage.objectAccessControls.delete" call.
  4224  func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4225  	gensupport.SetOptions(c.urlParams_, opts...)
  4226  	res, err := c.doRequest("json")
  4227  	if err != nil {
  4228  		return err
  4229  	}
  4230  	defer googleapi.CloseBody(res)
  4231  	if err := googleapi.CheckResponse(res); err != nil {
  4232  		return err
  4233  	}
  4234  	return nil
  4235  	// {
  4236  	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
  4237  	//   "httpMethod": "DELETE",
  4238  	//   "id": "storage.objectAccessControls.delete",
  4239  	//   "parameterOrder": [
  4240  	//     "bucket",
  4241  	//     "object",
  4242  	//     "entity"
  4243  	//   ],
  4244  	//   "parameters": {
  4245  	//     "bucket": {
  4246  	//       "description": "Name of a bucket.",
  4247  	//       "location": "path",
  4248  	//       "required": true,
  4249  	//       "type": "string"
  4250  	//     },
  4251  	//     "entity": {
  4252  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  4253  	//       "location": "path",
  4254  	//       "required": true,
  4255  	//       "type": "string"
  4256  	//     },
  4257  	//     "generation": {
  4258  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4259  	//       "format": "uint64",
  4260  	//       "location": "query",
  4261  	//       "type": "string"
  4262  	//     },
  4263  	//     "object": {
  4264  	//       "description": "Name of the object.",
  4265  	//       "location": "path",
  4266  	//       "required": true,
  4267  	//       "type": "string"
  4268  	//     }
  4269  	//   },
  4270  	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
  4271  	//   "scopes": [
  4272  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  4273  	//   ]
  4274  	// }
  4275  
  4276  }
  4277  
  4278  // method id "storage.objectAccessControls.get":
  4279  
  4280  type ObjectAccessControlsGetCall struct {
  4281  	s            *Service
  4282  	bucket       string
  4283  	object       string
  4284  	entity       string
  4285  	urlParams_   gensupport.URLParams
  4286  	ifNoneMatch_ string
  4287  	ctx_         context.Context
  4288  	header_      http.Header
  4289  }
  4290  
  4291  // Get: Returns the ACL entry for the specified entity on the specified
  4292  // object.
  4293  func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
  4294  	c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4295  	c.bucket = bucket
  4296  	c.object = object
  4297  	c.entity = entity
  4298  	return c
  4299  }
  4300  
  4301  // Generation sets the optional parameter "generation": If present,
  4302  // selects a specific revision of this object (as opposed to the latest
  4303  // version, the default).
  4304  func (c *ObjectAccessControlsGetCall) Generation(generation uint64) *ObjectAccessControlsGetCall {
  4305  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  4306  	return c
  4307  }
  4308  
  4309  // Fields allows partial responses to be retrieved. See
  4310  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4311  // for more information.
  4312  func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
  4313  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4314  	return c
  4315  }
  4316  
  4317  // IfNoneMatch sets the optional parameter which makes the operation
  4318  // fail if the object's ETag matches the given value. This is useful for
  4319  // getting updates only after the object has changed since the last
  4320  // request. Use googleapi.IsNotModified to check whether the response
  4321  // error from Do is the result of In-None-Match.
  4322  func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
  4323  	c.ifNoneMatch_ = entityTag
  4324  	return c
  4325  }
  4326  
  4327  // Context sets the context to be used in this call's Do method. Any
  4328  // pending HTTP request will be aborted if the provided context is
  4329  // canceled.
  4330  func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
  4331  	c.ctx_ = ctx
  4332  	return c
  4333  }
  4334  
  4335  // Header returns an http.Header that can be modified by the caller to
  4336  // add HTTP headers to the request.
  4337  func (c *ObjectAccessControlsGetCall) Header() http.Header {
  4338  	if c.header_ == nil {
  4339  		c.header_ = make(http.Header)
  4340  	}
  4341  	return c.header_
  4342  }
  4343  
  4344  func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  4345  	reqHeaders := make(http.Header)
  4346  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  4347  	for k, v := range c.header_ {
  4348  		reqHeaders[k] = v
  4349  	}
  4350  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4351  	if c.ifNoneMatch_ != "" {
  4352  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4353  	}
  4354  	var body io.Reader = nil
  4355  	c.urlParams_.Set("alt", alt)
  4356  	c.urlParams_.Set("prettyPrint", "false")
  4357  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  4358  	urls += "?" + c.urlParams_.Encode()
  4359  	req, err := http.NewRequest("GET", urls, body)
  4360  	if err != nil {
  4361  		return nil, err
  4362  	}
  4363  	req.Header = reqHeaders
  4364  	googleapi.Expand(req.URL, map[string]string{
  4365  		"bucket": c.bucket,
  4366  		"object": c.object,
  4367  		"entity": c.entity,
  4368  	})
  4369  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4370  }
  4371  
  4372  // Do executes the "storage.objectAccessControls.get" call.
  4373  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  4374  // non-2xx status code is an error. Response headers are in either
  4375  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  4376  // returned at all) in error.(*googleapi.Error).Header. Use
  4377  // googleapi.IsNotModified to check whether the returned error was
  4378  // because http.StatusNotModified was returned.
  4379  func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  4380  	gensupport.SetOptions(c.urlParams_, opts...)
  4381  	res, err := c.doRequest("json")
  4382  	if res != nil && res.StatusCode == http.StatusNotModified {
  4383  		if res.Body != nil {
  4384  			res.Body.Close()
  4385  		}
  4386  		return nil, &googleapi.Error{
  4387  			Code:   res.StatusCode,
  4388  			Header: res.Header,
  4389  		}
  4390  	}
  4391  	if err != nil {
  4392  		return nil, err
  4393  	}
  4394  	defer googleapi.CloseBody(res)
  4395  	if err := googleapi.CheckResponse(res); err != nil {
  4396  		return nil, err
  4397  	}
  4398  	ret := &ObjectAccessControl{
  4399  		ServerResponse: googleapi.ServerResponse{
  4400  			Header:         res.Header,
  4401  			HTTPStatusCode: res.StatusCode,
  4402  		},
  4403  	}
  4404  	target := &ret
  4405  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4406  		return nil, err
  4407  	}
  4408  	return ret, nil
  4409  	// {
  4410  	//   "description": "Returns the ACL entry for the specified entity on the specified object.",
  4411  	//   "httpMethod": "GET",
  4412  	//   "id": "storage.objectAccessControls.get",
  4413  	//   "parameterOrder": [
  4414  	//     "bucket",
  4415  	//     "object",
  4416  	//     "entity"
  4417  	//   ],
  4418  	//   "parameters": {
  4419  	//     "bucket": {
  4420  	//       "description": "Name of a bucket.",
  4421  	//       "location": "path",
  4422  	//       "required": true,
  4423  	//       "type": "string"
  4424  	//     },
  4425  	//     "entity": {
  4426  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  4427  	//       "location": "path",
  4428  	//       "required": true,
  4429  	//       "type": "string"
  4430  	//     },
  4431  	//     "generation": {
  4432  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4433  	//       "format": "uint64",
  4434  	//       "location": "query",
  4435  	//       "type": "string"
  4436  	//     },
  4437  	//     "object": {
  4438  	//       "description": "Name of the object.",
  4439  	//       "location": "path",
  4440  	//       "required": true,
  4441  	//       "type": "string"
  4442  	//     }
  4443  	//   },
  4444  	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
  4445  	//   "response": {
  4446  	//     "$ref": "ObjectAccessControl"
  4447  	//   },
  4448  	//   "scopes": [
  4449  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  4450  	//   ]
  4451  	// }
  4452  
  4453  }
  4454  
  4455  // method id "storage.objectAccessControls.insert":
  4456  
  4457  type ObjectAccessControlsInsertCall struct {
  4458  	s                   *Service
  4459  	bucket              string
  4460  	object              string
  4461  	objectaccesscontrol *ObjectAccessControl
  4462  	urlParams_          gensupport.URLParams
  4463  	ctx_                context.Context
  4464  	header_             http.Header
  4465  }
  4466  
  4467  // Insert: Creates a new ACL entry on the specified object.
  4468  func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
  4469  	c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4470  	c.bucket = bucket
  4471  	c.object = object
  4472  	c.objectaccesscontrol = objectaccesscontrol
  4473  	return c
  4474  }
  4475  
  4476  // Generation sets the optional parameter "generation": If present,
  4477  // selects a specific revision of this object (as opposed to the latest
  4478  // version, the default).
  4479  func (c *ObjectAccessControlsInsertCall) Generation(generation uint64) *ObjectAccessControlsInsertCall {
  4480  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  4481  	return c
  4482  }
  4483  
  4484  // Fields allows partial responses to be retrieved. See
  4485  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4486  // for more information.
  4487  func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
  4488  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4489  	return c
  4490  }
  4491  
  4492  // Context sets the context to be used in this call's Do method. Any
  4493  // pending HTTP request will be aborted if the provided context is
  4494  // canceled.
  4495  func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
  4496  	c.ctx_ = ctx
  4497  	return c
  4498  }
  4499  
  4500  // Header returns an http.Header that can be modified by the caller to
  4501  // add HTTP headers to the request.
  4502  func (c *ObjectAccessControlsInsertCall) Header() http.Header {
  4503  	if c.header_ == nil {
  4504  		c.header_ = make(http.Header)
  4505  	}
  4506  	return c.header_
  4507  }
  4508  
  4509  func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  4510  	reqHeaders := make(http.Header)
  4511  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  4512  	for k, v := range c.header_ {
  4513  		reqHeaders[k] = v
  4514  	}
  4515  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4516  	var body io.Reader = nil
  4517  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  4518  	if err != nil {
  4519  		return nil, err
  4520  	}
  4521  	reqHeaders.Set("Content-Type", "application/json")
  4522  	c.urlParams_.Set("alt", alt)
  4523  	c.urlParams_.Set("prettyPrint", "false")
  4524  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  4525  	urls += "?" + c.urlParams_.Encode()
  4526  	req, err := http.NewRequest("POST", urls, body)
  4527  	if err != nil {
  4528  		return nil, err
  4529  	}
  4530  	req.Header = reqHeaders
  4531  	googleapi.Expand(req.URL, map[string]string{
  4532  		"bucket": c.bucket,
  4533  		"object": c.object,
  4534  	})
  4535  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4536  }
  4537  
  4538  // Do executes the "storage.objectAccessControls.insert" call.
  4539  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  4540  // non-2xx status code is an error. Response headers are in either
  4541  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  4542  // returned at all) in error.(*googleapi.Error).Header. Use
  4543  // googleapi.IsNotModified to check whether the returned error was
  4544  // because http.StatusNotModified was returned.
  4545  func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  4546  	gensupport.SetOptions(c.urlParams_, opts...)
  4547  	res, err := c.doRequest("json")
  4548  	if res != nil && res.StatusCode == http.StatusNotModified {
  4549  		if res.Body != nil {
  4550  			res.Body.Close()
  4551  		}
  4552  		return nil, &googleapi.Error{
  4553  			Code:   res.StatusCode,
  4554  			Header: res.Header,
  4555  		}
  4556  	}
  4557  	if err != nil {
  4558  		return nil, err
  4559  	}
  4560  	defer googleapi.CloseBody(res)
  4561  	if err := googleapi.CheckResponse(res); err != nil {
  4562  		return nil, err
  4563  	}
  4564  	ret := &ObjectAccessControl{
  4565  		ServerResponse: googleapi.ServerResponse{
  4566  			Header:         res.Header,
  4567  			HTTPStatusCode: res.StatusCode,
  4568  		},
  4569  	}
  4570  	target := &ret
  4571  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4572  		return nil, err
  4573  	}
  4574  	return ret, nil
  4575  	// {
  4576  	//   "description": "Creates a new ACL entry on the specified object.",
  4577  	//   "httpMethod": "POST",
  4578  	//   "id": "storage.objectAccessControls.insert",
  4579  	//   "parameterOrder": [
  4580  	//     "bucket",
  4581  	//     "object"
  4582  	//   ],
  4583  	//   "parameters": {
  4584  	//     "bucket": {
  4585  	//       "description": "Name of a bucket.",
  4586  	//       "location": "path",
  4587  	//       "required": true,
  4588  	//       "type": "string"
  4589  	//     },
  4590  	//     "generation": {
  4591  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4592  	//       "format": "uint64",
  4593  	//       "location": "query",
  4594  	//       "type": "string"
  4595  	//     },
  4596  	//     "object": {
  4597  	//       "description": "Name of the object.",
  4598  	//       "location": "path",
  4599  	//       "required": true,
  4600  	//       "type": "string"
  4601  	//     }
  4602  	//   },
  4603  	//   "path": "b/{bucket}/o/{object}/acl",
  4604  	//   "request": {
  4605  	//     "$ref": "ObjectAccessControl"
  4606  	//   },
  4607  	//   "response": {
  4608  	//     "$ref": "ObjectAccessControl"
  4609  	//   },
  4610  	//   "scopes": [
  4611  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  4612  	//   ]
  4613  	// }
  4614  
  4615  }
  4616  
  4617  // method id "storage.objectAccessControls.list":
  4618  
  4619  type ObjectAccessControlsListCall struct {
  4620  	s            *Service
  4621  	bucket       string
  4622  	object       string
  4623  	urlParams_   gensupport.URLParams
  4624  	ifNoneMatch_ string
  4625  	ctx_         context.Context
  4626  	header_      http.Header
  4627  }
  4628  
  4629  // List: Retrieves ACL entries on the specified object.
  4630  func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
  4631  	c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4632  	c.bucket = bucket
  4633  	c.object = object
  4634  	return c
  4635  }
  4636  
  4637  // Generation sets the optional parameter "generation": If present,
  4638  // selects a specific revision of this object (as opposed to the latest
  4639  // version, the default).
  4640  func (c *ObjectAccessControlsListCall) Generation(generation uint64) *ObjectAccessControlsListCall {
  4641  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  4642  	return c
  4643  }
  4644  
  4645  // Fields allows partial responses to be retrieved. See
  4646  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4647  // for more information.
  4648  func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
  4649  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4650  	return c
  4651  }
  4652  
  4653  // IfNoneMatch sets the optional parameter which makes the operation
  4654  // fail if the object's ETag matches the given value. This is useful for
  4655  // getting updates only after the object has changed since the last
  4656  // request. Use googleapi.IsNotModified to check whether the response
  4657  // error from Do is the result of In-None-Match.
  4658  func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
  4659  	c.ifNoneMatch_ = entityTag
  4660  	return c
  4661  }
  4662  
  4663  // Context sets the context to be used in this call's Do method. Any
  4664  // pending HTTP request will be aborted if the provided context is
  4665  // canceled.
  4666  func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
  4667  	c.ctx_ = ctx
  4668  	return c
  4669  }
  4670  
  4671  // Header returns an http.Header that can be modified by the caller to
  4672  // add HTTP headers to the request.
  4673  func (c *ObjectAccessControlsListCall) Header() http.Header {
  4674  	if c.header_ == nil {
  4675  		c.header_ = make(http.Header)
  4676  	}
  4677  	return c.header_
  4678  }
  4679  
  4680  func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  4681  	reqHeaders := make(http.Header)
  4682  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  4683  	for k, v := range c.header_ {
  4684  		reqHeaders[k] = v
  4685  	}
  4686  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4687  	if c.ifNoneMatch_ != "" {
  4688  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4689  	}
  4690  	var body io.Reader = nil
  4691  	c.urlParams_.Set("alt", alt)
  4692  	c.urlParams_.Set("prettyPrint", "false")
  4693  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  4694  	urls += "?" + c.urlParams_.Encode()
  4695  	req, err := http.NewRequest("GET", urls, body)
  4696  	if err != nil {
  4697  		return nil, err
  4698  	}
  4699  	req.Header = reqHeaders
  4700  	googleapi.Expand(req.URL, map[string]string{
  4701  		"bucket": c.bucket,
  4702  		"object": c.object,
  4703  	})
  4704  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4705  }
  4706  
  4707  // Do executes the "storage.objectAccessControls.list" call.
  4708  // Exactly one of *ObjectAccessControls or error will be non-nil. Any
  4709  // non-2xx status code is an error. Response headers are in either
  4710  // *ObjectAccessControls.ServerResponse.Header or (if a response was
  4711  // returned at all) in error.(*googleapi.Error).Header. Use
  4712  // googleapi.IsNotModified to check whether the returned error was
  4713  // because http.StatusNotModified was returned.
  4714  func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
  4715  	gensupport.SetOptions(c.urlParams_, opts...)
  4716  	res, err := c.doRequest("json")
  4717  	if res != nil && res.StatusCode == http.StatusNotModified {
  4718  		if res.Body != nil {
  4719  			res.Body.Close()
  4720  		}
  4721  		return nil, &googleapi.Error{
  4722  			Code:   res.StatusCode,
  4723  			Header: res.Header,
  4724  		}
  4725  	}
  4726  	if err != nil {
  4727  		return nil, err
  4728  	}
  4729  	defer googleapi.CloseBody(res)
  4730  	if err := googleapi.CheckResponse(res); err != nil {
  4731  		return nil, err
  4732  	}
  4733  	ret := &ObjectAccessControls{
  4734  		ServerResponse: googleapi.ServerResponse{
  4735  			Header:         res.Header,
  4736  			HTTPStatusCode: res.StatusCode,
  4737  		},
  4738  	}
  4739  	target := &ret
  4740  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4741  		return nil, err
  4742  	}
  4743  	return ret, nil
  4744  	// {
  4745  	//   "description": "Retrieves ACL entries on the specified object.",
  4746  	//   "httpMethod": "GET",
  4747  	//   "id": "storage.objectAccessControls.list",
  4748  	//   "parameterOrder": [
  4749  	//     "bucket",
  4750  	//     "object"
  4751  	//   ],
  4752  	//   "parameters": {
  4753  	//     "bucket": {
  4754  	//       "description": "Name of a bucket.",
  4755  	//       "location": "path",
  4756  	//       "required": true,
  4757  	//       "type": "string"
  4758  	//     },
  4759  	//     "generation": {
  4760  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4761  	//       "format": "uint64",
  4762  	//       "location": "query",
  4763  	//       "type": "string"
  4764  	//     },
  4765  	//     "object": {
  4766  	//       "description": "Name of the object.",
  4767  	//       "location": "path",
  4768  	//       "required": true,
  4769  	//       "type": "string"
  4770  	//     }
  4771  	//   },
  4772  	//   "path": "b/{bucket}/o/{object}/acl",
  4773  	//   "response": {
  4774  	//     "$ref": "ObjectAccessControls"
  4775  	//   },
  4776  	//   "scopes": [
  4777  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  4778  	//   ]
  4779  	// }
  4780  
  4781  }
  4782  
  4783  // method id "storage.objectAccessControls.patch":
  4784  
  4785  type ObjectAccessControlsPatchCall struct {
  4786  	s                   *Service
  4787  	bucket              string
  4788  	object              string
  4789  	entity              string
  4790  	objectaccesscontrol *ObjectAccessControl
  4791  	urlParams_          gensupport.URLParams
  4792  	ctx_                context.Context
  4793  	header_             http.Header
  4794  }
  4795  
  4796  // Patch: Updates an ACL entry on the specified object. This method
  4797  // supports patch semantics.
  4798  func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
  4799  	c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4800  	c.bucket = bucket
  4801  	c.object = object
  4802  	c.entity = entity
  4803  	c.objectaccesscontrol = objectaccesscontrol
  4804  	return c
  4805  }
  4806  
  4807  // Generation sets the optional parameter "generation": If present,
  4808  // selects a specific revision of this object (as opposed to the latest
  4809  // version, the default).
  4810  func (c *ObjectAccessControlsPatchCall) Generation(generation uint64) *ObjectAccessControlsPatchCall {
  4811  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  4812  	return c
  4813  }
  4814  
  4815  // Fields allows partial responses to be retrieved. See
  4816  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4817  // for more information.
  4818  func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
  4819  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4820  	return c
  4821  }
  4822  
  4823  // Context sets the context to be used in this call's Do method. Any
  4824  // pending HTTP request will be aborted if the provided context is
  4825  // canceled.
  4826  func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
  4827  	c.ctx_ = ctx
  4828  	return c
  4829  }
  4830  
  4831  // Header returns an http.Header that can be modified by the caller to
  4832  // add HTTP headers to the request.
  4833  func (c *ObjectAccessControlsPatchCall) Header() http.Header {
  4834  	if c.header_ == nil {
  4835  		c.header_ = make(http.Header)
  4836  	}
  4837  	return c.header_
  4838  }
  4839  
  4840  func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  4841  	reqHeaders := make(http.Header)
  4842  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  4843  	for k, v := range c.header_ {
  4844  		reqHeaders[k] = v
  4845  	}
  4846  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4847  	var body io.Reader = nil
  4848  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  4849  	if err != nil {
  4850  		return nil, err
  4851  	}
  4852  	reqHeaders.Set("Content-Type", "application/json")
  4853  	c.urlParams_.Set("alt", alt)
  4854  	c.urlParams_.Set("prettyPrint", "false")
  4855  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  4856  	urls += "?" + c.urlParams_.Encode()
  4857  	req, err := http.NewRequest("PATCH", urls, body)
  4858  	if err != nil {
  4859  		return nil, err
  4860  	}
  4861  	req.Header = reqHeaders
  4862  	googleapi.Expand(req.URL, map[string]string{
  4863  		"bucket": c.bucket,
  4864  		"object": c.object,
  4865  		"entity": c.entity,
  4866  	})
  4867  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4868  }
  4869  
  4870  // Do executes the "storage.objectAccessControls.patch" call.
  4871  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  4872  // non-2xx status code is an error. Response headers are in either
  4873  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  4874  // returned at all) in error.(*googleapi.Error).Header. Use
  4875  // googleapi.IsNotModified to check whether the returned error was
  4876  // because http.StatusNotModified was returned.
  4877  func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  4878  	gensupport.SetOptions(c.urlParams_, opts...)
  4879  	res, err := c.doRequest("json")
  4880  	if res != nil && res.StatusCode == http.StatusNotModified {
  4881  		if res.Body != nil {
  4882  			res.Body.Close()
  4883  		}
  4884  		return nil, &googleapi.Error{
  4885  			Code:   res.StatusCode,
  4886  			Header: res.Header,
  4887  		}
  4888  	}
  4889  	if err != nil {
  4890  		return nil, err
  4891  	}
  4892  	defer googleapi.CloseBody(res)
  4893  	if err := googleapi.CheckResponse(res); err != nil {
  4894  		return nil, err
  4895  	}
  4896  	ret := &ObjectAccessControl{
  4897  		ServerResponse: googleapi.ServerResponse{
  4898  			Header:         res.Header,
  4899  			HTTPStatusCode: res.StatusCode,
  4900  		},
  4901  	}
  4902  	target := &ret
  4903  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4904  		return nil, err
  4905  	}
  4906  	return ret, nil
  4907  	// {
  4908  	//   "description": "Updates an ACL entry on the specified object. This method supports patch semantics.",
  4909  	//   "httpMethod": "PATCH",
  4910  	//   "id": "storage.objectAccessControls.patch",
  4911  	//   "parameterOrder": [
  4912  	//     "bucket",
  4913  	//     "object",
  4914  	//     "entity"
  4915  	//   ],
  4916  	//   "parameters": {
  4917  	//     "bucket": {
  4918  	//       "description": "Name of a bucket.",
  4919  	//       "location": "path",
  4920  	//       "required": true,
  4921  	//       "type": "string"
  4922  	//     },
  4923  	//     "entity": {
  4924  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  4925  	//       "location": "path",
  4926  	//       "required": true,
  4927  	//       "type": "string"
  4928  	//     },
  4929  	//     "generation": {
  4930  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4931  	//       "format": "uint64",
  4932  	//       "location": "query",
  4933  	//       "type": "string"
  4934  	//     },
  4935  	//     "object": {
  4936  	//       "description": "Name of the object.",
  4937  	//       "location": "path",
  4938  	//       "required": true,
  4939  	//       "type": "string"
  4940  	//     }
  4941  	//   },
  4942  	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
  4943  	//   "request": {
  4944  	//     "$ref": "ObjectAccessControl"
  4945  	//   },
  4946  	//   "response": {
  4947  	//     "$ref": "ObjectAccessControl"
  4948  	//   },
  4949  	//   "scopes": [
  4950  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  4951  	//   ]
  4952  	// }
  4953  
  4954  }
  4955  
  4956  // method id "storage.objectAccessControls.update":
  4957  
  4958  type ObjectAccessControlsUpdateCall struct {
  4959  	s                   *Service
  4960  	bucket              string
  4961  	object              string
  4962  	entity              string
  4963  	objectaccesscontrol *ObjectAccessControl
  4964  	urlParams_          gensupport.URLParams
  4965  	ctx_                context.Context
  4966  	header_             http.Header
  4967  }
  4968  
  4969  // Update: Updates an ACL entry on the specified object.
  4970  func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
  4971  	c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4972  	c.bucket = bucket
  4973  	c.object = object
  4974  	c.entity = entity
  4975  	c.objectaccesscontrol = objectaccesscontrol
  4976  	return c
  4977  }
  4978  
  4979  // Generation sets the optional parameter "generation": If present,
  4980  // selects a specific revision of this object (as opposed to the latest
  4981  // version, the default).
  4982  func (c *ObjectAccessControlsUpdateCall) Generation(generation uint64) *ObjectAccessControlsUpdateCall {
  4983  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  4984  	return c
  4985  }
  4986  
  4987  // Fields allows partial responses to be retrieved. See
  4988  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4989  // for more information.
  4990  func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
  4991  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4992  	return c
  4993  }
  4994  
  4995  // Context sets the context to be used in this call's Do method. Any
  4996  // pending HTTP request will be aborted if the provided context is
  4997  // canceled.
  4998  func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
  4999  	c.ctx_ = ctx
  5000  	return c
  5001  }
  5002  
  5003  // Header returns an http.Header that can be modified by the caller to
  5004  // add HTTP headers to the request.
  5005  func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
  5006  	if c.header_ == nil {
  5007  		c.header_ = make(http.Header)
  5008  	}
  5009  	return c.header_
  5010  }
  5011  
  5012  func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5013  	reqHeaders := make(http.Header)
  5014  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  5015  	for k, v := range c.header_ {
  5016  		reqHeaders[k] = v
  5017  	}
  5018  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5019  	var body io.Reader = nil
  5020  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  5021  	if err != nil {
  5022  		return nil, err
  5023  	}
  5024  	reqHeaders.Set("Content-Type", "application/json")
  5025  	c.urlParams_.Set("alt", alt)
  5026  	c.urlParams_.Set("prettyPrint", "false")
  5027  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  5028  	urls += "?" + c.urlParams_.Encode()
  5029  	req, err := http.NewRequest("PUT", urls, body)
  5030  	if err != nil {
  5031  		return nil, err
  5032  	}
  5033  	req.Header = reqHeaders
  5034  	googleapi.Expand(req.URL, map[string]string{
  5035  		"bucket": c.bucket,
  5036  		"object": c.object,
  5037  		"entity": c.entity,
  5038  	})
  5039  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5040  }
  5041  
  5042  // Do executes the "storage.objectAccessControls.update" call.
  5043  // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  5044  // non-2xx status code is an error. Response headers are in either
  5045  // *ObjectAccessControl.ServerResponse.Header or (if a response was
  5046  // returned at all) in error.(*googleapi.Error).Header. Use
  5047  // googleapi.IsNotModified to check whether the returned error was
  5048  // because http.StatusNotModified was returned.
  5049  func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  5050  	gensupport.SetOptions(c.urlParams_, opts...)
  5051  	res, err := c.doRequest("json")
  5052  	if res != nil && res.StatusCode == http.StatusNotModified {
  5053  		if res.Body != nil {
  5054  			res.Body.Close()
  5055  		}
  5056  		return nil, &googleapi.Error{
  5057  			Code:   res.StatusCode,
  5058  			Header: res.Header,
  5059  		}
  5060  	}
  5061  	if err != nil {
  5062  		return nil, err
  5063  	}
  5064  	defer googleapi.CloseBody(res)
  5065  	if err := googleapi.CheckResponse(res); err != nil {
  5066  		return nil, err
  5067  	}
  5068  	ret := &ObjectAccessControl{
  5069  		ServerResponse: googleapi.ServerResponse{
  5070  			Header:         res.Header,
  5071  			HTTPStatusCode: res.StatusCode,
  5072  		},
  5073  	}
  5074  	target := &ret
  5075  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5076  		return nil, err
  5077  	}
  5078  	return ret, nil
  5079  	// {
  5080  	//   "description": "Updates an ACL entry on the specified object.",
  5081  	//   "httpMethod": "PUT",
  5082  	//   "id": "storage.objectAccessControls.update",
  5083  	//   "parameterOrder": [
  5084  	//     "bucket",
  5085  	//     "object",
  5086  	//     "entity"
  5087  	//   ],
  5088  	//   "parameters": {
  5089  	//     "bucket": {
  5090  	//       "description": "Name of a bucket.",
  5091  	//       "location": "path",
  5092  	//       "required": true,
  5093  	//       "type": "string"
  5094  	//     },
  5095  	//     "entity": {
  5096  	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  5097  	//       "location": "path",
  5098  	//       "required": true,
  5099  	//       "type": "string"
  5100  	//     },
  5101  	//     "generation": {
  5102  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  5103  	//       "format": "uint64",
  5104  	//       "location": "query",
  5105  	//       "type": "string"
  5106  	//     },
  5107  	//     "object": {
  5108  	//       "description": "Name of the object.",
  5109  	//       "location": "path",
  5110  	//       "required": true,
  5111  	//       "type": "string"
  5112  	//     }
  5113  	//   },
  5114  	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
  5115  	//   "request": {
  5116  	//     "$ref": "ObjectAccessControl"
  5117  	//   },
  5118  	//   "response": {
  5119  	//     "$ref": "ObjectAccessControl"
  5120  	//   },
  5121  	//   "scopes": [
  5122  	//     "https://www.googleapis.com/auth/devstorage.full_control"
  5123  	//   ]
  5124  	// }
  5125  
  5126  }
  5127  
  5128  // method id "storage.objects.compose":
  5129  
  5130  type ObjectsComposeCall struct {
  5131  	s                 *Service
  5132  	destinationBucket string
  5133  	destinationObject string
  5134  	composerequest    *ComposeRequest
  5135  	urlParams_        gensupport.URLParams
  5136  	ctx_              context.Context
  5137  	header_           http.Header
  5138  }
  5139  
  5140  // Compose: Concatenates a list of existing objects into a new object in
  5141  // the same bucket.
  5142  func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
  5143  	c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5144  	c.destinationBucket = destinationBucket
  5145  	c.destinationObject = destinationObject
  5146  	c.composerequest = composerequest
  5147  	return c
  5148  }
  5149  
  5150  // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  5151  // Makes the operation conditional on whether the object's current
  5152  // generation matches the given value.
  5153  func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsComposeCall {
  5154  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  5155  	return c
  5156  }
  5157  
  5158  // IfMetagenerationMatch sets the optional parameter
  5159  // "ifMetagenerationMatch": Makes the operation conditional on whether
  5160  // the object's current metageneration matches the given value.
  5161  func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsComposeCall {
  5162  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5163  	return c
  5164  }
  5165  
  5166  // Fields allows partial responses to be retrieved. See
  5167  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5168  // for more information.
  5169  func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
  5170  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5171  	return c
  5172  }
  5173  
  5174  // Context sets the context to be used in this call's Do and Download
  5175  // methods. Any pending HTTP request will be aborted if the provided
  5176  // context is canceled.
  5177  func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
  5178  	c.ctx_ = ctx
  5179  	return c
  5180  }
  5181  
  5182  // Header returns an http.Header that can be modified by the caller to
  5183  // add HTTP headers to the request.
  5184  func (c *ObjectsComposeCall) Header() http.Header {
  5185  	if c.header_ == nil {
  5186  		c.header_ = make(http.Header)
  5187  	}
  5188  	return c.header_
  5189  }
  5190  
  5191  func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
  5192  	reqHeaders := make(http.Header)
  5193  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  5194  	for k, v := range c.header_ {
  5195  		reqHeaders[k] = v
  5196  	}
  5197  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5198  	var body io.Reader = nil
  5199  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
  5200  	if err != nil {
  5201  		return nil, err
  5202  	}
  5203  	reqHeaders.Set("Content-Type", "application/json")
  5204  	c.urlParams_.Set("alt", alt)
  5205  	c.urlParams_.Set("prettyPrint", "false")
  5206  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
  5207  	urls += "?" + c.urlParams_.Encode()
  5208  	req, err := http.NewRequest("POST", urls, body)
  5209  	if err != nil {
  5210  		return nil, err
  5211  	}
  5212  	req.Header = reqHeaders
  5213  	googleapi.Expand(req.URL, map[string]string{
  5214  		"destinationBucket": c.destinationBucket,
  5215  		"destinationObject": c.destinationObject,
  5216  	})
  5217  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5218  }
  5219  
  5220  // Download fetches the API endpoint's "media" value, instead of the normal
  5221  // API response value. If the returned error is nil, the Response is guaranteed to
  5222  // have a 2xx status code. Callers must close the Response.Body as usual.
  5223  func (c *ObjectsComposeCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  5224  	gensupport.SetOptions(c.urlParams_, opts...)
  5225  	res, err := c.doRequest("media")
  5226  	if err != nil {
  5227  		return nil, err
  5228  	}
  5229  	if err := googleapi.CheckMediaResponse(res); err != nil {
  5230  		res.Body.Close()
  5231  		return nil, err
  5232  	}
  5233  	return res, nil
  5234  }
  5235  
  5236  // Do executes the "storage.objects.compose" call.
  5237  // Exactly one of *Object or error will be non-nil. Any non-2xx status
  5238  // code is an error. Response headers are in either
  5239  // *Object.ServerResponse.Header or (if a response was returned at all)
  5240  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5241  // check whether the returned error was because http.StatusNotModified
  5242  // was returned.
  5243  func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  5244  	gensupport.SetOptions(c.urlParams_, opts...)
  5245  	res, err := c.doRequest("json")
  5246  	if res != nil && res.StatusCode == http.StatusNotModified {
  5247  		if res.Body != nil {
  5248  			res.Body.Close()
  5249  		}
  5250  		return nil, &googleapi.Error{
  5251  			Code:   res.StatusCode,
  5252  			Header: res.Header,
  5253  		}
  5254  	}
  5255  	if err != nil {
  5256  		return nil, err
  5257  	}
  5258  	defer googleapi.CloseBody(res)
  5259  	if err := googleapi.CheckResponse(res); err != nil {
  5260  		return nil, err
  5261  	}
  5262  	ret := &Object{
  5263  		ServerResponse: googleapi.ServerResponse{
  5264  			Header:         res.Header,
  5265  			HTTPStatusCode: res.StatusCode,
  5266  		},
  5267  	}
  5268  	target := &ret
  5269  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5270  		return nil, err
  5271  	}
  5272  	return ret, nil
  5273  	// {
  5274  	//   "description": "Concatenates a list of existing objects into a new object in the same bucket.",
  5275  	//   "httpMethod": "POST",
  5276  	//   "id": "storage.objects.compose",
  5277  	//   "parameterOrder": [
  5278  	//     "destinationBucket",
  5279  	//     "destinationObject"
  5280  	//   ],
  5281  	//   "parameters": {
  5282  	//     "destinationBucket": {
  5283  	//       "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
  5284  	//       "location": "path",
  5285  	//       "required": true,
  5286  	//       "type": "string"
  5287  	//     },
  5288  	//     "destinationObject": {
  5289  	//       "description": "Name of the new object.",
  5290  	//       "location": "path",
  5291  	//       "required": true,
  5292  	//       "type": "string"
  5293  	//     },
  5294  	//     "ifGenerationMatch": {
  5295  	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  5296  	//       "format": "uint64",
  5297  	//       "location": "query",
  5298  	//       "type": "string"
  5299  	//     },
  5300  	//     "ifMetagenerationMatch": {
  5301  	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  5302  	//       "format": "uint64",
  5303  	//       "location": "query",
  5304  	//       "type": "string"
  5305  	//     }
  5306  	//   },
  5307  	//   "path": "b/{destinationBucket}/o/{destinationObject}/compose",
  5308  	//   "request": {
  5309  	//     "$ref": "ComposeRequest"
  5310  	//   },
  5311  	//   "response": {
  5312  	//     "$ref": "Object"
  5313  	//   },
  5314  	//   "scopes": [
  5315  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  5316  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  5317  	//   ],
  5318  	//   "supportsMediaDownload": true
  5319  	// }
  5320  
  5321  }
  5322  
  5323  // method id "storage.objects.copy":
  5324  
  5325  type ObjectsCopyCall struct {
  5326  	s                 *Service
  5327  	sourceBucket      string
  5328  	sourceObject      string
  5329  	destinationBucket string
  5330  	destinationObject string
  5331  	object            *Object
  5332  	urlParams_        gensupport.URLParams
  5333  	ctx_              context.Context
  5334  	header_           http.Header
  5335  }
  5336  
  5337  // Copy: Copies an object to a destination in the same location.
  5338  // Optionally overrides metadata.
  5339  func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
  5340  	c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5341  	c.sourceBucket = sourceBucket
  5342  	c.sourceObject = sourceObject
  5343  	c.destinationBucket = destinationBucket
  5344  	c.destinationObject = destinationObject
  5345  	c.object = object
  5346  	return c
  5347  }
  5348  
  5349  // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  5350  // Makes the operation conditional on whether the destination object's
  5351  // current generation matches the given value.
  5352  func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsCopyCall {
  5353  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  5354  	return c
  5355  }
  5356  
  5357  // IfGenerationNotMatch sets the optional parameter
  5358  // "ifGenerationNotMatch": Makes the operation conditional on whether
  5359  // the destination object's current generation does not match the given
  5360  // value.
  5361  func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsCopyCall {
  5362  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  5363  	return c
  5364  }
  5365  
  5366  // IfMetagenerationMatch sets the optional parameter
  5367  // "ifMetagenerationMatch": Makes the operation conditional on whether
  5368  // the destination object's current metageneration matches the given
  5369  // value.
  5370  func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsCopyCall {
  5371  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5372  	return c
  5373  }
  5374  
  5375  // IfMetagenerationNotMatch sets the optional parameter
  5376  // "ifMetagenerationNotMatch": Makes the operation conditional on
  5377  // whether the destination object's current metageneration does not
  5378  // match the given value.
  5379  func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsCopyCall {
  5380  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5381  	return c
  5382  }
  5383  
  5384  // IfSourceGenerationMatch sets the optional parameter
  5385  // "ifSourceGenerationMatch": Makes the operation conditional on whether
  5386  // the source object's generation matches the given value.
  5387  func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch uint64) *ObjectsCopyCall {
  5388  	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
  5389  	return c
  5390  }
  5391  
  5392  // IfSourceGenerationNotMatch sets the optional parameter
  5393  // "ifSourceGenerationNotMatch": Makes the operation conditional on
  5394  // whether the source object's generation does not match the given
  5395  // value.
  5396  func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch uint64) *ObjectsCopyCall {
  5397  	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
  5398  	return c
  5399  }
  5400  
  5401  // IfSourceMetagenerationMatch sets the optional parameter
  5402  // "ifSourceMetagenerationMatch": Makes the operation conditional on
  5403  // whether the source object's current metageneration matches the given
  5404  // value.
  5405  func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch uint64) *ObjectsCopyCall {
  5406  	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
  5407  	return c
  5408  }
  5409  
  5410  // IfSourceMetagenerationNotMatch sets the optional parameter
  5411  // "ifSourceMetagenerationNotMatch": Makes the operation conditional on
  5412  // whether the source object's current metageneration does not match the
  5413  // given value.
  5414  func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch uint64) *ObjectsCopyCall {
  5415  	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
  5416  	return c
  5417  }
  5418  
  5419  // Projection sets the optional parameter "projection": Set of
  5420  // properties to return. Defaults to noAcl, unless the object resource
  5421  // specifies the acl property, when it defaults to full.
  5422  //
  5423  // Possible values:
  5424  //
  5425  //	"full" - Include all properties.
  5426  //	"noAcl" - Omit the acl property.
  5427  func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
  5428  	c.urlParams_.Set("projection", projection)
  5429  	return c
  5430  }
  5431  
  5432  // SourceGeneration sets the optional parameter "sourceGeneration": If
  5433  // present, selects a specific revision of the source object (as opposed
  5434  // to the latest version, the default).
  5435  func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration uint64) *ObjectsCopyCall {
  5436  	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
  5437  	return c
  5438  }
  5439  
  5440  // Fields allows partial responses to be retrieved. See
  5441  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5442  // for more information.
  5443  func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
  5444  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5445  	return c
  5446  }
  5447  
  5448  // Context sets the context to be used in this call's Do and Download
  5449  // methods. Any pending HTTP request will be aborted if the provided
  5450  // context is canceled.
  5451  func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
  5452  	c.ctx_ = ctx
  5453  	return c
  5454  }
  5455  
  5456  // Header returns an http.Header that can be modified by the caller to
  5457  // add HTTP headers to the request.
  5458  func (c *ObjectsCopyCall) Header() http.Header {
  5459  	if c.header_ == nil {
  5460  		c.header_ = make(http.Header)
  5461  	}
  5462  	return c.header_
  5463  }
  5464  
  5465  func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
  5466  	reqHeaders := make(http.Header)
  5467  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  5468  	for k, v := range c.header_ {
  5469  		reqHeaders[k] = v
  5470  	}
  5471  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5472  	var body io.Reader = nil
  5473  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
  5474  	if err != nil {
  5475  		return nil, err
  5476  	}
  5477  	reqHeaders.Set("Content-Type", "application/json")
  5478  	c.urlParams_.Set("alt", alt)
  5479  	c.urlParams_.Set("prettyPrint", "false")
  5480  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
  5481  	urls += "?" + c.urlParams_.Encode()
  5482  	req, err := http.NewRequest("POST", urls, body)
  5483  	if err != nil {
  5484  		return nil, err
  5485  	}
  5486  	req.Header = reqHeaders
  5487  	googleapi.Expand(req.URL, map[string]string{
  5488  		"sourceBucket":      c.sourceBucket,
  5489  		"sourceObject":      c.sourceObject,
  5490  		"destinationBucket": c.destinationBucket,
  5491  		"destinationObject": c.destinationObject,
  5492  	})
  5493  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5494  }
  5495  
  5496  // Download fetches the API endpoint's "media" value, instead of the normal
  5497  // API response value. If the returned error is nil, the Response is guaranteed to
  5498  // have a 2xx status code. Callers must close the Response.Body as usual.
  5499  func (c *ObjectsCopyCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  5500  	gensupport.SetOptions(c.urlParams_, opts...)
  5501  	res, err := c.doRequest("media")
  5502  	if err != nil {
  5503  		return nil, err
  5504  	}
  5505  	if err := googleapi.CheckMediaResponse(res); err != nil {
  5506  		res.Body.Close()
  5507  		return nil, err
  5508  	}
  5509  	return res, nil
  5510  }
  5511  
  5512  // Do executes the "storage.objects.copy" call.
  5513  // Exactly one of *Object or error will be non-nil. Any non-2xx status
  5514  // code is an error. Response headers are in either
  5515  // *Object.ServerResponse.Header or (if a response was returned at all)
  5516  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5517  // check whether the returned error was because http.StatusNotModified
  5518  // was returned.
  5519  func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  5520  	gensupport.SetOptions(c.urlParams_, opts...)
  5521  	res, err := c.doRequest("json")
  5522  	if res != nil && res.StatusCode == http.StatusNotModified {
  5523  		if res.Body != nil {
  5524  			res.Body.Close()
  5525  		}
  5526  		return nil, &googleapi.Error{
  5527  			Code:   res.StatusCode,
  5528  			Header: res.Header,
  5529  		}
  5530  	}
  5531  	if err != nil {
  5532  		return nil, err
  5533  	}
  5534  	defer googleapi.CloseBody(res)
  5535  	if err := googleapi.CheckResponse(res); err != nil {
  5536  		return nil, err
  5537  	}
  5538  	ret := &Object{
  5539  		ServerResponse: googleapi.ServerResponse{
  5540  			Header:         res.Header,
  5541  			HTTPStatusCode: res.StatusCode,
  5542  		},
  5543  	}
  5544  	target := &ret
  5545  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5546  		return nil, err
  5547  	}
  5548  	return ret, nil
  5549  	// {
  5550  	//   "description": "Copies an object to a destination in the same location. Optionally overrides metadata.",
  5551  	//   "httpMethod": "POST",
  5552  	//   "id": "storage.objects.copy",
  5553  	//   "parameterOrder": [
  5554  	//     "sourceBucket",
  5555  	//     "sourceObject",
  5556  	//     "destinationBucket",
  5557  	//     "destinationObject"
  5558  	//   ],
  5559  	//   "parameters": {
  5560  	//     "destinationBucket": {
  5561  	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
  5562  	//       "location": "path",
  5563  	//       "required": true,
  5564  	//       "type": "string"
  5565  	//     },
  5566  	//     "destinationObject": {
  5567  	//       "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
  5568  	//       "location": "path",
  5569  	//       "required": true,
  5570  	//       "type": "string"
  5571  	//     },
  5572  	//     "ifGenerationMatch": {
  5573  	//       "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.",
  5574  	//       "format": "uint64",
  5575  	//       "location": "query",
  5576  	//       "type": "string"
  5577  	//     },
  5578  	//     "ifGenerationNotMatch": {
  5579  	//       "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.",
  5580  	//       "format": "uint64",
  5581  	//       "location": "query",
  5582  	//       "type": "string"
  5583  	//     },
  5584  	//     "ifMetagenerationMatch": {
  5585  	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
  5586  	//       "format": "uint64",
  5587  	//       "location": "query",
  5588  	//       "type": "string"
  5589  	//     },
  5590  	//     "ifMetagenerationNotMatch": {
  5591  	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
  5592  	//       "format": "uint64",
  5593  	//       "location": "query",
  5594  	//       "type": "string"
  5595  	//     },
  5596  	//     "ifSourceGenerationMatch": {
  5597  	//       "description": "Makes the operation conditional on whether the source object's generation matches the given value.",
  5598  	//       "format": "uint64",
  5599  	//       "location": "query",
  5600  	//       "type": "string"
  5601  	//     },
  5602  	//     "ifSourceGenerationNotMatch": {
  5603  	//       "description": "Makes the operation conditional on whether the source object's generation does not match the given value.",
  5604  	//       "format": "uint64",
  5605  	//       "location": "query",
  5606  	//       "type": "string"
  5607  	//     },
  5608  	//     "ifSourceMetagenerationMatch": {
  5609  	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
  5610  	//       "format": "uint64",
  5611  	//       "location": "query",
  5612  	//       "type": "string"
  5613  	//     },
  5614  	//     "ifSourceMetagenerationNotMatch": {
  5615  	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
  5616  	//       "format": "uint64",
  5617  	//       "location": "query",
  5618  	//       "type": "string"
  5619  	//     },
  5620  	//     "projection": {
  5621  	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
  5622  	//       "enum": [
  5623  	//         "full",
  5624  	//         "noAcl"
  5625  	//       ],
  5626  	//       "enumDescriptions": [
  5627  	//         "Include all properties.",
  5628  	//         "Omit the acl property."
  5629  	//       ],
  5630  	//       "location": "query",
  5631  	//       "type": "string"
  5632  	//     },
  5633  	//     "sourceBucket": {
  5634  	//       "description": "Name of the bucket in which to find the source object.",
  5635  	//       "location": "path",
  5636  	//       "required": true,
  5637  	//       "type": "string"
  5638  	//     },
  5639  	//     "sourceGeneration": {
  5640  	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
  5641  	//       "format": "uint64",
  5642  	//       "location": "query",
  5643  	//       "type": "string"
  5644  	//     },
  5645  	//     "sourceObject": {
  5646  	//       "description": "Name of the source object.",
  5647  	//       "location": "path",
  5648  	//       "required": true,
  5649  	//       "type": "string"
  5650  	//     }
  5651  	//   },
  5652  	//   "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
  5653  	//   "request": {
  5654  	//     "$ref": "Object"
  5655  	//   },
  5656  	//   "response": {
  5657  	//     "$ref": "Object"
  5658  	//   },
  5659  	//   "scopes": [
  5660  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  5661  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  5662  	//   ],
  5663  	//   "supportsMediaDownload": true
  5664  	// }
  5665  
  5666  }
  5667  
  5668  // method id "storage.objects.delete":
  5669  
  5670  type ObjectsDeleteCall struct {
  5671  	s          *Service
  5672  	bucket     string
  5673  	object     string
  5674  	urlParams_ gensupport.URLParams
  5675  	ctx_       context.Context
  5676  	header_    http.Header
  5677  }
  5678  
  5679  // Delete: Deletes data blobs and associated metadata. Deletions are
  5680  // permanent if versioning is not enabled for the bucket, or if the
  5681  // generation parameter is used.
  5682  func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
  5683  	c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5684  	c.bucket = bucket
  5685  	c.object = object
  5686  	return c
  5687  }
  5688  
  5689  // Generation sets the optional parameter "generation": If present,
  5690  // permanently deletes a specific revision of this object (as opposed to
  5691  // the latest version, the default).
  5692  func (c *ObjectsDeleteCall) Generation(generation uint64) *ObjectsDeleteCall {
  5693  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  5694  	return c
  5695  }
  5696  
  5697  // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  5698  // Makes the operation conditional on whether the object's current
  5699  // generation matches the given value.
  5700  func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsDeleteCall {
  5701  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  5702  	return c
  5703  }
  5704  
  5705  // IfGenerationNotMatch sets the optional parameter
  5706  // "ifGenerationNotMatch": Makes the operation conditional on whether
  5707  // the object's current generation does not match the given value.
  5708  func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsDeleteCall {
  5709  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  5710  	return c
  5711  }
  5712  
  5713  // IfMetagenerationMatch sets the optional parameter
  5714  // "ifMetagenerationMatch": Makes the operation conditional on whether
  5715  // the object's current metageneration matches the given value.
  5716  func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsDeleteCall {
  5717  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5718  	return c
  5719  }
  5720  
  5721  // IfMetagenerationNotMatch sets the optional parameter
  5722  // "ifMetagenerationNotMatch": Makes the operation conditional on
  5723  // whether the object's current metageneration does not match the given
  5724  // value.
  5725  func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsDeleteCall {
  5726  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5727  	return c
  5728  }
  5729  
  5730  // Fields allows partial responses to be retrieved. See
  5731  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5732  // for more information.
  5733  func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
  5734  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5735  	return c
  5736  }
  5737  
  5738  // Context sets the context to be used in this call's Do method. Any
  5739  // pending HTTP request will be aborted if the provided context is
  5740  // canceled.
  5741  func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
  5742  	c.ctx_ = ctx
  5743  	return c
  5744  }
  5745  
  5746  // Header returns an http.Header that can be modified by the caller to
  5747  // add HTTP headers to the request.
  5748  func (c *ObjectsDeleteCall) Header() http.Header {
  5749  	if c.header_ == nil {
  5750  		c.header_ = make(http.Header)
  5751  	}
  5752  	return c.header_
  5753  }
  5754  
  5755  func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5756  	reqHeaders := make(http.Header)
  5757  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  5758  	for k, v := range c.header_ {
  5759  		reqHeaders[k] = v
  5760  	}
  5761  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5762  	var body io.Reader = nil
  5763  	c.urlParams_.Set("alt", alt)
  5764  	c.urlParams_.Set("prettyPrint", "false")
  5765  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  5766  	urls += "?" + c.urlParams_.Encode()
  5767  	req, err := http.NewRequest("DELETE", urls, body)
  5768  	if err != nil {
  5769  		return nil, err
  5770  	}
  5771  	req.Header = reqHeaders
  5772  	googleapi.Expand(req.URL, map[string]string{
  5773  		"bucket": c.bucket,
  5774  		"object": c.object,
  5775  	})
  5776  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5777  }
  5778  
  5779  // Do executes the "storage.objects.delete" call.
  5780  func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5781  	gensupport.SetOptions(c.urlParams_, opts...)
  5782  	res, err := c.doRequest("json")
  5783  	if err != nil {
  5784  		return err
  5785  	}
  5786  	defer googleapi.CloseBody(res)
  5787  	if err := googleapi.CheckResponse(res); err != nil {
  5788  		return err
  5789  	}
  5790  	return nil
  5791  	// {
  5792  	//   "description": "Deletes data blobs and associated metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
  5793  	//   "httpMethod": "DELETE",
  5794  	//   "id": "storage.objects.delete",
  5795  	//   "parameterOrder": [
  5796  	//     "bucket",
  5797  	//     "object"
  5798  	//   ],
  5799  	//   "parameters": {
  5800  	//     "bucket": {
  5801  	//       "description": "Name of the bucket in which the object resides.",
  5802  	//       "location": "path",
  5803  	//       "required": true,
  5804  	//       "type": "string"
  5805  	//     },
  5806  	//     "generation": {
  5807  	//       "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
  5808  	//       "format": "uint64",
  5809  	//       "location": "query",
  5810  	//       "type": "string"
  5811  	//     },
  5812  	//     "ifGenerationMatch": {
  5813  	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  5814  	//       "format": "uint64",
  5815  	//       "location": "query",
  5816  	//       "type": "string"
  5817  	//     },
  5818  	//     "ifGenerationNotMatch": {
  5819  	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  5820  	//       "format": "uint64",
  5821  	//       "location": "query",
  5822  	//       "type": "string"
  5823  	//     },
  5824  	//     "ifMetagenerationMatch": {
  5825  	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  5826  	//       "format": "uint64",
  5827  	//       "location": "query",
  5828  	//       "type": "string"
  5829  	//     },
  5830  	//     "ifMetagenerationNotMatch": {
  5831  	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  5832  	//       "format": "uint64",
  5833  	//       "location": "query",
  5834  	//       "type": "string"
  5835  	//     },
  5836  	//     "object": {
  5837  	//       "description": "Name of the object.",
  5838  	//       "location": "path",
  5839  	//       "required": true,
  5840  	//       "type": "string"
  5841  	//     }
  5842  	//   },
  5843  	//   "path": "b/{bucket}/o/{object}",
  5844  	//   "scopes": [
  5845  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  5846  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  5847  	//   ]
  5848  	// }
  5849  
  5850  }
  5851  
  5852  // method id "storage.objects.get":
  5853  
  5854  type ObjectsGetCall struct {
  5855  	s            *Service
  5856  	bucket       string
  5857  	object       string
  5858  	urlParams_   gensupport.URLParams
  5859  	ifNoneMatch_ string
  5860  	ctx_         context.Context
  5861  	header_      http.Header
  5862  }
  5863  
  5864  // Get: Retrieves objects or their associated metadata.
  5865  func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
  5866  	c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5867  	c.bucket = bucket
  5868  	c.object = object
  5869  	return c
  5870  }
  5871  
  5872  // Generation sets the optional parameter "generation": If present,
  5873  // selects a specific revision of this object (as opposed to the latest
  5874  // version, the default).
  5875  func (c *ObjectsGetCall) Generation(generation uint64) *ObjectsGetCall {
  5876  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  5877  	return c
  5878  }
  5879  
  5880  // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  5881  // Makes the operation conditional on whether the object's generation
  5882  // matches the given value.
  5883  func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsGetCall {
  5884  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  5885  	return c
  5886  }
  5887  
  5888  // IfGenerationNotMatch sets the optional parameter
  5889  // "ifGenerationNotMatch": Makes the operation conditional on whether
  5890  // the object's generation does not match the given value.
  5891  func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsGetCall {
  5892  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  5893  	return c
  5894  }
  5895  
  5896  // IfMetagenerationMatch sets the optional parameter
  5897  // "ifMetagenerationMatch": Makes the operation conditional on whether
  5898  // the object's current metageneration matches the given value.
  5899  func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsGetCall {
  5900  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5901  	return c
  5902  }
  5903  
  5904  // IfMetagenerationNotMatch sets the optional parameter
  5905  // "ifMetagenerationNotMatch": Makes the operation conditional on
  5906  // whether the object's current metageneration does not match the given
  5907  // value.
  5908  func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsGetCall {
  5909  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5910  	return c
  5911  }
  5912  
  5913  // Projection sets the optional parameter "projection": Set of
  5914  // properties to return. Defaults to noAcl.
  5915  //
  5916  // Possible values:
  5917  //
  5918  //	"full" - Include all properties.
  5919  //	"noAcl" - Omit the acl property.
  5920  func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
  5921  	c.urlParams_.Set("projection", projection)
  5922  	return c
  5923  }
  5924  
  5925  // Fields allows partial responses to be retrieved. See
  5926  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5927  // for more information.
  5928  func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
  5929  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5930  	return c
  5931  }
  5932  
  5933  // IfNoneMatch sets the optional parameter which makes the operation
  5934  // fail if the object's ETag matches the given value. This is useful for
  5935  // getting updates only after the object has changed since the last
  5936  // request. Use googleapi.IsNotModified to check whether the response
  5937  // error from Do is the result of In-None-Match.
  5938  func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
  5939  	c.ifNoneMatch_ = entityTag
  5940  	return c
  5941  }
  5942  
  5943  // Context sets the context to be used in this call's Do and Download
  5944  // methods. Any pending HTTP request will be aborted if the provided
  5945  // context is canceled.
  5946  func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
  5947  	c.ctx_ = ctx
  5948  	return c
  5949  }
  5950  
  5951  // Header returns an http.Header that can be modified by the caller to
  5952  // add HTTP headers to the request.
  5953  func (c *ObjectsGetCall) Header() http.Header {
  5954  	if c.header_ == nil {
  5955  		c.header_ = make(http.Header)
  5956  	}
  5957  	return c.header_
  5958  }
  5959  
  5960  func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
  5961  	reqHeaders := make(http.Header)
  5962  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  5963  	for k, v := range c.header_ {
  5964  		reqHeaders[k] = v
  5965  	}
  5966  	reqHeaders.Set("User-Agent", c.s.userAgent())
  5967  	if c.ifNoneMatch_ != "" {
  5968  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5969  	}
  5970  	var body io.Reader = nil
  5971  	c.urlParams_.Set("alt", alt)
  5972  	c.urlParams_.Set("prettyPrint", "false")
  5973  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  5974  	urls += "?" + c.urlParams_.Encode()
  5975  	req, err := http.NewRequest("GET", urls, body)
  5976  	if err != nil {
  5977  		return nil, err
  5978  	}
  5979  	req.Header = reqHeaders
  5980  	googleapi.Expand(req.URL, map[string]string{
  5981  		"bucket": c.bucket,
  5982  		"object": c.object,
  5983  	})
  5984  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5985  }
  5986  
  5987  // Download fetches the API endpoint's "media" value, instead of the normal
  5988  // API response value. If the returned error is nil, the Response is guaranteed to
  5989  // have a 2xx status code. Callers must close the Response.Body as usual.
  5990  func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  5991  	gensupport.SetOptions(c.urlParams_, opts...)
  5992  	res, err := c.doRequest("media")
  5993  	if err != nil {
  5994  		return nil, err
  5995  	}
  5996  	if err := googleapi.CheckMediaResponse(res); err != nil {
  5997  		res.Body.Close()
  5998  		return nil, err
  5999  	}
  6000  	return res, nil
  6001  }
  6002  
  6003  // Do executes the "storage.objects.get" call.
  6004  // Exactly one of *Object or error will be non-nil. Any non-2xx status
  6005  // code is an error. Response headers are in either
  6006  // *Object.ServerResponse.Header or (if a response was returned at all)
  6007  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6008  // check whether the returned error was because http.StatusNotModified
  6009  // was returned.
  6010  func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  6011  	gensupport.SetOptions(c.urlParams_, opts...)
  6012  	res, err := c.doRequest("json")
  6013  	if res != nil && res.StatusCode == http.StatusNotModified {
  6014  		if res.Body != nil {
  6015  			res.Body.Close()
  6016  		}
  6017  		return nil, &googleapi.Error{
  6018  			Code:   res.StatusCode,
  6019  			Header: res.Header,
  6020  		}
  6021  	}
  6022  	if err != nil {
  6023  		return nil, err
  6024  	}
  6025  	defer googleapi.CloseBody(res)
  6026  	if err := googleapi.CheckResponse(res); err != nil {
  6027  		return nil, err
  6028  	}
  6029  	ret := &Object{
  6030  		ServerResponse: googleapi.ServerResponse{
  6031  			Header:         res.Header,
  6032  			HTTPStatusCode: res.StatusCode,
  6033  		},
  6034  	}
  6035  	target := &ret
  6036  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6037  		return nil, err
  6038  	}
  6039  	return ret, nil
  6040  	// {
  6041  	//   "description": "Retrieves objects or their associated metadata.",
  6042  	//   "httpMethod": "GET",
  6043  	//   "id": "storage.objects.get",
  6044  	//   "parameterOrder": [
  6045  	//     "bucket",
  6046  	//     "object"
  6047  	//   ],
  6048  	//   "parameters": {
  6049  	//     "bucket": {
  6050  	//       "description": "Name of the bucket in which the object resides.",
  6051  	//       "location": "path",
  6052  	//       "required": true,
  6053  	//       "type": "string"
  6054  	//     },
  6055  	//     "generation": {
  6056  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  6057  	//       "format": "uint64",
  6058  	//       "location": "query",
  6059  	//       "type": "string"
  6060  	//     },
  6061  	//     "ifGenerationMatch": {
  6062  	//       "description": "Makes the operation conditional on whether the object's generation matches the given value.",
  6063  	//       "format": "uint64",
  6064  	//       "location": "query",
  6065  	//       "type": "string"
  6066  	//     },
  6067  	//     "ifGenerationNotMatch": {
  6068  	//       "description": "Makes the operation conditional on whether the object's generation does not match the given value.",
  6069  	//       "format": "uint64",
  6070  	//       "location": "query",
  6071  	//       "type": "string"
  6072  	//     },
  6073  	//     "ifMetagenerationMatch": {
  6074  	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  6075  	//       "format": "uint64",
  6076  	//       "location": "query",
  6077  	//       "type": "string"
  6078  	//     },
  6079  	//     "ifMetagenerationNotMatch": {
  6080  	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  6081  	//       "format": "uint64",
  6082  	//       "location": "query",
  6083  	//       "type": "string"
  6084  	//     },
  6085  	//     "object": {
  6086  	//       "description": "Name of the object.",
  6087  	//       "location": "path",
  6088  	//       "required": true,
  6089  	//       "type": "string"
  6090  	//     },
  6091  	//     "projection": {
  6092  	//       "description": "Set of properties to return. Defaults to noAcl.",
  6093  	//       "enum": [
  6094  	//         "full",
  6095  	//         "noAcl"
  6096  	//       ],
  6097  	//       "enumDescriptions": [
  6098  	//         "Include all properties.",
  6099  	//         "Omit the acl property."
  6100  	//       ],
  6101  	//       "location": "query",
  6102  	//       "type": "string"
  6103  	//     }
  6104  	//   },
  6105  	//   "path": "b/{bucket}/o/{object}",
  6106  	//   "response": {
  6107  	//     "$ref": "Object"
  6108  	//   },
  6109  	//   "scopes": [
  6110  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  6111  	//     "https://www.googleapis.com/auth/devstorage.read_only",
  6112  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  6113  	//   ],
  6114  	//   "supportsMediaDownload": true
  6115  	// }
  6116  
  6117  }
  6118  
  6119  // method id "storage.objects.insert":
  6120  
  6121  type ObjectsInsertCall struct {
  6122  	s          *Service
  6123  	bucket     string
  6124  	object     *Object
  6125  	urlParams_ gensupport.URLParams
  6126  	mediaInfo_ *gensupport.MediaInfo
  6127  	ctx_       context.Context
  6128  	header_    http.Header
  6129  }
  6130  
  6131  // Insert: Stores new data blobs and associated metadata.
  6132  func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
  6133  	c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6134  	c.bucket = bucket
  6135  	c.object = object
  6136  	return c
  6137  }
  6138  
  6139  // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  6140  // Makes the operation conditional on whether the object's current
  6141  // generation matches the given value.
  6142  func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsInsertCall {
  6143  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  6144  	return c
  6145  }
  6146  
  6147  // IfGenerationNotMatch sets the optional parameter
  6148  // "ifGenerationNotMatch": Makes the operation conditional on whether
  6149  // the object's current generation does not match the given value.
  6150  func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsInsertCall {
  6151  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  6152  	return c
  6153  }
  6154  
  6155  // IfMetagenerationMatch sets the optional parameter
  6156  // "ifMetagenerationMatch": Makes the operation conditional on whether
  6157  // the object's current metageneration matches the given value.
  6158  func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsInsertCall {
  6159  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6160  	return c
  6161  }
  6162  
  6163  // IfMetagenerationNotMatch sets the optional parameter
  6164  // "ifMetagenerationNotMatch": Makes the operation conditional on
  6165  // whether the object's current metageneration does not match the given
  6166  // value.
  6167  func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsInsertCall {
  6168  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  6169  	return c
  6170  }
  6171  
  6172  // Name sets the optional parameter "name": Name of the object. Required
  6173  // when the object metadata is not otherwise provided. Overrides the
  6174  // object metadata's name value, if any.
  6175  func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
  6176  	c.urlParams_.Set("name", name)
  6177  	return c
  6178  }
  6179  
  6180  // Projection sets the optional parameter "projection": Set of
  6181  // properties to return. Defaults to noAcl, unless the object resource
  6182  // specifies the acl property, when it defaults to full.
  6183  //
  6184  // Possible values:
  6185  //
  6186  //	"full" - Include all properties.
  6187  //	"noAcl" - Omit the acl property.
  6188  func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
  6189  	c.urlParams_.Set("projection", projection)
  6190  	return c
  6191  }
  6192  
  6193  // Media specifies the media to upload in one or more chunks. The chunk
  6194  // size may be controlled by supplying a MediaOption generated by
  6195  // googleapi.ChunkSize. The chunk size defaults to
  6196  // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  6197  // upload request will be determined by sniffing the contents of r,
  6198  // unless a MediaOption generated by googleapi.ContentType is
  6199  // supplied.
  6200  // At most one of Media and ResumableMedia may be set.
  6201  func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
  6202  	if ct := c.object.ContentType; ct != "" {
  6203  		options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
  6204  	}
  6205  	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  6206  	return c
  6207  }
  6208  
  6209  // ResumableMedia specifies the media to upload in chunks and can be
  6210  // canceled with ctx.
  6211  //
  6212  // Deprecated: use Media instead.
  6213  //
  6214  // At most one of Media and ResumableMedia may be set. mediaType
  6215  // identifies the MIME media type of the upload, such as "image/png". If
  6216  // mediaType is "", it will be auto-detected. The provided ctx will
  6217  // supersede any context previously provided to the Context method.
  6218  func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
  6219  	c.ctx_ = ctx
  6220  	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  6221  	return c
  6222  }
  6223  
  6224  // ProgressUpdater provides a callback function that will be called
  6225  // after every chunk. It should be a low-latency function in order to
  6226  // not slow down the upload operation. This should only be called when
  6227  // using ResumableMedia (as opposed to Media).
  6228  func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
  6229  	c.mediaInfo_.SetProgressUpdater(pu)
  6230  	return c
  6231  }
  6232  
  6233  // Fields allows partial responses to be retrieved. See
  6234  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6235  // for more information.
  6236  func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
  6237  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6238  	return c
  6239  }
  6240  
  6241  // Context sets the context to be used in this call's Do method. Any
  6242  // pending HTTP request will be aborted if the provided context is
  6243  // canceled.
  6244  // This context will supersede any context previously provided to the
  6245  // ResumableMedia method.
  6246  func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
  6247  	c.ctx_ = ctx
  6248  	return c
  6249  }
  6250  
  6251  // Header returns an http.Header that can be modified by the caller to
  6252  // add HTTP headers to the request.
  6253  func (c *ObjectsInsertCall) Header() http.Header {
  6254  	if c.header_ == nil {
  6255  		c.header_ = make(http.Header)
  6256  	}
  6257  	return c.header_
  6258  }
  6259  
  6260  func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
  6261  	reqHeaders := make(http.Header)
  6262  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  6263  	for k, v := range c.header_ {
  6264  		reqHeaders[k] = v
  6265  	}
  6266  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6267  	var body io.Reader = nil
  6268  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
  6269  	if err != nil {
  6270  		return nil, err
  6271  	}
  6272  	reqHeaders.Set("Content-Type", "application/json")
  6273  	c.urlParams_.Set("alt", alt)
  6274  	c.urlParams_.Set("prettyPrint", "false")
  6275  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
  6276  	if c.mediaInfo_ != nil {
  6277  		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1beta2/b/{bucket}/o")
  6278  		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  6279  	}
  6280  	if body == nil {
  6281  		body = new(bytes.Buffer)
  6282  		reqHeaders.Set("Content-Type", "application/json")
  6283  	}
  6284  	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  6285  	defer cleanup()
  6286  	urls += "?" + c.urlParams_.Encode()
  6287  	req, err := http.NewRequest("POST", urls, body)
  6288  	if err != nil {
  6289  		return nil, err
  6290  	}
  6291  	req.Header = reqHeaders
  6292  	req.GetBody = getBody
  6293  	googleapi.Expand(req.URL, map[string]string{
  6294  		"bucket": c.bucket,
  6295  	})
  6296  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6297  }
  6298  
  6299  // Do executes the "storage.objects.insert" call.
  6300  // Exactly one of *Object or error will be non-nil. Any non-2xx status
  6301  // code is an error. Response headers are in either
  6302  // *Object.ServerResponse.Header or (if a response was returned at all)
  6303  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6304  // check whether the returned error was because http.StatusNotModified
  6305  // was returned.
  6306  func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  6307  	gensupport.SetOptions(c.urlParams_, opts...)
  6308  	res, err := c.doRequest("json")
  6309  	if res != nil && res.StatusCode == http.StatusNotModified {
  6310  		if res.Body != nil {
  6311  			res.Body.Close()
  6312  		}
  6313  		return nil, &googleapi.Error{
  6314  			Code:   res.StatusCode,
  6315  			Header: res.Header,
  6316  		}
  6317  	}
  6318  	if err != nil {
  6319  		return nil, err
  6320  	}
  6321  	defer googleapi.CloseBody(res)
  6322  	if err := googleapi.CheckResponse(res); err != nil {
  6323  		return nil, err
  6324  	}
  6325  	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  6326  	if rx != nil {
  6327  		rx.Client = c.s.client
  6328  		rx.UserAgent = c.s.userAgent()
  6329  		ctx := c.ctx_
  6330  		if ctx == nil {
  6331  			ctx = context.TODO()
  6332  		}
  6333  		res, err = rx.Upload(ctx)
  6334  		if err != nil {
  6335  			return nil, err
  6336  		}
  6337  		defer res.Body.Close()
  6338  		if err := googleapi.CheckResponse(res); err != nil {
  6339  			return nil, err
  6340  		}
  6341  	}
  6342  	ret := &Object{
  6343  		ServerResponse: googleapi.ServerResponse{
  6344  			Header:         res.Header,
  6345  			HTTPStatusCode: res.StatusCode,
  6346  		},
  6347  	}
  6348  	target := &ret
  6349  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6350  		return nil, err
  6351  	}
  6352  	return ret, nil
  6353  	// {
  6354  	//   "description": "Stores new data blobs and associated metadata.",
  6355  	//   "httpMethod": "POST",
  6356  	//   "id": "storage.objects.insert",
  6357  	//   "mediaUpload": {
  6358  	//     "accept": [
  6359  	//       "*/*"
  6360  	//     ],
  6361  	//     "protocols": {
  6362  	//       "resumable": {
  6363  	//         "multipart": true,
  6364  	//         "path": "/resumable/upload/storage/v1beta2/b/{bucket}/o"
  6365  	//       },
  6366  	//       "simple": {
  6367  	//         "multipart": true,
  6368  	//         "path": "/upload/storage/v1beta2/b/{bucket}/o"
  6369  	//       }
  6370  	//     }
  6371  	//   },
  6372  	//   "parameterOrder": [
  6373  	//     "bucket"
  6374  	//   ],
  6375  	//   "parameters": {
  6376  	//     "bucket": {
  6377  	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
  6378  	//       "location": "path",
  6379  	//       "required": true,
  6380  	//       "type": "string"
  6381  	//     },
  6382  	//     "ifGenerationMatch": {
  6383  	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  6384  	//       "format": "uint64",
  6385  	//       "location": "query",
  6386  	//       "type": "string"
  6387  	//     },
  6388  	//     "ifGenerationNotMatch": {
  6389  	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  6390  	//       "format": "uint64",
  6391  	//       "location": "query",
  6392  	//       "type": "string"
  6393  	//     },
  6394  	//     "ifMetagenerationMatch": {
  6395  	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  6396  	//       "format": "uint64",
  6397  	//       "location": "query",
  6398  	//       "type": "string"
  6399  	//     },
  6400  	//     "ifMetagenerationNotMatch": {
  6401  	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  6402  	//       "format": "uint64",
  6403  	//       "location": "query",
  6404  	//       "type": "string"
  6405  	//     },
  6406  	//     "name": {
  6407  	//       "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
  6408  	//       "location": "query",
  6409  	//       "type": "string"
  6410  	//     },
  6411  	//     "projection": {
  6412  	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
  6413  	//       "enum": [
  6414  	//         "full",
  6415  	//         "noAcl"
  6416  	//       ],
  6417  	//       "enumDescriptions": [
  6418  	//         "Include all properties.",
  6419  	//         "Omit the acl property."
  6420  	//       ],
  6421  	//       "location": "query",
  6422  	//       "type": "string"
  6423  	//     }
  6424  	//   },
  6425  	//   "path": "b/{bucket}/o",
  6426  	//   "request": {
  6427  	//     "$ref": "Object"
  6428  	//   },
  6429  	//   "response": {
  6430  	//     "$ref": "Object"
  6431  	//   },
  6432  	//   "scopes": [
  6433  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  6434  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  6435  	//   ],
  6436  	//   "supportsMediaDownload": true,
  6437  	//   "supportsMediaUpload": true
  6438  	// }
  6439  
  6440  }
  6441  
  6442  // method id "storage.objects.list":
  6443  
  6444  type ObjectsListCall struct {
  6445  	s            *Service
  6446  	bucket       string
  6447  	urlParams_   gensupport.URLParams
  6448  	ifNoneMatch_ string
  6449  	ctx_         context.Context
  6450  	header_      http.Header
  6451  }
  6452  
  6453  // List: Retrieves a list of objects matching the criteria.
  6454  func (r *ObjectsService) List(bucket string) *ObjectsListCall {
  6455  	c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6456  	c.bucket = bucket
  6457  	return c
  6458  }
  6459  
  6460  // Delimiter sets the optional parameter "delimiter": Returns results in
  6461  // a directory-like mode. items will contain only objects whose names,
  6462  // aside from the prefix, do not contain delimiter. Objects whose names,
  6463  // aside from the prefix, contain delimiter will have their name,
  6464  // truncated after the delimiter, returned in prefixes. Duplicate
  6465  // prefixes are omitted.
  6466  func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
  6467  	c.urlParams_.Set("delimiter", delimiter)
  6468  	return c
  6469  }
  6470  
  6471  // MaxResults sets the optional parameter "maxResults": Maximum number
  6472  // of items plus prefixes to return. As duplicate prefixes are omitted,
  6473  // fewer total results may be returned than requested.
  6474  func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
  6475  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6476  	return c
  6477  }
  6478  
  6479  // PageToken sets the optional parameter "pageToken": A
  6480  // previously-returned page token representing part of the larger set of
  6481  // results to view.
  6482  func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
  6483  	c.urlParams_.Set("pageToken", pageToken)
  6484  	return c
  6485  }
  6486  
  6487  // Prefix sets the optional parameter "prefix": Filter results to
  6488  // objects whose names begin with this prefix.
  6489  func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
  6490  	c.urlParams_.Set("prefix", prefix)
  6491  	return c
  6492  }
  6493  
  6494  // Projection sets the optional parameter "projection": Set of
  6495  // properties to return. Defaults to noAcl.
  6496  //
  6497  // Possible values:
  6498  //
  6499  //	"full" - Include all properties.
  6500  //	"noAcl" - Omit the acl property.
  6501  func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
  6502  	c.urlParams_.Set("projection", projection)
  6503  	return c
  6504  }
  6505  
  6506  // Versions sets the optional parameter "versions": If true, lists all
  6507  // versions of a file as distinct results.
  6508  func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
  6509  	c.urlParams_.Set("versions", fmt.Sprint(versions))
  6510  	return c
  6511  }
  6512  
  6513  // Fields allows partial responses to be retrieved. See
  6514  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6515  // for more information.
  6516  func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
  6517  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6518  	return c
  6519  }
  6520  
  6521  // IfNoneMatch sets the optional parameter which makes the operation
  6522  // fail if the object's ETag matches the given value. This is useful for
  6523  // getting updates only after the object has changed since the last
  6524  // request. Use googleapi.IsNotModified to check whether the response
  6525  // error from Do is the result of In-None-Match.
  6526  func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
  6527  	c.ifNoneMatch_ = entityTag
  6528  	return c
  6529  }
  6530  
  6531  // Context sets the context to be used in this call's Do method. Any
  6532  // pending HTTP request will be aborted if the provided context is
  6533  // canceled.
  6534  func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
  6535  	c.ctx_ = ctx
  6536  	return c
  6537  }
  6538  
  6539  // Header returns an http.Header that can be modified by the caller to
  6540  // add HTTP headers to the request.
  6541  func (c *ObjectsListCall) Header() http.Header {
  6542  	if c.header_ == nil {
  6543  		c.header_ = make(http.Header)
  6544  	}
  6545  	return c.header_
  6546  }
  6547  
  6548  func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
  6549  	reqHeaders := make(http.Header)
  6550  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  6551  	for k, v := range c.header_ {
  6552  		reqHeaders[k] = v
  6553  	}
  6554  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6555  	if c.ifNoneMatch_ != "" {
  6556  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6557  	}
  6558  	var body io.Reader = nil
  6559  	c.urlParams_.Set("alt", alt)
  6560  	c.urlParams_.Set("prettyPrint", "false")
  6561  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
  6562  	urls += "?" + c.urlParams_.Encode()
  6563  	req, err := http.NewRequest("GET", urls, body)
  6564  	if err != nil {
  6565  		return nil, err
  6566  	}
  6567  	req.Header = reqHeaders
  6568  	googleapi.Expand(req.URL, map[string]string{
  6569  		"bucket": c.bucket,
  6570  	})
  6571  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6572  }
  6573  
  6574  // Do executes the "storage.objects.list" call.
  6575  // Exactly one of *Objects or error will be non-nil. Any non-2xx status
  6576  // code is an error. Response headers are in either
  6577  // *Objects.ServerResponse.Header or (if a response was returned at all)
  6578  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6579  // check whether the returned error was because http.StatusNotModified
  6580  // was returned.
  6581  func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
  6582  	gensupport.SetOptions(c.urlParams_, opts...)
  6583  	res, err := c.doRequest("json")
  6584  	if res != nil && res.StatusCode == http.StatusNotModified {
  6585  		if res.Body != nil {
  6586  			res.Body.Close()
  6587  		}
  6588  		return nil, &googleapi.Error{
  6589  			Code:   res.StatusCode,
  6590  			Header: res.Header,
  6591  		}
  6592  	}
  6593  	if err != nil {
  6594  		return nil, err
  6595  	}
  6596  	defer googleapi.CloseBody(res)
  6597  	if err := googleapi.CheckResponse(res); err != nil {
  6598  		return nil, err
  6599  	}
  6600  	ret := &Objects{
  6601  		ServerResponse: googleapi.ServerResponse{
  6602  			Header:         res.Header,
  6603  			HTTPStatusCode: res.StatusCode,
  6604  		},
  6605  	}
  6606  	target := &ret
  6607  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6608  		return nil, err
  6609  	}
  6610  	return ret, nil
  6611  	// {
  6612  	//   "description": "Retrieves a list of objects matching the criteria.",
  6613  	//   "httpMethod": "GET",
  6614  	//   "id": "storage.objects.list",
  6615  	//   "parameterOrder": [
  6616  	//     "bucket"
  6617  	//   ],
  6618  	//   "parameters": {
  6619  	//     "bucket": {
  6620  	//       "description": "Name of the bucket in which to look for objects.",
  6621  	//       "location": "path",
  6622  	//       "required": true,
  6623  	//       "type": "string"
  6624  	//     },
  6625  	//     "delimiter": {
  6626  	//       "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
  6627  	//       "location": "query",
  6628  	//       "type": "string"
  6629  	//     },
  6630  	//     "maxResults": {
  6631  	//       "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.",
  6632  	//       "format": "uint32",
  6633  	//       "location": "query",
  6634  	//       "minimum": "0",
  6635  	//       "type": "integer"
  6636  	//     },
  6637  	//     "pageToken": {
  6638  	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
  6639  	//       "location": "query",
  6640  	//       "type": "string"
  6641  	//     },
  6642  	//     "prefix": {
  6643  	//       "description": "Filter results to objects whose names begin with this prefix.",
  6644  	//       "location": "query",
  6645  	//       "type": "string"
  6646  	//     },
  6647  	//     "projection": {
  6648  	//       "description": "Set of properties to return. Defaults to noAcl.",
  6649  	//       "enum": [
  6650  	//         "full",
  6651  	//         "noAcl"
  6652  	//       ],
  6653  	//       "enumDescriptions": [
  6654  	//         "Include all properties.",
  6655  	//         "Omit the acl property."
  6656  	//       ],
  6657  	//       "location": "query",
  6658  	//       "type": "string"
  6659  	//     },
  6660  	//     "versions": {
  6661  	//       "description": "If true, lists all versions of a file as distinct results.",
  6662  	//       "location": "query",
  6663  	//       "type": "boolean"
  6664  	//     }
  6665  	//   },
  6666  	//   "path": "b/{bucket}/o",
  6667  	//   "response": {
  6668  	//     "$ref": "Objects"
  6669  	//   },
  6670  	//   "scopes": [
  6671  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  6672  	//     "https://www.googleapis.com/auth/devstorage.read_only",
  6673  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  6674  	//   ],
  6675  	//   "supportsSubscription": true
  6676  	// }
  6677  
  6678  }
  6679  
  6680  // Pages invokes f for each page of results.
  6681  // A non-nil error returned from f will halt the iteration.
  6682  // The provided context supersedes any context provided to the Context method.
  6683  func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
  6684  	c.ctx_ = ctx
  6685  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6686  	for {
  6687  		x, err := c.Do()
  6688  		if err != nil {
  6689  			return err
  6690  		}
  6691  		if err := f(x); err != nil {
  6692  			return err
  6693  		}
  6694  		if x.NextPageToken == "" {
  6695  			return nil
  6696  		}
  6697  		c.PageToken(x.NextPageToken)
  6698  	}
  6699  }
  6700  
  6701  // method id "storage.objects.patch":
  6702  
  6703  type ObjectsPatchCall struct {
  6704  	s          *Service
  6705  	bucket     string
  6706  	object     string
  6707  	object2    *Object
  6708  	urlParams_ gensupport.URLParams
  6709  	ctx_       context.Context
  6710  	header_    http.Header
  6711  }
  6712  
  6713  // Patch: Updates a data blob's associated metadata. This method
  6714  // supports patch semantics.
  6715  func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
  6716  	c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6717  	c.bucket = bucket
  6718  	c.object = object
  6719  	c.object2 = object2
  6720  	return c
  6721  }
  6722  
  6723  // Generation sets the optional parameter "generation": If present,
  6724  // selects a specific revision of this object (as opposed to the latest
  6725  // version, the default).
  6726  func (c *ObjectsPatchCall) Generation(generation uint64) *ObjectsPatchCall {
  6727  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  6728  	return c
  6729  }
  6730  
  6731  // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  6732  // Makes the operation conditional on whether the object's current
  6733  // generation matches the given value.
  6734  func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsPatchCall {
  6735  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  6736  	return c
  6737  }
  6738  
  6739  // IfGenerationNotMatch sets the optional parameter
  6740  // "ifGenerationNotMatch": Makes the operation conditional on whether
  6741  // the object's current generation does not match the given value.
  6742  func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsPatchCall {
  6743  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  6744  	return c
  6745  }
  6746  
  6747  // IfMetagenerationMatch sets the optional parameter
  6748  // "ifMetagenerationMatch": Makes the operation conditional on whether
  6749  // the object's current metageneration matches the given value.
  6750  func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsPatchCall {
  6751  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6752  	return c
  6753  }
  6754  
  6755  // IfMetagenerationNotMatch sets the optional parameter
  6756  // "ifMetagenerationNotMatch": Makes the operation conditional on
  6757  // whether the object's current metageneration does not match the given
  6758  // value.
  6759  func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsPatchCall {
  6760  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  6761  	return c
  6762  }
  6763  
  6764  // Projection sets the optional parameter "projection": Set of
  6765  // properties to return. Defaults to full.
  6766  //
  6767  // Possible values:
  6768  //
  6769  //	"full" - Include all properties.
  6770  //	"noAcl" - Omit the acl property.
  6771  func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
  6772  	c.urlParams_.Set("projection", projection)
  6773  	return c
  6774  }
  6775  
  6776  // Fields allows partial responses to be retrieved. See
  6777  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6778  // for more information.
  6779  func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
  6780  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6781  	return c
  6782  }
  6783  
  6784  // Context sets the context to be used in this call's Do method. Any
  6785  // pending HTTP request will be aborted if the provided context is
  6786  // canceled.
  6787  func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
  6788  	c.ctx_ = ctx
  6789  	return c
  6790  }
  6791  
  6792  // Header returns an http.Header that can be modified by the caller to
  6793  // add HTTP headers to the request.
  6794  func (c *ObjectsPatchCall) Header() http.Header {
  6795  	if c.header_ == nil {
  6796  		c.header_ = make(http.Header)
  6797  	}
  6798  	return c.header_
  6799  }
  6800  
  6801  func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
  6802  	reqHeaders := make(http.Header)
  6803  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  6804  	for k, v := range c.header_ {
  6805  		reqHeaders[k] = v
  6806  	}
  6807  	reqHeaders.Set("User-Agent", c.s.userAgent())
  6808  	var body io.Reader = nil
  6809  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
  6810  	if err != nil {
  6811  		return nil, err
  6812  	}
  6813  	reqHeaders.Set("Content-Type", "application/json")
  6814  	c.urlParams_.Set("alt", alt)
  6815  	c.urlParams_.Set("prettyPrint", "false")
  6816  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  6817  	urls += "?" + c.urlParams_.Encode()
  6818  	req, err := http.NewRequest("PATCH", urls, body)
  6819  	if err != nil {
  6820  		return nil, err
  6821  	}
  6822  	req.Header = reqHeaders
  6823  	googleapi.Expand(req.URL, map[string]string{
  6824  		"bucket": c.bucket,
  6825  		"object": c.object,
  6826  	})
  6827  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6828  }
  6829  
  6830  // Do executes the "storage.objects.patch" call.
  6831  // Exactly one of *Object or error will be non-nil. Any non-2xx status
  6832  // code is an error. Response headers are in either
  6833  // *Object.ServerResponse.Header or (if a response was returned at all)
  6834  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6835  // check whether the returned error was because http.StatusNotModified
  6836  // was returned.
  6837  func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  6838  	gensupport.SetOptions(c.urlParams_, opts...)
  6839  	res, err := c.doRequest("json")
  6840  	if res != nil && res.StatusCode == http.StatusNotModified {
  6841  		if res.Body != nil {
  6842  			res.Body.Close()
  6843  		}
  6844  		return nil, &googleapi.Error{
  6845  			Code:   res.StatusCode,
  6846  			Header: res.Header,
  6847  		}
  6848  	}
  6849  	if err != nil {
  6850  		return nil, err
  6851  	}
  6852  	defer googleapi.CloseBody(res)
  6853  	if err := googleapi.CheckResponse(res); err != nil {
  6854  		return nil, err
  6855  	}
  6856  	ret := &Object{
  6857  		ServerResponse: googleapi.ServerResponse{
  6858  			Header:         res.Header,
  6859  			HTTPStatusCode: res.StatusCode,
  6860  		},
  6861  	}
  6862  	target := &ret
  6863  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6864  		return nil, err
  6865  	}
  6866  	return ret, nil
  6867  	// {
  6868  	//   "description": "Updates a data blob's associated metadata. This method supports patch semantics.",
  6869  	//   "httpMethod": "PATCH",
  6870  	//   "id": "storage.objects.patch",
  6871  	//   "parameterOrder": [
  6872  	//     "bucket",
  6873  	//     "object"
  6874  	//   ],
  6875  	//   "parameters": {
  6876  	//     "bucket": {
  6877  	//       "description": "Name of the bucket in which the object resides.",
  6878  	//       "location": "path",
  6879  	//       "required": true,
  6880  	//       "type": "string"
  6881  	//     },
  6882  	//     "generation": {
  6883  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  6884  	//       "format": "uint64",
  6885  	//       "location": "query",
  6886  	//       "type": "string"
  6887  	//     },
  6888  	//     "ifGenerationMatch": {
  6889  	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  6890  	//       "format": "uint64",
  6891  	//       "location": "query",
  6892  	//       "type": "string"
  6893  	//     },
  6894  	//     "ifGenerationNotMatch": {
  6895  	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  6896  	//       "format": "uint64",
  6897  	//       "location": "query",
  6898  	//       "type": "string"
  6899  	//     },
  6900  	//     "ifMetagenerationMatch": {
  6901  	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  6902  	//       "format": "uint64",
  6903  	//       "location": "query",
  6904  	//       "type": "string"
  6905  	//     },
  6906  	//     "ifMetagenerationNotMatch": {
  6907  	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  6908  	//       "format": "uint64",
  6909  	//       "location": "query",
  6910  	//       "type": "string"
  6911  	//     },
  6912  	//     "object": {
  6913  	//       "description": "Name of the object.",
  6914  	//       "location": "path",
  6915  	//       "required": true,
  6916  	//       "type": "string"
  6917  	//     },
  6918  	//     "projection": {
  6919  	//       "description": "Set of properties to return. Defaults to full.",
  6920  	//       "enum": [
  6921  	//         "full",
  6922  	//         "noAcl"
  6923  	//       ],
  6924  	//       "enumDescriptions": [
  6925  	//         "Include all properties.",
  6926  	//         "Omit the acl property."
  6927  	//       ],
  6928  	//       "location": "query",
  6929  	//       "type": "string"
  6930  	//     }
  6931  	//   },
  6932  	//   "path": "b/{bucket}/o/{object}",
  6933  	//   "request": {
  6934  	//     "$ref": "Object"
  6935  	//   },
  6936  	//   "response": {
  6937  	//     "$ref": "Object"
  6938  	//   },
  6939  	//   "scopes": [
  6940  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  6941  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  6942  	//   ]
  6943  	// }
  6944  
  6945  }
  6946  
  6947  // method id "storage.objects.update":
  6948  
  6949  type ObjectsUpdateCall struct {
  6950  	s          *Service
  6951  	bucket     string
  6952  	object     string
  6953  	object2    *Object
  6954  	urlParams_ gensupport.URLParams
  6955  	ctx_       context.Context
  6956  	header_    http.Header
  6957  }
  6958  
  6959  // Update: Updates a data blob's associated metadata.
  6960  func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
  6961  	c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6962  	c.bucket = bucket
  6963  	c.object = object
  6964  	c.object2 = object2
  6965  	return c
  6966  }
  6967  
  6968  // Generation sets the optional parameter "generation": If present,
  6969  // selects a specific revision of this object (as opposed to the latest
  6970  // version, the default).
  6971  func (c *ObjectsUpdateCall) Generation(generation uint64) *ObjectsUpdateCall {
  6972  	c.urlParams_.Set("generation", fmt.Sprint(generation))
  6973  	return c
  6974  }
  6975  
  6976  // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  6977  // Makes the operation conditional on whether the object's current
  6978  // generation matches the given value.
  6979  func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsUpdateCall {
  6980  	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  6981  	return c
  6982  }
  6983  
  6984  // IfGenerationNotMatch sets the optional parameter
  6985  // "ifGenerationNotMatch": Makes the operation conditional on whether
  6986  // the object's current generation does not match the given value.
  6987  func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsUpdateCall {
  6988  	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  6989  	return c
  6990  }
  6991  
  6992  // IfMetagenerationMatch sets the optional parameter
  6993  // "ifMetagenerationMatch": Makes the operation conditional on whether
  6994  // the object's current metageneration matches the given value.
  6995  func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsUpdateCall {
  6996  	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6997  	return c
  6998  }
  6999  
  7000  // IfMetagenerationNotMatch sets the optional parameter
  7001  // "ifMetagenerationNotMatch": Makes the operation conditional on
  7002  // whether the object's current metageneration does not match the given
  7003  // value.
  7004  func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsUpdateCall {
  7005  	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  7006  	return c
  7007  }
  7008  
  7009  // Projection sets the optional parameter "projection": Set of
  7010  // properties to return. Defaults to full.
  7011  //
  7012  // Possible values:
  7013  //
  7014  //	"full" - Include all properties.
  7015  //	"noAcl" - Omit the acl property.
  7016  func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
  7017  	c.urlParams_.Set("projection", projection)
  7018  	return c
  7019  }
  7020  
  7021  // Fields allows partial responses to be retrieved. See
  7022  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7023  // for more information.
  7024  func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
  7025  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7026  	return c
  7027  }
  7028  
  7029  // Context sets the context to be used in this call's Do and Download
  7030  // methods. Any pending HTTP request will be aborted if the provided
  7031  // context is canceled.
  7032  func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
  7033  	c.ctx_ = ctx
  7034  	return c
  7035  }
  7036  
  7037  // Header returns an http.Header that can be modified by the caller to
  7038  // add HTTP headers to the request.
  7039  func (c *ObjectsUpdateCall) Header() http.Header {
  7040  	if c.header_ == nil {
  7041  		c.header_ = make(http.Header)
  7042  	}
  7043  	return c.header_
  7044  }
  7045  
  7046  func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7047  	reqHeaders := make(http.Header)
  7048  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  7049  	for k, v := range c.header_ {
  7050  		reqHeaders[k] = v
  7051  	}
  7052  	reqHeaders.Set("User-Agent", c.s.userAgent())
  7053  	var body io.Reader = nil
  7054  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
  7055  	if err != nil {
  7056  		return nil, err
  7057  	}
  7058  	reqHeaders.Set("Content-Type", "application/json")
  7059  	c.urlParams_.Set("alt", alt)
  7060  	c.urlParams_.Set("prettyPrint", "false")
  7061  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  7062  	urls += "?" + c.urlParams_.Encode()
  7063  	req, err := http.NewRequest("PUT", urls, body)
  7064  	if err != nil {
  7065  		return nil, err
  7066  	}
  7067  	req.Header = reqHeaders
  7068  	googleapi.Expand(req.URL, map[string]string{
  7069  		"bucket": c.bucket,
  7070  		"object": c.object,
  7071  	})
  7072  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7073  }
  7074  
  7075  // Download fetches the API endpoint's "media" value, instead of the normal
  7076  // API response value. If the returned error is nil, the Response is guaranteed to
  7077  // have a 2xx status code. Callers must close the Response.Body as usual.
  7078  func (c *ObjectsUpdateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  7079  	gensupport.SetOptions(c.urlParams_, opts...)
  7080  	res, err := c.doRequest("media")
  7081  	if err != nil {
  7082  		return nil, err
  7083  	}
  7084  	if err := googleapi.CheckMediaResponse(res); err != nil {
  7085  		res.Body.Close()
  7086  		return nil, err
  7087  	}
  7088  	return res, nil
  7089  }
  7090  
  7091  // Do executes the "storage.objects.update" call.
  7092  // Exactly one of *Object or error will be non-nil. Any non-2xx status
  7093  // code is an error. Response headers are in either
  7094  // *Object.ServerResponse.Header or (if a response was returned at all)
  7095  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7096  // check whether the returned error was because http.StatusNotModified
  7097  // was returned.
  7098  func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  7099  	gensupport.SetOptions(c.urlParams_, opts...)
  7100  	res, err := c.doRequest("json")
  7101  	if res != nil && res.StatusCode == http.StatusNotModified {
  7102  		if res.Body != nil {
  7103  			res.Body.Close()
  7104  		}
  7105  		return nil, &googleapi.Error{
  7106  			Code:   res.StatusCode,
  7107  			Header: res.Header,
  7108  		}
  7109  	}
  7110  	if err != nil {
  7111  		return nil, err
  7112  	}
  7113  	defer googleapi.CloseBody(res)
  7114  	if err := googleapi.CheckResponse(res); err != nil {
  7115  		return nil, err
  7116  	}
  7117  	ret := &Object{
  7118  		ServerResponse: googleapi.ServerResponse{
  7119  			Header:         res.Header,
  7120  			HTTPStatusCode: res.StatusCode,
  7121  		},
  7122  	}
  7123  	target := &ret
  7124  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7125  		return nil, err
  7126  	}
  7127  	return ret, nil
  7128  	// {
  7129  	//   "description": "Updates a data blob's associated metadata.",
  7130  	//   "httpMethod": "PUT",
  7131  	//   "id": "storage.objects.update",
  7132  	//   "parameterOrder": [
  7133  	//     "bucket",
  7134  	//     "object"
  7135  	//   ],
  7136  	//   "parameters": {
  7137  	//     "bucket": {
  7138  	//       "description": "Name of the bucket in which the object resides.",
  7139  	//       "location": "path",
  7140  	//       "required": true,
  7141  	//       "type": "string"
  7142  	//     },
  7143  	//     "generation": {
  7144  	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  7145  	//       "format": "uint64",
  7146  	//       "location": "query",
  7147  	//       "type": "string"
  7148  	//     },
  7149  	//     "ifGenerationMatch": {
  7150  	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  7151  	//       "format": "uint64",
  7152  	//       "location": "query",
  7153  	//       "type": "string"
  7154  	//     },
  7155  	//     "ifGenerationNotMatch": {
  7156  	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  7157  	//       "format": "uint64",
  7158  	//       "location": "query",
  7159  	//       "type": "string"
  7160  	//     },
  7161  	//     "ifMetagenerationMatch": {
  7162  	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  7163  	//       "format": "uint64",
  7164  	//       "location": "query",
  7165  	//       "type": "string"
  7166  	//     },
  7167  	//     "ifMetagenerationNotMatch": {
  7168  	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  7169  	//       "format": "uint64",
  7170  	//       "location": "query",
  7171  	//       "type": "string"
  7172  	//     },
  7173  	//     "object": {
  7174  	//       "description": "Name of the object.",
  7175  	//       "location": "path",
  7176  	//       "required": true,
  7177  	//       "type": "string"
  7178  	//     },
  7179  	//     "projection": {
  7180  	//       "description": "Set of properties to return. Defaults to full.",
  7181  	//       "enum": [
  7182  	//         "full",
  7183  	//         "noAcl"
  7184  	//       ],
  7185  	//       "enumDescriptions": [
  7186  	//         "Include all properties.",
  7187  	//         "Omit the acl property."
  7188  	//       ],
  7189  	//       "location": "query",
  7190  	//       "type": "string"
  7191  	//     }
  7192  	//   },
  7193  	//   "path": "b/{bucket}/o/{object}",
  7194  	//   "request": {
  7195  	//     "$ref": "Object"
  7196  	//   },
  7197  	//   "response": {
  7198  	//     "$ref": "Object"
  7199  	//   },
  7200  	//   "scopes": [
  7201  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  7202  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  7203  	//   ],
  7204  	//   "supportsMediaDownload": true
  7205  	// }
  7206  
  7207  }
  7208  
  7209  // method id "storage.objects.watchAll":
  7210  
  7211  type ObjectsWatchAllCall struct {
  7212  	s          *Service
  7213  	bucket     string
  7214  	channel    *Channel
  7215  	urlParams_ gensupport.URLParams
  7216  	ctx_       context.Context
  7217  	header_    http.Header
  7218  }
  7219  
  7220  // WatchAll: Watch for changes on all objects in a bucket.
  7221  func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
  7222  	c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7223  	c.bucket = bucket
  7224  	c.channel = channel
  7225  	return c
  7226  }
  7227  
  7228  // Delimiter sets the optional parameter "delimiter": Returns results in
  7229  // a directory-like mode. items will contain only objects whose names,
  7230  // aside from the prefix, do not contain delimiter. Objects whose names,
  7231  // aside from the prefix, contain delimiter will have their name,
  7232  // truncated after the delimiter, returned in prefixes. Duplicate
  7233  // prefixes are omitted.
  7234  func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
  7235  	c.urlParams_.Set("delimiter", delimiter)
  7236  	return c
  7237  }
  7238  
  7239  // MaxResults sets the optional parameter "maxResults": Maximum number
  7240  // of items plus prefixes to return. As duplicate prefixes are omitted,
  7241  // fewer total results may be returned than requested.
  7242  func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
  7243  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7244  	return c
  7245  }
  7246  
  7247  // PageToken sets the optional parameter "pageToken": A
  7248  // previously-returned page token representing part of the larger set of
  7249  // results to view.
  7250  func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
  7251  	c.urlParams_.Set("pageToken", pageToken)
  7252  	return c
  7253  }
  7254  
  7255  // Prefix sets the optional parameter "prefix": Filter results to
  7256  // objects whose names begin with this prefix.
  7257  func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
  7258  	c.urlParams_.Set("prefix", prefix)
  7259  	return c
  7260  }
  7261  
  7262  // Projection sets the optional parameter "projection": Set of
  7263  // properties to return. Defaults to noAcl.
  7264  //
  7265  // Possible values:
  7266  //
  7267  //	"full" - Include all properties.
  7268  //	"noAcl" - Omit the acl property.
  7269  func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
  7270  	c.urlParams_.Set("projection", projection)
  7271  	return c
  7272  }
  7273  
  7274  // Versions sets the optional parameter "versions": If true, lists all
  7275  // versions of a file as distinct results.
  7276  func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
  7277  	c.urlParams_.Set("versions", fmt.Sprint(versions))
  7278  	return c
  7279  }
  7280  
  7281  // Fields allows partial responses to be retrieved. See
  7282  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7283  // for more information.
  7284  func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
  7285  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7286  	return c
  7287  }
  7288  
  7289  // Context sets the context to be used in this call's Do method. Any
  7290  // pending HTTP request will be aborted if the provided context is
  7291  // canceled.
  7292  func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
  7293  	c.ctx_ = ctx
  7294  	return c
  7295  }
  7296  
  7297  // Header returns an http.Header that can be modified by the caller to
  7298  // add HTTP headers to the request.
  7299  func (c *ObjectsWatchAllCall) Header() http.Header {
  7300  	if c.header_ == nil {
  7301  		c.header_ = make(http.Header)
  7302  	}
  7303  	return c.header_
  7304  }
  7305  
  7306  func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
  7307  	reqHeaders := make(http.Header)
  7308  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
  7309  	for k, v := range c.header_ {
  7310  		reqHeaders[k] = v
  7311  	}
  7312  	reqHeaders.Set("User-Agent", c.s.userAgent())
  7313  	var body io.Reader = nil
  7314  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  7315  	if err != nil {
  7316  		return nil, err
  7317  	}
  7318  	reqHeaders.Set("Content-Type", "application/json")
  7319  	c.urlParams_.Set("alt", alt)
  7320  	c.urlParams_.Set("prettyPrint", "false")
  7321  	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
  7322  	urls += "?" + c.urlParams_.Encode()
  7323  	req, err := http.NewRequest("POST", urls, body)
  7324  	if err != nil {
  7325  		return nil, err
  7326  	}
  7327  	req.Header = reqHeaders
  7328  	googleapi.Expand(req.URL, map[string]string{
  7329  		"bucket": c.bucket,
  7330  	})
  7331  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7332  }
  7333  
  7334  // Do executes the "storage.objects.watchAll" call.
  7335  // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  7336  // code is an error. Response headers are in either
  7337  // *Channel.ServerResponse.Header or (if a response was returned at all)
  7338  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7339  // check whether the returned error was because http.StatusNotModified
  7340  // was returned.
  7341  func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  7342  	gensupport.SetOptions(c.urlParams_, opts...)
  7343  	res, err := c.doRequest("json")
  7344  	if res != nil && res.StatusCode == http.StatusNotModified {
  7345  		if res.Body != nil {
  7346  			res.Body.Close()
  7347  		}
  7348  		return nil, &googleapi.Error{
  7349  			Code:   res.StatusCode,
  7350  			Header: res.Header,
  7351  		}
  7352  	}
  7353  	if err != nil {
  7354  		return nil, err
  7355  	}
  7356  	defer googleapi.CloseBody(res)
  7357  	if err := googleapi.CheckResponse(res); err != nil {
  7358  		return nil, err
  7359  	}
  7360  	ret := &Channel{
  7361  		ServerResponse: googleapi.ServerResponse{
  7362  			Header:         res.Header,
  7363  			HTTPStatusCode: res.StatusCode,
  7364  		},
  7365  	}
  7366  	target := &ret
  7367  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7368  		return nil, err
  7369  	}
  7370  	return ret, nil
  7371  	// {
  7372  	//   "description": "Watch for changes on all objects in a bucket.",
  7373  	//   "httpMethod": "POST",
  7374  	//   "id": "storage.objects.watchAll",
  7375  	//   "parameterOrder": [
  7376  	//     "bucket"
  7377  	//   ],
  7378  	//   "parameters": {
  7379  	//     "bucket": {
  7380  	//       "description": "Name of the bucket in which to look for objects.",
  7381  	//       "location": "path",
  7382  	//       "required": true,
  7383  	//       "type": "string"
  7384  	//     },
  7385  	//     "delimiter": {
  7386  	//       "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
  7387  	//       "location": "query",
  7388  	//       "type": "string"
  7389  	//     },
  7390  	//     "maxResults": {
  7391  	//       "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.",
  7392  	//       "format": "uint32",
  7393  	//       "location": "query",
  7394  	//       "minimum": "0",
  7395  	//       "type": "integer"
  7396  	//     },
  7397  	//     "pageToken": {
  7398  	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
  7399  	//       "location": "query",
  7400  	//       "type": "string"
  7401  	//     },
  7402  	//     "prefix": {
  7403  	//       "description": "Filter results to objects whose names begin with this prefix.",
  7404  	//       "location": "query",
  7405  	//       "type": "string"
  7406  	//     },
  7407  	//     "projection": {
  7408  	//       "description": "Set of properties to return. Defaults to noAcl.",
  7409  	//       "enum": [
  7410  	//         "full",
  7411  	//         "noAcl"
  7412  	//       ],
  7413  	//       "enumDescriptions": [
  7414  	//         "Include all properties.",
  7415  	//         "Omit the acl property."
  7416  	//       ],
  7417  	//       "location": "query",
  7418  	//       "type": "string"
  7419  	//     },
  7420  	//     "versions": {
  7421  	//       "description": "If true, lists all versions of a file as distinct results.",
  7422  	//       "location": "query",
  7423  	//       "type": "boolean"
  7424  	//     }
  7425  	//   },
  7426  	//   "path": "b/{bucket}/o/watch",
  7427  	//   "request": {
  7428  	//     "$ref": "Channel",
  7429  	//     "parameterName": "resource"
  7430  	//   },
  7431  	//   "response": {
  7432  	//     "$ref": "Channel"
  7433  	//   },
  7434  	//   "scopes": [
  7435  	//     "https://www.googleapis.com/auth/devstorage.full_control",
  7436  	//     "https://www.googleapis.com/auth/devstorage.read_only",
  7437  	//     "https://www.googleapis.com/auth/devstorage.read_write"
  7438  	//   ],
  7439  	//   "supportsSubscription": true
  7440  	// }
  7441  
  7442  }
  7443  

View as plain text