1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package storage provides access to the Cloud Storage JSON API.
8//
9// This package is DEPRECATED. Use package cloud.google.com/go/storage instead.
10//
11// For product documentation, see: https://developers.google.com/storage/docs/json_api/
12//
13// Creating a client
14//
15// Usage example:
16//
17//   import "google.golang.org/api/storage/v1"
18//   ...
19//   ctx := context.Background()
20//   storageService, err := storage.NewService(ctx)
21//
22// In this example, Google Application Default Credentials are used for authentication.
23//
24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
25//
26// Other authentication options
27//
28// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
29//
30//   storageService, err := storage.NewService(ctx, option.WithScopes(storage.DevstorageReadWriteScope))
31//
32// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
33//
34//   storageService, err := storage.NewService(ctx, option.WithAPIKey("AIza..."))
35//
36// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
37//
38//   config := &oauth2.Config{...}
39//   // ...
40//   token, err := config.Exchange(ctx, ...)
41//   storageService, err := storage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
42//
43// See https://godoc.org/google.golang.org/api/option/ for details on options.
44package storage // import "google.golang.org/api/storage/v1"
45
46import (
47	"bytes"
48	"context"
49	"encoding/json"
50	"errors"
51	"fmt"
52	"io"
53	"net/http"
54	"net/url"
55	"strconv"
56	"strings"
57
58	googleapi "google.golang.org/api/googleapi"
59	gensupport "google.golang.org/api/internal/gensupport"
60	option "google.golang.org/api/option"
61	internaloption "google.golang.org/api/option/internaloption"
62	htransport "google.golang.org/api/transport/http"
63)
64
65// Always reference these packages, just in case the auto-generated code
66// below doesn't.
67var _ = bytes.NewBuffer
68var _ = strconv.Itoa
69var _ = fmt.Sprintf
70var _ = json.NewDecoder
71var _ = io.Copy
72var _ = url.Parse
73var _ = gensupport.MarshalJSON
74var _ = googleapi.Version
75var _ = errors.New
76var _ = strings.Replace
77var _ = context.Canceled
78var _ = internaloption.WithDefaultEndpoint
79
80const apiId = "storage:v1"
81const apiName = "storage"
82const apiVersion = "v1"
83const basePath = "https://storage.googleapis.com/storage/v1/"
84
85// OAuth2 scopes used by this API.
86const (
87	// View and manage your data across Google Cloud Platform services
88	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
89
90	// View your data across Google Cloud Platform services
91	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
92
93	// Manage your data and permissions in Google Cloud Storage
94	DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
95
96	// View your data in Google Cloud Storage
97	DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
98
99	// Manage your data in Google Cloud Storage
100	DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
101)
102
103// NewService creates a new Service.
104func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105	scopesOption := option.WithScopes(
106		"https://www.googleapis.com/auth/cloud-platform",
107		"https://www.googleapis.com/auth/cloud-platform.read-only",
108		"https://www.googleapis.com/auth/devstorage.full_control",
109		"https://www.googleapis.com/auth/devstorage.read_only",
110		"https://www.googleapis.com/auth/devstorage.read_write",
111	)
112	// NOTE: prepend, so we don't override user-specified scopes.
113	opts = append([]option.ClientOption{scopesOption}, opts...)
114	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
115	client, endpoint, err := htransport.NewClient(ctx, opts...)
116	if err != nil {
117		return nil, err
118	}
119	s, err := New(client)
120	if err != nil {
121		return nil, err
122	}
123	if endpoint != "" {
124		s.BasePath = endpoint
125	}
126	return s, nil
127}
128
129// New creates a new Service. It uses the provided http.Client for requests.
130//
131// Deprecated: please use NewService instead.
132// To provide a custom HTTP client, use option.WithHTTPClient.
133// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
134func New(client *http.Client) (*Service, error) {
135	if client == nil {
136		return nil, errors.New("client is nil")
137	}
138	s := &Service{client: client, BasePath: basePath}
139	s.BucketAccessControls = NewBucketAccessControlsService(s)
140	s.Buckets = NewBucketsService(s)
141	s.Channels = NewChannelsService(s)
142	s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
143	s.Notifications = NewNotificationsService(s)
144	s.ObjectAccessControls = NewObjectAccessControlsService(s)
145	s.Objects = NewObjectsService(s)
146	s.Projects = NewProjectsService(s)
147	return s, nil
148}
149
150type Service struct {
151	client    *http.Client
152	BasePath  string // API endpoint base URL
153	UserAgent string // optional additional User-Agent fragment
154
155	BucketAccessControls *BucketAccessControlsService
156
157	Buckets *BucketsService
158
159	Channels *ChannelsService
160
161	DefaultObjectAccessControls *DefaultObjectAccessControlsService
162
163	Notifications *NotificationsService
164
165	ObjectAccessControls *ObjectAccessControlsService
166
167	Objects *ObjectsService
168
169	Projects *ProjectsService
170}
171
172func (s *Service) userAgent() string {
173	if s.UserAgent == "" {
174		return googleapi.UserAgent
175	}
176	return googleapi.UserAgent + " " + s.UserAgent
177}
178
179func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
180	rs := &BucketAccessControlsService{s: s}
181	return rs
182}
183
184type BucketAccessControlsService struct {
185	s *Service
186}
187
188func NewBucketsService(s *Service) *BucketsService {
189	rs := &BucketsService{s: s}
190	return rs
191}
192
193type BucketsService struct {
194	s *Service
195}
196
197func NewChannelsService(s *Service) *ChannelsService {
198	rs := &ChannelsService{s: s}
199	return rs
200}
201
202type ChannelsService struct {
203	s *Service
204}
205
206func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
207	rs := &DefaultObjectAccessControlsService{s: s}
208	return rs
209}
210
211type DefaultObjectAccessControlsService struct {
212	s *Service
213}
214
215func NewNotificationsService(s *Service) *NotificationsService {
216	rs := &NotificationsService{s: s}
217	return rs
218}
219
220type NotificationsService struct {
221	s *Service
222}
223
224func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
225	rs := &ObjectAccessControlsService{s: s}
226	return rs
227}
228
229type ObjectAccessControlsService struct {
230	s *Service
231}
232
233func NewObjectsService(s *Service) *ObjectsService {
234	rs := &ObjectsService{s: s}
235	return rs
236}
237
238type ObjectsService struct {
239	s *Service
240}
241
242func NewProjectsService(s *Service) *ProjectsService {
243	rs := &ProjectsService{s: s}
244	rs.HmacKeys = NewProjectsHmacKeysService(s)
245	rs.ServiceAccount = NewProjectsServiceAccountService(s)
246	return rs
247}
248
249type ProjectsService struct {
250	s *Service
251
252	HmacKeys *ProjectsHmacKeysService
253
254	ServiceAccount *ProjectsServiceAccountService
255}
256
257func NewProjectsHmacKeysService(s *Service) *ProjectsHmacKeysService {
258	rs := &ProjectsHmacKeysService{s: s}
259	return rs
260}
261
262type ProjectsHmacKeysService struct {
263	s *Service
264}
265
266func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
267	rs := &ProjectsServiceAccountService{s: s}
268	return rs
269}
270
271type ProjectsServiceAccountService struct {
272	s *Service
273}
274
275// Bucket: A bucket.
276type Bucket struct {
277	// Acl: Access controls on the bucket.
278	Acl []*BucketAccessControl `json:"acl,omitempty"`
279
280	// Billing: The bucket's billing configuration.
281	Billing *BucketBilling `json:"billing,omitempty"`
282
283	// Cors: The bucket's Cross-Origin Resource Sharing (CORS)
284	// configuration.
285	Cors []*BucketCors `json:"cors,omitempty"`
286
287	// DefaultEventBasedHold: The default value for event-based hold on
288	// newly created objects in this bucket. Event-based hold is a way to
289	// retain objects indefinitely until an event occurs, signified by the
290	// hold's release. After being released, such objects will be subject to
291	// bucket-level retention (if any). One sample use case of this flag is
292	// for banks to hold loan documents for at least 3 years after loan is
293	// paid in full. Here, bucket-level retention is 3 years and the event
294	// is loan being paid in full. In this example, these objects will be
295	// held intact for any number of years until the event has occurred
296	// (event-based hold on the object is released) and then 3 more years
297	// after that. That means retention duration of the objects begins from
298	// the moment event-based hold transitioned from true to false. Objects
299	// under event-based hold cannot be deleted, overwritten or archived
300	// until the hold is removed.
301	DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
302
303	// DefaultObjectAcl: Default access controls to apply to new objects
304	// when no ACL is provided.
305	DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
306
307	// Encryption: Encryption configuration for a bucket.
308	Encryption *BucketEncryption `json:"encryption,omitempty"`
309
310	// Etag: HTTP 1.1 Entity tag for the bucket.
311	Etag string `json:"etag,omitempty"`
312
313	// IamConfiguration: The bucket's IAM configuration.
314	IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"`
315
316	// Id: The ID of the bucket. For buckets, the id and name properties are
317	// the same.
318	Id string `json:"id,omitempty"`
319
320	// Kind: The kind of item this is. For buckets, this is always
321	// storage#bucket.
322	Kind string `json:"kind,omitempty"`
323
324	// Labels: User-provided labels, in key/value pairs.
325	Labels map[string]string `json:"labels,omitempty"`
326
327	// Lifecycle: The bucket's lifecycle configuration. See lifecycle
328	// management for more information.
329	Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
330
331	// Location: The location of the bucket. Object data for objects in the
332	// bucket resides in physical storage within this region. Defaults to
333	// US. See the developer's guide for the authoritative list.
334	Location string `json:"location,omitempty"`
335
336	// LocationType: The type of the bucket location.
337	LocationType string `json:"locationType,omitempty"`
338
339	// Logging: The bucket's logging configuration, which defines the
340	// destination bucket and optional name prefix for the current bucket's
341	// logs.
342	Logging *BucketLogging `json:"logging,omitempty"`
343
344	// Metageneration: The metadata generation of this bucket.
345	Metageneration int64 `json:"metageneration,omitempty,string"`
346
347	// Name: The name of the bucket.
348	Name string `json:"name,omitempty"`
349
350	// Owner: The owner of the bucket. This is always the project team's
351	// owner group.
352	Owner *BucketOwner `json:"owner,omitempty"`
353
354	// ProjectNumber: The project number of the project the bucket belongs
355	// to.
356	ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
357
358	// RetentionPolicy: The bucket's retention policy. The retention policy
359	// enforces a minimum retention time for all objects contained in the
360	// bucket, based on their creation time. Any attempt to overwrite or
361	// delete objects younger than the retention period will result in a
362	// PERMISSION_DENIED error. An unlocked retention policy can be modified
363	// or removed from the bucket via a storage.buckets.update operation. A
364	// locked retention policy cannot be removed or shortened in duration
365	// for the lifetime of the bucket. Attempting to remove or decrease
366	// period of a locked retention policy will result in a
367	// PERMISSION_DENIED error.
368	RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"`
369
370	// SelfLink: The URI of this bucket.
371	SelfLink string `json:"selfLink,omitempty"`
372
373	// StorageClass: The bucket's default storage class, used whenever no
374	// storageClass is specified for a newly-created object. This defines
375	// how objects in the bucket are stored and determines the SLA and the
376	// cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD,
377	// NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If
378	// this value is not specified when the bucket is created, it will
379	// default to STANDARD. For more information, see storage classes.
380	StorageClass string `json:"storageClass,omitempty"`
381
382	// TimeCreated: The creation time of the bucket in RFC 3339 format.
383	TimeCreated string `json:"timeCreated,omitempty"`
384
385	// Updated: The modification time of the bucket in RFC 3339 format.
386	Updated string `json:"updated,omitempty"`
387
388	// Versioning: The bucket's versioning configuration.
389	Versioning *BucketVersioning `json:"versioning,omitempty"`
390
391	// Website: The bucket's website configuration, controlling how the
392	// service behaves when accessing bucket contents as a web site. See the
393	// Static Website Examples for more information.
394	Website *BucketWebsite `json:"website,omitempty"`
395
396	// ServerResponse contains the HTTP response code and headers from the
397	// server.
398	googleapi.ServerResponse `json:"-"`
399
400	// ForceSendFields is a list of field names (e.g. "Acl") to
401	// unconditionally include in API requests. By default, fields with
402	// empty values are omitted from API requests. However, any non-pointer,
403	// non-interface field appearing in ForceSendFields will be sent to the
404	// server regardless of whether the field is empty or not. This may be
405	// used to include empty fields in Patch requests.
406	ForceSendFields []string `json:"-"`
407
408	// NullFields is a list of field names (e.g. "Acl") to include in API
409	// requests with the JSON null value. By default, fields with empty
410	// values are omitted from API requests. However, any field with an
411	// empty value appearing in NullFields will be sent to the server as
412	// null. It is an error if a field in this list has a non-empty value.
413	// This may be used to include null fields in Patch requests.
414	NullFields []string `json:"-"`
415}
416
417func (s *Bucket) MarshalJSON() ([]byte, error) {
418	type NoMethod Bucket
419	raw := NoMethod(*s)
420	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
421}
422
423// BucketBilling: The bucket's billing configuration.
424type BucketBilling struct {
425	// RequesterPays: When set to true, Requester Pays is enabled for this
426	// bucket.
427	RequesterPays bool `json:"requesterPays,omitempty"`
428
429	// ForceSendFields is a list of field names (e.g. "RequesterPays") to
430	// unconditionally include in API requests. By default, fields with
431	// empty values are omitted from API requests. However, any non-pointer,
432	// non-interface field appearing in ForceSendFields will be sent to the
433	// server regardless of whether the field is empty or not. This may be
434	// used to include empty fields in Patch requests.
435	ForceSendFields []string `json:"-"`
436
437	// NullFields is a list of field names (e.g. "RequesterPays") to include
438	// in API requests with the JSON null value. By default, fields with
439	// empty values are omitted from API requests. However, any field with
440	// an empty value appearing in NullFields will be sent to the server as
441	// null. It is an error if a field in this list has a non-empty value.
442	// This may be used to include null fields in Patch requests.
443	NullFields []string `json:"-"`
444}
445
446func (s *BucketBilling) MarshalJSON() ([]byte, error) {
447	type NoMethod BucketBilling
448	raw := NoMethod(*s)
449	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
450}
451
452type BucketCors struct {
453	// MaxAgeSeconds: The value, in seconds, to return in the
454	// Access-Control-Max-Age header used in preflight responses.
455	MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
456
457	// Method: The list of HTTP methods on which to include CORS response
458	// headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list
459	// of methods, and means "any method".
460	Method []string `json:"method,omitempty"`
461
462	// Origin: The list of Origins eligible to receive CORS response
463	// headers. Note: "*" is permitted in the list of origins, and means
464	// "any Origin".
465	Origin []string `json:"origin,omitempty"`
466
467	// ResponseHeader: The list of HTTP headers other than the simple
468	// response headers to give permission for the user-agent to share
469	// across domains.
470	ResponseHeader []string `json:"responseHeader,omitempty"`
471
472	// ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
473	// unconditionally include in API requests. By default, fields with
474	// empty values are omitted from API requests. However, any non-pointer,
475	// non-interface field appearing in ForceSendFields will be sent to the
476	// server regardless of whether the field is empty or not. This may be
477	// used to include empty fields in Patch requests.
478	ForceSendFields []string `json:"-"`
479
480	// NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
481	// in API requests with the JSON null value. By default, fields with
482	// empty values are omitted from API requests. However, any field with
483	// an empty value appearing in NullFields will be sent to the server as
484	// null. It is an error if a field in this list has a non-empty value.
485	// This may be used to include null fields in Patch requests.
486	NullFields []string `json:"-"`
487}
488
489func (s *BucketCors) MarshalJSON() ([]byte, error) {
490	type NoMethod BucketCors
491	raw := NoMethod(*s)
492	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
493}
494
495// BucketEncryption: Encryption configuration for a bucket.
496type BucketEncryption struct {
497	// DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt
498	// objects inserted into this bucket, if no encryption method is
499	// specified.
500	DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
501
502	// ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName")
503	// to unconditionally include in API requests. By default, fields with
504	// empty values are omitted from API requests. However, any non-pointer,
505	// non-interface field appearing in ForceSendFields will be sent to the
506	// server regardless of whether the field is empty or not. This may be
507	// used to include empty fields in Patch requests.
508	ForceSendFields []string `json:"-"`
509
510	// NullFields is a list of field names (e.g. "DefaultKmsKeyName") to
511	// include in API requests with the JSON null value. By default, fields
512	// with empty values are omitted from API requests. However, any field
513	// with an empty value appearing in NullFields will be sent to the
514	// server as null. It is an error if a field in this list has a
515	// non-empty value. This may be used to include null fields in Patch
516	// requests.
517	NullFields []string `json:"-"`
518}
519
520func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
521	type NoMethod BucketEncryption
522	raw := NoMethod(*s)
523	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
524}
525
526// BucketIamConfiguration: The bucket's IAM configuration.
527type BucketIamConfiguration struct {
528	// BucketPolicyOnly: The bucket's uniform bucket-level access
529	// configuration. The feature was formerly known as Bucket Policy Only.
530	// For backward compatibility, this field will be populated with
531	// identical information as the uniformBucketLevelAccess field. We
532	// recommend using the uniformBucketLevelAccess field to enable and
533	// disable the feature.
534	BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"`
535
536	// UniformBucketLevelAccess: The bucket's uniform bucket-level access
537	// configuration.
538	UniformBucketLevelAccess *BucketIamConfigurationUniformBucketLevelAccess `json:"uniformBucketLevelAccess,omitempty"`
539
540	// ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to
541	// unconditionally include in API requests. By default, fields with
542	// empty values are omitted from API requests. However, any non-pointer,
543	// non-interface field appearing in ForceSendFields will be sent to the
544	// server regardless of whether the field is empty or not. This may be
545	// used to include empty fields in Patch requests.
546	ForceSendFields []string `json:"-"`
547
548	// NullFields is a list of field names (e.g. "BucketPolicyOnly") to
549	// include in API requests with the JSON null value. By default, fields
550	// with empty values are omitted from API requests. However, any field
551	// with an empty value appearing in NullFields will be sent to the
552	// server as null. It is an error if a field in this list has a
553	// non-empty value. This may be used to include null fields in Patch
554	// requests.
555	NullFields []string `json:"-"`
556}
557
558func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) {
559	type NoMethod BucketIamConfiguration
560	raw := NoMethod(*s)
561	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
562}
563
564// BucketIamConfigurationBucketPolicyOnly: The bucket's uniform
565// bucket-level access configuration. The feature was formerly known as
566// Bucket Policy Only. For backward compatibility, this field will be
567// populated with identical information as the uniformBucketLevelAccess
568// field. We recommend using the uniformBucketLevelAccess field to
569// enable and disable the feature.
570type BucketIamConfigurationBucketPolicyOnly struct {
571	// Enabled: If set, access is controlled only by bucket-level or above
572	// IAM policies.
573	Enabled bool `json:"enabled,omitempty"`
574
575	// LockedTime: The deadline for changing
576	// iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC
577	// 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed
578	// from true to false until the locked time, after which the field is
579	// immutable.
580	LockedTime string `json:"lockedTime,omitempty"`
581
582	// ForceSendFields is a list of field names (e.g. "Enabled") to
583	// unconditionally include in API requests. By default, fields with
584	// empty values are omitted from API requests. However, any non-pointer,
585	// non-interface field appearing in ForceSendFields will be sent to the
586	// server regardless of whether the field is empty or not. This may be
587	// used to include empty fields in Patch requests.
588	ForceSendFields []string `json:"-"`
589
590	// NullFields is a list of field names (e.g. "Enabled") to include in
591	// API requests with the JSON null value. By default, fields with empty
592	// values are omitted from API requests. However, any field with an
593	// empty value appearing in NullFields will be sent to the server as
594	// null. It is an error if a field in this list has a non-empty value.
595	// This may be used to include null fields in Patch requests.
596	NullFields []string `json:"-"`
597}
598
599func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) {
600	type NoMethod BucketIamConfigurationBucketPolicyOnly
601	raw := NoMethod(*s)
602	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
603}
604
605// BucketIamConfigurationUniformBucketLevelAccess: The bucket's uniform
606// bucket-level access configuration.
607type BucketIamConfigurationUniformBucketLevelAccess struct {
608	// Enabled: If set, access is controlled only by bucket-level or above
609	// IAM policies.
610	Enabled bool `json:"enabled,omitempty"`
611
612	// LockedTime: The deadline for changing
613	// iamConfiguration.uniformBucketLevelAccess.enabled from true to false
614	// in RFC 3339  format.
615	// iamConfiguration.uniformBucketLevelAccess.enabled may be changed from
616	// true to false until the locked time, after which the field is
617	// immutable.
618	LockedTime string `json:"lockedTime,omitempty"`
619
620	// ForceSendFields is a list of field names (e.g. "Enabled") to
621	// unconditionally include in API requests. By default, fields with
622	// empty values are omitted from API requests. However, any non-pointer,
623	// non-interface field appearing in ForceSendFields will be sent to the
624	// server regardless of whether the field is empty or not. This may be
625	// used to include empty fields in Patch requests.
626	ForceSendFields []string `json:"-"`
627
628	// NullFields is a list of field names (e.g. "Enabled") to include in
629	// API requests with the JSON null value. By default, fields with empty
630	// values are omitted from API requests. However, any field with an
631	// empty value appearing in NullFields will be sent to the server as
632	// null. It is an error if a field in this list has a non-empty value.
633	// This may be used to include null fields in Patch requests.
634	NullFields []string `json:"-"`
635}
636
637func (s *BucketIamConfigurationUniformBucketLevelAccess) MarshalJSON() ([]byte, error) {
638	type NoMethod BucketIamConfigurationUniformBucketLevelAccess
639	raw := NoMethod(*s)
640	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
641}
642
643// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
644// management for more information.
645type BucketLifecycle struct {
646	// Rule: A lifecycle management rule, which is made of an action to take
647	// and the condition(s) under which the action will be taken.
648	Rule []*BucketLifecycleRule `json:"rule,omitempty"`
649
650	// ForceSendFields is a list of field names (e.g. "Rule") to
651	// unconditionally include in API requests. By default, fields with
652	// empty values are omitted from API requests. However, any non-pointer,
653	// non-interface field appearing in ForceSendFields will be sent to the
654	// server regardless of whether the field is empty or not. This may be
655	// used to include empty fields in Patch requests.
656	ForceSendFields []string `json:"-"`
657
658	// NullFields is a list of field names (e.g. "Rule") to include in API
659	// requests with the JSON null value. By default, fields with empty
660	// values are omitted from API requests. However, any field with an
661	// empty value appearing in NullFields will be sent to the server as
662	// null. It is an error if a field in this list has a non-empty value.
663	// This may be used to include null fields in Patch requests.
664	NullFields []string `json:"-"`
665}
666
667func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
668	type NoMethod BucketLifecycle
669	raw := NoMethod(*s)
670	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
671}
672
673type BucketLifecycleRule struct {
674	// Action: The action to take.
675	Action *BucketLifecycleRuleAction `json:"action,omitempty"`
676
677	// Condition: The condition(s) under which the action will be taken.
678	Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
679
680	// ForceSendFields is a list of field names (e.g. "Action") to
681	// unconditionally include in API requests. By default, fields with
682	// empty values are omitted from API requests. However, any non-pointer,
683	// non-interface field appearing in ForceSendFields will be sent to the
684	// server regardless of whether the field is empty or not. This may be
685	// used to include empty fields in Patch requests.
686	ForceSendFields []string `json:"-"`
687
688	// NullFields is a list of field names (e.g. "Action") to include in API
689	// requests with the JSON null value. By default, fields with empty
690	// values are omitted from API requests. However, any field with an
691	// empty value appearing in NullFields will be sent to the server as
692	// null. It is an error if a field in this list has a non-empty value.
693	// This may be used to include null fields in Patch requests.
694	NullFields []string `json:"-"`
695}
696
697func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
698	type NoMethod BucketLifecycleRule
699	raw := NoMethod(*s)
700	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
701}
702
703// BucketLifecycleRuleAction: The action to take.
704type BucketLifecycleRuleAction struct {
705	// StorageClass: Target storage class. Required iff the type of the
706	// action is SetStorageClass.
707	StorageClass string `json:"storageClass,omitempty"`
708
709	// Type: Type of the action. Currently, only Delete and SetStorageClass
710	// are supported.
711	Type string `json:"type,omitempty"`
712
713	// ForceSendFields is a list of field names (e.g. "StorageClass") to
714	// unconditionally include in API requests. By default, fields with
715	// empty values are omitted from API requests. However, any non-pointer,
716	// non-interface field appearing in ForceSendFields will be sent to the
717	// server regardless of whether the field is empty or not. This may be
718	// used to include empty fields in Patch requests.
719	ForceSendFields []string `json:"-"`
720
721	// NullFields is a list of field names (e.g. "StorageClass") to include
722	// in API requests with the JSON null value. By default, fields with
723	// empty values are omitted from API requests. However, any field with
724	// an empty value appearing in NullFields will be sent to the server as
725	// null. It is an error if a field in this list has a non-empty value.
726	// This may be used to include null fields in Patch requests.
727	NullFields []string `json:"-"`
728}
729
730func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
731	type NoMethod BucketLifecycleRuleAction
732	raw := NoMethod(*s)
733	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
734}
735
736// BucketLifecycleRuleCondition: The condition(s) under which the action
737// will be taken.
738type BucketLifecycleRuleCondition struct {
739	// Age: Age of an object (in days). This condition is satisfied when an
740	// object reaches the specified age.
741	Age int64 `json:"age,omitempty"`
742
743	// CreatedBefore: A date in RFC 3339 format with only the date part (for
744	// instance, "2013-01-15"). This condition is satisfied when an object
745	// is created before midnight of the specified date in UTC.
746	CreatedBefore string `json:"createdBefore,omitempty"`
747
748	// IsLive: Relevant only for versioned objects. If the value is true,
749	// this condition matches live objects; if the value is false, it
750	// matches archived objects.
751	IsLive *bool `json:"isLive,omitempty"`
752
753	// MatchesPattern: A regular expression that satisfies the RE2 syntax.
754	// This condition is satisfied when the name of the object matches the
755	// RE2 pattern. Note: This feature is currently in the "Early Access"
756	// launch stage and is only available to a whitelisted set of users;
757	// that means that this feature may be changed in backward-incompatible
758	// ways and that it is not guaranteed to be released.
759	MatchesPattern string `json:"matchesPattern,omitempty"`
760
761	// MatchesStorageClass: Objects having any of the storage classes
762	// specified by this condition will be matched. Values include
763	// MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and
764	// DURABLE_REDUCED_AVAILABILITY.
765	MatchesStorageClass []string `json:"matchesStorageClass,omitempty"`
766
767	// NumNewerVersions: Relevant only for versioned objects. If the value
768	// is N, this condition is satisfied when there are at least N versions
769	// (including the live version) newer than this version of the object.
770	NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
771
772	// ForceSendFields is a list of field names (e.g. "Age") to
773	// unconditionally include in API requests. By default, fields with
774	// empty values are omitted from API requests. However, any non-pointer,
775	// non-interface field appearing in ForceSendFields will be sent to the
776	// server regardless of whether the field is empty or not. This may be
777	// used to include empty fields in Patch requests.
778	ForceSendFields []string `json:"-"`
779
780	// NullFields is a list of field names (e.g. "Age") to include in API
781	// requests with the JSON null value. By default, fields with empty
782	// values are omitted from API requests. However, any field with an
783	// empty value appearing in NullFields will be sent to the server as
784	// null. It is an error if a field in this list has a non-empty value.
785	// This may be used to include null fields in Patch requests.
786	NullFields []string `json:"-"`
787}
788
789func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
790	type NoMethod BucketLifecycleRuleCondition
791	raw := NoMethod(*s)
792	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
793}
794
795// BucketLogging: The bucket's logging configuration, which defines the
796// destination bucket and optional name prefix for the current bucket's
797// logs.
798type BucketLogging struct {
799	// LogBucket: The destination bucket where the current bucket's logs
800	// should be placed.
801	LogBucket string `json:"logBucket,omitempty"`
802
803	// LogObjectPrefix: A prefix for log object names.
804	LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
805
806	// ForceSendFields is a list of field names (e.g. "LogBucket") to
807	// unconditionally include in API requests. By default, fields with
808	// empty values are omitted from API requests. However, any non-pointer,
809	// non-interface field appearing in ForceSendFields will be sent to the
810	// server regardless of whether the field is empty or not. This may be
811	// used to include empty fields in Patch requests.
812	ForceSendFields []string `json:"-"`
813
814	// NullFields is a list of field names (e.g. "LogBucket") to include in
815	// API requests with the JSON null value. By default, fields with empty
816	// values are omitted from API requests. However, any field with an
817	// empty value appearing in NullFields will be sent to the server as
818	// null. It is an error if a field in this list has a non-empty value.
819	// This may be used to include null fields in Patch requests.
820	NullFields []string `json:"-"`
821}
822
823func (s *BucketLogging) MarshalJSON() ([]byte, error) {
824	type NoMethod BucketLogging
825	raw := NoMethod(*s)
826	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
827}
828
829// BucketOwner: The owner of the bucket. This is always the project
830// team's owner group.
831type BucketOwner struct {
832	// Entity: The entity, in the form project-owner-projectId.
833	Entity string `json:"entity,omitempty"`
834
835	// EntityId: The ID for the entity.
836	EntityId string `json:"entityId,omitempty"`
837
838	// ForceSendFields is a list of field names (e.g. "Entity") to
839	// unconditionally include in API requests. By default, fields with
840	// empty values are omitted from API requests. However, any non-pointer,
841	// non-interface field appearing in ForceSendFields will be sent to the
842	// server regardless of whether the field is empty or not. This may be
843	// used to include empty fields in Patch requests.
844	ForceSendFields []string `json:"-"`
845
846	// NullFields is a list of field names (e.g. "Entity") to include in API
847	// requests with the JSON null value. By default, fields with empty
848	// values are omitted from API requests. However, any field with an
849	// empty value appearing in NullFields will be sent to the server as
850	// null. It is an error if a field in this list has a non-empty value.
851	// This may be used to include null fields in Patch requests.
852	NullFields []string `json:"-"`
853}
854
855func (s *BucketOwner) MarshalJSON() ([]byte, error) {
856	type NoMethod BucketOwner
857	raw := NoMethod(*s)
858	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
859}
860
861// BucketRetentionPolicy: The bucket's retention policy. The retention
862// policy enforces a minimum retention time for all objects contained in
863// the bucket, based on their creation time. Any attempt to overwrite or
864// delete objects younger than the retention period will result in a
865// PERMISSION_DENIED error. An unlocked retention policy can be modified
866// or removed from the bucket via a storage.buckets.update operation. A
867// locked retention policy cannot be removed or shortened in duration
868// for the lifetime of the bucket. Attempting to remove or decrease
869// period of a locked retention policy will result in a
870// PERMISSION_DENIED error.
871type BucketRetentionPolicy struct {
872	// EffectiveTime: Server-determined value that indicates the time from
873	// which policy was enforced and effective. This value is in RFC 3339
874	// format.
875	EffectiveTime string `json:"effectiveTime,omitempty"`
876
877	// IsLocked: Once locked, an object retention policy cannot be modified.
878	IsLocked bool `json:"isLocked,omitempty"`
879
880	// RetentionPeriod: The duration in seconds that objects need to be
881	// retained. Retention duration must be greater than zero and less than
882	// 100 years. Note that enforcement of retention periods less than a day
883	// is not guaranteed. Such periods should only be used for testing
884	// purposes.
885	RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"`
886
887	// ForceSendFields is a list of field names (e.g. "EffectiveTime") to
888	// unconditionally include in API requests. By default, fields with
889	// empty values are omitted from API requests. However, any non-pointer,
890	// non-interface field appearing in ForceSendFields will be sent to the
891	// server regardless of whether the field is empty or not. This may be
892	// used to include empty fields in Patch requests.
893	ForceSendFields []string `json:"-"`
894
895	// NullFields is a list of field names (e.g. "EffectiveTime") to include
896	// in API requests with the JSON null value. By default, fields with
897	// empty values are omitted from API requests. However, any field with
898	// an empty value appearing in NullFields will be sent to the server as
899	// null. It is an error if a field in this list has a non-empty value.
900	// This may be used to include null fields in Patch requests.
901	NullFields []string `json:"-"`
902}
903
904func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) {
905	type NoMethod BucketRetentionPolicy
906	raw := NoMethod(*s)
907	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
908}
909
910// BucketVersioning: The bucket's versioning configuration.
911type BucketVersioning struct {
912	// Enabled: While set to true, versioning is fully enabled for this
913	// bucket.
914	Enabled bool `json:"enabled,omitempty"`
915
916	// ForceSendFields is a list of field names (e.g. "Enabled") to
917	// unconditionally include in API requests. By default, fields with
918	// empty values are omitted from API requests. However, any non-pointer,
919	// non-interface field appearing in ForceSendFields will be sent to the
920	// server regardless of whether the field is empty or not. This may be
921	// used to include empty fields in Patch requests.
922	ForceSendFields []string `json:"-"`
923
924	// NullFields is a list of field names (e.g. "Enabled") to include in
925	// API requests with the JSON null value. By default, fields with empty
926	// values are omitted from API requests. However, any field with an
927	// empty value appearing in NullFields will be sent to the server as
928	// null. It is an error if a field in this list has a non-empty value.
929	// This may be used to include null fields in Patch requests.
930	NullFields []string `json:"-"`
931}
932
933func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
934	type NoMethod BucketVersioning
935	raw := NoMethod(*s)
936	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
937}
938
939// BucketWebsite: The bucket's website configuration, controlling how
940// the service behaves when accessing bucket contents as a web site. See
941// the Static Website Examples for more information.
942type BucketWebsite struct {
943	// MainPageSuffix: If the requested object path is missing, the service
944	// will ensure the path has a trailing '/', append this suffix, and
945	// attempt to retrieve the resulting object. This allows the creation of
946	// index.html objects to represent directory pages.
947	MainPageSuffix string `json:"mainPageSuffix,omitempty"`
948
949	// NotFoundPage: If the requested object path is missing, and any
950	// mainPageSuffix object is missing, if applicable, the service will
951	// return the named object from this bucket as the content for a 404 Not
952	// Found result.
953	NotFoundPage string `json:"notFoundPage,omitempty"`
954
955	// ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
956	// unconditionally include in API requests. By default, fields with
957	// empty values are omitted from API requests. However, any non-pointer,
958	// non-interface field appearing in ForceSendFields will be sent to the
959	// server regardless of whether the field is empty or not. This may be
960	// used to include empty fields in Patch requests.
961	ForceSendFields []string `json:"-"`
962
963	// NullFields is a list of field names (e.g. "MainPageSuffix") to
964	// include in API requests with the JSON null value. By default, fields
965	// with empty values are omitted from API requests. However, any field
966	// with an empty value appearing in NullFields will be sent to the
967	// server as null. It is an error if a field in this list has a
968	// non-empty value. This may be used to include null fields in Patch
969	// requests.
970	NullFields []string `json:"-"`
971}
972
973func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
974	type NoMethod BucketWebsite
975	raw := NoMethod(*s)
976	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
977}
978
979// BucketAccessControl: An access-control entry.
980type BucketAccessControl struct {
981	// Bucket: The name of the bucket.
982	Bucket string `json:"bucket,omitempty"`
983
984	// Domain: The domain associated with the entity, if any.
985	Domain string `json:"domain,omitempty"`
986
987	// Email: The email address associated with the entity, if any.
988	Email string `json:"email,omitempty"`
989
990	// Entity: The entity holding the permission, in one of the following
991	// forms:
992	// - user-userId
993	// - user-email
994	// - group-groupId
995	// - group-email
996	// - domain-domain
997	// - project-team-projectId
998	// - allUsers
999	// - allAuthenticatedUsers Examples:
1000	// - The user liz@example.com would be user-liz@example.com.
1001	// - The group example@googlegroups.com would be
1002	// group-example@googlegroups.com.
1003	// - To refer to all members of the Google Apps for Business domain
1004	// example.com, the entity would be domain-example.com.
1005	Entity string `json:"entity,omitempty"`
1006
1007	// EntityId: The ID for the entity, if any.
1008	EntityId string `json:"entityId,omitempty"`
1009
1010	// Etag: HTTP 1.1 Entity tag for the access-control entry.
1011	Etag string `json:"etag,omitempty"`
1012
1013	// Id: The ID of the access-control entry.
1014	Id string `json:"id,omitempty"`
1015
1016	// Kind: The kind of item this is. For bucket access control entries,
1017	// this is always storage#bucketAccessControl.
1018	Kind string `json:"kind,omitempty"`
1019
1020	// ProjectTeam: The project team associated with the entity, if any.
1021	ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
1022
1023	// Role: The access permission for the entity.
1024	Role string `json:"role,omitempty"`
1025
1026	// SelfLink: The link to this access-control entry.
1027	SelfLink string `json:"selfLink,omitempty"`
1028
1029	// ServerResponse contains the HTTP response code and headers from the
1030	// server.
1031	googleapi.ServerResponse `json:"-"`
1032
1033	// ForceSendFields is a list of field names (e.g. "Bucket") to
1034	// unconditionally include in API requests. By default, fields with
1035	// empty values are omitted from API requests. However, any non-pointer,
1036	// non-interface field appearing in ForceSendFields will be sent to the
1037	// server regardless of whether the field is empty or not. This may be
1038	// used to include empty fields in Patch requests.
1039	ForceSendFields []string `json:"-"`
1040
1041	// NullFields is a list of field names (e.g. "Bucket") to include in API
1042	// requests with the JSON null value. By default, fields with empty
1043	// values are omitted from API requests. However, any field with an
1044	// empty value appearing in NullFields will be sent to the server as
1045	// null. It is an error if a field in this list has a non-empty value.
1046	// This may be used to include null fields in Patch requests.
1047	NullFields []string `json:"-"`
1048}
1049
1050func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
1051	type NoMethod BucketAccessControl
1052	raw := NoMethod(*s)
1053	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1054}
1055
1056// BucketAccessControlProjectTeam: The project team associated with the
1057// entity, if any.
1058type BucketAccessControlProjectTeam struct {
1059	// ProjectNumber: The project number.
1060	ProjectNumber string `json:"projectNumber,omitempty"`
1061
1062	// Team: The team.
1063	Team string `json:"team,omitempty"`
1064
1065	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1066	// unconditionally include in API requests. By default, fields with
1067	// empty values are omitted from API requests. However, any non-pointer,
1068	// non-interface field appearing in ForceSendFields will be sent to the
1069	// server regardless of whether the field is empty or not. This may be
1070	// used to include empty fields in Patch requests.
1071	ForceSendFields []string `json:"-"`
1072
1073	// NullFields is a list of field names (e.g. "ProjectNumber") to include
1074	// in API requests with the JSON null value. By default, fields with
1075	// empty values are omitted from API requests. However, any field with
1076	// an empty value appearing in NullFields will be sent to the server as
1077	// null. It is an error if a field in this list has a non-empty value.
1078	// This may be used to include null fields in Patch requests.
1079	NullFields []string `json:"-"`
1080}
1081
1082func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1083	type NoMethod BucketAccessControlProjectTeam
1084	raw := NoMethod(*s)
1085	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1086}
1087
1088// BucketAccessControls: An access-control list.
1089type BucketAccessControls struct {
1090	// Items: The list of items.
1091	Items []*BucketAccessControl `json:"items,omitempty"`
1092
1093	// Kind: The kind of item this is. For lists of bucket access control
1094	// entries, this is always storage#bucketAccessControls.
1095	Kind string `json:"kind,omitempty"`
1096
1097	// ServerResponse contains the HTTP response code and headers from the
1098	// server.
1099	googleapi.ServerResponse `json:"-"`
1100
1101	// ForceSendFields is a list of field names (e.g. "Items") to
1102	// unconditionally include in API requests. By default, fields with
1103	// empty values are omitted from API requests. However, any non-pointer,
1104	// non-interface field appearing in ForceSendFields will be sent to the
1105	// server regardless of whether the field is empty or not. This may be
1106	// used to include empty fields in Patch requests.
1107	ForceSendFields []string `json:"-"`
1108
1109	// NullFields is a list of field names (e.g. "Items") to include in API
1110	// requests with the JSON null value. By default, fields with empty
1111	// values are omitted from API requests. However, any field with an
1112	// empty value appearing in NullFields will be sent to the server as
1113	// null. It is an error if a field in this list has a non-empty value.
1114	// This may be used to include null fields in Patch requests.
1115	NullFields []string `json:"-"`
1116}
1117
1118func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
1119	type NoMethod BucketAccessControls
1120	raw := NoMethod(*s)
1121	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1122}
1123
1124// Buckets: A list of buckets.
1125type Buckets struct {
1126	// Items: The list of items.
1127	Items []*Bucket `json:"items,omitempty"`
1128
1129	// Kind: The kind of item this is. For lists of buckets, this is always
1130	// storage#buckets.
1131	Kind string `json:"kind,omitempty"`
1132
1133	// NextPageToken: The continuation token, used to page through large
1134	// result sets. Provide this value in a subsequent request to return the
1135	// next page of results.
1136	NextPageToken string `json:"nextPageToken,omitempty"`
1137
1138	// ServerResponse contains the HTTP response code and headers from the
1139	// server.
1140	googleapi.ServerResponse `json:"-"`
1141
1142	// ForceSendFields is a list of field names (e.g. "Items") to
1143	// unconditionally include in API requests. By default, fields with
1144	// empty values are omitted from API requests. However, any non-pointer,
1145	// non-interface field appearing in ForceSendFields will be sent to the
1146	// server regardless of whether the field is empty or not. This may be
1147	// used to include empty fields in Patch requests.
1148	ForceSendFields []string `json:"-"`
1149
1150	// NullFields is a list of field names (e.g. "Items") to include in API
1151	// requests with the JSON null value. By default, fields with empty
1152	// values are omitted from API requests. However, any field with an
1153	// empty value appearing in NullFields will be sent to the server as
1154	// null. It is an error if a field in this list has a non-empty value.
1155	// This may be used to include null fields in Patch requests.
1156	NullFields []string `json:"-"`
1157}
1158
1159func (s *Buckets) MarshalJSON() ([]byte, error) {
1160	type NoMethod Buckets
1161	raw := NoMethod(*s)
1162	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1163}
1164
1165// Channel: An notification channel used to watch for resource changes.
1166type Channel struct {
1167	// Address: The address where notifications are delivered for this
1168	// channel.
1169	Address string `json:"address,omitempty"`
1170
1171	// Expiration: Date and time of notification channel expiration,
1172	// expressed as a Unix timestamp, in milliseconds. Optional.
1173	Expiration int64 `json:"expiration,omitempty,string"`
1174
1175	// Id: A UUID or similar unique string that identifies this channel.
1176	Id string `json:"id,omitempty"`
1177
1178	// Kind: Identifies this as a notification channel used to watch for
1179	// changes to a resource, which is "api#channel".
1180	Kind string `json:"kind,omitempty"`
1181
1182	// Params: Additional parameters controlling delivery channel behavior.
1183	// Optional.
1184	Params map[string]string `json:"params,omitempty"`
1185
1186	// Payload: A Boolean value to indicate whether payload is wanted.
1187	// Optional.
1188	Payload bool `json:"payload,omitempty"`
1189
1190	// ResourceId: An opaque ID that identifies the resource being watched
1191	// on this channel. Stable across different API versions.
1192	ResourceId string `json:"resourceId,omitempty"`
1193
1194	// ResourceUri: A version-specific identifier for the watched resource.
1195	ResourceUri string `json:"resourceUri,omitempty"`
1196
1197	// Token: An arbitrary string delivered to the target address with each
1198	// notification delivered over this channel. Optional.
1199	Token string `json:"token,omitempty"`
1200
1201	// Type: The type of delivery mechanism used for this channel.
1202	Type string `json:"type,omitempty"`
1203
1204	// ServerResponse contains the HTTP response code and headers from the
1205	// server.
1206	googleapi.ServerResponse `json:"-"`
1207
1208	// ForceSendFields is a list of field names (e.g. "Address") to
1209	// unconditionally include in API requests. By default, fields with
1210	// empty values are omitted from API requests. However, any non-pointer,
1211	// non-interface field appearing in ForceSendFields will be sent to the
1212	// server regardless of whether the field is empty or not. This may be
1213	// used to include empty fields in Patch requests.
1214	ForceSendFields []string `json:"-"`
1215
1216	// NullFields is a list of field names (e.g. "Address") to include in
1217	// API requests with the JSON null value. By default, fields with empty
1218	// values are omitted from API requests. However, any field with an
1219	// empty value appearing in NullFields will be sent to the server as
1220	// null. It is an error if a field in this list has a non-empty value.
1221	// This may be used to include null fields in Patch requests.
1222	NullFields []string `json:"-"`
1223}
1224
1225func (s *Channel) MarshalJSON() ([]byte, error) {
1226	type NoMethod Channel
1227	raw := NoMethod(*s)
1228	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1229}
1230
1231// ComposeRequest: A Compose request.
1232type ComposeRequest struct {
1233	// Destination: Properties of the resulting object.
1234	Destination *Object `json:"destination,omitempty"`
1235
1236	// Kind: The kind of item this is.
1237	Kind string `json:"kind,omitempty"`
1238
1239	// SourceObjects: The list of source objects that will be concatenated
1240	// into a single object.
1241	SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
1242
1243	// ForceSendFields is a list of field names (e.g. "Destination") to
1244	// unconditionally include in API requests. By default, fields with
1245	// empty values are omitted from API requests. However, any non-pointer,
1246	// non-interface field appearing in ForceSendFields will be sent to the
1247	// server regardless of whether the field is empty or not. This may be
1248	// used to include empty fields in Patch requests.
1249	ForceSendFields []string `json:"-"`
1250
1251	// NullFields is a list of field names (e.g. "Destination") to include
1252	// in API requests with the JSON null value. By default, fields with
1253	// empty values are omitted from API requests. However, any field with
1254	// an empty value appearing in NullFields will be sent to the server as
1255	// null. It is an error if a field in this list has a non-empty value.
1256	// This may be used to include null fields in Patch requests.
1257	NullFields []string `json:"-"`
1258}
1259
1260func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
1261	type NoMethod ComposeRequest
1262	raw := NoMethod(*s)
1263	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1264}
1265
1266type ComposeRequestSourceObjects struct {
1267	// Generation: The generation of this object to use as the source.
1268	Generation int64 `json:"generation,omitempty,string"`
1269
1270	// Name: The source object's name. All source objects must reside in the
1271	// same bucket.
1272	Name string `json:"name,omitempty"`
1273
1274	// ObjectPreconditions: Conditions that must be met for this operation
1275	// to execute.
1276	ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
1277
1278	// ForceSendFields is a list of field names (e.g. "Generation") to
1279	// unconditionally include in API requests. By default, fields with
1280	// empty values are omitted from API requests. However, any non-pointer,
1281	// non-interface field appearing in ForceSendFields will be sent to the
1282	// server regardless of whether the field is empty or not. This may be
1283	// used to include empty fields in Patch requests.
1284	ForceSendFields []string `json:"-"`
1285
1286	// NullFields is a list of field names (e.g. "Generation") to include in
1287	// API requests with the JSON null value. By default, fields with empty
1288	// values are omitted from API requests. However, any field with an
1289	// empty value appearing in NullFields will be sent to the server as
1290	// null. It is an error if a field in this list has a non-empty value.
1291	// This may be used to include null fields in Patch requests.
1292	NullFields []string `json:"-"`
1293}
1294
1295func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
1296	type NoMethod ComposeRequestSourceObjects
1297	raw := NoMethod(*s)
1298	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1299}
1300
1301// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
1302// be met for this operation to execute.
1303type ComposeRequestSourceObjectsObjectPreconditions struct {
1304	// IfGenerationMatch: Only perform the composition if the generation of
1305	// the source object that would be used matches this value. If this
1306	// value and a generation are both specified, they must be the same
1307	// value or the call will fail.
1308	IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
1309
1310	// ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
1311	// to unconditionally include in API requests. By default, fields with
1312	// empty values are omitted from API requests. However, any non-pointer,
1313	// non-interface field appearing in ForceSendFields will be sent to the
1314	// server regardless of whether the field is empty or not. This may be
1315	// used to include empty fields in Patch requests.
1316	ForceSendFields []string `json:"-"`
1317
1318	// NullFields is a list of field names (e.g. "IfGenerationMatch") to
1319	// include in API requests with the JSON null value. By default, fields
1320	// with empty values are omitted from API requests. However, any field
1321	// with an empty value appearing in NullFields will be sent to the
1322	// server as null. It is an error if a field in this list has a
1323	// non-empty value. This may be used to include null fields in Patch
1324	// requests.
1325	NullFields []string `json:"-"`
1326}
1327
1328func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
1329	type NoMethod ComposeRequestSourceObjectsObjectPreconditions
1330	raw := NoMethod(*s)
1331	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1332}
1333
1334// Expr: Represents an expression text. Example: title: "User account
1335// presence" description: "Determines whether the request has a user
1336// account" expression: "size(request.user) > 0"
1337type Expr struct {
1338	// Description: An optional description of the expression. This is a
1339	// longer text which describes the expression, e.g. when hovered over it
1340	// in a UI.
1341	Description string `json:"description,omitempty"`
1342
1343	// Expression: Textual representation of an expression in Common
1344	// Expression Language syntax. The application context of the containing
1345	// message determines which well-known feature set of CEL is supported.
1346	Expression string `json:"expression,omitempty"`
1347
1348	// Location: An optional string indicating the location of the
1349	// expression for error reporting, e.g. a file name and a position in
1350	// the file.
1351	Location string `json:"location,omitempty"`
1352
1353	// Title: An optional title for the expression, i.e. a short string
1354	// describing its purpose. This can be used e.g. in UIs which allow to
1355	// enter the expression.
1356	Title string `json:"title,omitempty"`
1357
1358	// ForceSendFields is a list of field names (e.g. "Description") to
1359	// unconditionally include in API requests. By default, fields with
1360	// empty values are omitted from API requests. However, any non-pointer,
1361	// non-interface field appearing in ForceSendFields will be sent to the
1362	// server regardless of whether the field is empty or not. This may be
1363	// used to include empty fields in Patch requests.
1364	ForceSendFields []string `json:"-"`
1365
1366	// NullFields is a list of field names (e.g. "Description") to include
1367	// in API requests with the JSON null value. By default, fields with
1368	// empty values are omitted from API requests. However, any field with
1369	// an empty value appearing in NullFields will be sent to the server as
1370	// null. It is an error if a field in this list has a non-empty value.
1371	// This may be used to include null fields in Patch requests.
1372	NullFields []string `json:"-"`
1373}
1374
1375func (s *Expr) MarshalJSON() ([]byte, error) {
1376	type NoMethod Expr
1377	raw := NoMethod(*s)
1378	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1379}
1380
1381// HmacKey: JSON template to produce a JSON-style HMAC Key resource for
1382// Create responses.
1383type HmacKey struct {
1384	// Kind: The kind of item this is. For HMAC keys, this is always
1385	// storage#hmacKey.
1386	Kind string `json:"kind,omitempty"`
1387
1388	// Metadata: Key metadata.
1389	Metadata *HmacKeyMetadata `json:"metadata,omitempty"`
1390
1391	// Secret: HMAC secret key material.
1392	Secret string `json:"secret,omitempty"`
1393
1394	// ServerResponse contains the HTTP response code and headers from the
1395	// server.
1396	googleapi.ServerResponse `json:"-"`
1397
1398	// ForceSendFields is a list of field names (e.g. "Kind") to
1399	// unconditionally include in API requests. By default, fields with
1400	// empty values are omitted from API requests. However, any non-pointer,
1401	// non-interface field appearing in ForceSendFields will be sent to the
1402	// server regardless of whether the field is empty or not. This may be
1403	// used to include empty fields in Patch requests.
1404	ForceSendFields []string `json:"-"`
1405
1406	// NullFields is a list of field names (e.g. "Kind") to include in API
1407	// requests with the JSON null value. By default, fields with empty
1408	// values are omitted from API requests. However, any field with an
1409	// empty value appearing in NullFields will be sent to the server as
1410	// null. It is an error if a field in this list has a non-empty value.
1411	// This may be used to include null fields in Patch requests.
1412	NullFields []string `json:"-"`
1413}
1414
1415func (s *HmacKey) MarshalJSON() ([]byte, error) {
1416	type NoMethod HmacKey
1417	raw := NoMethod(*s)
1418	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1419}
1420
1421// HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key
1422// metadata resource.
1423type HmacKeyMetadata struct {
1424	// AccessId: The ID of the HMAC Key.
1425	AccessId string `json:"accessId,omitempty"`
1426
1427	// Etag: HTTP 1.1 Entity tag for the HMAC key.
1428	Etag string `json:"etag,omitempty"`
1429
1430	// Id: The ID of the HMAC key, including the Project ID and the Access
1431	// ID.
1432	Id string `json:"id,omitempty"`
1433
1434	// Kind: The kind of item this is. For HMAC Key metadata, this is always
1435	// storage#hmacKeyMetadata.
1436	Kind string `json:"kind,omitempty"`
1437
1438	// ProjectId: Project ID owning the service account to which the key
1439	// authenticates.
1440	ProjectId string `json:"projectId,omitempty"`
1441
1442	// SelfLink: The link to this resource.
1443	SelfLink string `json:"selfLink,omitempty"`
1444
1445	// ServiceAccountEmail: The email address of the key's associated
1446	// service account.
1447	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
1448
1449	// State: The state of the key. Can be one of ACTIVE, INACTIVE, or
1450	// DELETED.
1451	State string `json:"state,omitempty"`
1452
1453	// TimeCreated: The creation time of the HMAC key in RFC 3339 format.
1454	TimeCreated string `json:"timeCreated,omitempty"`
1455
1456	// Updated: The last modification time of the HMAC key metadata in RFC
1457	// 3339 format.
1458	Updated string `json:"updated,omitempty"`
1459
1460	// ServerResponse contains the HTTP response code and headers from the
1461	// server.
1462	googleapi.ServerResponse `json:"-"`
1463
1464	// ForceSendFields is a list of field names (e.g. "AccessId") to
1465	// unconditionally include in API requests. By default, fields with
1466	// empty values are omitted from API requests. However, any non-pointer,
1467	// non-interface field appearing in ForceSendFields will be sent to the
1468	// server regardless of whether the field is empty or not. This may be
1469	// used to include empty fields in Patch requests.
1470	ForceSendFields []string `json:"-"`
1471
1472	// NullFields is a list of field names (e.g. "AccessId") to include in
1473	// API requests with the JSON null value. By default, fields with empty
1474	// values are omitted from API requests. However, any field with an
1475	// empty value appearing in NullFields will be sent to the server as
1476	// null. It is an error if a field in this list has a non-empty value.
1477	// This may be used to include null fields in Patch requests.
1478	NullFields []string `json:"-"`
1479}
1480
1481func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) {
1482	type NoMethod HmacKeyMetadata
1483	raw := NoMethod(*s)
1484	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1485}
1486
1487// HmacKeysMetadata: A list of hmacKeys.
1488type HmacKeysMetadata struct {
1489	// Items: The list of items.
1490	Items []*HmacKeyMetadata `json:"items,omitempty"`
1491
1492	// Kind: The kind of item this is. For lists of hmacKeys, this is always
1493	// storage#hmacKeysMetadata.
1494	Kind string `json:"kind,omitempty"`
1495
1496	// NextPageToken: The continuation token, used to page through large
1497	// result sets. Provide this value in a subsequent request to return the
1498	// next page of results.
1499	NextPageToken string `json:"nextPageToken,omitempty"`
1500
1501	// ServerResponse contains the HTTP response code and headers from the
1502	// server.
1503	googleapi.ServerResponse `json:"-"`
1504
1505	// ForceSendFields is a list of field names (e.g. "Items") to
1506	// unconditionally include in API requests. By default, fields with
1507	// empty values are omitted from API requests. However, any non-pointer,
1508	// non-interface field appearing in ForceSendFields will be sent to the
1509	// server regardless of whether the field is empty or not. This may be
1510	// used to include empty fields in Patch requests.
1511	ForceSendFields []string `json:"-"`
1512
1513	// NullFields is a list of field names (e.g. "Items") to include in API
1514	// requests with the JSON null value. By default, fields with empty
1515	// values are omitted from API requests. However, any field with an
1516	// empty value appearing in NullFields will be sent to the server as
1517	// null. It is an error if a field in this list has a non-empty value.
1518	// This may be used to include null fields in Patch requests.
1519	NullFields []string `json:"-"`
1520}
1521
1522func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) {
1523	type NoMethod HmacKeysMetadata
1524	raw := NoMethod(*s)
1525	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1526}
1527
1528// Notification: A subscription to receive Google PubSub notifications.
1529type Notification struct {
1530	// CustomAttributes: An optional list of additional attributes to attach
1531	// to each Cloud PubSub message published for this notification
1532	// subscription.
1533	CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
1534
1535	// Etag: HTTP 1.1 Entity tag for this subscription notification.
1536	Etag string `json:"etag,omitempty"`
1537
1538	// EventTypes: If present, only send notifications about listed event
1539	// types. If empty, sent notifications for all event types.
1540	EventTypes []string `json:"event_types,omitempty"`
1541
1542	// Id: The ID of the notification.
1543	Id string `json:"id,omitempty"`
1544
1545	// Kind: The kind of item this is. For notifications, this is always
1546	// storage#notification.
1547	Kind string `json:"kind,omitempty"`
1548
1549	// ObjectNamePrefix: If present, only apply this notification
1550	// configuration to object names that begin with this prefix.
1551	ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
1552
1553	// PayloadFormat: The desired content of the Payload.
1554	PayloadFormat string `json:"payload_format,omitempty"`
1555
1556	// SelfLink: The canonical URL of this notification.
1557	SelfLink string `json:"selfLink,omitempty"`
1558
1559	// Topic: The Cloud PubSub topic to which this subscription publishes.
1560	// Formatted as:
1561	// '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
1562	// c}'
1563	Topic string `json:"topic,omitempty"`
1564
1565	// ServerResponse contains the HTTP response code and headers from the
1566	// server.
1567	googleapi.ServerResponse `json:"-"`
1568
1569	// ForceSendFields is a list of field names (e.g. "CustomAttributes") to
1570	// unconditionally include in API requests. By default, fields with
1571	// empty values are omitted from API requests. However, any non-pointer,
1572	// non-interface field appearing in ForceSendFields will be sent to the
1573	// server regardless of whether the field is empty or not. This may be
1574	// used to include empty fields in Patch requests.
1575	ForceSendFields []string `json:"-"`
1576
1577	// NullFields is a list of field names (e.g. "CustomAttributes") to
1578	// include in API requests with the JSON null value. By default, fields
1579	// with empty values are omitted from API requests. However, any field
1580	// with an empty value appearing in NullFields will be sent to the
1581	// server as null. It is an error if a field in this list has a
1582	// non-empty value. This may be used to include null fields in Patch
1583	// requests.
1584	NullFields []string `json:"-"`
1585}
1586
1587func (s *Notification) MarshalJSON() ([]byte, error) {
1588	type NoMethod Notification
1589	raw := NoMethod(*s)
1590	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1591}
1592
1593// Notifications: A list of notification subscriptions.
1594type Notifications struct {
1595	// Items: The list of items.
1596	Items []*Notification `json:"items,omitempty"`
1597
1598	// Kind: The kind of item this is. For lists of notifications, this is
1599	// always storage#notifications.
1600	Kind string `json:"kind,omitempty"`
1601
1602	// ServerResponse contains the HTTP response code and headers from the
1603	// server.
1604	googleapi.ServerResponse `json:"-"`
1605
1606	// ForceSendFields is a list of field names (e.g. "Items") to
1607	// unconditionally include in API requests. By default, fields with
1608	// empty values are omitted from API requests. However, any non-pointer,
1609	// non-interface field appearing in ForceSendFields will be sent to the
1610	// server regardless of whether the field is empty or not. This may be
1611	// used to include empty fields in Patch requests.
1612	ForceSendFields []string `json:"-"`
1613
1614	// NullFields is a list of field names (e.g. "Items") to include in API
1615	// requests with the JSON null value. By default, fields with empty
1616	// values are omitted from API requests. However, any field with an
1617	// empty value appearing in NullFields will be sent to the server as
1618	// null. It is an error if a field in this list has a non-empty value.
1619	// This may be used to include null fields in Patch requests.
1620	NullFields []string `json:"-"`
1621}
1622
1623func (s *Notifications) MarshalJSON() ([]byte, error) {
1624	type NoMethod Notifications
1625	raw := NoMethod(*s)
1626	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1627}
1628
1629// Object: An object.
1630type Object struct {
1631	// Acl: Access controls on the object.
1632	Acl []*ObjectAccessControl `json:"acl,omitempty"`
1633
1634	// Bucket: The name of the bucket containing this object.
1635	Bucket string `json:"bucket,omitempty"`
1636
1637	// CacheControl: Cache-Control directive for the object data. If
1638	// omitted, and the object is accessible to all anonymous users, the
1639	// default will be public, max-age=3600.
1640	CacheControl string `json:"cacheControl,omitempty"`
1641
1642	// ComponentCount: Number of underlying components that make up this
1643	// object. Components are accumulated by compose operations.
1644	ComponentCount int64 `json:"componentCount,omitempty"`
1645
1646	// ContentDisposition: Content-Disposition of the object data.
1647	ContentDisposition string `json:"contentDisposition,omitempty"`
1648
1649	// ContentEncoding: Content-Encoding of the object data.
1650	ContentEncoding string `json:"contentEncoding,omitempty"`
1651
1652	// ContentLanguage: Content-Language of the object data.
1653	ContentLanguage string `json:"contentLanguage,omitempty"`
1654
1655	// ContentType: Content-Type of the object data. If an object is stored
1656	// without a Content-Type, it is served as application/octet-stream.
1657	ContentType string `json:"contentType,omitempty"`
1658
1659	// Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
1660	// encoded using base64 in big-endian byte order. For more information
1661	// about using the CRC32c checksum, see Hashes and ETags: Best
1662	// Practices.
1663	Crc32c string `json:"crc32c,omitempty"`
1664
1665	// CustomerEncryption: Metadata of customer-supplied encryption key, if
1666	// the object is encrypted by such a key.
1667	CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
1668
1669	// Etag: HTTP 1.1 Entity tag for the object.
1670	Etag string `json:"etag,omitempty"`
1671
1672	// EventBasedHold: Whether an object is under event-based hold.
1673	// Event-based hold is a way to retain objects until an event occurs,
1674	// which is signified by the hold's release (i.e. this value is set to
1675	// false). After being released (set to false), such objects will be
1676	// subject to bucket-level retention (if any). One sample use case of
1677	// this flag is for banks to hold loan documents for at least 3 years
1678	// after loan is paid in full. Here, bucket-level retention is 3 years
1679	// and the event is the loan being paid in full. In this example, these
1680	// objects will be held intact for any number of years until the event
1681	// has occurred (event-based hold on the object is released) and then 3
1682	// more years after that. That means retention duration of the objects
1683	// begins from the moment event-based hold transitioned from true to
1684	// false.
1685	EventBasedHold bool `json:"eventBasedHold,omitempty"`
1686
1687	// Generation: The content generation of this object. Used for object
1688	// versioning.
1689	Generation int64 `json:"generation,omitempty,string"`
1690
1691	// Id: The ID of the object, including the bucket name, object name, and
1692	// generation number.
1693	Id string `json:"id,omitempty"`
1694
1695	// Kind: The kind of item this is. For objects, this is always
1696	// storage#object.
1697	Kind string `json:"kind,omitempty"`
1698
1699	// KmsKeyName: Cloud KMS Key used to encrypt this object, if the object
1700	// is encrypted by such a key.
1701	KmsKeyName string `json:"kmsKeyName,omitempty"`
1702
1703	// Md5Hash: MD5 hash of the data; encoded using base64. For more
1704	// information about using the MD5 hash, see Hashes and ETags: Best
1705	// Practices.
1706	Md5Hash string `json:"md5Hash,omitempty"`
1707
1708	// MediaLink: Media download link.
1709	MediaLink string `json:"mediaLink,omitempty"`
1710
1711	// Metadata: User-provided metadata, in key/value pairs.
1712	Metadata map[string]string `json:"metadata,omitempty"`
1713
1714	// Metageneration: The version of the metadata for this object at this
1715	// generation. Used for preconditions and for detecting changes in
1716	// metadata. A metageneration number is only meaningful in the context
1717	// of a particular generation of a particular object.
1718	Metageneration int64 `json:"metageneration,omitempty,string"`
1719
1720	// Name: The name of the object. Required if not specified by URL
1721	// parameter.
1722	Name string `json:"name,omitempty"`
1723
1724	// Owner: The owner of the object. This will always be the uploader of
1725	// the object.
1726	Owner *ObjectOwner `json:"owner,omitempty"`
1727
1728	// RetentionExpirationTime: A server-determined value that specifies the
1729	// earliest time that the object's retention period expires. This value
1730	// is in RFC 3339 format. Note 1: This field is not provided for objects
1731	// with an active event-based hold, since retention expiration is
1732	// unknown until the hold is removed. Note 2: This value can be provided
1733	// even when temporary hold is set (so that the user can reason about
1734	// policy without having to first unset the temporary hold).
1735	RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"`
1736
1737	// SelfLink: The link to this object.
1738	SelfLink string `json:"selfLink,omitempty"`
1739
1740	// Size: Content-Length of the data in bytes.
1741	Size uint64 `json:"size,omitempty,string"`
1742
1743	// StorageClass: Storage class of the object.
1744	StorageClass string `json:"storageClass,omitempty"`
1745
1746	// TemporaryHold: Whether an object is under temporary hold. While this
1747	// flag is set to true, the object is protected against deletion and
1748	// overwrites. A common use case of this flag is regulatory
1749	// investigations where objects need to be retained while the
1750	// investigation is ongoing. Note that unlike event-based hold,
1751	// temporary hold does not impact retention expiration time of an
1752	// object.
1753	TemporaryHold bool `json:"temporaryHold,omitempty"`
1754
1755	// TimeCreated: The creation time of the object in RFC 3339 format.
1756	TimeCreated string `json:"timeCreated,omitempty"`
1757
1758	// TimeDeleted: The deletion time of the object in RFC 3339 format. Will
1759	// be returned if and only if this version of the object has been
1760	// deleted.
1761	TimeDeleted string `json:"timeDeleted,omitempty"`
1762
1763	// TimeStorageClassUpdated: The time at which the object's storage class
1764	// was last changed. When the object is initially created, it will be
1765	// set to timeCreated.
1766	TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
1767
1768	// Updated: The modification time of the object metadata in RFC 3339
1769	// format.
1770	Updated string `json:"updated,omitempty"`
1771
1772	// ServerResponse contains the HTTP response code and headers from the
1773	// server.
1774	googleapi.ServerResponse `json:"-"`
1775
1776	// ForceSendFields is a list of field names (e.g. "Acl") to
1777	// unconditionally include in API requests. By default, fields with
1778	// empty values are omitted from API requests. However, any non-pointer,
1779	// non-interface field appearing in ForceSendFields will be sent to the
1780	// server regardless of whether the field is empty or not. This may be
1781	// used to include empty fields in Patch requests.
1782	ForceSendFields []string `json:"-"`
1783
1784	// NullFields is a list of field names (e.g. "Acl") to include in API
1785	// requests with the JSON null value. By default, fields with empty
1786	// values are omitted from API requests. However, any field with an
1787	// empty value appearing in NullFields will be sent to the server as
1788	// null. It is an error if a field in this list has a non-empty value.
1789	// This may be used to include null fields in Patch requests.
1790	NullFields []string `json:"-"`
1791}
1792
1793func (s *Object) MarshalJSON() ([]byte, error) {
1794	type NoMethod Object
1795	raw := NoMethod(*s)
1796	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1797}
1798
1799// ObjectCustomerEncryption: Metadata of customer-supplied encryption
1800// key, if the object is encrypted by such a key.
1801type ObjectCustomerEncryption struct {
1802	// EncryptionAlgorithm: The encryption algorithm.
1803	EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"`
1804
1805	// KeySha256: SHA256 hash value of the encryption key.
1806	KeySha256 string `json:"keySha256,omitempty"`
1807
1808	// ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm")
1809	// to unconditionally include in API requests. By default, fields with
1810	// empty values are omitted from API requests. However, any non-pointer,
1811	// non-interface field appearing in ForceSendFields will be sent to the
1812	// server regardless of whether the field is empty or not. This may be
1813	// used to include empty fields in Patch requests.
1814	ForceSendFields []string `json:"-"`
1815
1816	// NullFields is a list of field names (e.g. "EncryptionAlgorithm") to
1817	// include in API requests with the JSON null value. By default, fields
1818	// with empty values are omitted from API requests. However, any field
1819	// with an empty value appearing in NullFields will be sent to the
1820	// server as null. It is an error if a field in this list has a
1821	// non-empty value. This may be used to include null fields in Patch
1822	// requests.
1823	NullFields []string `json:"-"`
1824}
1825
1826func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
1827	type NoMethod ObjectCustomerEncryption
1828	raw := NoMethod(*s)
1829	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1830}
1831
1832// ObjectOwner: The owner of the object. This will always be the
1833// uploader of the object.
1834type ObjectOwner struct {
1835	// Entity: The entity, in the form user-userId.
1836	Entity string `json:"entity,omitempty"`
1837
1838	// EntityId: The ID for the entity.
1839	EntityId string `json:"entityId,omitempty"`
1840
1841	// ForceSendFields is a list of field names (e.g. "Entity") to
1842	// unconditionally include in API requests. By default, fields with
1843	// empty values are omitted from API requests. However, any non-pointer,
1844	// non-interface field appearing in ForceSendFields will be sent to the
1845	// server regardless of whether the field is empty or not. This may be
1846	// used to include empty fields in Patch requests.
1847	ForceSendFields []string `json:"-"`
1848
1849	// NullFields is a list of field names (e.g. "Entity") to include in API
1850	// requests with the JSON null value. By default, fields with empty
1851	// values are omitted from API requests. However, any field with an
1852	// empty value appearing in NullFields will be sent to the server as
1853	// null. It is an error if a field in this list has a non-empty value.
1854	// This may be used to include null fields in Patch requests.
1855	NullFields []string `json:"-"`
1856}
1857
1858func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
1859	type NoMethod ObjectOwner
1860	raw := NoMethod(*s)
1861	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1862}
1863
1864// ObjectAccessControl: An access-control entry.
1865type ObjectAccessControl struct {
1866	// Bucket: The name of the bucket.
1867	Bucket string `json:"bucket,omitempty"`
1868
1869	// Domain: The domain associated with the entity, if any.
1870	Domain string `json:"domain,omitempty"`
1871
1872	// Email: The email address associated with the entity, if any.
1873	Email string `json:"email,omitempty"`
1874
1875	// Entity: The entity holding the permission, in one of the following
1876	// forms:
1877	// - user-userId
1878	// - user-email
1879	// - group-groupId
1880	// - group-email
1881	// - domain-domain
1882	// - project-team-projectId
1883	// - allUsers
1884	// - allAuthenticatedUsers Examples:
1885	// - The user liz@example.com would be user-liz@example.com.
1886	// - The group example@googlegroups.com would be
1887	// group-example@googlegroups.com.
1888	// - To refer to all members of the Google Apps for Business domain
1889	// example.com, the entity would be domain-example.com.
1890	Entity string `json:"entity,omitempty"`
1891
1892	// EntityId: The ID for the entity, if any.
1893	EntityId string `json:"entityId,omitempty"`
1894
1895	// Etag: HTTP 1.1 Entity tag for the access-control entry.
1896	Etag string `json:"etag,omitempty"`
1897
1898	// Generation: The content generation of the object, if applied to an
1899	// object.
1900	Generation int64 `json:"generation,omitempty,string"`
1901
1902	// Id: The ID of the access-control entry.
1903	Id string `json:"id,omitempty"`
1904
1905	// Kind: The kind of item this is. For object access control entries,
1906	// this is always storage#objectAccessControl.
1907	Kind string `json:"kind,omitempty"`
1908
1909	// Object: The name of the object, if applied to an object.
1910	Object string `json:"object,omitempty"`
1911
1912	// ProjectTeam: The project team associated with the entity, if any.
1913	ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
1914
1915	// Role: The access permission for the entity.
1916	Role string `json:"role,omitempty"`
1917
1918	// SelfLink: The link to this access-control entry.
1919	SelfLink string `json:"selfLink,omitempty"`
1920
1921	// ServerResponse contains the HTTP response code and headers from the
1922	// server.
1923	googleapi.ServerResponse `json:"-"`
1924
1925	// ForceSendFields is a list of field names (e.g. "Bucket") to
1926	// unconditionally include in API requests. By default, fields with
1927	// empty values are omitted from API requests. However, any non-pointer,
1928	// non-interface field appearing in ForceSendFields will be sent to the
1929	// server regardless of whether the field is empty or not. This may be
1930	// used to include empty fields in Patch requests.
1931	ForceSendFields []string `json:"-"`
1932
1933	// NullFields is a list of field names (e.g. "Bucket") to include in API
1934	// requests with the JSON null value. By default, fields with empty
1935	// values are omitted from API requests. However, any field with an
1936	// empty value appearing in NullFields will be sent to the server as
1937	// null. It is an error if a field in this list has a non-empty value.
1938	// This may be used to include null fields in Patch requests.
1939	NullFields []string `json:"-"`
1940}
1941
1942func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
1943	type NoMethod ObjectAccessControl
1944	raw := NoMethod(*s)
1945	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1946}
1947
1948// ObjectAccessControlProjectTeam: The project team associated with the
1949// entity, if any.
1950type ObjectAccessControlProjectTeam struct {
1951	// ProjectNumber: The project number.
1952	ProjectNumber string `json:"projectNumber,omitempty"`
1953
1954	// Team: The team.
1955	Team string `json:"team,omitempty"`
1956
1957	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1958	// unconditionally include in API requests. By default, fields with
1959	// empty values are omitted from API requests. However, any non-pointer,
1960	// non-interface field appearing in ForceSendFields will be sent to the
1961	// server regardless of whether the field is empty or not. This may be
1962	// used to include empty fields in Patch requests.
1963	ForceSendFields []string `json:"-"`
1964
1965	// NullFields is a list of field names (e.g. "ProjectNumber") to include
1966	// in API requests with the JSON null value. By default, fields with
1967	// empty values are omitted from API requests. However, any field with
1968	// an empty value appearing in NullFields will be sent to the server as
1969	// null. It is an error if a field in this list has a non-empty value.
1970	// This may be used to include null fields in Patch requests.
1971	NullFields []string `json:"-"`
1972}
1973
1974func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1975	type NoMethod ObjectAccessControlProjectTeam
1976	raw := NoMethod(*s)
1977	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1978}
1979
1980// ObjectAccessControls: An access-control list.
1981type ObjectAccessControls struct {
1982	// Items: The list of items.
1983	Items []*ObjectAccessControl `json:"items,omitempty"`
1984
1985	// Kind: The kind of item this is. For lists of object access control
1986	// entries, this is always storage#objectAccessControls.
1987	Kind string `json:"kind,omitempty"`
1988
1989	// ServerResponse contains the HTTP response code and headers from the
1990	// server.
1991	googleapi.ServerResponse `json:"-"`
1992
1993	// ForceSendFields is a list of field names (e.g. "Items") to
1994	// unconditionally include in API requests. By default, fields with
1995	// empty values are omitted from API requests. However, any non-pointer,
1996	// non-interface field appearing in ForceSendFields will be sent to the
1997	// server regardless of whether the field is empty or not. This may be
1998	// used to include empty fields in Patch requests.
1999	ForceSendFields []string `json:"-"`
2000
2001	// NullFields is a list of field names (e.g. "Items") to include in API
2002	// requests with the JSON null value. By default, fields with empty
2003	// values are omitted from API requests. However, any field with an
2004	// empty value appearing in NullFields will be sent to the server as
2005	// null. It is an error if a field in this list has a non-empty value.
2006	// This may be used to include null fields in Patch requests.
2007	NullFields []string `json:"-"`
2008}
2009
2010func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
2011	type NoMethod ObjectAccessControls
2012	raw := NoMethod(*s)
2013	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2014}
2015
2016// Objects: A list of objects.
2017type Objects struct {
2018	// Items: The list of items.
2019	Items []*Object `json:"items,omitempty"`
2020
2021	// Kind: The kind of item this is. For lists of objects, this is always
2022	// storage#objects.
2023	Kind string `json:"kind,omitempty"`
2024
2025	// NextPageToken: The continuation token, used to page through large
2026	// result sets. Provide this value in a subsequent request to return the
2027	// next page of results.
2028	NextPageToken string `json:"nextPageToken,omitempty"`
2029
2030	// Prefixes: The list of prefixes of objects matching-but-not-listed up
2031	// to and including the requested delimiter.
2032	Prefixes []string `json:"prefixes,omitempty"`
2033
2034	// ServerResponse contains the HTTP response code and headers from the
2035	// server.
2036	googleapi.ServerResponse `json:"-"`
2037
2038	// ForceSendFields is a list of field names (e.g. "Items") to
2039	// unconditionally include in API requests. By default, fields with
2040	// empty values are omitted from API requests. However, any non-pointer,
2041	// non-interface field appearing in ForceSendFields will be sent to the
2042	// server regardless of whether the field is empty or not. This may be
2043	// used to include empty fields in Patch requests.
2044	ForceSendFields []string `json:"-"`
2045
2046	// NullFields is a list of field names (e.g. "Items") to include in API
2047	// requests with the JSON null value. By default, fields with empty
2048	// values are omitted from API requests. However, any field with an
2049	// empty value appearing in NullFields will be sent to the server as
2050	// null. It is an error if a field in this list has a non-empty value.
2051	// This may be used to include null fields in Patch requests.
2052	NullFields []string `json:"-"`
2053}
2054
2055func (s *Objects) MarshalJSON() ([]byte, error) {
2056	type NoMethod Objects
2057	raw := NoMethod(*s)
2058	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2059}
2060
2061// Policy: A bucket/object IAM policy.
2062type Policy struct {
2063	// Bindings: An association between a role, which comes with a set of
2064	// permissions, and members who may assume that role.
2065	Bindings []*PolicyBindings `json:"bindings,omitempty"`
2066
2067	// Etag: HTTP 1.1  Entity tag for the policy.
2068	Etag string `json:"etag,omitempty"`
2069
2070	// Kind: The kind of item this is. For policies, this is always
2071	// storage#policy. This field is ignored on input.
2072	Kind string `json:"kind,omitempty"`
2073
2074	// ResourceId: The ID of the resource to which this policy belongs. Will
2075	// be of the form projects/_/buckets/bucket for buckets, and
2076	// projects/_/buckets/bucket/objects/object for objects. A specific
2077	// generation may be specified by appending #generationNumber to the end
2078	// of the object name, e.g.
2079	// projects/_/buckets/my-bucket/objects/data.txt#17. The current
2080	// generation can be denoted with #0. This field is ignored on input.
2081	ResourceId string `json:"resourceId,omitempty"`
2082
2083	// Version: The IAM policy format version.
2084	Version int64 `json:"version,omitempty"`
2085
2086	// ServerResponse contains the HTTP response code and headers from the
2087	// server.
2088	googleapi.ServerResponse `json:"-"`
2089
2090	// ForceSendFields is a list of field names (e.g. "Bindings") to
2091	// unconditionally include in API requests. By default, fields with
2092	// empty values are omitted from API requests. However, any non-pointer,
2093	// non-interface field appearing in ForceSendFields will be sent to the
2094	// server regardless of whether the field is empty or not. This may be
2095	// used to include empty fields in Patch requests.
2096	ForceSendFields []string `json:"-"`
2097
2098	// NullFields is a list of field names (e.g. "Bindings") to include in
2099	// API requests with the JSON null value. By default, fields with empty
2100	// values are omitted from API requests. However, any field with an
2101	// empty value appearing in NullFields will be sent to the server as
2102	// null. It is an error if a field in this list has a non-empty value.
2103	// This may be used to include null fields in Patch requests.
2104	NullFields []string `json:"-"`
2105}
2106
2107func (s *Policy) MarshalJSON() ([]byte, error) {
2108	type NoMethod Policy
2109	raw := NoMethod(*s)
2110	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2111}
2112
2113type PolicyBindings struct {
2114	// Condition: The condition that is associated with this binding. NOTE:
2115	// an unsatisfied condition will not allow user access via current
2116	// binding. Different bindings, including their conditions, are examined
2117	// independently.
2118	Condition *Expr `json:"condition,omitempty"`
2119
2120	// Members: A collection of identifiers for members who may assume the
2121	// provided role. Recognized identifiers are as follows:
2122	// - allUsers — A special identifier that represents anyone on the
2123	// internet; with or without a Google account.
2124	// - allAuthenticatedUsers — A special identifier that represents
2125	// anyone who is authenticated with a Google account or a service
2126	// account.
2127	// - user:emailid — An email address that represents a specific
2128	// account. For example, user:alice@gmail.com or user:joe@example.com.
2129	//
2130	// - serviceAccount:emailid — An email address that represents a
2131	// service account. For example,
2132	// serviceAccount:my-other-app@appspot.gserviceaccount.com .
2133	// - group:emailid — An email address that represents a Google group.
2134	// For example, group:admins@example.com.
2135	// - domain:domain — A Google Apps domain name that represents all the
2136	// users of that domain. For example, domain:google.com or
2137	// domain:example.com.
2138	// - projectOwner:projectid — Owners of the given project. For
2139	// example, projectOwner:my-example-project
2140	// - projectEditor:projectid — Editors of the given project. For
2141	// example, projectEditor:my-example-project
2142	// - projectViewer:projectid — Viewers of the given project. For
2143	// example, projectViewer:my-example-project
2144	Members []string `json:"members,omitempty"`
2145
2146	// Role: The role to which members belong. Two types of roles are
2147	// supported: new IAM roles, which grant permissions that do not map
2148	// directly to those provided by ACLs, and legacy IAM roles, which do
2149	// map directly to ACL permissions. All roles are of the format
2150	// roles/storage.specificRole.
2151	// The new IAM roles are:
2152	// - roles/storage.admin — Full control of Google Cloud Storage
2153	// resources.
2154	// - roles/storage.objectViewer — Read-Only access to Google Cloud
2155	// Storage objects.
2156	// - roles/storage.objectCreator — Access to create objects in Google
2157	// Cloud Storage.
2158	// - roles/storage.objectAdmin — Full control of Google Cloud Storage
2159	// objects.   The legacy IAM roles are:
2160	// - roles/storage.legacyObjectReader — Read-only access to objects
2161	// without listing. Equivalent to an ACL entry on an object with the
2162	// READER role.
2163	// - roles/storage.legacyObjectOwnerRead/write access to existing
2164	// objects without listing. Equivalent to an ACL entry on an object with
2165	// the OWNER role.
2166	// - roles/storage.legacyBucketReader — Read access to buckets with
2167	// object listing. Equivalent to an ACL entry on a bucket with the
2168	// READER role.
2169	// - roles/storage.legacyBucketWriter — Read access to buckets with
2170	// object listing/creation/deletion. Equivalent to an ACL entry on a
2171	// bucket with the WRITER role.
2172	// - roles/storage.legacyBucketOwner — Read and write access to
2173	// existing buckets with object listing/creation/deletion. Equivalent to
2174	// an ACL entry on a bucket with the OWNER role.
2175	Role string `json:"role,omitempty"`
2176
2177	// ForceSendFields is a list of field names (e.g. "Condition") to
2178	// unconditionally include in API requests. By default, fields with
2179	// empty values are omitted from API requests. However, any non-pointer,
2180	// non-interface field appearing in ForceSendFields will be sent to the
2181	// server regardless of whether the field is empty or not. This may be
2182	// used to include empty fields in Patch requests.
2183	ForceSendFields []string `json:"-"`
2184
2185	// NullFields is a list of field names (e.g. "Condition") to include in
2186	// API requests with the JSON null value. By default, fields with empty
2187	// values are omitted from API requests. However, any field with an
2188	// empty value appearing in NullFields will be sent to the server as
2189	// null. It is an error if a field in this list has a non-empty value.
2190	// This may be used to include null fields in Patch requests.
2191	NullFields []string `json:"-"`
2192}
2193
2194func (s *PolicyBindings) MarshalJSON() ([]byte, error) {
2195	type NoMethod PolicyBindings
2196	raw := NoMethod(*s)
2197	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2198}
2199
2200// RewriteResponse: A rewrite response.
2201type RewriteResponse struct {
2202	// Done: true if the copy is finished; otherwise, false if the copy is
2203	// in progress. This property is always present in the response.
2204	Done bool `json:"done,omitempty"`
2205
2206	// Kind: The kind of item this is.
2207	Kind string `json:"kind,omitempty"`
2208
2209	// ObjectSize: The total size of the object being copied in bytes. This
2210	// property is always present in the response.
2211	ObjectSize int64 `json:"objectSize,omitempty,string"`
2212
2213	// Resource: A resource containing the metadata for the copied-to
2214	// object. This property is present in the response only when copying
2215	// completes.
2216	Resource *Object `json:"resource,omitempty"`
2217
2218	// RewriteToken: A token to use in subsequent requests to continue
2219	// copying data. This token is present in the response only when there
2220	// is more data to copy.
2221	RewriteToken string `json:"rewriteToken,omitempty"`
2222
2223	// TotalBytesRewritten: The total bytes written so far, which can be
2224	// used to provide a waiting user with a progress indicator. This
2225	// property is always present in the response.
2226	TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
2227
2228	// ServerResponse contains the HTTP response code and headers from the
2229	// server.
2230	googleapi.ServerResponse `json:"-"`
2231
2232	// ForceSendFields is a list of field names (e.g. "Done") to
2233	// unconditionally include in API requests. By default, fields with
2234	// empty values are omitted from API requests. However, any non-pointer,
2235	// non-interface field appearing in ForceSendFields will be sent to the
2236	// server regardless of whether the field is empty or not. This may be
2237	// used to include empty fields in Patch requests.
2238	ForceSendFields []string `json:"-"`
2239
2240	// NullFields is a list of field names (e.g. "Done") to include in API
2241	// requests with the JSON null value. By default, fields with empty
2242	// values are omitted from API requests. However, any field with an
2243	// empty value appearing in NullFields will be sent to the server as
2244	// null. It is an error if a field in this list has a non-empty value.
2245	// This may be used to include null fields in Patch requests.
2246	NullFields []string `json:"-"`
2247}
2248
2249func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
2250	type NoMethod RewriteResponse
2251	raw := NoMethod(*s)
2252	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2253}
2254
2255// ServiceAccount: A subscription to receive Google PubSub
2256// notifications.
2257type ServiceAccount struct {
2258	// EmailAddress: The ID of the notification.
2259	EmailAddress string `json:"email_address,omitempty"`
2260
2261	// Kind: The kind of item this is. For notifications, this is always
2262	// storage#notification.
2263	Kind string `json:"kind,omitempty"`
2264
2265	// ServerResponse contains the HTTP response code and headers from the
2266	// server.
2267	googleapi.ServerResponse `json:"-"`
2268
2269	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
2270	// unconditionally include in API requests. By default, fields with
2271	// empty values are omitted from API requests. However, any non-pointer,
2272	// non-interface field appearing in ForceSendFields will be sent to the
2273	// server regardless of whether the field is empty or not. This may be
2274	// used to include empty fields in Patch requests.
2275	ForceSendFields []string `json:"-"`
2276
2277	// NullFields is a list of field names (e.g. "EmailAddress") to include
2278	// in API requests with the JSON null value. By default, fields with
2279	// empty values are omitted from API requests. However, any field with
2280	// an empty value appearing in NullFields will be sent to the server as
2281	// null. It is an error if a field in this list has a non-empty value.
2282	// This may be used to include null fields in Patch requests.
2283	NullFields []string `json:"-"`
2284}
2285
2286func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
2287	type NoMethod ServiceAccount
2288	raw := NoMethod(*s)
2289	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2290}
2291
2292// TestIamPermissionsResponse: A
2293// storage.(buckets|objects).testIamPermissions response.
2294type TestIamPermissionsResponse struct {
2295	// Kind: The kind of item this is.
2296	Kind string `json:"kind,omitempty"`
2297
2298	// Permissions: The permissions held by the caller. Permissions are
2299	// always of the format storage.resource.capability, where resource is
2300	// one of buckets or objects. The supported permissions are as follows:
2301	//
2302	// - storage.buckets.delete — Delete bucket.
2303	// - storage.buckets.get — Read bucket metadata.
2304	// - storage.buckets.getIamPolicy — Read bucket IAM policy.
2305	// - storage.buckets.create — Create bucket.
2306	// - storage.buckets.list — List buckets.
2307	// - storage.buckets.setIamPolicy — Update bucket IAM policy.
2308	// - storage.buckets.update — Update bucket metadata.
2309	// - storage.objects.delete — Delete object.
2310	// - storage.objects.get — Read object data and metadata.
2311	// - storage.objects.getIamPolicy — Read object IAM policy.
2312	// - storage.objects.create — Create object.
2313	// - storage.objects.list — List objects.
2314	// - storage.objects.setIamPolicy — Update object IAM policy.
2315	// - storage.objects.update — Update object metadata.
2316	Permissions []string `json:"permissions,omitempty"`
2317
2318	// ServerResponse contains the HTTP response code and headers from the
2319	// server.
2320	googleapi.ServerResponse `json:"-"`
2321
2322	// ForceSendFields is a list of field names (e.g. "Kind") to
2323	// unconditionally include in API requests. By default, fields with
2324	// empty values are omitted from API requests. However, any non-pointer,
2325	// non-interface field appearing in ForceSendFields will be sent to the
2326	// server regardless of whether the field is empty or not. This may be
2327	// used to include empty fields in Patch requests.
2328	ForceSendFields []string `json:"-"`
2329
2330	// NullFields is a list of field names (e.g. "Kind") to include in API
2331	// requests with the JSON null value. By default, fields with empty
2332	// values are omitted from API requests. However, any field with an
2333	// empty value appearing in NullFields will be sent to the server as
2334	// null. It is an error if a field in this list has a non-empty value.
2335	// This may be used to include null fields in Patch requests.
2336	NullFields []string `json:"-"`
2337}
2338
2339func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
2340	type NoMethod TestIamPermissionsResponse
2341	raw := NoMethod(*s)
2342	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2343}
2344
2345// method id "storage.bucketAccessControls.delete":
2346
2347type BucketAccessControlsDeleteCall struct {
2348	s          *Service
2349	bucket     string
2350	entity     string
2351	urlParams_ gensupport.URLParams
2352	ctx_       context.Context
2353	header_    http.Header
2354}
2355
2356// Delete: Permanently deletes the ACL entry for the specified entity on
2357// the specified bucket.
2358func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
2359	c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2360	c.bucket = bucket
2361	c.entity = entity
2362	return c
2363}
2364
2365// ProvisionalUserProject sets the optional parameter
2366// "provisionalUserProject": The project to be billed for this request
2367// if the target bucket is requester-pays bucket.
2368func (c *BucketAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsDeleteCall {
2369	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2370	return c
2371}
2372
2373// UserProject sets the optional parameter "userProject": The project to
2374// be billed for this request. Required for Requester Pays buckets.
2375func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
2376	c.urlParams_.Set("userProject", userProject)
2377	return c
2378}
2379
2380// Fields allows partial responses to be retrieved. See
2381// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2382// for more information.
2383func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
2384	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2385	return c
2386}
2387
2388// Context sets the context to be used in this call's Do method. Any
2389// pending HTTP request will be aborted if the provided context is
2390// canceled.
2391func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
2392	c.ctx_ = ctx
2393	return c
2394}
2395
2396// Header returns an http.Header that can be modified by the caller to
2397// add HTTP headers to the request.
2398func (c *BucketAccessControlsDeleteCall) Header() http.Header {
2399	if c.header_ == nil {
2400		c.header_ = make(http.Header)
2401	}
2402	return c.header_
2403}
2404
2405func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
2406	reqHeaders := make(http.Header)
2407	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
2408	for k, v := range c.header_ {
2409		reqHeaders[k] = v
2410	}
2411	reqHeaders.Set("User-Agent", c.s.userAgent())
2412	var body io.Reader = nil
2413	c.urlParams_.Set("alt", alt)
2414	c.urlParams_.Set("prettyPrint", "false")
2415	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2416	urls += "?" + c.urlParams_.Encode()
2417	req, err := http.NewRequest("DELETE", urls, body)
2418	if err != nil {
2419		return nil, err
2420	}
2421	req.Header = reqHeaders
2422	googleapi.Expand(req.URL, map[string]string{
2423		"bucket": c.bucket,
2424		"entity": c.entity,
2425	})
2426	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2427}
2428
2429// Do executes the "storage.bucketAccessControls.delete" call.
2430func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
2431	gensupport.SetOptions(c.urlParams_, opts...)
2432	res, err := c.doRequest("json")
2433	if err != nil {
2434		return err
2435	}
2436	defer googleapi.CloseBody(res)
2437	if err := googleapi.CheckResponse(res); err != nil {
2438		return err
2439	}
2440	return nil
2441	// {
2442	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
2443	//   "httpMethod": "DELETE",
2444	//   "id": "storage.bucketAccessControls.delete",
2445	//   "parameterOrder": [
2446	//     "bucket",
2447	//     "entity"
2448	//   ],
2449	//   "parameters": {
2450	//     "bucket": {
2451	//       "description": "Name of a bucket.",
2452	//       "location": "path",
2453	//       "required": true,
2454	//       "type": "string"
2455	//     },
2456	//     "entity": {
2457	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2458	//       "location": "path",
2459	//       "required": true,
2460	//       "type": "string"
2461	//     },
2462	//     "provisionalUserProject": {
2463	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2464	//       "location": "query",
2465	//       "type": "string"
2466	//     },
2467	//     "userProject": {
2468	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2469	//       "location": "query",
2470	//       "type": "string"
2471	//     }
2472	//   },
2473	//   "path": "b/{bucket}/acl/{entity}",
2474	//   "scopes": [
2475	//     "https://www.googleapis.com/auth/cloud-platform",
2476	//     "https://www.googleapis.com/auth/devstorage.full_control"
2477	//   ]
2478	// }
2479
2480}
2481
2482// method id "storage.bucketAccessControls.get":
2483
2484type BucketAccessControlsGetCall struct {
2485	s            *Service
2486	bucket       string
2487	entity       string
2488	urlParams_   gensupport.URLParams
2489	ifNoneMatch_ string
2490	ctx_         context.Context
2491	header_      http.Header
2492}
2493
2494// Get: Returns the ACL entry for the specified entity on the specified
2495// bucket.
2496func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
2497	c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2498	c.bucket = bucket
2499	c.entity = entity
2500	return c
2501}
2502
2503// ProvisionalUserProject sets the optional parameter
2504// "provisionalUserProject": The project to be billed for this request
2505// if the target bucket is requester-pays bucket.
2506func (c *BucketAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsGetCall {
2507	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2508	return c
2509}
2510
2511// UserProject sets the optional parameter "userProject": The project to
2512// be billed for this request. Required for Requester Pays buckets.
2513func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
2514	c.urlParams_.Set("userProject", userProject)
2515	return c
2516}
2517
2518// Fields allows partial responses to be retrieved. See
2519// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2520// for more information.
2521func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
2522	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2523	return c
2524}
2525
2526// IfNoneMatch sets the optional parameter which makes the operation
2527// fail if the object's ETag matches the given value. This is useful for
2528// getting updates only after the object has changed since the last
2529// request. Use googleapi.IsNotModified to check whether the response
2530// error from Do is the result of In-None-Match.
2531func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
2532	c.ifNoneMatch_ = entityTag
2533	return c
2534}
2535
2536// Context sets the context to be used in this call's Do method. Any
2537// pending HTTP request will be aborted if the provided context is
2538// canceled.
2539func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
2540	c.ctx_ = ctx
2541	return c
2542}
2543
2544// Header returns an http.Header that can be modified by the caller to
2545// add HTTP headers to the request.
2546func (c *BucketAccessControlsGetCall) Header() http.Header {
2547	if c.header_ == nil {
2548		c.header_ = make(http.Header)
2549	}
2550	return c.header_
2551}
2552
2553func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
2554	reqHeaders := make(http.Header)
2555	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
2556	for k, v := range c.header_ {
2557		reqHeaders[k] = v
2558	}
2559	reqHeaders.Set("User-Agent", c.s.userAgent())
2560	if c.ifNoneMatch_ != "" {
2561		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2562	}
2563	var body io.Reader = nil
2564	c.urlParams_.Set("alt", alt)
2565	c.urlParams_.Set("prettyPrint", "false")
2566	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2567	urls += "?" + c.urlParams_.Encode()
2568	req, err := http.NewRequest("GET", urls, body)
2569	if err != nil {
2570		return nil, err
2571	}
2572	req.Header = reqHeaders
2573	googleapi.Expand(req.URL, map[string]string{
2574		"bucket": c.bucket,
2575		"entity": c.entity,
2576	})
2577	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2578}
2579
2580// Do executes the "storage.bucketAccessControls.get" call.
2581// Exactly one of *BucketAccessControl or error will be non-nil. Any
2582// non-2xx status code is an error. Response headers are in either
2583// *BucketAccessControl.ServerResponse.Header or (if a response was
2584// returned at all) in error.(*googleapi.Error).Header. Use
2585// googleapi.IsNotModified to check whether the returned error was
2586// because http.StatusNotModified was returned.
2587func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2588	gensupport.SetOptions(c.urlParams_, opts...)
2589	res, err := c.doRequest("json")
2590	if res != nil && res.StatusCode == http.StatusNotModified {
2591		if res.Body != nil {
2592			res.Body.Close()
2593		}
2594		return nil, &googleapi.Error{
2595			Code:   res.StatusCode,
2596			Header: res.Header,
2597		}
2598	}
2599	if err != nil {
2600		return nil, err
2601	}
2602	defer googleapi.CloseBody(res)
2603	if err := googleapi.CheckResponse(res); err != nil {
2604		return nil, err
2605	}
2606	ret := &BucketAccessControl{
2607		ServerResponse: googleapi.ServerResponse{
2608			Header:         res.Header,
2609			HTTPStatusCode: res.StatusCode,
2610		},
2611	}
2612	target := &ret
2613	if err := gensupport.DecodeResponse(target, res); err != nil {
2614		return nil, err
2615	}
2616	return ret, nil
2617	// {
2618	//   "description": "Returns the ACL entry for the specified entity on the specified bucket.",
2619	//   "httpMethod": "GET",
2620	//   "id": "storage.bucketAccessControls.get",
2621	//   "parameterOrder": [
2622	//     "bucket",
2623	//     "entity"
2624	//   ],
2625	//   "parameters": {
2626	//     "bucket": {
2627	//       "description": "Name of a bucket.",
2628	//       "location": "path",
2629	//       "required": true,
2630	//       "type": "string"
2631	//     },
2632	//     "entity": {
2633	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2634	//       "location": "path",
2635	//       "required": true,
2636	//       "type": "string"
2637	//     },
2638	//     "provisionalUserProject": {
2639	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2640	//       "location": "query",
2641	//       "type": "string"
2642	//     },
2643	//     "userProject": {
2644	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2645	//       "location": "query",
2646	//       "type": "string"
2647	//     }
2648	//   },
2649	//   "path": "b/{bucket}/acl/{entity}",
2650	//   "response": {
2651	//     "$ref": "BucketAccessControl"
2652	//   },
2653	//   "scopes": [
2654	//     "https://www.googleapis.com/auth/cloud-platform",
2655	//     "https://www.googleapis.com/auth/devstorage.full_control"
2656	//   ]
2657	// }
2658
2659}
2660
2661// method id "storage.bucketAccessControls.insert":
2662
2663type BucketAccessControlsInsertCall struct {
2664	s                   *Service
2665	bucket              string
2666	bucketaccesscontrol *BucketAccessControl
2667	urlParams_          gensupport.URLParams
2668	ctx_                context.Context
2669	header_             http.Header
2670}
2671
2672// Insert: Creates a new ACL entry on the specified bucket.
2673func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
2674	c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2675	c.bucket = bucket
2676	c.bucketaccesscontrol = bucketaccesscontrol
2677	return c
2678}
2679
2680// ProvisionalUserProject sets the optional parameter
2681// "provisionalUserProject": The project to be billed for this request
2682// if the target bucket is requester-pays bucket.
2683func (c *BucketAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsInsertCall {
2684	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2685	return c
2686}
2687
2688// UserProject sets the optional parameter "userProject": The project to
2689// be billed for this request. Required for Requester Pays buckets.
2690func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
2691	c.urlParams_.Set("userProject", userProject)
2692	return c
2693}
2694
2695// Fields allows partial responses to be retrieved. See
2696// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2697// for more information.
2698func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
2699	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2700	return c
2701}
2702
2703// Context sets the context to be used in this call's Do method. Any
2704// pending HTTP request will be aborted if the provided context is
2705// canceled.
2706func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
2707	c.ctx_ = ctx
2708	return c
2709}
2710
2711// Header returns an http.Header that can be modified by the caller to
2712// add HTTP headers to the request.
2713func (c *BucketAccessControlsInsertCall) Header() http.Header {
2714	if c.header_ == nil {
2715		c.header_ = make(http.Header)
2716	}
2717	return c.header_
2718}
2719
2720func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
2721	reqHeaders := make(http.Header)
2722	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
2723	for k, v := range c.header_ {
2724		reqHeaders[k] = v
2725	}
2726	reqHeaders.Set("User-Agent", c.s.userAgent())
2727	var body io.Reader = nil
2728	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2729	if err != nil {
2730		return nil, err
2731	}
2732	reqHeaders.Set("Content-Type", "application/json")
2733	c.urlParams_.Set("alt", alt)
2734	c.urlParams_.Set("prettyPrint", "false")
2735	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2736	urls += "?" + c.urlParams_.Encode()
2737	req, err := http.NewRequest("POST", urls, body)
2738	if err != nil {
2739		return nil, err
2740	}
2741	req.Header = reqHeaders
2742	googleapi.Expand(req.URL, map[string]string{
2743		"bucket": c.bucket,
2744	})
2745	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2746}
2747
2748// Do executes the "storage.bucketAccessControls.insert" call.
2749// Exactly one of *BucketAccessControl or error will be non-nil. Any
2750// non-2xx status code is an error. Response headers are in either
2751// *BucketAccessControl.ServerResponse.Header or (if a response was
2752// returned at all) in error.(*googleapi.Error).Header. Use
2753// googleapi.IsNotModified to check whether the returned error was
2754// because http.StatusNotModified was returned.
2755func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2756	gensupport.SetOptions(c.urlParams_, opts...)
2757	res, err := c.doRequest("json")
2758	if res != nil && res.StatusCode == http.StatusNotModified {
2759		if res.Body != nil {
2760			res.Body.Close()
2761		}
2762		return nil, &googleapi.Error{
2763			Code:   res.StatusCode,
2764			Header: res.Header,
2765		}
2766	}
2767	if err != nil {
2768		return nil, err
2769	}
2770	defer googleapi.CloseBody(res)
2771	if err := googleapi.CheckResponse(res); err != nil {
2772		return nil, err
2773	}
2774	ret := &BucketAccessControl{
2775		ServerResponse: googleapi.ServerResponse{
2776			Header:         res.Header,
2777			HTTPStatusCode: res.StatusCode,
2778		},
2779	}
2780	target := &ret
2781	if err := gensupport.DecodeResponse(target, res); err != nil {
2782		return nil, err
2783	}
2784	return ret, nil
2785	// {
2786	//   "description": "Creates a new ACL entry on the specified bucket.",
2787	//   "httpMethod": "POST",
2788	//   "id": "storage.bucketAccessControls.insert",
2789	//   "parameterOrder": [
2790	//     "bucket"
2791	//   ],
2792	//   "parameters": {
2793	//     "bucket": {
2794	//       "description": "Name of a bucket.",
2795	//       "location": "path",
2796	//       "required": true,
2797	//       "type": "string"
2798	//     },
2799	//     "provisionalUserProject": {
2800	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2801	//       "location": "query",
2802	//       "type": "string"
2803	//     },
2804	//     "userProject": {
2805	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2806	//       "location": "query",
2807	//       "type": "string"
2808	//     }
2809	//   },
2810	//   "path": "b/{bucket}/acl",
2811	//   "request": {
2812	//     "$ref": "BucketAccessControl"
2813	//   },
2814	//   "response": {
2815	//     "$ref": "BucketAccessControl"
2816	//   },
2817	//   "scopes": [
2818	//     "https://www.googleapis.com/auth/cloud-platform",
2819	//     "https://www.googleapis.com/auth/devstorage.full_control"
2820	//   ]
2821	// }
2822
2823}
2824
2825// method id "storage.bucketAccessControls.list":
2826
2827type BucketAccessControlsListCall struct {
2828	s            *Service
2829	bucket       string
2830	urlParams_   gensupport.URLParams
2831	ifNoneMatch_ string
2832	ctx_         context.Context
2833	header_      http.Header
2834}
2835
2836// List: Retrieves ACL entries on the specified bucket.
2837func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
2838	c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2839	c.bucket = bucket
2840	return c
2841}
2842
2843// ProvisionalUserProject sets the optional parameter
2844// "provisionalUserProject": The project to be billed for this request
2845// if the target bucket is requester-pays bucket.
2846func (c *BucketAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsListCall {
2847	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2848	return c
2849}
2850
2851// UserProject sets the optional parameter "userProject": The project to
2852// be billed for this request. Required for Requester Pays buckets.
2853func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
2854	c.urlParams_.Set("userProject", userProject)
2855	return c
2856}
2857
2858// Fields allows partial responses to be retrieved. See
2859// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2860// for more information.
2861func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
2862	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2863	return c
2864}
2865
2866// IfNoneMatch sets the optional parameter which makes the operation
2867// fail if the object's ETag matches the given value. This is useful for
2868// getting updates only after the object has changed since the last
2869// request. Use googleapi.IsNotModified to check whether the response
2870// error from Do is the result of In-None-Match.
2871func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
2872	c.ifNoneMatch_ = entityTag
2873	return c
2874}
2875
2876// Context sets the context to be used in this call's Do method. Any
2877// pending HTTP request will be aborted if the provided context is
2878// canceled.
2879func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
2880	c.ctx_ = ctx
2881	return c
2882}
2883
2884// Header returns an http.Header that can be modified by the caller to
2885// add HTTP headers to the request.
2886func (c *BucketAccessControlsListCall) Header() http.Header {
2887	if c.header_ == nil {
2888		c.header_ = make(http.Header)
2889	}
2890	return c.header_
2891}
2892
2893func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
2894	reqHeaders := make(http.Header)
2895	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
2896	for k, v := range c.header_ {
2897		reqHeaders[k] = v
2898	}
2899	reqHeaders.Set("User-Agent", c.s.userAgent())
2900	if c.ifNoneMatch_ != "" {
2901		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2902	}
2903	var body io.Reader = nil
2904	c.urlParams_.Set("alt", alt)
2905	c.urlParams_.Set("prettyPrint", "false")
2906	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2907	urls += "?" + c.urlParams_.Encode()
2908	req, err := http.NewRequest("GET", urls, body)
2909	if err != nil {
2910		return nil, err
2911	}
2912	req.Header = reqHeaders
2913	googleapi.Expand(req.URL, map[string]string{
2914		"bucket": c.bucket,
2915	})
2916	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2917}
2918
2919// Do executes the "storage.bucketAccessControls.list" call.
2920// Exactly one of *BucketAccessControls or error will be non-nil. Any
2921// non-2xx status code is an error. Response headers are in either
2922// *BucketAccessControls.ServerResponse.Header or (if a response was
2923// returned at all) in error.(*googleapi.Error).Header. Use
2924// googleapi.IsNotModified to check whether the returned error was
2925// because http.StatusNotModified was returned.
2926func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
2927	gensupport.SetOptions(c.urlParams_, opts...)
2928	res, err := c.doRequest("json")
2929	if res != nil && res.StatusCode == http.StatusNotModified {
2930		if res.Body != nil {
2931			res.Body.Close()
2932		}
2933		return nil, &googleapi.Error{
2934			Code:   res.StatusCode,
2935			Header: res.Header,
2936		}
2937	}
2938	if err != nil {
2939		return nil, err
2940	}
2941	defer googleapi.CloseBody(res)
2942	if err := googleapi.CheckResponse(res); err != nil {
2943		return nil, err
2944	}
2945	ret := &BucketAccessControls{
2946		ServerResponse: googleapi.ServerResponse{
2947			Header:         res.Header,
2948			HTTPStatusCode: res.StatusCode,
2949		},
2950	}
2951	target := &ret
2952	if err := gensupport.DecodeResponse(target, res); err != nil {
2953		return nil, err
2954	}
2955	return ret, nil
2956	// {
2957	//   "description": "Retrieves ACL entries on the specified bucket.",
2958	//   "httpMethod": "GET",
2959	//   "id": "storage.bucketAccessControls.list",
2960	//   "parameterOrder": [
2961	//     "bucket"
2962	//   ],
2963	//   "parameters": {
2964	//     "bucket": {
2965	//       "description": "Name of a bucket.",
2966	//       "location": "path",
2967	//       "required": true,
2968	//       "type": "string"
2969	//     },
2970	//     "provisionalUserProject": {
2971	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2972	//       "location": "query",
2973	//       "type": "string"
2974	//     },
2975	//     "userProject": {
2976	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2977	//       "location": "query",
2978	//       "type": "string"
2979	//     }
2980	//   },
2981	//   "path": "b/{bucket}/acl",
2982	//   "response": {
2983	//     "$ref": "BucketAccessControls"
2984	//   },
2985	//   "scopes": [
2986	//     "https://www.googleapis.com/auth/cloud-platform",
2987	//     "https://www.googleapis.com/auth/devstorage.full_control"
2988	//   ]
2989	// }
2990
2991}
2992
2993// method id "storage.bucketAccessControls.patch":
2994
2995type BucketAccessControlsPatchCall struct {
2996	s                   *Service
2997	bucket              string
2998	entity              string
2999	bucketaccesscontrol *BucketAccessControl
3000	urlParams_          gensupport.URLParams
3001	ctx_                context.Context
3002	header_             http.Header
3003}
3004
3005// Patch: Patches an ACL entry on the specified bucket.
3006func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
3007	c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3008	c.bucket = bucket
3009	c.entity = entity
3010	c.bucketaccesscontrol = bucketaccesscontrol
3011	return c
3012}
3013
3014// ProvisionalUserProject sets the optional parameter
3015// "provisionalUserProject": The project to be billed for this request
3016// if the target bucket is requester-pays bucket.
3017func (c *BucketAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsPatchCall {
3018	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3019	return c
3020}
3021
3022// UserProject sets the optional parameter "userProject": The project to
3023// be billed for this request. Required for Requester Pays buckets.
3024func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
3025	c.urlParams_.Set("userProject", userProject)
3026	return c
3027}
3028
3029// Fields allows partial responses to be retrieved. See
3030// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3031// for more information.
3032func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
3033	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3034	return c
3035}
3036
3037// Context sets the context to be used in this call's Do method. Any
3038// pending HTTP request will be aborted if the provided context is
3039// canceled.
3040func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
3041	c.ctx_ = ctx
3042	return c
3043}
3044
3045// Header returns an http.Header that can be modified by the caller to
3046// add HTTP headers to the request.
3047func (c *BucketAccessControlsPatchCall) Header() http.Header {
3048	if c.header_ == nil {
3049		c.header_ = make(http.Header)
3050	}
3051	return c.header_
3052}
3053
3054func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
3055	reqHeaders := make(http.Header)
3056	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
3057	for k, v := range c.header_ {
3058		reqHeaders[k] = v
3059	}
3060	reqHeaders.Set("User-Agent", c.s.userAgent())
3061	var body io.Reader = nil
3062	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
3063	if err != nil {
3064		return nil, err
3065	}
3066	reqHeaders.Set("Content-Type", "application/json")
3067	c.urlParams_.Set("alt", alt)
3068	c.urlParams_.Set("prettyPrint", "false")
3069	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
3070	urls += "?" + c.urlParams_.Encode()
3071	req, err := http.NewRequest("PATCH", urls, body)
3072	if err != nil {
3073		return nil, err
3074	}
3075	req.Header = reqHeaders
3076	googleapi.Expand(req.URL, map[string]string{
3077		"bucket": c.bucket,
3078		"entity": c.entity,
3079	})
3080	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3081}
3082
3083// Do executes the "storage.bucketAccessControls.patch" call.
3084// Exactly one of *BucketAccessControl or error will be non-nil. Any
3085// non-2xx status code is an error. Response headers are in either
3086// *BucketAccessControl.ServerResponse.Header or (if a response was
3087// returned at all) in error.(*googleapi.Error).Header. Use
3088// googleapi.IsNotModified to check whether the returned error was
3089// because http.StatusNotModified was returned.
3090func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, 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 := &BucketAccessControl{
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": "Patches an ACL entry on the specified bucket.",
3122	//   "httpMethod": "PATCH",
3123	//   "id": "storage.bucketAccessControls.patch",
3124	//   "parameterOrder": [
3125	//     "bucket",
3126	//     "entity"
3127	//   ],
3128	//   "parameters": {
3129	//     "bucket": {
3130	//       "description": "Name of a bucket.",
3131	//       "location": "path",
3132	//       "required": true,
3133	//       "type": "string"
3134	//     },
3135	//     "entity": {
3136	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
3137	//       "location": "path",
3138	//       "required": true,
3139	//       "type": "string"
3140	//     },
3141	//     "provisionalUserProject": {
3142	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3143	//       "location": "query",
3144	//       "type": "string"
3145	//     },
3146	//     "userProject": {
3147	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3148	//       "location": "query",
3149	//       "type": "string"
3150	//     }
3151	//   },
3152	//   "path": "b/{bucket}/acl/{entity}",
3153	//   "request": {
3154	//     "$ref": "BucketAccessControl"
3155	//   },
3156	//   "response": {
3157	//     "$ref": "BucketAccessControl"
3158	//   },
3159	//   "scopes": [
3160	//     "https://www.googleapis.com/auth/cloud-platform",
3161	//     "https://www.googleapis.com/auth/devstorage.full_control"
3162	//   ]
3163	// }
3164
3165}
3166
3167// method id "storage.bucketAccessControls.update":
3168
3169type BucketAccessControlsUpdateCall struct {
3170	s                   *Service
3171	bucket              string
3172	entity              string
3173	bucketaccesscontrol *BucketAccessControl
3174	urlParams_          gensupport.URLParams
3175	ctx_                context.Context
3176	header_             http.Header
3177}
3178
3179// Update: Updates an ACL entry on the specified bucket.
3180func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
3181	c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3182	c.bucket = bucket
3183	c.entity = entity
3184	c.bucketaccesscontrol = bucketaccesscontrol
3185	return c
3186}
3187
3188// ProvisionalUserProject sets the optional parameter
3189// "provisionalUserProject": The project to be billed for this request
3190// if the target bucket is requester-pays bucket.
3191func (c *BucketAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsUpdateCall {
3192	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3193	return c
3194}
3195
3196// UserProject sets the optional parameter "userProject": The project to
3197// be billed for this request. Required for Requester Pays buckets.
3198func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
3199	c.urlParams_.Set("userProject", userProject)
3200	return c
3201}
3202
3203// Fields allows partial responses to be retrieved. See
3204// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3205// for more information.
3206func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
3207	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3208	return c
3209}
3210
3211// Context sets the context to be used in this call's Do method. Any
3212// pending HTTP request will be aborted if the provided context is
3213// canceled.
3214func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
3215	c.ctx_ = ctx
3216	return c
3217}
3218
3219// Header returns an http.Header that can be modified by the caller to
3220// add HTTP headers to the request.
3221func (c *BucketAccessControlsUpdateCall) Header() http.Header {
3222	if c.header_ == nil {
3223		c.header_ = make(http.Header)
3224	}
3225	return c.header_
3226}
3227
3228func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
3229	reqHeaders := make(http.Header)
3230	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
3231	for k, v := range c.header_ {
3232		reqHeaders[k] = v
3233	}
3234	reqHeaders.Set("User-Agent", c.s.userAgent())
3235	var body io.Reader = nil
3236	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
3237	if err != nil {
3238		return nil, err
3239	}
3240	reqHeaders.Set("Content-Type", "application/json")
3241	c.urlParams_.Set("alt", alt)
3242	c.urlParams_.Set("prettyPrint", "false")
3243	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
3244	urls += "?" + c.urlParams_.Encode()
3245	req, err := http.NewRequest("PUT", urls, body)
3246	if err != nil {
3247		return nil, err
3248	}
3249	req.Header = reqHeaders
3250	googleapi.Expand(req.URL, map[string]string{
3251		"bucket": c.bucket,
3252		"entity": c.entity,
3253	})
3254	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3255}
3256
3257// Do executes the "storage.bucketAccessControls.update" call.
3258// Exactly one of *BucketAccessControl or error will be non-nil. Any
3259// non-2xx status code is an error. Response headers are in either
3260// *BucketAccessControl.ServerResponse.Header or (if a response was
3261// returned at all) in error.(*googleapi.Error).Header. Use
3262// googleapi.IsNotModified to check whether the returned error was
3263// because http.StatusNotModified was returned.
3264func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
3265	gensupport.SetOptions(c.urlParams_, opts...)
3266	res, err := c.doRequest("json")
3267	if res != nil && res.StatusCode == http.StatusNotModified {
3268		if res.Body != nil {
3269			res.Body.Close()
3270		}
3271		return nil, &googleapi.Error{
3272			Code:   res.StatusCode,
3273			Header: res.Header,
3274		}
3275	}
3276	if err != nil {
3277		return nil, err
3278	}
3279	defer googleapi.CloseBody(res)
3280	if err := googleapi.CheckResponse(res); err != nil {
3281		return nil, err
3282	}
3283	ret := &BucketAccessControl{
3284		ServerResponse: googleapi.ServerResponse{
3285			Header:         res.Header,
3286			HTTPStatusCode: res.StatusCode,
3287		},
3288	}
3289	target := &ret
3290	if err := gensupport.DecodeResponse(target, res); err != nil {
3291		return nil, err
3292	}
3293	return ret, nil
3294	// {
3295	//   "description": "Updates an ACL entry on the specified bucket.",
3296	//   "httpMethod": "PUT",
3297	//   "id": "storage.bucketAccessControls.update",
3298	//   "parameterOrder": [
3299	//     "bucket",
3300	//     "entity"
3301	//   ],
3302	//   "parameters": {
3303	//     "bucket": {
3304	//       "description": "Name of a bucket.",
3305	//       "location": "path",
3306	//       "required": true,
3307	//       "type": "string"
3308	//     },
3309	//     "entity": {
3310	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
3311	//       "location": "path",
3312	//       "required": true,
3313	//       "type": "string"
3314	//     },
3315	//     "provisionalUserProject": {
3316	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3317	//       "location": "query",
3318	//       "type": "string"
3319	//     },
3320	//     "userProject": {
3321	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3322	//       "location": "query",
3323	//       "type": "string"
3324	//     }
3325	//   },
3326	//   "path": "b/{bucket}/acl/{entity}",
3327	//   "request": {
3328	//     "$ref": "BucketAccessControl"
3329	//   },
3330	//   "response": {
3331	//     "$ref": "BucketAccessControl"
3332	//   },
3333	//   "scopes": [
3334	//     "https://www.googleapis.com/auth/cloud-platform",
3335	//     "https://www.googleapis.com/auth/devstorage.full_control"
3336	//   ]
3337	// }
3338
3339}
3340
3341// method id "storage.buckets.delete":
3342
3343type BucketsDeleteCall struct {
3344	s          *Service
3345	bucket     string
3346	urlParams_ gensupport.URLParams
3347	ctx_       context.Context
3348	header_    http.Header
3349}
3350
3351// Delete: Permanently deletes an empty bucket.
3352func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
3353	c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3354	c.bucket = bucket
3355	return c
3356}
3357
3358// IfMetagenerationMatch sets the optional parameter
3359// "ifMetagenerationMatch": If set, only deletes the bucket if its
3360// metageneration matches this value.
3361func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall {
3362	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3363	return c
3364}
3365
3366// IfMetagenerationNotMatch sets the optional parameter
3367// "ifMetagenerationNotMatch": If set, only deletes the bucket if its
3368// metageneration does not match this value.
3369func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall {
3370	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3371	return c
3372}
3373
3374// ProvisionalUserProject sets the optional parameter
3375// "provisionalUserProject": The project to be billed for this request
3376// if the target bucket is requester-pays bucket.
3377func (c *BucketsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketsDeleteCall {
3378	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3379	return c
3380}
3381
3382// UserProject sets the optional parameter "userProject": The project to
3383// be billed for this request. Required for Requester Pays buckets.
3384func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
3385	c.urlParams_.Set("userProject", userProject)
3386	return c
3387}
3388
3389// Fields allows partial responses to be retrieved. See
3390// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3391// for more information.
3392func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
3393	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3394	return c
3395}
3396
3397// Context sets the context to be used in this call's Do method. Any
3398// pending HTTP request will be aborted if the provided context is
3399// canceled.
3400func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
3401	c.ctx_ = ctx
3402	return c
3403}
3404
3405// Header returns an http.Header that can be modified by the caller to
3406// add HTTP headers to the request.
3407func (c *BucketsDeleteCall) Header() http.Header {
3408	if c.header_ == nil {
3409		c.header_ = make(http.Header)
3410	}
3411	return c.header_
3412}
3413
3414func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
3415	reqHeaders := make(http.Header)
3416	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
3417	for k, v := range c.header_ {
3418		reqHeaders[k] = v
3419	}
3420	reqHeaders.Set("User-Agent", c.s.userAgent())
3421	var body io.Reader = nil
3422	c.urlParams_.Set("alt", alt)
3423	c.urlParams_.Set("prettyPrint", "false")
3424	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3425	urls += "?" + c.urlParams_.Encode()
3426	req, err := http.NewRequest("DELETE", urls, body)
3427	if err != nil {
3428		return nil, err
3429	}
3430	req.Header = reqHeaders
3431	googleapi.Expand(req.URL, map[string]string{
3432		"bucket": c.bucket,
3433	})
3434	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3435}
3436
3437// Do executes the "storage.buckets.delete" call.
3438func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
3439	gensupport.SetOptions(c.urlParams_, opts...)
3440	res, err := c.doRequest("json")
3441	if err != nil {
3442		return err
3443	}
3444	defer googleapi.CloseBody(res)
3445	if err := googleapi.CheckResponse(res); err != nil {
3446		return err
3447	}
3448	return nil
3449	// {
3450	//   "description": "Permanently deletes an empty bucket.",
3451	//   "httpMethod": "DELETE",
3452	//   "id": "storage.buckets.delete",
3453	//   "parameterOrder": [
3454	//     "bucket"
3455	//   ],
3456	//   "parameters": {
3457	//     "bucket": {
3458	//       "description": "Name of a bucket.",
3459	//       "location": "path",
3460	//       "required": true,
3461	//       "type": "string"
3462	//     },
3463	//     "ifMetagenerationMatch": {
3464	//       "description": "If set, only deletes the bucket if its metageneration matches this value.",
3465	//       "format": "int64",
3466	//       "location": "query",
3467	//       "type": "string"
3468	//     },
3469	//     "ifMetagenerationNotMatch": {
3470	//       "description": "If set, only deletes the bucket if its metageneration does not match this value.",
3471	//       "format": "int64",
3472	//       "location": "query",
3473	//       "type": "string"
3474	//     },
3475	//     "provisionalUserProject": {
3476	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3477	//       "location": "query",
3478	//       "type": "string"
3479	//     },
3480	//     "userProject": {
3481	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3482	//       "location": "query",
3483	//       "type": "string"
3484	//     }
3485	//   },
3486	//   "path": "b/{bucket}",
3487	//   "scopes": [
3488	//     "https://www.googleapis.com/auth/cloud-platform",
3489	//     "https://www.googleapis.com/auth/devstorage.full_control",
3490	//     "https://www.googleapis.com/auth/devstorage.read_write"
3491	//   ]
3492	// }
3493
3494}
3495
3496// method id "storage.buckets.get":
3497
3498type BucketsGetCall struct {
3499	s            *Service
3500	bucket       string
3501	urlParams_   gensupport.URLParams
3502	ifNoneMatch_ string
3503	ctx_         context.Context
3504	header_      http.Header
3505}
3506
3507// Get: Returns metadata for the specified bucket.
3508func (r *BucketsService) Get(bucket string) *BucketsGetCall {
3509	c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3510	c.bucket = bucket
3511	return c
3512}
3513
3514// IfMetagenerationMatch sets the optional parameter
3515// "ifMetagenerationMatch": Makes the return of the bucket metadata
3516// conditional on whether the bucket's current metageneration matches
3517// the given value.
3518func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
3519	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3520	return c
3521}
3522
3523// IfMetagenerationNotMatch sets the optional parameter
3524// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
3525// conditional on whether the bucket's current metageneration does not
3526// match the given value.
3527func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall {
3528	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3529	return c
3530}
3531
3532// Projection sets the optional parameter "projection": Set of
3533// properties to return. Defaults to noAcl.
3534//
3535// Possible values:
3536//   "full" - Include all properties.
3537//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3538func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
3539	c.urlParams_.Set("projection", projection)
3540	return c
3541}
3542
3543// ProvisionalUserProject sets the optional parameter
3544// "provisionalUserProject": The project to be billed for this request
3545// if the target bucket is requester-pays bucket.
3546func (c *BucketsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetCall {
3547	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3548	return c
3549}
3550
3551// UserProject sets the optional parameter "userProject": The project to
3552// be billed for this request. Required for Requester Pays buckets.
3553func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
3554	c.urlParams_.Set("userProject", userProject)
3555	return c
3556}
3557
3558// Fields allows partial responses to be retrieved. See
3559// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3560// for more information.
3561func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
3562	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3563	return c
3564}
3565
3566// IfNoneMatch sets the optional parameter which makes the operation
3567// fail if the object's ETag matches the given value. This is useful for
3568// getting updates only after the object has changed since the last
3569// request. Use googleapi.IsNotModified to check whether the response
3570// error from Do is the result of In-None-Match.
3571func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
3572	c.ifNoneMatch_ = entityTag
3573	return c
3574}
3575
3576// Context sets the context to be used in this call's Do method. Any
3577// pending HTTP request will be aborted if the provided context is
3578// canceled.
3579func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
3580	c.ctx_ = ctx
3581	return c
3582}
3583
3584// Header returns an http.Header that can be modified by the caller to
3585// add HTTP headers to the request.
3586func (c *BucketsGetCall) Header() http.Header {
3587	if c.header_ == nil {
3588		c.header_ = make(http.Header)
3589	}
3590	return c.header_
3591}
3592
3593func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
3594	reqHeaders := make(http.Header)
3595	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
3596	for k, v := range c.header_ {
3597		reqHeaders[k] = v
3598	}
3599	reqHeaders.Set("User-Agent", c.s.userAgent())
3600	if c.ifNoneMatch_ != "" {
3601		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3602	}
3603	var body io.Reader = nil
3604	c.urlParams_.Set("alt", alt)
3605	c.urlParams_.Set("prettyPrint", "false")
3606	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3607	urls += "?" + c.urlParams_.Encode()
3608	req, err := http.NewRequest("GET", urls, body)
3609	if err != nil {
3610		return nil, err
3611	}
3612	req.Header = reqHeaders
3613	googleapi.Expand(req.URL, map[string]string{
3614		"bucket": c.bucket,
3615	})
3616	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3617}
3618
3619// Do executes the "storage.buckets.get" call.
3620// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3621// code is an error. Response headers are in either
3622// *Bucket.ServerResponse.Header or (if a response was returned at all)
3623// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3624// check whether the returned error was because http.StatusNotModified
3625// was returned.
3626func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3627	gensupport.SetOptions(c.urlParams_, opts...)
3628	res, err := c.doRequest("json")
3629	if res != nil && res.StatusCode == http.StatusNotModified {
3630		if res.Body != nil {
3631			res.Body.Close()
3632		}
3633		return nil, &googleapi.Error{
3634			Code:   res.StatusCode,
3635			Header: res.Header,
3636		}
3637	}
3638	if err != nil {
3639		return nil, err
3640	}
3641	defer googleapi.CloseBody(res)
3642	if err := googleapi.CheckResponse(res); err != nil {
3643		return nil, err
3644	}
3645	ret := &Bucket{
3646		ServerResponse: googleapi.ServerResponse{
3647			Header:         res.Header,
3648			HTTPStatusCode: res.StatusCode,
3649		},
3650	}
3651	target := &ret
3652	if err := gensupport.DecodeResponse(target, res); err != nil {
3653		return nil, err
3654	}
3655	return ret, nil
3656	// {
3657	//   "description": "Returns metadata for the specified bucket.",
3658	//   "httpMethod": "GET",
3659	//   "id": "storage.buckets.get",
3660	//   "parameterOrder": [
3661	//     "bucket"
3662	//   ],
3663	//   "parameters": {
3664	//     "bucket": {
3665	//       "description": "Name of a bucket.",
3666	//       "location": "path",
3667	//       "required": true,
3668	//       "type": "string"
3669	//     },
3670	//     "ifMetagenerationMatch": {
3671	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
3672	//       "format": "int64",
3673	//       "location": "query",
3674	//       "type": "string"
3675	//     },
3676	//     "ifMetagenerationNotMatch": {
3677	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
3678	//       "format": "int64",
3679	//       "location": "query",
3680	//       "type": "string"
3681	//     },
3682	//     "projection": {
3683	//       "description": "Set of properties to return. Defaults to noAcl.",
3684	//       "enum": [
3685	//         "full",
3686	//         "noAcl"
3687	//       ],
3688	//       "enumDescriptions": [
3689	//         "Include all properties.",
3690	//         "Omit owner, acl and defaultObjectAcl properties."
3691	//       ],
3692	//       "location": "query",
3693	//       "type": "string"
3694	//     },
3695	//     "provisionalUserProject": {
3696	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3697	//       "location": "query",
3698	//       "type": "string"
3699	//     },
3700	//     "userProject": {
3701	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3702	//       "location": "query",
3703	//       "type": "string"
3704	//     }
3705	//   },
3706	//   "path": "b/{bucket}",
3707	//   "response": {
3708	//     "$ref": "Bucket"
3709	//   },
3710	//   "scopes": [
3711	//     "https://www.googleapis.com/auth/cloud-platform",
3712	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3713	//     "https://www.googleapis.com/auth/devstorage.full_control",
3714	//     "https://www.googleapis.com/auth/devstorage.read_only",
3715	//     "https://www.googleapis.com/auth/devstorage.read_write"
3716	//   ]
3717	// }
3718
3719}
3720
3721// method id "storage.buckets.getIamPolicy":
3722
3723type BucketsGetIamPolicyCall struct {
3724	s            *Service
3725	bucket       string
3726	urlParams_   gensupport.URLParams
3727	ifNoneMatch_ string
3728	ctx_         context.Context
3729	header_      http.Header
3730}
3731
3732// GetIamPolicy: Returns an IAM policy for the specified bucket.
3733func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
3734	c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3735	c.bucket = bucket
3736	return c
3737}
3738
3739// OptionsRequestedPolicyVersion sets the optional parameter
3740// "optionsRequestedPolicyVersion": The IAM policy format version to be
3741// returned. If the optionsRequestedPolicyVersion is for an older
3742// version that doesn't support part of the requested IAM policy, the
3743// request fails.
3744func (c *BucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BucketsGetIamPolicyCall {
3745	c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3746	return c
3747}
3748
3749// ProvisionalUserProject sets the optional parameter
3750// "provisionalUserProject": The project to be billed for this request
3751// if the target bucket is requester-pays bucket.
3752func (c *BucketsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetIamPolicyCall {
3753	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3754	return c
3755}
3756
3757// UserProject sets the optional parameter "userProject": The project to
3758// be billed for this request. Required for Requester Pays buckets.
3759func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
3760	c.urlParams_.Set("userProject", userProject)
3761	return c
3762}
3763
3764// Fields allows partial responses to be retrieved. See
3765// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3766// for more information.
3767func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall {
3768	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3769	return c
3770}
3771
3772// IfNoneMatch sets the optional parameter which makes the operation
3773// fail if the object's ETag matches the given value. This is useful for
3774// getting updates only after the object has changed since the last
3775// request. Use googleapi.IsNotModified to check whether the response
3776// error from Do is the result of In-None-Match.
3777func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall {
3778	c.ifNoneMatch_ = entityTag
3779	return c
3780}
3781
3782// Context sets the context to be used in this call's Do method. Any
3783// pending HTTP request will be aborted if the provided context is
3784// canceled.
3785func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
3786	c.ctx_ = ctx
3787	return c
3788}
3789
3790// Header returns an http.Header that can be modified by the caller to
3791// add HTTP headers to the request.
3792func (c *BucketsGetIamPolicyCall) Header() http.Header {
3793	if c.header_ == nil {
3794		c.header_ = make(http.Header)
3795	}
3796	return c.header_
3797}
3798
3799func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3800	reqHeaders := make(http.Header)
3801	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
3802	for k, v := range c.header_ {
3803		reqHeaders[k] = v
3804	}
3805	reqHeaders.Set("User-Agent", c.s.userAgent())
3806	if c.ifNoneMatch_ != "" {
3807		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3808	}
3809	var body io.Reader = nil
3810	c.urlParams_.Set("alt", alt)
3811	c.urlParams_.Set("prettyPrint", "false")
3812	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
3813	urls += "?" + c.urlParams_.Encode()
3814	req, err := http.NewRequest("GET", urls, body)
3815	if err != nil {
3816		return nil, err
3817	}
3818	req.Header = reqHeaders
3819	googleapi.Expand(req.URL, map[string]string{
3820		"bucket": c.bucket,
3821	})
3822	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3823}
3824
3825// Do executes the "storage.buckets.getIamPolicy" call.
3826// Exactly one of *Policy or error will be non-nil. Any non-2xx status
3827// code is an error. Response headers are in either
3828// *Policy.ServerResponse.Header or (if a response was returned at all)
3829// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3830// check whether the returned error was because http.StatusNotModified
3831// was returned.
3832func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3833	gensupport.SetOptions(c.urlParams_, opts...)
3834	res, err := c.doRequest("json")
3835	if res != nil && res.StatusCode == http.StatusNotModified {
3836		if res.Body != nil {
3837			res.Body.Close()
3838		}
3839		return nil, &googleapi.Error{
3840			Code:   res.StatusCode,
3841			Header: res.Header,
3842		}
3843	}
3844	if err != nil {
3845		return nil, err
3846	}
3847	defer googleapi.CloseBody(res)
3848	if err := googleapi.CheckResponse(res); err != nil {
3849		return nil, err
3850	}
3851	ret := &Policy{
3852		ServerResponse: googleapi.ServerResponse{
3853			Header:         res.Header,
3854			HTTPStatusCode: res.StatusCode,
3855		},
3856	}
3857	target := &ret
3858	if err := gensupport.DecodeResponse(target, res); err != nil {
3859		return nil, err
3860	}
3861	return ret, nil
3862	// {
3863	//   "description": "Returns an IAM policy for the specified bucket.",
3864	//   "httpMethod": "GET",
3865	//   "id": "storage.buckets.getIamPolicy",
3866	//   "parameterOrder": [
3867	//     "bucket"
3868	//   ],
3869	//   "parameters": {
3870	//     "bucket": {
3871	//       "description": "Name of a bucket.",
3872	//       "location": "path",
3873	//       "required": true,
3874	//       "type": "string"
3875	//     },
3876	//     "optionsRequestedPolicyVersion": {
3877	//       "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.",
3878	//       "format": "int32",
3879	//       "location": "query",
3880	//       "minimum": "1",
3881	//       "type": "integer"
3882	//     },
3883	//     "provisionalUserProject": {
3884	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3885	//       "location": "query",
3886	//       "type": "string"
3887	//     },
3888	//     "userProject": {
3889	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3890	//       "location": "query",
3891	//       "type": "string"
3892	//     }
3893	//   },
3894	//   "path": "b/{bucket}/iam",
3895	//   "response": {
3896	//     "$ref": "Policy"
3897	//   },
3898	//   "scopes": [
3899	//     "https://www.googleapis.com/auth/cloud-platform",
3900	//     "https://www.googleapis.com/auth/devstorage.full_control"
3901	//   ]
3902	// }
3903
3904}
3905
3906// method id "storage.buckets.insert":
3907
3908type BucketsInsertCall struct {
3909	s          *Service
3910	bucket     *Bucket
3911	urlParams_ gensupport.URLParams
3912	ctx_       context.Context
3913	header_    http.Header
3914}
3915
3916// Insert: Creates a new bucket.
3917func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
3918	c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3919	c.urlParams_.Set("project", projectid)
3920	c.bucket = bucket
3921	return c
3922}
3923
3924// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
3925// predefined set of access controls to this bucket.
3926//
3927// Possible values:
3928//   "authenticatedRead" - Project team owners get OWNER access, and
3929// allAuthenticatedUsers get READER access.
3930//   "private" - Project team owners get OWNER access.
3931//   "projectPrivate" - Project team members get access according to
3932// their roles.
3933//   "publicRead" - Project team owners get OWNER access, and allUsers
3934// get READER access.
3935//   "publicReadWrite" - Project team owners get OWNER access, and
3936// allUsers get WRITER access.
3937func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall {
3938	c.urlParams_.Set("predefinedAcl", predefinedAcl)
3939	return c
3940}
3941
3942// PredefinedDefaultObjectAcl sets the optional parameter
3943// "predefinedDefaultObjectAcl": Apply a predefined set of default
3944// object access controls to this bucket.
3945//
3946// Possible values:
3947//   "authenticatedRead" - Object owner gets OWNER access, and
3948// allAuthenticatedUsers get READER access.
3949//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
3950// project team owners get OWNER access.
3951//   "bucketOwnerRead" - Object owner gets OWNER access, and project
3952// team owners get READER access.
3953//   "private" - Object owner gets OWNER access.
3954//   "projectPrivate" - Object owner gets OWNER access, and project team
3955// members get access according to their roles.
3956//   "publicRead" - Object owner gets OWNER access, and allUsers get
3957// READER access.
3958func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
3959	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
3960	return c
3961}
3962
3963// Projection sets the optional parameter "projection": Set of
3964// properties to return. Defaults to noAcl, unless the bucket resource
3965// specifies acl or defaultObjectAcl properties, when it defaults to
3966// full.
3967//
3968// Possible values:
3969//   "full" - Include all properties.
3970//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3971func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
3972	c.urlParams_.Set("projection", projection)
3973	return c
3974}
3975
3976// ProvisionalUserProject sets the optional parameter
3977// "provisionalUserProject": The project to be billed for this request
3978// if the target bucket is requester-pays bucket.
3979func (c *BucketsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketsInsertCall {
3980	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3981	return c
3982}
3983
3984// UserProject sets the optional parameter "userProject": The project to
3985// be billed for this request.
3986func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall {
3987	c.urlParams_.Set("userProject", userProject)
3988	return c
3989}
3990
3991// Fields allows partial responses to be retrieved. See
3992// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3993// for more information.
3994func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
3995	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3996	return c
3997}
3998
3999// Context sets the context to be used in this call's Do method. Any
4000// pending HTTP request will be aborted if the provided context is
4001// canceled.
4002func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
4003	c.ctx_ = ctx
4004	return c
4005}
4006
4007// Header returns an http.Header that can be modified by the caller to
4008// add HTTP headers to the request.
4009func (c *BucketsInsertCall) Header() http.Header {
4010	if c.header_ == nil {
4011		c.header_ = make(http.Header)
4012	}
4013	return c.header_
4014}
4015
4016func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
4017	reqHeaders := make(http.Header)
4018	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
4019	for k, v := range c.header_ {
4020		reqHeaders[k] = v
4021	}
4022	reqHeaders.Set("User-Agent", c.s.userAgent())
4023	var body io.Reader = nil
4024	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
4025	if err != nil {
4026		return nil, err
4027	}
4028	reqHeaders.Set("Content-Type", "application/json")
4029	c.urlParams_.Set("alt", alt)
4030	c.urlParams_.Set("prettyPrint", "false")
4031	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
4032	urls += "?" + c.urlParams_.Encode()
4033	req, err := http.NewRequest("POST", urls, body)
4034	if err != nil {
4035		return nil, err
4036	}
4037	req.Header = reqHeaders
4038	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4039}
4040
4041// Do executes the "storage.buckets.insert" call.
4042// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4043// code is an error. Response headers are in either
4044// *Bucket.ServerResponse.Header or (if a response was returned at all)
4045// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4046// check whether the returned error was because http.StatusNotModified
4047// was returned.
4048func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4049	gensupport.SetOptions(c.urlParams_, opts...)
4050	res, err := c.doRequest("json")
4051	if res != nil && res.StatusCode == http.StatusNotModified {
4052		if res.Body != nil {
4053			res.Body.Close()
4054		}
4055		return nil, &googleapi.Error{
4056			Code:   res.StatusCode,
4057			Header: res.Header,
4058		}
4059	}
4060	if err != nil {
4061		return nil, err
4062	}
4063	defer googleapi.CloseBody(res)
4064	if err := googleapi.CheckResponse(res); err != nil {
4065		return nil, err
4066	}
4067	ret := &Bucket{
4068		ServerResponse: googleapi.ServerResponse{
4069			Header:         res.Header,
4070			HTTPStatusCode: res.StatusCode,
4071		},
4072	}
4073	target := &ret
4074	if err := gensupport.DecodeResponse(target, res); err != nil {
4075		return nil, err
4076	}
4077	return ret, nil
4078	// {
4079	//   "description": "Creates a new bucket.",
4080	//   "httpMethod": "POST",
4081	//   "id": "storage.buckets.insert",
4082	//   "parameterOrder": [
4083	//     "project"
4084	//   ],
4085	//   "parameters": {
4086	//     "predefinedAcl": {
4087	//       "description": "Apply a predefined set of access controls to this bucket.",
4088	//       "enum": [
4089	//         "authenticatedRead",
4090	//         "private",
4091	//         "projectPrivate",
4092	//         "publicRead",
4093	//         "publicReadWrite"
4094	//       ],
4095	//       "enumDescriptions": [
4096	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4097	//         "Project team owners get OWNER access.",
4098	//         "Project team members get access according to their roles.",
4099	//         "Project team owners get OWNER access, and allUsers get READER access.",
4100	//         "Project team owners get OWNER access, and allUsers get WRITER access."
4101	//       ],
4102	//       "location": "query",
4103	//       "type": "string"
4104	//     },
4105	//     "predefinedDefaultObjectAcl": {
4106	//       "description": "Apply a predefined set of default object access controls to this bucket.",
4107	//       "enum": [
4108	//         "authenticatedRead",
4109	//         "bucketOwnerFullControl",
4110	//         "bucketOwnerRead",
4111	//         "private",
4112	//         "projectPrivate",
4113	//         "publicRead"
4114	//       ],
4115	//       "enumDescriptions": [
4116	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4117	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
4118	//         "Object owner gets OWNER access, and project team owners get READER access.",
4119	//         "Object owner gets OWNER access.",
4120	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
4121	//         "Object owner gets OWNER access, and allUsers get READER access."
4122	//       ],
4123	//       "location": "query",
4124	//       "type": "string"
4125	//     },
4126	//     "project": {
4127	//       "description": "A valid API project identifier.",
4128	//       "location": "query",
4129	//       "required": true,
4130	//       "type": "string"
4131	//     },
4132	//     "projection": {
4133	//       "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
4134	//       "enum": [
4135	//         "full",
4136	//         "noAcl"
4137	//       ],
4138	//       "enumDescriptions": [
4139	//         "Include all properties.",
4140	//         "Omit owner, acl and defaultObjectAcl properties."
4141	//       ],
4142	//       "location": "query",
4143	//       "type": "string"
4144	//     },
4145	//     "provisionalUserProject": {
4146	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4147	//       "location": "query",
4148	//       "type": "string"
4149	//     },
4150	//     "userProject": {
4151	//       "description": "The project to be billed for this request.",
4152	//       "location": "query",
4153	//       "type": "string"
4154	//     }
4155	//   },
4156	//   "path": "b",
4157	//   "request": {
4158	//     "$ref": "Bucket"
4159	//   },
4160	//   "response": {
4161	//     "$ref": "Bucket"
4162	//   },
4163	//   "scopes": [
4164	//     "https://www.googleapis.com/auth/cloud-platform",
4165	//     "https://www.googleapis.com/auth/devstorage.full_control",
4166	//     "https://www.googleapis.com/auth/devstorage.read_write"
4167	//   ]
4168	// }
4169
4170}
4171
4172// method id "storage.buckets.list":
4173
4174type BucketsListCall struct {
4175	s            *Service
4176	urlParams_   gensupport.URLParams
4177	ifNoneMatch_ string
4178	ctx_         context.Context
4179	header_      http.Header
4180}
4181
4182// List: Retrieves a list of buckets for a given project.
4183func (r *BucketsService) List(projectid string) *BucketsListCall {
4184	c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4185	c.urlParams_.Set("project", projectid)
4186	return c
4187}
4188
4189// MaxResults sets the optional parameter "maxResults": Maximum number
4190// of buckets to return in a single response. The service will use this
4191// parameter or 1,000 items, whichever is smaller.
4192func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
4193	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4194	return c
4195}
4196
4197// PageToken sets the optional parameter "pageToken": A
4198// previously-returned page token representing part of the larger set of
4199// results to view.
4200func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
4201	c.urlParams_.Set("pageToken", pageToken)
4202	return c
4203}
4204
4205// Prefix sets the optional parameter "prefix": Filter results to
4206// buckets whose names begin with this prefix.
4207func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall {
4208	c.urlParams_.Set("prefix", prefix)
4209	return c
4210}
4211
4212// Projection sets the optional parameter "projection": Set of
4213// properties to return. Defaults to noAcl.
4214//
4215// Possible values:
4216//   "full" - Include all properties.
4217//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4218func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
4219	c.urlParams_.Set("projection", projection)
4220	return c
4221}
4222
4223// ProvisionalUserProject sets the optional parameter
4224// "provisionalUserProject": The project to be billed for this request
4225// if the target bucket is requester-pays bucket.
4226func (c *BucketsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketsListCall {
4227	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4228	return c
4229}
4230
4231// UserProject sets the optional parameter "userProject": The project to
4232// be billed for this request.
4233func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall {
4234	c.urlParams_.Set("userProject", userProject)
4235	return c
4236}
4237
4238// Fields allows partial responses to be retrieved. See
4239// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4240// for more information.
4241func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
4242	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4243	return c
4244}
4245
4246// IfNoneMatch sets the optional parameter which makes the operation
4247// fail if the object's ETag matches the given value. This is useful for
4248// getting updates only after the object has changed since the last
4249// request. Use googleapi.IsNotModified to check whether the response
4250// error from Do is the result of In-None-Match.
4251func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
4252	c.ifNoneMatch_ = entityTag
4253	return c
4254}
4255
4256// Context sets the context to be used in this call's Do method. Any
4257// pending HTTP request will be aborted if the provided context is
4258// canceled.
4259func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
4260	c.ctx_ = ctx
4261	return c
4262}
4263
4264// Header returns an http.Header that can be modified by the caller to
4265// add HTTP headers to the request.
4266func (c *BucketsListCall) Header() http.Header {
4267	if c.header_ == nil {
4268		c.header_ = make(http.Header)
4269	}
4270	return c.header_
4271}
4272
4273func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
4274	reqHeaders := make(http.Header)
4275	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
4276	for k, v := range c.header_ {
4277		reqHeaders[k] = v
4278	}
4279	reqHeaders.Set("User-Agent", c.s.userAgent())
4280	if c.ifNoneMatch_ != "" {
4281		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4282	}
4283	var body io.Reader = nil
4284	c.urlParams_.Set("alt", alt)
4285	c.urlParams_.Set("prettyPrint", "false")
4286	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
4287	urls += "?" + c.urlParams_.Encode()
4288	req, err := http.NewRequest("GET", urls, body)
4289	if err != nil {
4290		return nil, err
4291	}
4292	req.Header = reqHeaders
4293	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4294}
4295
4296// Do executes the "storage.buckets.list" call.
4297// Exactly one of *Buckets or error will be non-nil. Any non-2xx status
4298// code is an error. Response headers are in either
4299// *Buckets.ServerResponse.Header or (if a response was returned at all)
4300// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4301// check whether the returned error was because http.StatusNotModified
4302// was returned.
4303func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
4304	gensupport.SetOptions(c.urlParams_, opts...)
4305	res, err := c.doRequest("json")
4306	if res != nil && res.StatusCode == http.StatusNotModified {
4307		if res.Body != nil {
4308			res.Body.Close()
4309		}
4310		return nil, &googleapi.Error{
4311			Code:   res.StatusCode,
4312			Header: res.Header,
4313		}
4314	}
4315	if err != nil {
4316		return nil, err
4317	}
4318	defer googleapi.CloseBody(res)
4319	if err := googleapi.CheckResponse(res); err != nil {
4320		return nil, err
4321	}
4322	ret := &Buckets{
4323		ServerResponse: googleapi.ServerResponse{
4324			Header:         res.Header,
4325			HTTPStatusCode: res.StatusCode,
4326		},
4327	}
4328	target := &ret
4329	if err := gensupport.DecodeResponse(target, res); err != nil {
4330		return nil, err
4331	}
4332	return ret, nil
4333	// {
4334	//   "description": "Retrieves a list of buckets for a given project.",
4335	//   "httpMethod": "GET",
4336	//   "id": "storage.buckets.list",
4337	//   "parameterOrder": [
4338	//     "project"
4339	//   ],
4340	//   "parameters": {
4341	//     "maxResults": {
4342	//       "default": "1000",
4343	//       "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
4344	//       "format": "uint32",
4345	//       "location": "query",
4346	//       "minimum": "0",
4347	//       "type": "integer"
4348	//     },
4349	//     "pageToken": {
4350	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
4351	//       "location": "query",
4352	//       "type": "string"
4353	//     },
4354	//     "prefix": {
4355	//       "description": "Filter results to buckets whose names begin with this prefix.",
4356	//       "location": "query",
4357	//       "type": "string"
4358	//     },
4359	//     "project": {
4360	//       "description": "A valid API project identifier.",
4361	//       "location": "query",
4362	//       "required": true,
4363	//       "type": "string"
4364	//     },
4365	//     "projection": {
4366	//       "description": "Set of properties to return. Defaults to noAcl.",
4367	//       "enum": [
4368	//         "full",
4369	//         "noAcl"
4370	//       ],
4371	//       "enumDescriptions": [
4372	//         "Include all properties.",
4373	//         "Omit owner, acl and defaultObjectAcl properties."
4374	//       ],
4375	//       "location": "query",
4376	//       "type": "string"
4377	//     },
4378	//     "provisionalUserProject": {
4379	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4380	//       "location": "query",
4381	//       "type": "string"
4382	//     },
4383	//     "userProject": {
4384	//       "description": "The project to be billed for this request.",
4385	//       "location": "query",
4386	//       "type": "string"
4387	//     }
4388	//   },
4389	//   "path": "b",
4390	//   "response": {
4391	//     "$ref": "Buckets"
4392	//   },
4393	//   "scopes": [
4394	//     "https://www.googleapis.com/auth/cloud-platform",
4395	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4396	//     "https://www.googleapis.com/auth/devstorage.full_control",
4397	//     "https://www.googleapis.com/auth/devstorage.read_only",
4398	//     "https://www.googleapis.com/auth/devstorage.read_write"
4399	//   ]
4400	// }
4401
4402}
4403
4404// Pages invokes f for each page of results.
4405// A non-nil error returned from f will halt the iteration.
4406// The provided context supersedes any context provided to the Context method.
4407func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
4408	c.ctx_ = ctx
4409	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4410	for {
4411		x, err := c.Do()
4412		if err != nil {
4413			return err
4414		}
4415		if err := f(x); err != nil {
4416			return err
4417		}
4418		if x.NextPageToken == "" {
4419			return nil
4420		}
4421		c.PageToken(x.NextPageToken)
4422	}
4423}
4424
4425// method id "storage.buckets.lockRetentionPolicy":
4426
4427type BucketsLockRetentionPolicyCall struct {
4428	s          *Service
4429	bucket     string
4430	urlParams_ gensupport.URLParams
4431	ctx_       context.Context
4432	header_    http.Header
4433}
4434
4435// LockRetentionPolicy: Locks retention policy on a bucket.
4436func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall {
4437	c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4438	c.bucket = bucket
4439	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4440	return c
4441}
4442
4443// ProvisionalUserProject sets the optional parameter
4444// "provisionalUserProject": The project to be billed for this request
4445// if the target bucket is requester-pays bucket.
4446func (c *BucketsLockRetentionPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsLockRetentionPolicyCall {
4447	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4448	return c
4449}
4450
4451// UserProject sets the optional parameter "userProject": The project to
4452// be billed for this request. Required for Requester Pays buckets.
4453func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall {
4454	c.urlParams_.Set("userProject", userProject)
4455	return c
4456}
4457
4458// Fields allows partial responses to be retrieved. See
4459// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4460// for more information.
4461func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall {
4462	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4463	return c
4464}
4465
4466// Context sets the context to be used in this call's Do method. Any
4467// pending HTTP request will be aborted if the provided context is
4468// canceled.
4469func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall {
4470	c.ctx_ = ctx
4471	return c
4472}
4473
4474// Header returns an http.Header that can be modified by the caller to
4475// add HTTP headers to the request.
4476func (c *BucketsLockRetentionPolicyCall) Header() http.Header {
4477	if c.header_ == nil {
4478		c.header_ = make(http.Header)
4479	}
4480	return c.header_
4481}
4482
4483func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
4484	reqHeaders := make(http.Header)
4485	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
4486	for k, v := range c.header_ {
4487		reqHeaders[k] = v
4488	}
4489	reqHeaders.Set("User-Agent", c.s.userAgent())
4490	var body io.Reader = nil
4491	c.urlParams_.Set("alt", alt)
4492	c.urlParams_.Set("prettyPrint", "false")
4493	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy")
4494	urls += "?" + c.urlParams_.Encode()
4495	req, err := http.NewRequest("POST", urls, body)
4496	if err != nil {
4497		return nil, err
4498	}
4499	req.Header = reqHeaders
4500	googleapi.Expand(req.URL, map[string]string{
4501		"bucket": c.bucket,
4502	})
4503	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4504}
4505
4506// Do executes the "storage.buckets.lockRetentionPolicy" call.
4507// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4508// code is an error. Response headers are in either
4509// *Bucket.ServerResponse.Header or (if a response was returned at all)
4510// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4511// check whether the returned error was because http.StatusNotModified
4512// was returned.
4513func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4514	gensupport.SetOptions(c.urlParams_, opts...)
4515	res, err := c.doRequest("json")
4516	if res != nil && res.StatusCode == http.StatusNotModified {
4517		if res.Body != nil {
4518			res.Body.Close()
4519		}
4520		return nil, &googleapi.Error{
4521			Code:   res.StatusCode,
4522			Header: res.Header,
4523		}
4524	}
4525	if err != nil {
4526		return nil, err
4527	}
4528	defer googleapi.CloseBody(res)
4529	if err := googleapi.CheckResponse(res); err != nil {
4530		return nil, err
4531	}
4532	ret := &Bucket{
4533		ServerResponse: googleapi.ServerResponse{
4534			Header:         res.Header,
4535			HTTPStatusCode: res.StatusCode,
4536		},
4537	}
4538	target := &ret
4539	if err := gensupport.DecodeResponse(target, res); err != nil {
4540		return nil, err
4541	}
4542	return ret, nil
4543	// {
4544	//   "description": "Locks retention policy on a bucket.",
4545	//   "httpMethod": "POST",
4546	//   "id": "storage.buckets.lockRetentionPolicy",
4547	//   "parameterOrder": [
4548	//     "bucket",
4549	//     "ifMetagenerationMatch"
4550	//   ],
4551	//   "parameters": {
4552	//     "bucket": {
4553	//       "description": "Name of a bucket.",
4554	//       "location": "path",
4555	//       "required": true,
4556	//       "type": "string"
4557	//     },
4558	//     "ifMetagenerationMatch": {
4559	//       "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
4560	//       "format": "int64",
4561	//       "location": "query",
4562	//       "required": true,
4563	//       "type": "string"
4564	//     },
4565	//     "provisionalUserProject": {
4566	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4567	//       "location": "query",
4568	//       "type": "string"
4569	//     },
4570	//     "userProject": {
4571	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4572	//       "location": "query",
4573	//       "type": "string"
4574	//     }
4575	//   },
4576	//   "path": "b/{bucket}/lockRetentionPolicy",
4577	//   "response": {
4578	//     "$ref": "Bucket"
4579	//   },
4580	//   "scopes": [
4581	//     "https://www.googleapis.com/auth/cloud-platform",
4582	//     "https://www.googleapis.com/auth/devstorage.full_control",
4583	//     "https://www.googleapis.com/auth/devstorage.read_write"
4584	//   ]
4585	// }
4586
4587}
4588
4589// method id "storage.buckets.patch":
4590
4591type BucketsPatchCall struct {
4592	s          *Service
4593	bucket     string
4594	bucket2    *Bucket
4595	urlParams_ gensupport.URLParams
4596	ctx_       context.Context
4597	header_    http.Header
4598}
4599
4600// Patch: Patches a bucket. Changes to the bucket will be readable
4601// immediately after writing, but configuration changes may take time to
4602// propagate.
4603func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
4604	c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4605	c.bucket = bucket
4606	c.bucket2 = bucket2
4607	return c
4608}
4609
4610// IfMetagenerationMatch sets the optional parameter
4611// "ifMetagenerationMatch": Makes the return of the bucket metadata
4612// conditional on whether the bucket's current metageneration matches
4613// the given value.
4614func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
4615	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4616	return c
4617}
4618
4619// IfMetagenerationNotMatch sets the optional parameter
4620// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
4621// conditional on whether the bucket's current metageneration does not
4622// match the given value.
4623func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall {
4624	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
4625	return c
4626}
4627
4628// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4629// predefined set of access controls to this bucket.
4630//
4631// Possible values:
4632//   "authenticatedRead" - Project team owners get OWNER access, and
4633// allAuthenticatedUsers get READER access.
4634//   "private" - Project team owners get OWNER access.
4635//   "projectPrivate" - Project team members get access according to
4636// their roles.
4637//   "publicRead" - Project team owners get OWNER access, and allUsers
4638// get READER access.
4639//   "publicReadWrite" - Project team owners get OWNER access, and
4640// allUsers get WRITER access.
4641func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall {
4642	c.urlParams_.Set("predefinedAcl", predefinedAcl)
4643	return c
4644}
4645
4646// PredefinedDefaultObjectAcl sets the optional parameter
4647// "predefinedDefaultObjectAcl": Apply a predefined set of default
4648// object access controls to this bucket.
4649//
4650// Possible values:
4651//   "authenticatedRead" - Object owner gets OWNER access, and
4652// allAuthenticatedUsers get READER access.
4653//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
4654// project team owners get OWNER access.
4655//   "bucketOwnerRead" - Object owner gets OWNER access, and project
4656// team owners get READER access.
4657//   "private" - Object owner gets OWNER access.
4658//   "projectPrivate" - Object owner gets OWNER access, and project team
4659// members get access according to their roles.
4660//   "publicRead" - Object owner gets OWNER access, and allUsers get
4661// READER access.
4662func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
4663	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4664	return c
4665}
4666
4667// Projection sets the optional parameter "projection": Set of
4668// properties to return. Defaults to full.
4669//
4670// Possible values:
4671//   "full" - Include all properties.
4672//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4673func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
4674	c.urlParams_.Set("projection", projection)
4675	return c
4676}
4677
4678// ProvisionalUserProject sets the optional parameter
4679// "provisionalUserProject": The project to be billed for this request
4680// if the target bucket is requester-pays bucket.
4681func (c *BucketsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketsPatchCall {
4682	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4683	return c
4684}
4685
4686// UserProject sets the optional parameter "userProject": The project to
4687// be billed for this request. Required for Requester Pays buckets.
4688func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
4689	c.urlParams_.Set("userProject", userProject)
4690	return c
4691}
4692
4693// Fields allows partial responses to be retrieved. See
4694// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4695// for more information.
4696func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
4697	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4698	return c
4699}
4700
4701// Context sets the context to be used in this call's Do method. Any
4702// pending HTTP request will be aborted if the provided context is
4703// canceled.
4704func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
4705	c.ctx_ = ctx
4706	return c
4707}
4708
4709// Header returns an http.Header that can be modified by the caller to
4710// add HTTP headers to the request.
4711func (c *BucketsPatchCall) Header() http.Header {
4712	if c.header_ == nil {
4713		c.header_ = make(http.Header)
4714	}
4715	return c.header_
4716}
4717
4718func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
4719	reqHeaders := make(http.Header)
4720	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
4721	for k, v := range c.header_ {
4722		reqHeaders[k] = v
4723	}
4724	reqHeaders.Set("User-Agent", c.s.userAgent())
4725	var body io.Reader = nil
4726	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
4727	if err != nil {
4728		return nil, err
4729	}
4730	reqHeaders.Set("Content-Type", "application/json")
4731	c.urlParams_.Set("alt", alt)
4732	c.urlParams_.Set("prettyPrint", "false")
4733	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
4734	urls += "?" + c.urlParams_.Encode()
4735	req, err := http.NewRequest("PATCH", urls, body)
4736	if err != nil {
4737		return nil, err
4738	}
4739	req.Header = reqHeaders
4740	googleapi.Expand(req.URL, map[string]string{
4741		"bucket": c.bucket,
4742	})
4743	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4744}
4745
4746// Do executes the "storage.buckets.patch" call.
4747// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4748// code is an error. Response headers are in either
4749// *Bucket.ServerResponse.Header or (if a response was returned at all)
4750// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4751// check whether the returned error was because http.StatusNotModified
4752// was returned.
4753func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4754	gensupport.SetOptions(c.urlParams_, opts...)
4755	res, err := c.doRequest("json")
4756	if res != nil && res.StatusCode == http.StatusNotModified {
4757		if res.Body != nil {
4758			res.Body.Close()
4759		}
4760		return nil, &googleapi.Error{
4761			Code:   res.StatusCode,
4762			Header: res.Header,
4763		}
4764	}
4765	if err != nil {
4766		return nil, err
4767	}
4768	defer googleapi.CloseBody(res)
4769	if err := googleapi.CheckResponse(res); err != nil {
4770		return nil, err
4771	}
4772	ret := &Bucket{
4773		ServerResponse: googleapi.ServerResponse{
4774			Header:         res.Header,
4775			HTTPStatusCode: res.StatusCode,
4776		},
4777	}
4778	target := &ret
4779	if err := gensupport.DecodeResponse(target, res); err != nil {
4780		return nil, err
4781	}
4782	return ret, nil
4783	// {
4784	//   "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
4785	//   "httpMethod": "PATCH",
4786	//   "id": "storage.buckets.patch",
4787	//   "parameterOrder": [
4788	//     "bucket"
4789	//   ],
4790	//   "parameters": {
4791	//     "bucket": {
4792	//       "description": "Name of a bucket.",
4793	//       "location": "path",
4794	//       "required": true,
4795	//       "type": "string"
4796	//     },
4797	//     "ifMetagenerationMatch": {
4798	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
4799	//       "format": "int64",
4800	//       "location": "query",
4801	//       "type": "string"
4802	//     },
4803	//     "ifMetagenerationNotMatch": {
4804	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
4805	//       "format": "int64",
4806	//       "location": "query",
4807	//       "type": "string"
4808	//     },
4809	//     "predefinedAcl": {
4810	//       "description": "Apply a predefined set of access controls to this bucket.",
4811	//       "enum": [
4812	//         "authenticatedRead",
4813	//         "private",
4814	//         "projectPrivate",
4815	//         "publicRead",
4816	//         "publicReadWrite"
4817	//       ],
4818	//       "enumDescriptions": [
4819	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4820	//         "Project team owners get OWNER access.",
4821	//         "Project team members get access according to their roles.",
4822	//         "Project team owners get OWNER access, and allUsers get READER access.",
4823	//         "Project team owners get OWNER access, and allUsers get WRITER access."
4824	//       ],
4825	//       "location": "query",
4826	//       "type": "string"
4827	//     },
4828	//     "predefinedDefaultObjectAcl": {
4829	//       "description": "Apply a predefined set of default object access controls to this bucket.",
4830	//       "enum": [
4831	//         "authenticatedRead",
4832	//         "bucketOwnerFullControl",
4833	//         "bucketOwnerRead",
4834	//         "private",
4835	//         "projectPrivate",
4836	//         "publicRead"
4837	//       ],
4838	//       "enumDescriptions": [
4839	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4840	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
4841	//         "Object owner gets OWNER access, and project team owners get READER access.",
4842	//         "Object owner gets OWNER access.",
4843	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
4844	//         "Object owner gets OWNER access, and allUsers get READER access."
4845	//       ],
4846	//       "location": "query",
4847	//       "type": "string"
4848	//     },
4849	//     "projection": {
4850	//       "description": "Set of properties to return. Defaults to full.",
4851	//       "enum": [
4852	//         "full",
4853	//         "noAcl"
4854	//       ],
4855	//       "enumDescriptions": [
4856	//         "Include all properties.",
4857	//         "Omit owner, acl and defaultObjectAcl properties."
4858	//       ],
4859	//       "location": "query",
4860	//       "type": "string"
4861	//     },
4862	//     "provisionalUserProject": {
4863	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4864	//       "location": "query",
4865	//       "type": "string"
4866	//     },
4867	//     "userProject": {
4868	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4869	//       "location": "query",
4870	//       "type": "string"
4871	//     }
4872	//   },
4873	//   "path": "b/{bucket}",
4874	//   "request": {
4875	//     "$ref": "Bucket"
4876	//   },
4877	//   "response": {
4878	//     "$ref": "Bucket"
4879	//   },
4880	//   "scopes": [
4881	//     "https://www.googleapis.com/auth/cloud-platform",
4882	//     "https://www.googleapis.com/auth/devstorage.full_control"
4883	//   ]
4884	// }
4885
4886}
4887
4888// method id "storage.buckets.setIamPolicy":
4889
4890type BucketsSetIamPolicyCall struct {
4891	s          *Service
4892	bucket     string
4893	policy     *Policy
4894	urlParams_ gensupport.URLParams
4895	ctx_       context.Context
4896	header_    http.Header
4897}
4898
4899// SetIamPolicy: Updates an IAM policy for the specified bucket.
4900func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall {
4901	c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4902	c.bucket = bucket
4903	c.policy = policy
4904	return c
4905}
4906
4907// ProvisionalUserProject sets the optional parameter
4908// "provisionalUserProject": The project to be billed for this request
4909// if the target bucket is requester-pays bucket.
4910func (c *BucketsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsSetIamPolicyCall {
4911	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4912	return c
4913}
4914
4915// UserProject sets the optional parameter "userProject": The project to
4916// be billed for this request. Required for Requester Pays buckets.
4917func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
4918	c.urlParams_.Set("userProject", userProject)
4919	return c
4920}
4921
4922// Fields allows partial responses to be retrieved. See
4923// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4924// for more information.
4925func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall {
4926	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4927	return c
4928}
4929
4930// Context sets the context to be used in this call's Do method. Any
4931// pending HTTP request will be aborted if the provided context is
4932// canceled.
4933func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
4934	c.ctx_ = ctx
4935	return c
4936}
4937
4938// Header returns an http.Header that can be modified by the caller to
4939// add HTTP headers to the request.
4940func (c *BucketsSetIamPolicyCall) Header() http.Header {
4941	if c.header_ == nil {
4942		c.header_ = make(http.Header)
4943	}
4944	return c.header_
4945}
4946
4947func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4948	reqHeaders := make(http.Header)
4949	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
4950	for k, v := range c.header_ {
4951		reqHeaders[k] = v
4952	}
4953	reqHeaders.Set("User-Agent", c.s.userAgent())
4954	var body io.Reader = nil
4955	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
4956	if err != nil {
4957		return nil, err
4958	}
4959	reqHeaders.Set("Content-Type", "application/json")
4960	c.urlParams_.Set("alt", alt)
4961	c.urlParams_.Set("prettyPrint", "false")
4962	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
4963	urls += "?" + c.urlParams_.Encode()
4964	req, err := http.NewRequest("PUT", urls, body)
4965	if err != nil {
4966		return nil, err
4967	}
4968	req.Header = reqHeaders
4969	googleapi.Expand(req.URL, map[string]string{
4970		"bucket": c.bucket,
4971	})
4972	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4973}
4974
4975// Do executes the "storage.buckets.setIamPolicy" call.
4976// Exactly one of *Policy or error will be non-nil. Any non-2xx status
4977// code is an error. Response headers are in either
4978// *Policy.ServerResponse.Header or (if a response was returned at all)
4979// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4980// check whether the returned error was because http.StatusNotModified
4981// was returned.
4982func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4983	gensupport.SetOptions(c.urlParams_, opts...)
4984	res, err := c.doRequest("json")
4985	if res != nil && res.StatusCode == http.StatusNotModified {
4986		if res.Body != nil {
4987			res.Body.Close()
4988		}
4989		return nil, &googleapi.Error{
4990			Code:   res.StatusCode,
4991			Header: res.Header,
4992		}
4993	}
4994	if err != nil {
4995		return nil, err
4996	}
4997	defer googleapi.CloseBody(res)
4998	if err := googleapi.CheckResponse(res); err != nil {
4999		return nil, err
5000	}
5001	ret := &Policy{
5002		ServerResponse: googleapi.ServerResponse{
5003			Header:         res.Header,
5004			HTTPStatusCode: res.StatusCode,
5005		},
5006	}
5007	target := &ret
5008	if err := gensupport.DecodeResponse(target, res); err != nil {
5009		return nil, err
5010	}
5011	return ret, nil
5012	// {
5013	//   "description": "Updates an IAM policy for the specified bucket.",
5014	//   "httpMethod": "PUT",
5015	//   "id": "storage.buckets.setIamPolicy",
5016	//   "parameterOrder": [
5017	//     "bucket"
5018	//   ],
5019	//   "parameters": {
5020	//     "bucket": {
5021	//       "description": "Name of a bucket.",
5022	//       "location": "path",
5023	//       "required": true,
5024	//       "type": "string"
5025	//     },
5026	//     "provisionalUserProject": {
5027	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5028	//       "location": "query",
5029	//       "type": "string"
5030	//     },
5031	//     "userProject": {
5032	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5033	//       "location": "query",
5034	//       "type": "string"
5035	//     }
5036	//   },
5037	//   "path": "b/{bucket}/iam",
5038	//   "request": {
5039	//     "$ref": "Policy"
5040	//   },
5041	//   "response": {
5042	//     "$ref": "Policy"
5043	//   },
5044	//   "scopes": [
5045	//     "https://www.googleapis.com/auth/cloud-platform",
5046	//     "https://www.googleapis.com/auth/devstorage.full_control"
5047	//   ]
5048	// }
5049
5050}
5051
5052// method id "storage.buckets.testIamPermissions":
5053
5054type BucketsTestIamPermissionsCall struct {
5055	s            *Service
5056	bucket       string
5057	urlParams_   gensupport.URLParams
5058	ifNoneMatch_ string
5059	ctx_         context.Context
5060	header_      http.Header
5061}
5062
5063// TestIamPermissions: Tests a set of permissions on the given bucket to
5064// see which, if any, are held by the caller.
5065func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall {
5066	c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5067	c.bucket = bucket
5068	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
5069	return c
5070}
5071
5072// ProvisionalUserProject sets the optional parameter
5073// "provisionalUserProject": The project to be billed for this request
5074// if the target bucket is requester-pays bucket.
5075func (c *BucketsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *BucketsTestIamPermissionsCall {
5076	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5077	return c
5078}
5079
5080// UserProject sets the optional parameter "userProject": The project to
5081// be billed for this request. Required for Requester Pays buckets.
5082func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
5083	c.urlParams_.Set("userProject", userProject)
5084	return c
5085}
5086
5087// Fields allows partial responses to be retrieved. See
5088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5089// for more information.
5090func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall {
5091	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5092	return c
5093}
5094
5095// IfNoneMatch sets the optional parameter which makes the operation
5096// fail if the object's ETag matches the given value. This is useful for
5097// getting updates only after the object has changed since the last
5098// request. Use googleapi.IsNotModified to check whether the response
5099// error from Do is the result of In-None-Match.
5100func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall {
5101	c.ifNoneMatch_ = entityTag
5102	return c
5103}
5104
5105// Context sets the context to be used in this call's Do method. Any
5106// pending HTTP request will be aborted if the provided context is
5107// canceled.
5108func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
5109	c.ctx_ = ctx
5110	return c
5111}
5112
5113// Header returns an http.Header that can be modified by the caller to
5114// add HTTP headers to the request.
5115func (c *BucketsTestIamPermissionsCall) Header() http.Header {
5116	if c.header_ == nil {
5117		c.header_ = make(http.Header)
5118	}
5119	return c.header_
5120}
5121
5122func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5123	reqHeaders := make(http.Header)
5124	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
5125	for k, v := range c.header_ {
5126		reqHeaders[k] = v
5127	}
5128	reqHeaders.Set("User-Agent", c.s.userAgent())
5129	if c.ifNoneMatch_ != "" {
5130		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5131	}
5132	var body io.Reader = nil
5133	c.urlParams_.Set("alt", alt)
5134	c.urlParams_.Set("prettyPrint", "false")
5135	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions")
5136	urls += "?" + c.urlParams_.Encode()
5137	req, err := http.NewRequest("GET", urls, body)
5138	if err != nil {
5139		return nil, err
5140	}
5141	req.Header = reqHeaders
5142	googleapi.Expand(req.URL, map[string]string{
5143		"bucket": c.bucket,
5144	})
5145	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5146}
5147
5148// Do executes the "storage.buckets.testIamPermissions" call.
5149// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
5150// Any non-2xx status code is an error. Response headers are in either
5151// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
5152// was returned at all) in error.(*googleapi.Error).Header. Use
5153// googleapi.IsNotModified to check whether the returned error was
5154// because http.StatusNotModified was returned.
5155func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
5156	gensupport.SetOptions(c.urlParams_, opts...)
5157	res, err := c.doRequest("json")
5158	if res != nil && res.StatusCode == http.StatusNotModified {
5159		if res.Body != nil {
5160			res.Body.Close()
5161		}
5162		return nil, &googleapi.Error{
5163			Code:   res.StatusCode,
5164			Header: res.Header,
5165		}
5166	}
5167	if err != nil {
5168		return nil, err
5169	}
5170	defer googleapi.CloseBody(res)
5171	if err := googleapi.CheckResponse(res); err != nil {
5172		return nil, err
5173	}
5174	ret := &TestIamPermissionsResponse{
5175		ServerResponse: googleapi.ServerResponse{
5176			Header:         res.Header,
5177			HTTPStatusCode: res.StatusCode,
5178		},
5179	}
5180	target := &ret
5181	if err := gensupport.DecodeResponse(target, res); err != nil {
5182		return nil, err
5183	}
5184	return ret, nil
5185	// {
5186	//   "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
5187	//   "httpMethod": "GET",
5188	//   "id": "storage.buckets.testIamPermissions",
5189	//   "parameterOrder": [
5190	//     "bucket",
5191	//     "permissions"
5192	//   ],
5193	//   "parameters": {
5194	//     "bucket": {
5195	//       "description": "Name of a bucket.",
5196	//       "location": "path",
5197	//       "required": true,
5198	//       "type": "string"
5199	//     },
5200	//     "permissions": {
5201	//       "description": "Permissions to test.",
5202	//       "location": "query",
5203	//       "repeated": true,
5204	//       "required": true,
5205	//       "type": "string"
5206	//     },
5207	//     "provisionalUserProject": {
5208	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5209	//       "location": "query",
5210	//       "type": "string"
5211	//     },
5212	//     "userProject": {
5213	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5214	//       "location": "query",
5215	//       "type": "string"
5216	//     }
5217	//   },
5218	//   "path": "b/{bucket}/iam/testPermissions",
5219	//   "response": {
5220	//     "$ref": "TestIamPermissionsResponse"
5221	//   },
5222	//   "scopes": [
5223	//     "https://www.googleapis.com/auth/cloud-platform",
5224	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5225	//     "https://www.googleapis.com/auth/devstorage.full_control",
5226	//     "https://www.googleapis.com/auth/devstorage.read_only",
5227	//     "https://www.googleapis.com/auth/devstorage.read_write"
5228	//   ]
5229	// }
5230
5231}
5232
5233// method id "storage.buckets.update":
5234
5235type BucketsUpdateCall struct {
5236	s          *Service
5237	bucket     string
5238	bucket2    *Bucket
5239	urlParams_ gensupport.URLParams
5240	ctx_       context.Context
5241	header_    http.Header
5242}
5243
5244// Update: Updates a bucket. Changes to the bucket will be readable
5245// immediately after writing, but configuration changes may take time to
5246// propagate.
5247func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
5248	c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5249	c.bucket = bucket
5250	c.bucket2 = bucket2
5251	return c
5252}
5253
5254// IfMetagenerationMatch sets the optional parameter
5255// "ifMetagenerationMatch": Makes the return of the bucket metadata
5256// conditional on whether the bucket's current metageneration matches
5257// the given value.
5258func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
5259	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5260	return c
5261}
5262
5263// IfMetagenerationNotMatch sets the optional parameter
5264// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
5265// conditional on whether the bucket's current metageneration does not
5266// match the given value.
5267func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall {
5268	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5269	return c
5270}
5271
5272// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
5273// predefined set of access controls to this bucket.
5274//
5275// Possible values:
5276//   "authenticatedRead" - Project team owners get OWNER access, and
5277// allAuthenticatedUsers get READER access.
5278//   "private" - Project team owners get OWNER access.
5279//   "projectPrivate" - Project team members get access according to
5280// their roles.
5281//   "publicRead" - Project team owners get OWNER access, and allUsers
5282// get READER access.
5283//   "publicReadWrite" - Project team owners get OWNER access, and
5284// allUsers get WRITER access.
5285func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall {
5286	c.urlParams_.Set("predefinedAcl", predefinedAcl)
5287	return c
5288}
5289
5290// PredefinedDefaultObjectAcl sets the optional parameter
5291// "predefinedDefaultObjectAcl": Apply a predefined set of default
5292// object access controls to this bucket.
5293//
5294// Possible values:
5295//   "authenticatedRead" - Object owner gets OWNER access, and
5296// allAuthenticatedUsers get READER access.
5297//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
5298// project team owners get OWNER access.
5299//   "bucketOwnerRead" - Object owner gets OWNER access, and project
5300// team owners get READER access.
5301//   "private" - Object owner gets OWNER access.
5302//   "projectPrivate" - Object owner gets OWNER access, and project team
5303// members get access according to their roles.
5304//   "publicRead" - Object owner gets OWNER access, and allUsers get
5305// READER access.
5306func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
5307	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
5308	return c
5309}
5310
5311// Projection sets the optional parameter "projection": Set of
5312// properties to return. Defaults to full.
5313//
5314// Possible values:
5315//   "full" - Include all properties.
5316//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
5317func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
5318	c.urlParams_.Set("projection", projection)
5319	return c
5320}
5321
5322// ProvisionalUserProject sets the optional parameter
5323// "provisionalUserProject": The project to be billed for this request
5324// if the target bucket is requester-pays bucket.
5325func (c *BucketsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketsUpdateCall {
5326	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5327	return c
5328}
5329
5330// UserProject sets the optional parameter "userProject": The project to
5331// be billed for this request. Required for Requester Pays buckets.
5332func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
5333	c.urlParams_.Set("userProject", userProject)
5334	return c
5335}
5336
5337// Fields allows partial responses to be retrieved. See
5338// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5339// for more information.
5340func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
5341	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5342	return c
5343}
5344
5345// Context sets the context to be used in this call's Do method. Any
5346// pending HTTP request will be aborted if the provided context is
5347// canceled.
5348func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
5349	c.ctx_ = ctx
5350	return c
5351}
5352
5353// Header returns an http.Header that can be modified by the caller to
5354// add HTTP headers to the request.
5355func (c *BucketsUpdateCall) Header() http.Header {
5356	if c.header_ == nil {
5357		c.header_ = make(http.Header)
5358	}
5359	return c.header_
5360}
5361
5362func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
5363	reqHeaders := make(http.Header)
5364	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
5365	for k, v := range c.header_ {
5366		reqHeaders[k] = v
5367	}
5368	reqHeaders.Set("User-Agent", c.s.userAgent())
5369	var body io.Reader = nil
5370	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
5371	if err != nil {
5372		return nil, err
5373	}
5374	reqHeaders.Set("Content-Type", "application/json")
5375	c.urlParams_.Set("alt", alt)
5376	c.urlParams_.Set("prettyPrint", "false")
5377	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
5378	urls += "?" + c.urlParams_.Encode()
5379	req, err := http.NewRequest("PUT", urls, body)
5380	if err != nil {
5381		return nil, err
5382	}
5383	req.Header = reqHeaders
5384	googleapi.Expand(req.URL, map[string]string{
5385		"bucket": c.bucket,
5386	})
5387	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5388}
5389
5390// Do executes the "storage.buckets.update" call.
5391// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
5392// code is an error. Response headers are in either
5393// *Bucket.ServerResponse.Header or (if a response was returned at all)
5394// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5395// check whether the returned error was because http.StatusNotModified
5396// was returned.
5397func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
5398	gensupport.SetOptions(c.urlParams_, opts...)
5399	res, err := c.doRequest("json")
5400	if res != nil && res.StatusCode == http.StatusNotModified {
5401		if res.Body != nil {
5402			res.Body.Close()
5403		}
5404		return nil, &googleapi.Error{
5405			Code:   res.StatusCode,
5406			Header: res.Header,
5407		}
5408	}
5409	if err != nil {
5410		return nil, err
5411	}
5412	defer googleapi.CloseBody(res)
5413	if err := googleapi.CheckResponse(res); err != nil {
5414		return nil, err
5415	}
5416	ret := &Bucket{
5417		ServerResponse: googleapi.ServerResponse{
5418			Header:         res.Header,
5419			HTTPStatusCode: res.StatusCode,
5420		},
5421	}
5422	target := &ret
5423	if err := gensupport.DecodeResponse(target, res); err != nil {
5424		return nil, err
5425	}
5426	return ret, nil
5427	// {
5428	//   "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
5429	//   "httpMethod": "PUT",
5430	//   "id": "storage.buckets.update",
5431	//   "parameterOrder": [
5432	//     "bucket"
5433	//   ],
5434	//   "parameters": {
5435	//     "bucket": {
5436	//       "description": "Name of a bucket.",
5437	//       "location": "path",
5438	//       "required": true,
5439	//       "type": "string"
5440	//     },
5441	//     "ifMetagenerationMatch": {
5442	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
5443	//       "format": "int64",
5444	//       "location": "query",
5445	//       "type": "string"
5446	//     },
5447	//     "ifMetagenerationNotMatch": {
5448	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
5449	//       "format": "int64",
5450	//       "location": "query",
5451	//       "type": "string"
5452	//     },
5453	//     "predefinedAcl": {
5454	//       "description": "Apply a predefined set of access controls to this bucket.",
5455	//       "enum": [
5456	//         "authenticatedRead",
5457	//         "private",
5458	//         "projectPrivate",
5459	//         "publicRead",
5460	//         "publicReadWrite"
5461	//       ],
5462	//       "enumDescriptions": [
5463	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
5464	//         "Project team owners get OWNER access.",
5465	//         "Project team members get access according to their roles.",
5466	//         "Project team owners get OWNER access, and allUsers get READER access.",
5467	//         "Project team owners get OWNER access, and allUsers get WRITER access."
5468	//       ],
5469	//       "location": "query",
5470	//       "type": "string"
5471	//     },
5472	//     "predefinedDefaultObjectAcl": {
5473	//       "description": "Apply a predefined set of default object access controls to this bucket.",
5474	//       "enum": [
5475	//         "authenticatedRead",
5476	//         "bucketOwnerFullControl",
5477	//         "bucketOwnerRead",
5478	//         "private",
5479	//         "projectPrivate",
5480	//         "publicRead"
5481	//       ],
5482	//       "enumDescriptions": [
5483	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
5484	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
5485	//         "Object owner gets OWNER access, and project team owners get READER access.",
5486	//         "Object owner gets OWNER access.",
5487	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
5488	//         "Object owner gets OWNER access, and allUsers get READER access."
5489	//       ],
5490	//       "location": "query",
5491	//       "type": "string"
5492	//     },
5493	//     "projection": {
5494	//       "description": "Set of properties to return. Defaults to full.",
5495	//       "enum": [
5496	//         "full",
5497	//         "noAcl"
5498	//       ],
5499	//       "enumDescriptions": [
5500	//         "Include all properties.",
5501	//         "Omit owner, acl and defaultObjectAcl properties."
5502	//       ],
5503	//       "location": "query",
5504	//       "type": "string"
5505	//     },
5506	//     "provisionalUserProject": {
5507	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5508	//       "location": "query",
5509	//       "type": "string"
5510	//     },
5511	//     "userProject": {
5512	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5513	//       "location": "query",
5514	//       "type": "string"
5515	//     }
5516	//   },
5517	//   "path": "b/{bucket}",
5518	//   "request": {
5519	//     "$ref": "Bucket"
5520	//   },
5521	//   "response": {
5522	//     "$ref": "Bucket"
5523	//   },
5524	//   "scopes": [
5525	//     "https://www.googleapis.com/auth/cloud-platform",
5526	//     "https://www.googleapis.com/auth/devstorage.full_control"
5527	//   ]
5528	// }
5529
5530}
5531
5532// method id "storage.channels.stop":
5533
5534type ChannelsStopCall struct {
5535	s          *Service
5536	channel    *Channel
5537	urlParams_ gensupport.URLParams
5538	ctx_       context.Context
5539	header_    http.Header
5540}
5541
5542// Stop: Stop watching resources through this channel
5543func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
5544	c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5545	c.channel = channel
5546	return c
5547}
5548
5549// Fields allows partial responses to be retrieved. See
5550// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5551// for more information.
5552func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
5553	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5554	return c
5555}
5556
5557// Context sets the context to be used in this call's Do method. Any
5558// pending HTTP request will be aborted if the provided context is
5559// canceled.
5560func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
5561	c.ctx_ = ctx
5562	return c
5563}
5564
5565// Header returns an http.Header that can be modified by the caller to
5566// add HTTP headers to the request.
5567func (c *ChannelsStopCall) Header() http.Header {
5568	if c.header_ == nil {
5569		c.header_ = make(http.Header)
5570	}
5571	return c.header_
5572}
5573
5574func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
5575	reqHeaders := make(http.Header)
5576	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
5577	for k, v := range c.header_ {
5578		reqHeaders[k] = v
5579	}
5580	reqHeaders.Set("User-Agent", c.s.userAgent())
5581	var body io.Reader = nil
5582	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
5583	if err != nil {
5584		return nil, err
5585	}
5586	reqHeaders.Set("Content-Type", "application/json")
5587	c.urlParams_.Set("alt", alt)
5588	c.urlParams_.Set("prettyPrint", "false")
5589	urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
5590	urls += "?" + c.urlParams_.Encode()
5591	req, err := http.NewRequest("POST", urls, body)
5592	if err != nil {
5593		return nil, err
5594	}
5595	req.Header = reqHeaders
5596	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5597}
5598
5599// Do executes the "storage.channels.stop" call.
5600func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
5601	gensupport.SetOptions(c.urlParams_, opts...)
5602	res, err := c.doRequest("json")
5603	if err != nil {
5604		return err
5605	}
5606	defer googleapi.CloseBody(res)
5607	if err := googleapi.CheckResponse(res); err != nil {
5608		return err
5609	}
5610	return nil
5611	// {
5612	//   "description": "Stop watching resources through this channel",
5613	//   "httpMethod": "POST",
5614	//   "id": "storage.channels.stop",
5615	//   "path": "channels/stop",
5616	//   "request": {
5617	//     "$ref": "Channel",
5618	//     "parameterName": "resource"
5619	//   },
5620	//   "scopes": [
5621	//     "https://www.googleapis.com/auth/cloud-platform",
5622	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5623	//     "https://www.googleapis.com/auth/devstorage.full_control",
5624	//     "https://www.googleapis.com/auth/devstorage.read_only",
5625	//     "https://www.googleapis.com/auth/devstorage.read_write"
5626	//   ]
5627	// }
5628
5629}
5630
5631// method id "storage.defaultObjectAccessControls.delete":
5632
5633type DefaultObjectAccessControlsDeleteCall struct {
5634	s          *Service
5635	bucket     string
5636	entity     string
5637	urlParams_ gensupport.URLParams
5638	ctx_       context.Context
5639	header_    http.Header
5640}
5641
5642// Delete: Permanently deletes the default object ACL entry for the
5643// specified entity on the specified bucket.
5644func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
5645	c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5646	c.bucket = bucket
5647	c.entity = entity
5648	return c
5649}
5650
5651// ProvisionalUserProject sets the optional parameter
5652// "provisionalUserProject": The project to be billed for this request
5653// if the target bucket is requester-pays bucket.
5654func (c *DefaultObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsDeleteCall {
5655	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5656	return c
5657}
5658
5659// UserProject sets the optional parameter "userProject": The project to
5660// be billed for this request. Required for Requester Pays buckets.
5661func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
5662	c.urlParams_.Set("userProject", userProject)
5663	return c
5664}
5665
5666// Fields allows partial responses to be retrieved. See
5667// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5668// for more information.
5669func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
5670	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5671	return c
5672}
5673
5674// Context sets the context to be used in this call's Do method. Any
5675// pending HTTP request will be aborted if the provided context is
5676// canceled.
5677func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
5678	c.ctx_ = ctx
5679	return c
5680}
5681
5682// Header returns an http.Header that can be modified by the caller to
5683// add HTTP headers to the request.
5684func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
5685	if c.header_ == nil {
5686		c.header_ = make(http.Header)
5687	}
5688	return c.header_
5689}
5690
5691func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
5692	reqHeaders := make(http.Header)
5693	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
5694	for k, v := range c.header_ {
5695		reqHeaders[k] = v
5696	}
5697	reqHeaders.Set("User-Agent", c.s.userAgent())
5698	var body io.Reader = nil
5699	c.urlParams_.Set("alt", alt)
5700	c.urlParams_.Set("prettyPrint", "false")
5701	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5702	urls += "?" + c.urlParams_.Encode()
5703	req, err := http.NewRequest("DELETE", urls, body)
5704	if err != nil {
5705		return nil, err
5706	}
5707	req.Header = reqHeaders
5708	googleapi.Expand(req.URL, map[string]string{
5709		"bucket": c.bucket,
5710		"entity": c.entity,
5711	})
5712	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5713}
5714
5715// Do executes the "storage.defaultObjectAccessControls.delete" call.
5716func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
5717	gensupport.SetOptions(c.urlParams_, opts...)
5718	res, err := c.doRequest("json")
5719	if err != nil {
5720		return err
5721	}
5722	defer googleapi.CloseBody(res)
5723	if err := googleapi.CheckResponse(res); err != nil {
5724		return err
5725	}
5726	return nil
5727	// {
5728	//   "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
5729	//   "httpMethod": "DELETE",
5730	//   "id": "storage.defaultObjectAccessControls.delete",
5731	//   "parameterOrder": [
5732	//     "bucket",
5733	//     "entity"
5734	//   ],
5735	//   "parameters": {
5736	//     "bucket": {
5737	//       "description": "Name of a bucket.",
5738	//       "location": "path",
5739	//       "required": true,
5740	//       "type": "string"
5741	//     },
5742	//     "entity": {
5743	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5744	//       "location": "path",
5745	//       "required": true,
5746	//       "type": "string"
5747	//     },
5748	//     "provisionalUserProject": {
5749	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5750	//       "location": "query",
5751	//       "type": "string"
5752	//     },
5753	//     "userProject": {
5754	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5755	//       "location": "query",
5756	//       "type": "string"
5757	//     }
5758	//   },
5759	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5760	//   "scopes": [
5761	//     "https://www.googleapis.com/auth/cloud-platform",
5762	//     "https://www.googleapis.com/auth/devstorage.full_control"
5763	//   ]
5764	// }
5765
5766}
5767
5768// method id "storage.defaultObjectAccessControls.get":
5769
5770type DefaultObjectAccessControlsGetCall struct {
5771	s            *Service
5772	bucket       string
5773	entity       string
5774	urlParams_   gensupport.URLParams
5775	ifNoneMatch_ string
5776	ctx_         context.Context
5777	header_      http.Header
5778}
5779
5780// Get: Returns the default object ACL entry for the specified entity on
5781// the specified bucket.
5782func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
5783	c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5784	c.bucket = bucket
5785	c.entity = entity
5786	return c
5787}
5788
5789// ProvisionalUserProject sets the optional parameter
5790// "provisionalUserProject": The project to be billed for this request
5791// if the target bucket is requester-pays bucket.
5792func (c *DefaultObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsGetCall {
5793	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5794	return c
5795}
5796
5797// UserProject sets the optional parameter "userProject": The project to
5798// be billed for this request. Required for Requester Pays buckets.
5799func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
5800	c.urlParams_.Set("userProject", userProject)
5801	return c
5802}
5803
5804// Fields allows partial responses to be retrieved. See
5805// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5806// for more information.
5807func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
5808	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5809	return c
5810}
5811
5812// IfNoneMatch sets the optional parameter which makes the operation
5813// fail if the object's ETag matches the given value. This is useful for
5814// getting updates only after the object has changed since the last
5815// request. Use googleapi.IsNotModified to check whether the response
5816// error from Do is the result of In-None-Match.
5817func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
5818	c.ifNoneMatch_ = entityTag
5819	return c
5820}
5821
5822// Context sets the context to be used in this call's Do method. Any
5823// pending HTTP request will be aborted if the provided context is
5824// canceled.
5825func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
5826	c.ctx_ = ctx
5827	return c
5828}
5829
5830// Header returns an http.Header that can be modified by the caller to
5831// add HTTP headers to the request.
5832func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
5833	if c.header_ == nil {
5834		c.header_ = make(http.Header)
5835	}
5836	return c.header_
5837}
5838
5839func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
5840	reqHeaders := make(http.Header)
5841	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
5842	for k, v := range c.header_ {
5843		reqHeaders[k] = v
5844	}
5845	reqHeaders.Set("User-Agent", c.s.userAgent())
5846	if c.ifNoneMatch_ != "" {
5847		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5848	}
5849	var body io.Reader = nil
5850	c.urlParams_.Set("alt", alt)
5851	c.urlParams_.Set("prettyPrint", "false")
5852	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5853	urls += "?" + c.urlParams_.Encode()
5854	req, err := http.NewRequest("GET", urls, body)
5855	if err != nil {
5856		return nil, err
5857	}
5858	req.Header = reqHeaders
5859	googleapi.Expand(req.URL, map[string]string{
5860		"bucket": c.bucket,
5861		"entity": c.entity,
5862	})
5863	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5864}
5865
5866// Do executes the "storage.defaultObjectAccessControls.get" call.
5867// Exactly one of *ObjectAccessControl or error will be non-nil. Any
5868// non-2xx status code is an error. Response headers are in either
5869// *ObjectAccessControl.ServerResponse.Header or (if a response was
5870// returned at all) in error.(*googleapi.Error).Header. Use
5871// googleapi.IsNotModified to check whether the returned error was
5872// because http.StatusNotModified was returned.
5873func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5874	gensupport.SetOptions(c.urlParams_, opts...)
5875	res, err := c.doRequest("json")
5876	if res != nil && res.StatusCode == http.StatusNotModified {
5877		if res.Body != nil {
5878			res.Body.Close()
5879		}
5880		return nil, &googleapi.Error{
5881			Code:   res.StatusCode,
5882			Header: res.Header,
5883		}
5884	}
5885	if err != nil {
5886		return nil, err
5887	}
5888	defer googleapi.CloseBody(res)
5889	if err := googleapi.CheckResponse(res); err != nil {
5890		return nil, err
5891	}
5892	ret := &ObjectAccessControl{
5893		ServerResponse: googleapi.ServerResponse{
5894			Header:         res.Header,
5895			HTTPStatusCode: res.StatusCode,
5896		},
5897	}
5898	target := &ret
5899	if err := gensupport.DecodeResponse(target, res); err != nil {
5900		return nil, err
5901	}
5902	return ret, nil
5903	// {
5904	//   "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
5905	//   "httpMethod": "GET",
5906	//   "id": "storage.defaultObjectAccessControls.get",
5907	//   "parameterOrder": [
5908	//     "bucket",
5909	//     "entity"
5910	//   ],
5911	//   "parameters": {
5912	//     "bucket": {
5913	//       "description": "Name of a bucket.",
5914	//       "location": "path",
5915	//       "required": true,
5916	//       "type": "string"
5917	//     },
5918	//     "entity": {
5919	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5920	//       "location": "path",
5921	//       "required": true,
5922	//       "type": "string"
5923	//     },
5924	//     "provisionalUserProject": {
5925	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5926	//       "location": "query",
5927	//       "type": "string"
5928	//     },
5929	//     "userProject": {
5930	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5931	//       "location": "query",
5932	//       "type": "string"
5933	//     }
5934	//   },
5935	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5936	//   "response": {
5937	//     "$ref": "ObjectAccessControl"
5938	//   },
5939	//   "scopes": [
5940	//     "https://www.googleapis.com/auth/cloud-platform",
5941	//     "https://www.googleapis.com/auth/devstorage.full_control"
5942	//   ]
5943	// }
5944
5945}
5946
5947// method id "storage.defaultObjectAccessControls.insert":
5948
5949type DefaultObjectAccessControlsInsertCall struct {
5950	s                   *Service
5951	bucket              string
5952	objectaccesscontrol *ObjectAccessControl
5953	urlParams_          gensupport.URLParams
5954	ctx_                context.Context
5955	header_             http.Header
5956}
5957
5958// Insert: Creates a new default object ACL entry on the specified
5959// bucket.
5960func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
5961	c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5962	c.bucket = bucket
5963	c.objectaccesscontrol = objectaccesscontrol
5964	return c
5965}
5966
5967// ProvisionalUserProject sets the optional parameter
5968// "provisionalUserProject": The project to be billed for this request
5969// if the target bucket is requester-pays bucket.
5970func (c *DefaultObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsInsertCall {
5971	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5972	return c
5973}
5974
5975// UserProject sets the optional parameter "userProject": The project to
5976// be billed for this request. Required for Requester Pays buckets.
5977func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
5978	c.urlParams_.Set("userProject", userProject)
5979	return c
5980}
5981
5982// Fields allows partial responses to be retrieved. See
5983// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5984// for more information.
5985func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
5986	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5987	return c
5988}
5989
5990// Context sets the context to be used in this call's Do method. Any
5991// pending HTTP request will be aborted if the provided context is
5992// canceled.
5993func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
5994	c.ctx_ = ctx
5995	return c
5996}
5997
5998// Header returns an http.Header that can be modified by the caller to
5999// add HTTP headers to the request.
6000func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
6001	if c.header_ == nil {
6002		c.header_ = make(http.Header)
6003	}
6004	return c.header_
6005}
6006
6007func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
6008	reqHeaders := make(http.Header)
6009	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
6010	for k, v := range c.header_ {
6011		reqHeaders[k] = v
6012	}
6013	reqHeaders.Set("User-Agent", c.s.userAgent())
6014	var body io.Reader = nil
6015	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6016	if err != nil {
6017		return nil, err
6018	}
6019	reqHeaders.Set("Content-Type", "application/json")
6020	c.urlParams_.Set("alt", alt)
6021	c.urlParams_.Set("prettyPrint", "false")
6022	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
6023	urls += "?" + c.urlParams_.Encode()
6024	req, err := http.NewRequest("POST", urls, body)
6025	if err != nil {
6026		return nil, err
6027	}
6028	req.Header = reqHeaders
6029	googleapi.Expand(req.URL, map[string]string{
6030		"bucket": c.bucket,
6031	})
6032	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6033}
6034
6035// Do executes the "storage.defaultObjectAccessControls.insert" call.
6036// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6037// non-2xx status code is an error. Response headers are in either
6038// *ObjectAccessControl.ServerResponse.Header or (if a response was
6039// returned at all) in error.(*googleapi.Error).Header. Use
6040// googleapi.IsNotModified to check whether the returned error was
6041// because http.StatusNotModified was returned.
6042func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6043	gensupport.SetOptions(c.urlParams_, opts...)
6044	res, err := c.doRequest("json")
6045	if res != nil && res.StatusCode == http.StatusNotModified {
6046		if res.Body != nil {
6047			res.Body.Close()
6048		}
6049		return nil, &googleapi.Error{
6050			Code:   res.StatusCode,
6051			Header: res.Header,
6052		}
6053	}
6054	if err != nil {
6055		return nil, err
6056	}
6057	defer googleapi.CloseBody(res)
6058	if err := googleapi.CheckResponse(res); err != nil {
6059		return nil, err
6060	}
6061	ret := &ObjectAccessControl{
6062		ServerResponse: googleapi.ServerResponse{
6063			Header:         res.Header,
6064			HTTPStatusCode: res.StatusCode,
6065		},
6066	}
6067	target := &ret
6068	if err := gensupport.DecodeResponse(target, res); err != nil {
6069		return nil, err
6070	}
6071	return ret, nil
6072	// {
6073	//   "description": "Creates a new default object ACL entry on the specified bucket.",
6074	//   "httpMethod": "POST",
6075	//   "id": "storage.defaultObjectAccessControls.insert",
6076	//   "parameterOrder": [
6077	//     "bucket"
6078	//   ],
6079	//   "parameters": {
6080	//     "bucket": {
6081	//       "description": "Name of a bucket.",
6082	//       "location": "path",
6083	//       "required": true,
6084	//       "type": "string"
6085	//     },
6086	//     "provisionalUserProject": {
6087	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6088	//       "location": "query",
6089	//       "type": "string"
6090	//     },
6091	//     "userProject": {
6092	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6093	//       "location": "query",
6094	//       "type": "string"
6095	//     }
6096	//   },
6097	//   "path": "b/{bucket}/defaultObjectAcl",
6098	//   "request": {
6099	//     "$ref": "ObjectAccessControl"
6100	//   },
6101	//   "response": {
6102	//     "$ref": "ObjectAccessControl"
6103	//   },
6104	//   "scopes": [
6105	//     "https://www.googleapis.com/auth/cloud-platform",
6106	//     "https://www.googleapis.com/auth/devstorage.full_control"
6107	//   ]
6108	// }
6109
6110}
6111
6112// method id "storage.defaultObjectAccessControls.list":
6113
6114type DefaultObjectAccessControlsListCall struct {
6115	s            *Service
6116	bucket       string
6117	urlParams_   gensupport.URLParams
6118	ifNoneMatch_ string
6119	ctx_         context.Context
6120	header_      http.Header
6121}
6122
6123// List: Retrieves default object ACL entries on the specified bucket.
6124func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
6125	c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6126	c.bucket = bucket
6127	return c
6128}
6129
6130// IfMetagenerationMatch sets the optional parameter
6131// "ifMetagenerationMatch": If present, only return default ACL listing
6132// if the bucket's current metageneration matches this value.
6133func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
6134	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
6135	return c
6136}
6137
6138// IfMetagenerationNotMatch sets the optional parameter
6139// "ifMetagenerationNotMatch": If present, only return default ACL
6140// listing if the bucket's current metageneration does not match the
6141// given value.
6142func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
6143	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
6144	return c
6145}
6146
6147// ProvisionalUserProject sets the optional parameter
6148// "provisionalUserProject": The project to be billed for this request
6149// if the target bucket is requester-pays bucket.
6150func (c *DefaultObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsListCall {
6151	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6152	return c
6153}
6154
6155// UserProject sets the optional parameter "userProject": The project to
6156// be billed for this request. Required for Requester Pays buckets.
6157func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
6158	c.urlParams_.Set("userProject", userProject)
6159	return c
6160}
6161
6162// Fields allows partial responses to be retrieved. See
6163// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6164// for more information.
6165func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
6166	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6167	return c
6168}
6169
6170// IfNoneMatch sets the optional parameter which makes the operation
6171// fail if the object's ETag matches the given value. This is useful for
6172// getting updates only after the object has changed since the last
6173// request. Use googleapi.IsNotModified to check whether the response
6174// error from Do is the result of In-None-Match.
6175func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
6176	c.ifNoneMatch_ = entityTag
6177	return c
6178}
6179
6180// Context sets the context to be used in this call's Do method. Any
6181// pending HTTP request will be aborted if the provided context is
6182// canceled.
6183func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
6184	c.ctx_ = ctx
6185	return c
6186}
6187
6188// Header returns an http.Header that can be modified by the caller to
6189// add HTTP headers to the request.
6190func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
6191	if c.header_ == nil {
6192		c.header_ = make(http.Header)
6193	}
6194	return c.header_
6195}
6196
6197func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
6198	reqHeaders := make(http.Header)
6199	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
6200	for k, v := range c.header_ {
6201		reqHeaders[k] = v
6202	}
6203	reqHeaders.Set("User-Agent", c.s.userAgent())
6204	if c.ifNoneMatch_ != "" {
6205		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6206	}
6207	var body io.Reader = nil
6208	c.urlParams_.Set("alt", alt)
6209	c.urlParams_.Set("prettyPrint", "false")
6210	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
6211	urls += "?" + c.urlParams_.Encode()
6212	req, err := http.NewRequest("GET", urls, body)
6213	if err != nil {
6214		return nil, err
6215	}
6216	req.Header = reqHeaders
6217	googleapi.Expand(req.URL, map[string]string{
6218		"bucket": c.bucket,
6219	})
6220	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6221}
6222
6223// Do executes the "storage.defaultObjectAccessControls.list" call.
6224// Exactly one of *ObjectAccessControls or error will be non-nil. Any
6225// non-2xx status code is an error. Response headers are in either
6226// *ObjectAccessControls.ServerResponse.Header or (if a response was
6227// returned at all) in error.(*googleapi.Error).Header. Use
6228// googleapi.IsNotModified to check whether the returned error was
6229// because http.StatusNotModified was returned.
6230func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
6231	gensupport.SetOptions(c.urlParams_, opts...)
6232	res, err := c.doRequest("json")
6233	if res != nil && res.StatusCode == http.StatusNotModified {
6234		if res.Body != nil {
6235			res.Body.Close()
6236		}
6237		return nil, &googleapi.Error{
6238			Code:   res.StatusCode,
6239			Header: res.Header,
6240		}
6241	}
6242	if err != nil {
6243		return nil, err
6244	}
6245	defer googleapi.CloseBody(res)
6246	if err := googleapi.CheckResponse(res); err != nil {
6247		return nil, err
6248	}
6249	ret := &ObjectAccessControls{
6250		ServerResponse: googleapi.ServerResponse{
6251			Header:         res.Header,
6252			HTTPStatusCode: res.StatusCode,
6253		},
6254	}
6255	target := &ret
6256	if err := gensupport.DecodeResponse(target, res); err != nil {
6257		return nil, err
6258	}
6259	return ret, nil
6260	// {
6261	//   "description": "Retrieves default object ACL entries on the specified bucket.",
6262	//   "httpMethod": "GET",
6263	//   "id": "storage.defaultObjectAccessControls.list",
6264	//   "parameterOrder": [
6265	//     "bucket"
6266	//   ],
6267	//   "parameters": {
6268	//     "bucket": {
6269	//       "description": "Name of a bucket.",
6270	//       "location": "path",
6271	//       "required": true,
6272	//       "type": "string"
6273	//     },
6274	//     "ifMetagenerationMatch": {
6275	//       "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
6276	//       "format": "int64",
6277	//       "location": "query",
6278	//       "type": "string"
6279	//     },
6280	//     "ifMetagenerationNotMatch": {
6281	//       "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
6282	//       "format": "int64",
6283	//       "location": "query",
6284	//       "type": "string"
6285	//     },
6286	//     "provisionalUserProject": {
6287	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6288	//       "location": "query",
6289	//       "type": "string"
6290	//     },
6291	//     "userProject": {
6292	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6293	//       "location": "query",
6294	//       "type": "string"
6295	//     }
6296	//   },
6297	//   "path": "b/{bucket}/defaultObjectAcl",
6298	//   "response": {
6299	//     "$ref": "ObjectAccessControls"
6300	//   },
6301	//   "scopes": [
6302	//     "https://www.googleapis.com/auth/cloud-platform",
6303	//     "https://www.googleapis.com/auth/devstorage.full_control"
6304	//   ]
6305	// }
6306
6307}
6308
6309// method id "storage.defaultObjectAccessControls.patch":
6310
6311type DefaultObjectAccessControlsPatchCall struct {
6312	s                   *Service
6313	bucket              string
6314	entity              string
6315	objectaccesscontrol *ObjectAccessControl
6316	urlParams_          gensupport.URLParams
6317	ctx_                context.Context
6318	header_             http.Header
6319}
6320
6321// Patch: Patches a default object ACL entry on the specified bucket.
6322func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
6323	c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6324	c.bucket = bucket
6325	c.entity = entity
6326	c.objectaccesscontrol = objectaccesscontrol
6327	return c
6328}
6329
6330// ProvisionalUserProject sets the optional parameter
6331// "provisionalUserProject": The project to be billed for this request
6332// if the target bucket is requester-pays bucket.
6333func (c *DefaultObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsPatchCall {
6334	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6335	return c
6336}
6337
6338// UserProject sets the optional parameter "userProject": The project to
6339// be billed for this request. Required for Requester Pays buckets.
6340func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
6341	c.urlParams_.Set("userProject", userProject)
6342	return c
6343}
6344
6345// Fields allows partial responses to be retrieved. See
6346// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6347// for more information.
6348func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
6349	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6350	return c
6351}
6352
6353// Context sets the context to be used in this call's Do method. Any
6354// pending HTTP request will be aborted if the provided context is
6355// canceled.
6356func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
6357	c.ctx_ = ctx
6358	return c
6359}
6360
6361// Header returns an http.Header that can be modified by the caller to
6362// add HTTP headers to the request.
6363func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
6364	if c.header_ == nil {
6365		c.header_ = make(http.Header)
6366	}
6367	return c.header_
6368}
6369
6370func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
6371	reqHeaders := make(http.Header)
6372	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
6373	for k, v := range c.header_ {
6374		reqHeaders[k] = v
6375	}
6376	reqHeaders.Set("User-Agent", c.s.userAgent())
6377	var body io.Reader = nil
6378	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6379	if err != nil {
6380		return nil, err
6381	}
6382	reqHeaders.Set("Content-Type", "application/json")
6383	c.urlParams_.Set("alt", alt)
6384	c.urlParams_.Set("prettyPrint", "false")
6385	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
6386	urls += "?" + c.urlParams_.Encode()
6387	req, err := http.NewRequest("PATCH", urls, body)
6388	if err != nil {
6389		return nil, err
6390	}
6391	req.Header = reqHeaders
6392	googleapi.Expand(req.URL, map[string]string{
6393		"bucket": c.bucket,
6394		"entity": c.entity,
6395	})
6396	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6397}
6398
6399// Do executes the "storage.defaultObjectAccessControls.patch" call.
6400// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6401// non-2xx status code is an error. Response headers are in either
6402// *ObjectAccessControl.ServerResponse.Header or (if a response was
6403// returned at all) in error.(*googleapi.Error).Header. Use
6404// googleapi.IsNotModified to check whether the returned error was
6405// because http.StatusNotModified was returned.
6406func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6407	gensupport.SetOptions(c.urlParams_, opts...)
6408	res, err := c.doRequest("json")
6409	if res != nil && res.StatusCode == http.StatusNotModified {
6410		if res.Body != nil {
6411			res.Body.Close()
6412		}
6413		return nil, &googleapi.Error{
6414			Code:   res.StatusCode,
6415			Header: res.Header,
6416		}
6417	}
6418	if err != nil {
6419		return nil, err
6420	}
6421	defer googleapi.CloseBody(res)
6422	if err := googleapi.CheckResponse(res); err != nil {
6423		return nil, err
6424	}
6425	ret := &ObjectAccessControl{
6426		ServerResponse: googleapi.ServerResponse{
6427			Header:         res.Header,
6428			HTTPStatusCode: res.StatusCode,
6429		},
6430	}
6431	target := &ret
6432	if err := gensupport.DecodeResponse(target, res); err != nil {
6433		return nil, err
6434	}
6435	return ret, nil
6436	// {
6437	//   "description": "Patches a default object ACL entry on the specified bucket.",
6438	//   "httpMethod": "PATCH",
6439	//   "id": "storage.defaultObjectAccessControls.patch",
6440	//   "parameterOrder": [
6441	//     "bucket",
6442	//     "entity"
6443	//   ],
6444	//   "parameters": {
6445	//     "bucket": {
6446	//       "description": "Name of a bucket.",
6447	//       "location": "path",
6448	//       "required": true,
6449	//       "type": "string"
6450	//     },
6451	//     "entity": {
6452	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6453	//       "location": "path",
6454	//       "required": true,
6455	//       "type": "string"
6456	//     },
6457	//     "provisionalUserProject": {
6458	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6459	//       "location": "query",
6460	//       "type": "string"
6461	//     },
6462	//     "userProject": {
6463	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6464	//       "location": "query",
6465	//       "type": "string"
6466	//     }
6467	//   },
6468	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
6469	//   "request": {
6470	//     "$ref": "ObjectAccessControl"
6471	//   },
6472	//   "response": {
6473	//     "$ref": "ObjectAccessControl"
6474	//   },
6475	//   "scopes": [
6476	//     "https://www.googleapis.com/auth/cloud-platform",
6477	//     "https://www.googleapis.com/auth/devstorage.full_control"
6478	//   ]
6479	// }
6480
6481}
6482
6483// method id "storage.defaultObjectAccessControls.update":
6484
6485type DefaultObjectAccessControlsUpdateCall struct {
6486	s                   *Service
6487	bucket              string
6488	entity              string
6489	objectaccesscontrol *ObjectAccessControl
6490	urlParams_          gensupport.URLParams
6491	ctx_                context.Context
6492	header_             http.Header
6493}
6494
6495// Update: Updates a default object ACL entry on the specified bucket.
6496func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
6497	c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6498	c.bucket = bucket
6499	c.entity = entity
6500	c.objectaccesscontrol = objectaccesscontrol
6501	return c
6502}
6503
6504// ProvisionalUserProject sets the optional parameter
6505// "provisionalUserProject": The project to be billed for this request
6506// if the target bucket is requester-pays bucket.
6507func (c *DefaultObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsUpdateCall {
6508	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6509	return c
6510}
6511
6512// UserProject sets the optional parameter "userProject": The project to
6513// be billed for this request. Required for Requester Pays buckets.
6514func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
6515	c.urlParams_.Set("userProject", userProject)
6516	return c
6517}
6518
6519// Fields allows partial responses to be retrieved. See
6520// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6521// for more information.
6522func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
6523	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6524	return c
6525}
6526
6527// Context sets the context to be used in this call's Do method. Any
6528// pending HTTP request will be aborted if the provided context is
6529// canceled.
6530func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
6531	c.ctx_ = ctx
6532	return c
6533}
6534
6535// Header returns an http.Header that can be modified by the caller to
6536// add HTTP headers to the request.
6537func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
6538	if c.header_ == nil {
6539		c.header_ = make(http.Header)
6540	}
6541	return c.header_
6542}
6543
6544func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
6545	reqHeaders := make(http.Header)
6546	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
6547	for k, v := range c.header_ {
6548		reqHeaders[k] = v
6549	}
6550	reqHeaders.Set("User-Agent", c.s.userAgent())
6551	var body io.Reader = nil
6552	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6553	if err != nil {
6554		return nil, err
6555	}
6556	reqHeaders.Set("Content-Type", "application/json")
6557	c.urlParams_.Set("alt", alt)
6558	c.urlParams_.Set("prettyPrint", "false")
6559	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
6560	urls += "?" + c.urlParams_.Encode()
6561	req, err := http.NewRequest("PUT", urls, body)
6562	if err != nil {
6563		return nil, err
6564	}
6565	req.Header = reqHeaders
6566	googleapi.Expand(req.URL, map[string]string{
6567		"bucket": c.bucket,
6568		"entity": c.entity,
6569	})
6570	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6571}
6572
6573// Do executes the "storage.defaultObjectAccessControls.update" call.
6574// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6575// non-2xx status code is an error. Response headers are in either
6576// *ObjectAccessControl.ServerResponse.Header or (if a response was
6577// returned at all) in error.(*googleapi.Error).Header. Use
6578// googleapi.IsNotModified to check whether the returned error was
6579// because http.StatusNotModified was returned.
6580func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6581	gensupport.SetOptions(c.urlParams_, opts...)
6582	res, err := c.doRequest("json")
6583	if res != nil && res.StatusCode == http.StatusNotModified {
6584		if res.Body != nil {
6585			res.Body.Close()
6586		}
6587		return nil, &googleapi.Error{
6588			Code:   res.StatusCode,
6589			Header: res.Header,
6590		}
6591	}
6592	if err != nil {
6593		return nil, err
6594	}
6595	defer googleapi.CloseBody(res)
6596	if err := googleapi.CheckResponse(res); err != nil {
6597		return nil, err
6598	}
6599	ret := &ObjectAccessControl{
6600		ServerResponse: googleapi.ServerResponse{
6601			Header:         res.Header,
6602			HTTPStatusCode: res.StatusCode,
6603		},
6604	}
6605	target := &ret
6606	if err := gensupport.DecodeResponse(target, res); err != nil {
6607		return nil, err
6608	}
6609	return ret, nil
6610	// {
6611	//   "description": "Updates a default object ACL entry on the specified bucket.",
6612	//   "httpMethod": "PUT",
6613	//   "id": "storage.defaultObjectAccessControls.update",
6614	//   "parameterOrder": [
6615	//     "bucket",
6616	//     "entity"
6617	//   ],
6618	//   "parameters": {
6619	//     "bucket": {
6620	//       "description": "Name of a bucket.",
6621	//       "location": "path",
6622	//       "required": true,
6623	//       "type": "string"
6624	//     },
6625	//     "entity": {
6626	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6627	//       "location": "path",
6628	//       "required": true,
6629	//       "type": "string"
6630	//     },
6631	//     "provisionalUserProject": {
6632	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6633	//       "location": "query",
6634	//       "type": "string"
6635	//     },
6636	//     "userProject": {
6637	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6638	//       "location": "query",
6639	//       "type": "string"
6640	//     }
6641	//   },
6642	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
6643	//   "request": {
6644	//     "$ref": "ObjectAccessControl"
6645	//   },
6646	//   "response": {
6647	//     "$ref": "ObjectAccessControl"
6648	//   },
6649	//   "scopes": [
6650	//     "https://www.googleapis.com/auth/cloud-platform",
6651	//     "https://www.googleapis.com/auth/devstorage.full_control"
6652	//   ]
6653	// }
6654
6655}
6656
6657// method id "storage.notifications.delete":
6658
6659type NotificationsDeleteCall struct {
6660	s            *Service
6661	bucket       string
6662	notification string
6663	urlParams_   gensupport.URLParams
6664	ctx_         context.Context
6665	header_      http.Header
6666}
6667
6668// Delete: Permanently deletes a notification subscription.
6669func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
6670	c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6671	c.bucket = bucket
6672	c.notification = notification
6673	return c
6674}
6675
6676// ProvisionalUserProject sets the optional parameter
6677// "provisionalUserProject": The project to be billed for this request
6678// if the target bucket is requester-pays bucket.
6679func (c *NotificationsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsDeleteCall {
6680	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6681	return c
6682}
6683
6684// UserProject sets the optional parameter "userProject": The project to
6685// be billed for this request. Required for Requester Pays buckets.
6686func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
6687	c.urlParams_.Set("userProject", userProject)
6688	return c
6689}
6690
6691// Fields allows partial responses to be retrieved. See
6692// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6693// for more information.
6694func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
6695	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6696	return c
6697}
6698
6699// Context sets the context to be used in this call's Do method. Any
6700// pending HTTP request will be aborted if the provided context is
6701// canceled.
6702func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
6703	c.ctx_ = ctx
6704	return c
6705}
6706
6707// Header returns an http.Header that can be modified by the caller to
6708// add HTTP headers to the request.
6709func (c *NotificationsDeleteCall) Header() http.Header {
6710	if c.header_ == nil {
6711		c.header_ = make(http.Header)
6712	}
6713	return c.header_
6714}
6715
6716func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
6717	reqHeaders := make(http.Header)
6718	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
6719	for k, v := range c.header_ {
6720		reqHeaders[k] = v
6721	}
6722	reqHeaders.Set("User-Agent", c.s.userAgent())
6723	var body io.Reader = nil
6724	c.urlParams_.Set("alt", alt)
6725	c.urlParams_.Set("prettyPrint", "false")
6726	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6727	urls += "?" + c.urlParams_.Encode()
6728	req, err := http.NewRequest("DELETE", urls, body)
6729	if err != nil {
6730		return nil, err
6731	}
6732	req.Header = reqHeaders
6733	googleapi.Expand(req.URL, map[string]string{
6734		"bucket":       c.bucket,
6735		"notification": c.notification,
6736	})
6737	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6738}
6739
6740// Do executes the "storage.notifications.delete" call.
6741func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
6742	gensupport.SetOptions(c.urlParams_, opts...)
6743	res, err := c.doRequest("json")
6744	if err != nil {
6745		return err
6746	}
6747	defer googleapi.CloseBody(res)
6748	if err := googleapi.CheckResponse(res); err != nil {
6749		return err
6750	}
6751	return nil
6752	// {
6753	//   "description": "Permanently deletes a notification subscription.",
6754	//   "httpMethod": "DELETE",
6755	//   "id": "storage.notifications.delete",
6756	//   "parameterOrder": [
6757	//     "bucket",
6758	//     "notification"
6759	//   ],
6760	//   "parameters": {
6761	//     "bucket": {
6762	//       "description": "The parent bucket of the notification.",
6763	//       "location": "path",
6764	//       "required": true,
6765	//       "type": "string"
6766	//     },
6767	//     "notification": {
6768	//       "description": "ID of the notification to delete.",
6769	//       "location": "path",
6770	//       "required": true,
6771	//       "type": "string"
6772	//     },
6773	//     "provisionalUserProject": {
6774	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6775	//       "location": "query",
6776	//       "type": "string"
6777	//     },
6778	//     "userProject": {
6779	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6780	//       "location": "query",
6781	//       "type": "string"
6782	//     }
6783	//   },
6784	//   "path": "b/{bucket}/notificationConfigs/{notification}",
6785	//   "scopes": [
6786	//     "https://www.googleapis.com/auth/cloud-platform",
6787	//     "https://www.googleapis.com/auth/devstorage.full_control",
6788	//     "https://www.googleapis.com/auth/devstorage.read_write"
6789	//   ]
6790	// }
6791
6792}
6793
6794// method id "storage.notifications.get":
6795
6796type NotificationsGetCall struct {
6797	s            *Service
6798	bucket       string
6799	notification string
6800	urlParams_   gensupport.URLParams
6801	ifNoneMatch_ string
6802	ctx_         context.Context
6803	header_      http.Header
6804}
6805
6806// Get: View a notification configuration.
6807func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
6808	c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6809	c.bucket = bucket
6810	c.notification = notification
6811	return c
6812}
6813
6814// ProvisionalUserProject sets the optional parameter
6815// "provisionalUserProject": The project to be billed for this request
6816// if the target bucket is requester-pays bucket.
6817func (c *NotificationsGetCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsGetCall {
6818	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6819	return c
6820}
6821
6822// UserProject sets the optional parameter "userProject": The project to
6823// be billed for this request. Required for Requester Pays buckets.
6824func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
6825	c.urlParams_.Set("userProject", userProject)
6826	return c
6827}
6828
6829// Fields allows partial responses to be retrieved. See
6830// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6831// for more information.
6832func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
6833	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6834	return c
6835}
6836
6837// IfNoneMatch sets the optional parameter which makes the operation
6838// fail if the object's ETag matches the given value. This is useful for
6839// getting updates only after the object has changed since the last
6840// request. Use googleapi.IsNotModified to check whether the response
6841// error from Do is the result of In-None-Match.
6842func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
6843	c.ifNoneMatch_ = entityTag
6844	return c
6845}
6846
6847// Context sets the context to be used in this call's Do method. Any
6848// pending HTTP request will be aborted if the provided context is
6849// canceled.
6850func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
6851	c.ctx_ = ctx
6852	return c
6853}
6854
6855// Header returns an http.Header that can be modified by the caller to
6856// add HTTP headers to the request.
6857func (c *NotificationsGetCall) Header() http.Header {
6858	if c.header_ == nil {
6859		c.header_ = make(http.Header)
6860	}
6861	return c.header_
6862}
6863
6864func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
6865	reqHeaders := make(http.Header)
6866	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
6867	for k, v := range c.header_ {
6868		reqHeaders[k] = v
6869	}
6870	reqHeaders.Set("User-Agent", c.s.userAgent())
6871	if c.ifNoneMatch_ != "" {
6872		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6873	}
6874	var body io.Reader = nil
6875	c.urlParams_.Set("alt", alt)
6876	c.urlParams_.Set("prettyPrint", "false")
6877	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6878	urls += "?" + c.urlParams_.Encode()
6879	req, err := http.NewRequest("GET", urls, body)
6880	if err != nil {
6881		return nil, err
6882	}
6883	req.Header = reqHeaders
6884	googleapi.Expand(req.URL, map[string]string{
6885		"bucket":       c.bucket,
6886		"notification": c.notification,
6887	})
6888	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6889}
6890
6891// Do executes the "storage.notifications.get" call.
6892// Exactly one of *Notification or error will be non-nil. Any non-2xx
6893// status code is an error. Response headers are in either
6894// *Notification.ServerResponse.Header or (if a response was returned at
6895// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6896// to check whether the returned error was because
6897// http.StatusNotModified was returned.
6898func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
6899	gensupport.SetOptions(c.urlParams_, opts...)
6900	res, err := c.doRequest("json")
6901	if res != nil && res.StatusCode == http.StatusNotModified {
6902		if res.Body != nil {
6903			res.Body.Close()
6904		}
6905		return nil, &googleapi.Error{
6906			Code:   res.StatusCode,
6907			Header: res.Header,
6908		}
6909	}
6910	if err != nil {
6911		return nil, err
6912	}
6913	defer googleapi.CloseBody(res)
6914	if err := googleapi.CheckResponse(res); err != nil {
6915		return nil, err
6916	}
6917	ret := &Notification{
6918		ServerResponse: googleapi.ServerResponse{
6919			Header:         res.Header,
6920			HTTPStatusCode: res.StatusCode,
6921		},
6922	}
6923	target := &ret
6924	if err := gensupport.DecodeResponse(target, res); err != nil {
6925		return nil, err
6926	}
6927	return ret, nil
6928	// {
6929	//   "description": "View a notification configuration.",
6930	//   "httpMethod": "GET",
6931	//   "id": "storage.notifications.get",
6932	//   "parameterOrder": [
6933	//     "bucket",
6934	//     "notification"
6935	//   ],
6936	//   "parameters": {
6937	//     "bucket": {
6938	//       "description": "The parent bucket of the notification.",
6939	//       "location": "path",
6940	//       "required": true,
6941	//       "type": "string"
6942	//     },
6943	//     "notification": {
6944	//       "description": "Notification ID",
6945	//       "location": "path",
6946	//       "required": true,
6947	//       "type": "string"
6948	//     },
6949	//     "provisionalUserProject": {
6950	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6951	//       "location": "query",
6952	//       "type": "string"
6953	//     },
6954	//     "userProject": {
6955	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6956	//       "location": "query",
6957	//       "type": "string"
6958	//     }
6959	//   },
6960	//   "path": "b/{bucket}/notificationConfigs/{notification}",
6961	//   "response": {
6962	//     "$ref": "Notification"
6963	//   },
6964	//   "scopes": [
6965	//     "https://www.googleapis.com/auth/cloud-platform",
6966	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6967	//     "https://www.googleapis.com/auth/devstorage.full_control",
6968	//     "https://www.googleapis.com/auth/devstorage.read_only",
6969	//     "https://www.googleapis.com/auth/devstorage.read_write"
6970	//   ]
6971	// }
6972
6973}
6974
6975// method id "storage.notifications.insert":
6976
6977type NotificationsInsertCall struct {
6978	s            *Service
6979	bucket       string
6980	notification *Notification
6981	urlParams_   gensupport.URLParams
6982	ctx_         context.Context
6983	header_      http.Header
6984}
6985
6986// Insert: Creates a notification subscription for a given bucket.
6987func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
6988	c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6989	c.bucket = bucket
6990	c.notification = notification
6991	return c
6992}
6993
6994// ProvisionalUserProject sets the optional parameter
6995// "provisionalUserProject": The project to be billed for this request
6996// if the target bucket is requester-pays bucket.
6997func (c *NotificationsInsertCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsInsertCall {
6998	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6999	return c
7000}
7001
7002// UserProject sets the optional parameter "userProject": The project to
7003// be billed for this request. Required for Requester Pays buckets.
7004func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
7005	c.urlParams_.Set("userProject", userProject)
7006	return c
7007}
7008
7009// Fields allows partial responses to be retrieved. See
7010// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7011// for more information.
7012func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
7013	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7014	return c
7015}
7016
7017// Context sets the context to be used in this call's Do method. Any
7018// pending HTTP request will be aborted if the provided context is
7019// canceled.
7020func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
7021	c.ctx_ = ctx
7022	return c
7023}
7024
7025// Header returns an http.Header that can be modified by the caller to
7026// add HTTP headers to the request.
7027func (c *NotificationsInsertCall) Header() http.Header {
7028	if c.header_ == nil {
7029		c.header_ = make(http.Header)
7030	}
7031	return c.header_
7032}
7033
7034func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
7035	reqHeaders := make(http.Header)
7036	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
7037	for k, v := range c.header_ {
7038		reqHeaders[k] = v
7039	}
7040	reqHeaders.Set("User-Agent", c.s.userAgent())
7041	var body io.Reader = nil
7042	body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
7043	if err != nil {
7044		return nil, err
7045	}
7046	reqHeaders.Set("Content-Type", "application/json")
7047	c.urlParams_.Set("alt", alt)
7048	c.urlParams_.Set("prettyPrint", "false")
7049	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
7050	urls += "?" + c.urlParams_.Encode()
7051	req, err := http.NewRequest("POST", urls, body)
7052	if err != nil {
7053		return nil, err
7054	}
7055	req.Header = reqHeaders
7056	googleapi.Expand(req.URL, map[string]string{
7057		"bucket": c.bucket,
7058	})
7059	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7060}
7061
7062// Do executes the "storage.notifications.insert" call.
7063// Exactly one of *Notification or error will be non-nil. Any non-2xx
7064// status code is an error. Response headers are in either
7065// *Notification.ServerResponse.Header or (if a response was returned at
7066// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7067// to check whether the returned error was because
7068// http.StatusNotModified was returned.
7069func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
7070	gensupport.SetOptions(c.urlParams_, opts...)
7071	res, err := c.doRequest("json")
7072	if res != nil && res.StatusCode == http.StatusNotModified {
7073		if res.Body != nil {
7074			res.Body.Close()
7075		}
7076		return nil, &googleapi.Error{
7077			Code:   res.StatusCode,
7078			Header: res.Header,
7079		}
7080	}
7081	if err != nil {
7082		return nil, err
7083	}
7084	defer googleapi.CloseBody(res)
7085	if err := googleapi.CheckResponse(res); err != nil {
7086		return nil, err
7087	}
7088	ret := &Notification{
7089		ServerResponse: googleapi.ServerResponse{
7090			Header:         res.Header,
7091			HTTPStatusCode: res.StatusCode,
7092		},
7093	}
7094	target := &ret
7095	if err := gensupport.DecodeResponse(target, res); err != nil {
7096		return nil, err
7097	}
7098	return ret, nil
7099	// {
7100	//   "description": "Creates a notification subscription for a given bucket.",
7101	//   "httpMethod": "POST",
7102	//   "id": "storage.notifications.insert",
7103	//   "parameterOrder": [
7104	//     "bucket"
7105	//   ],
7106	//   "parameters": {
7107	//     "bucket": {
7108	//       "description": "The parent bucket of the notification.",
7109	//       "location": "path",
7110	//       "required": true,
7111	//       "type": "string"
7112	//     },
7113	//     "provisionalUserProject": {
7114	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7115	//       "location": "query",
7116	//       "type": "string"
7117	//     },
7118	//     "userProject": {
7119	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7120	//       "location": "query",
7121	//       "type": "string"
7122	//     }
7123	//   },
7124	//   "path": "b/{bucket}/notificationConfigs",
7125	//   "request": {
7126	//     "$ref": "Notification"
7127	//   },
7128	//   "response": {
7129	//     "$ref": "Notification"
7130	//   },
7131	//   "scopes": [
7132	//     "https://www.googleapis.com/auth/cloud-platform",
7133	//     "https://www.googleapis.com/auth/devstorage.full_control",
7134	//     "https://www.googleapis.com/auth/devstorage.read_write"
7135	//   ]
7136	// }
7137
7138}
7139
7140// method id "storage.notifications.list":
7141
7142type NotificationsListCall struct {
7143	s            *Service
7144	bucket       string
7145	urlParams_   gensupport.URLParams
7146	ifNoneMatch_ string
7147	ctx_         context.Context
7148	header_      http.Header
7149}
7150
7151// List: Retrieves a list of notification subscriptions for a given
7152// bucket.
7153func (r *NotificationsService) List(bucket string) *NotificationsListCall {
7154	c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7155	c.bucket = bucket
7156	return c
7157}
7158
7159// ProvisionalUserProject sets the optional parameter
7160// "provisionalUserProject": The project to be billed for this request
7161// if the target bucket is requester-pays bucket.
7162func (c *NotificationsListCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsListCall {
7163	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7164	return c
7165}
7166
7167// UserProject sets the optional parameter "userProject": The project to
7168// be billed for this request. Required for Requester Pays buckets.
7169func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
7170	c.urlParams_.Set("userProject", userProject)
7171	return c
7172}
7173
7174// Fields allows partial responses to be retrieved. See
7175// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7176// for more information.
7177func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
7178	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7179	return c
7180}
7181
7182// IfNoneMatch sets the optional parameter which makes the operation
7183// fail if the object's ETag matches the given value. This is useful for
7184// getting updates only after the object has changed since the last
7185// request. Use googleapi.IsNotModified to check whether the response
7186// error from Do is the result of In-None-Match.
7187func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
7188	c.ifNoneMatch_ = entityTag
7189	return c
7190}
7191
7192// Context sets the context to be used in this call's Do method. Any
7193// pending HTTP request will be aborted if the provided context is
7194// canceled.
7195func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
7196	c.ctx_ = ctx
7197	return c
7198}
7199
7200// Header returns an http.Header that can be modified by the caller to
7201// add HTTP headers to the request.
7202func (c *NotificationsListCall) Header() http.Header {
7203	if c.header_ == nil {
7204		c.header_ = make(http.Header)
7205	}
7206	return c.header_
7207}
7208
7209func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
7210	reqHeaders := make(http.Header)
7211	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
7212	for k, v := range c.header_ {
7213		reqHeaders[k] = v
7214	}
7215	reqHeaders.Set("User-Agent", c.s.userAgent())
7216	if c.ifNoneMatch_ != "" {
7217		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7218	}
7219	var body io.Reader = nil
7220	c.urlParams_.Set("alt", alt)
7221	c.urlParams_.Set("prettyPrint", "false")
7222	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
7223	urls += "?" + c.urlParams_.Encode()
7224	req, err := http.NewRequest("GET", urls, body)
7225	if err != nil {
7226		return nil, err
7227	}
7228	req.Header = reqHeaders
7229	googleapi.Expand(req.URL, map[string]string{
7230		"bucket": c.bucket,
7231	})
7232	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7233}
7234
7235// Do executes the "storage.notifications.list" call.
7236// Exactly one of *Notifications or error will be non-nil. Any non-2xx
7237// status code is an error. Response headers are in either
7238// *Notifications.ServerResponse.Header or (if a response was returned
7239// at all) in error.(*googleapi.Error).Header. Use
7240// googleapi.IsNotModified to check whether the returned error was
7241// because http.StatusNotModified was returned.
7242func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
7243	gensupport.SetOptions(c.urlParams_, opts...)
7244	res, err := c.doRequest("json")
7245	if res != nil && res.StatusCode == http.StatusNotModified {
7246		if res.Body != nil {
7247			res.Body.Close()
7248		}
7249		return nil, &googleapi.Error{
7250			Code:   res.StatusCode,
7251			Header: res.Header,
7252		}
7253	}
7254	if err != nil {
7255		return nil, err
7256	}
7257	defer googleapi.CloseBody(res)
7258	if err := googleapi.CheckResponse(res); err != nil {
7259		return nil, err
7260	}
7261	ret := &Notifications{
7262		ServerResponse: googleapi.ServerResponse{
7263			Header:         res.Header,
7264			HTTPStatusCode: res.StatusCode,
7265		},
7266	}
7267	target := &ret
7268	if err := gensupport.DecodeResponse(target, res); err != nil {
7269		return nil, err
7270	}
7271	return ret, nil
7272	// {
7273	//   "description": "Retrieves a list of notification subscriptions for a given bucket.",
7274	//   "httpMethod": "GET",
7275	//   "id": "storage.notifications.list",
7276	//   "parameterOrder": [
7277	//     "bucket"
7278	//   ],
7279	//   "parameters": {
7280	//     "bucket": {
7281	//       "description": "Name of a Google Cloud Storage bucket.",
7282	//       "location": "path",
7283	//       "required": true,
7284	//       "type": "string"
7285	//     },
7286	//     "provisionalUserProject": {
7287	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7288	//       "location": "query",
7289	//       "type": "string"
7290	//     },
7291	//     "userProject": {
7292	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7293	//       "location": "query",
7294	//       "type": "string"
7295	//     }
7296	//   },
7297	//   "path": "b/{bucket}/notificationConfigs",
7298	//   "response": {
7299	//     "$ref": "Notifications"
7300	//   },
7301	//   "scopes": [
7302	//     "https://www.googleapis.com/auth/cloud-platform",
7303	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7304	//     "https://www.googleapis.com/auth/devstorage.full_control",
7305	//     "https://www.googleapis.com/auth/devstorage.read_only",
7306	//     "https://www.googleapis.com/auth/devstorage.read_write"
7307	//   ]
7308	// }
7309
7310}
7311
7312// method id "storage.objectAccessControls.delete":
7313
7314type ObjectAccessControlsDeleteCall struct {
7315	s          *Service
7316	bucket     string
7317	object     string
7318	entity     string
7319	urlParams_ gensupport.URLParams
7320	ctx_       context.Context
7321	header_    http.Header
7322}
7323
7324// Delete: Permanently deletes the ACL entry for the specified entity on
7325// the specified object.
7326func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
7327	c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7328	c.bucket = bucket
7329	c.object = object
7330	c.entity = entity
7331	return c
7332}
7333
7334// Generation sets the optional parameter "generation": If present,
7335// selects a specific revision of this object (as opposed to the latest
7336// version, the default).
7337func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall {
7338	c.urlParams_.Set("generation", fmt.Sprint(generation))
7339	return c
7340}
7341
7342// ProvisionalUserProject sets the optional parameter
7343// "provisionalUserProject": The project to be billed for this request
7344// if the target bucket is requester-pays bucket.
7345func (c *ObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsDeleteCall {
7346	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7347	return c
7348}
7349
7350// UserProject sets the optional parameter "userProject": The project to
7351// be billed for this request. Required for Requester Pays buckets.
7352func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
7353	c.urlParams_.Set("userProject", userProject)
7354	return c
7355}
7356
7357// Fields allows partial responses to be retrieved. See
7358// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7359// for more information.
7360func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
7361	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7362	return c
7363}
7364
7365// Context sets the context to be used in this call's Do method. Any
7366// pending HTTP request will be aborted if the provided context is
7367// canceled.
7368func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
7369	c.ctx_ = ctx
7370	return c
7371}
7372
7373// Header returns an http.Header that can be modified by the caller to
7374// add HTTP headers to the request.
7375func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
7376	if c.header_ == nil {
7377		c.header_ = make(http.Header)
7378	}
7379	return c.header_
7380}
7381
7382func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
7383	reqHeaders := make(http.Header)
7384	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
7385	for k, v := range c.header_ {
7386		reqHeaders[k] = v
7387	}
7388	reqHeaders.Set("User-Agent", c.s.userAgent())
7389	var body io.Reader = nil
7390	c.urlParams_.Set("alt", alt)
7391	c.urlParams_.Set("prettyPrint", "false")
7392	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7393	urls += "?" + c.urlParams_.Encode()
7394	req, err := http.NewRequest("DELETE", urls, body)
7395	if err != nil {
7396		return nil, err
7397	}
7398	req.Header = reqHeaders
7399	googleapi.Expand(req.URL, map[string]string{
7400		"bucket": c.bucket,
7401		"object": c.object,
7402		"entity": c.entity,
7403	})
7404	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7405}
7406
7407// Do executes the "storage.objectAccessControls.delete" call.
7408func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
7409	gensupport.SetOptions(c.urlParams_, opts...)
7410	res, err := c.doRequest("json")
7411	if err != nil {
7412		return err
7413	}
7414	defer googleapi.CloseBody(res)
7415	if err := googleapi.CheckResponse(res); err != nil {
7416		return err
7417	}
7418	return nil
7419	// {
7420	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
7421	//   "httpMethod": "DELETE",
7422	//   "id": "storage.objectAccessControls.delete",
7423	//   "parameterOrder": [
7424	//     "bucket",
7425	//     "object",
7426	//     "entity"
7427	//   ],
7428	//   "parameters": {
7429	//     "bucket": {
7430	//       "description": "Name of a bucket.",
7431	//       "location": "path",
7432	//       "required": true,
7433	//       "type": "string"
7434	//     },
7435	//     "entity": {
7436	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7437	//       "location": "path",
7438	//       "required": true,
7439	//       "type": "string"
7440	//     },
7441	//     "generation": {
7442	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7443	//       "format": "int64",
7444	//       "location": "query",
7445	//       "type": "string"
7446	//     },
7447	//     "object": {
7448	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7449	//       "location": "path",
7450	//       "required": true,
7451	//       "type": "string"
7452	//     },
7453	//     "provisionalUserProject": {
7454	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7455	//       "location": "query",
7456	//       "type": "string"
7457	//     },
7458	//     "userProject": {
7459	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7460	//       "location": "query",
7461	//       "type": "string"
7462	//     }
7463	//   },
7464	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
7465	//   "scopes": [
7466	//     "https://www.googleapis.com/auth/cloud-platform",
7467	//     "https://www.googleapis.com/auth/devstorage.full_control"
7468	//   ]
7469	// }
7470
7471}
7472
7473// method id "storage.objectAccessControls.get":
7474
7475type ObjectAccessControlsGetCall struct {
7476	s            *Service
7477	bucket       string
7478	object       string
7479	entity       string
7480	urlParams_   gensupport.URLParams
7481	ifNoneMatch_ string
7482	ctx_         context.Context
7483	header_      http.Header
7484}
7485
7486// Get: Returns the ACL entry for the specified entity on the specified
7487// object.
7488func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
7489	c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7490	c.bucket = bucket
7491	c.object = object
7492	c.entity = entity
7493	return c
7494}
7495
7496// Generation sets the optional parameter "generation": If present,
7497// selects a specific revision of this object (as opposed to the latest
7498// version, the default).
7499func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall {
7500	c.urlParams_.Set("generation", fmt.Sprint(generation))
7501	return c
7502}
7503
7504// ProvisionalUserProject sets the optional parameter
7505// "provisionalUserProject": The project to be billed for this request
7506// if the target bucket is requester-pays bucket.
7507func (c *ObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsGetCall {
7508	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7509	return c
7510}
7511
7512// UserProject sets the optional parameter "userProject": The project to
7513// be billed for this request. Required for Requester Pays buckets.
7514func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
7515	c.urlParams_.Set("userProject", userProject)
7516	return c
7517}
7518
7519// Fields allows partial responses to be retrieved. See
7520// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7521// for more information.
7522func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
7523	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7524	return c
7525}
7526
7527// IfNoneMatch sets the optional parameter which makes the operation
7528// fail if the object's ETag matches the given value. This is useful for
7529// getting updates only after the object has changed since the last
7530// request. Use googleapi.IsNotModified to check whether the response
7531// error from Do is the result of In-None-Match.
7532func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
7533	c.ifNoneMatch_ = entityTag
7534	return c
7535}
7536
7537// Context sets the context to be used in this call's Do method. Any
7538// pending HTTP request will be aborted if the provided context is
7539// canceled.
7540func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
7541	c.ctx_ = ctx
7542	return c
7543}
7544
7545// Header returns an http.Header that can be modified by the caller to
7546// add HTTP headers to the request.
7547func (c *ObjectAccessControlsGetCall) Header() http.Header {
7548	if c.header_ == nil {
7549		c.header_ = make(http.Header)
7550	}
7551	return c.header_
7552}
7553
7554func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
7555	reqHeaders := make(http.Header)
7556	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
7557	for k, v := range c.header_ {
7558		reqHeaders[k] = v
7559	}
7560	reqHeaders.Set("User-Agent", c.s.userAgent())
7561	if c.ifNoneMatch_ != "" {
7562		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7563	}
7564	var body io.Reader = nil
7565	c.urlParams_.Set("alt", alt)
7566	c.urlParams_.Set("prettyPrint", "false")
7567	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7568	urls += "?" + c.urlParams_.Encode()
7569	req, err := http.NewRequest("GET", urls, body)
7570	if err != nil {
7571		return nil, err
7572	}
7573	req.Header = reqHeaders
7574	googleapi.Expand(req.URL, map[string]string{
7575		"bucket": c.bucket,
7576		"object": c.object,
7577		"entity": c.entity,
7578	})
7579	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7580}
7581
7582// Do executes the "storage.objectAccessControls.get" call.
7583// Exactly one of *ObjectAccessControl or error will be non-nil. Any
7584// non-2xx status code is an error. Response headers are in either
7585// *ObjectAccessControl.ServerResponse.Header or (if a response was
7586// returned at all) in error.(*googleapi.Error).Header. Use
7587// googleapi.IsNotModified to check whether the returned error was
7588// because http.StatusNotModified was returned.
7589func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7590	gensupport.SetOptions(c.urlParams_, opts...)
7591	res, err := c.doRequest("json")
7592	if res != nil && res.StatusCode == http.StatusNotModified {
7593		if res.Body != nil {
7594			res.Body.Close()
7595		}
7596		return nil, &googleapi.Error{
7597			Code:   res.StatusCode,
7598			Header: res.Header,
7599		}
7600	}
7601	if err != nil {
7602		return nil, err
7603	}
7604	defer googleapi.CloseBody(res)
7605	if err := googleapi.CheckResponse(res); err != nil {
7606		return nil, err
7607	}
7608	ret := &ObjectAccessControl{
7609		ServerResponse: googleapi.ServerResponse{
7610			Header:         res.Header,
7611			HTTPStatusCode: res.StatusCode,
7612		},
7613	}
7614	target := &ret
7615	if err := gensupport.DecodeResponse(target, res); err != nil {
7616		return nil, err
7617	}
7618	return ret, nil
7619	// {
7620	//   "description": "Returns the ACL entry for the specified entity on the specified object.",
7621	//   "httpMethod": "GET",
7622	//   "id": "storage.objectAccessControls.get",
7623	//   "parameterOrder": [
7624	//     "bucket",
7625	//     "object",
7626	//     "entity"
7627	//   ],
7628	//   "parameters": {
7629	//     "bucket": {
7630	//       "description": "Name of a bucket.",
7631	//       "location": "path",
7632	//       "required": true,
7633	//       "type": "string"
7634	//     },
7635	//     "entity": {
7636	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7637	//       "location": "path",
7638	//       "required": true,
7639	//       "type": "string"
7640	//     },
7641	//     "generation": {
7642	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7643	//       "format": "int64",
7644	//       "location": "query",
7645	//       "type": "string"
7646	//     },
7647	//     "object": {
7648	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7649	//       "location": "path",
7650	//       "required": true,
7651	//       "type": "string"
7652	//     },
7653	//     "provisionalUserProject": {
7654	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7655	//       "location": "query",
7656	//       "type": "string"
7657	//     },
7658	//     "userProject": {
7659	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7660	//       "location": "query",
7661	//       "type": "string"
7662	//     }
7663	//   },
7664	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
7665	//   "response": {
7666	//     "$ref": "ObjectAccessControl"
7667	//   },
7668	//   "scopes": [
7669	//     "https://www.googleapis.com/auth/cloud-platform",
7670	//     "https://www.googleapis.com/auth/devstorage.full_control"
7671	//   ]
7672	// }
7673
7674}
7675
7676// method id "storage.objectAccessControls.insert":
7677
7678type ObjectAccessControlsInsertCall struct {
7679	s                   *Service
7680	bucket              string
7681	object              string
7682	objectaccesscontrol *ObjectAccessControl
7683	urlParams_          gensupport.URLParams
7684	ctx_                context.Context
7685	header_             http.Header
7686}
7687
7688// Insert: Creates a new ACL entry on the specified object.
7689func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
7690	c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7691	c.bucket = bucket
7692	c.object = object
7693	c.objectaccesscontrol = objectaccesscontrol
7694	return c
7695}
7696
7697// Generation sets the optional parameter "generation": If present,
7698// selects a specific revision of this object (as opposed to the latest
7699// version, the default).
7700func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall {
7701	c.urlParams_.Set("generation", fmt.Sprint(generation))
7702	return c
7703}
7704
7705// ProvisionalUserProject sets the optional parameter
7706// "provisionalUserProject": The project to be billed for this request
7707// if the target bucket is requester-pays bucket.
7708func (c *ObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsInsertCall {
7709	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7710	return c
7711}
7712
7713// UserProject sets the optional parameter "userProject": The project to
7714// be billed for this request. Required for Requester Pays buckets.
7715func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
7716	c.urlParams_.Set("userProject", userProject)
7717	return c
7718}
7719
7720// Fields allows partial responses to be retrieved. See
7721// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7722// for more information.
7723func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
7724	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7725	return c
7726}
7727
7728// Context sets the context to be used in this call's Do method. Any
7729// pending HTTP request will be aborted if the provided context is
7730// canceled.
7731func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
7732	c.ctx_ = ctx
7733	return c
7734}
7735
7736// Header returns an http.Header that can be modified by the caller to
7737// add HTTP headers to the request.
7738func (c *ObjectAccessControlsInsertCall) Header() http.Header {
7739	if c.header_ == nil {
7740		c.header_ = make(http.Header)
7741	}
7742	return c.header_
7743}
7744
7745func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
7746	reqHeaders := make(http.Header)
7747	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
7748	for k, v := range c.header_ {
7749		reqHeaders[k] = v
7750	}
7751	reqHeaders.Set("User-Agent", c.s.userAgent())
7752	var body io.Reader = nil
7753	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
7754	if err != nil {
7755		return nil, err
7756	}
7757	reqHeaders.Set("Content-Type", "application/json")
7758	c.urlParams_.Set("alt", alt)
7759	c.urlParams_.Set("prettyPrint", "false")
7760	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7761	urls += "?" + c.urlParams_.Encode()
7762	req, err := http.NewRequest("POST", urls, body)
7763	if err != nil {
7764		return nil, err
7765	}
7766	req.Header = reqHeaders
7767	googleapi.Expand(req.URL, map[string]string{
7768		"bucket": c.bucket,
7769		"object": c.object,
7770	})
7771	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7772}
7773
7774// Do executes the "storage.objectAccessControls.insert" call.
7775// Exactly one of *ObjectAccessControl or error will be non-nil. Any
7776// non-2xx status code is an error. Response headers are in either
7777// *ObjectAccessControl.ServerResponse.Header or (if a response was
7778// returned at all) in error.(*googleapi.Error).Header. Use
7779// googleapi.IsNotModified to check whether the returned error was
7780// because http.StatusNotModified was returned.
7781func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7782	gensupport.SetOptions(c.urlParams_, opts...)
7783	res, err := c.doRequest("json")
7784	if res != nil && res.StatusCode == http.StatusNotModified {
7785		if res.Body != nil {
7786			res.Body.Close()
7787		}
7788		return nil, &googleapi.Error{
7789			Code:   res.StatusCode,
7790			Header: res.Header,
7791		}
7792	}
7793	if err != nil {
7794		return nil, err
7795	}
7796	defer googleapi.CloseBody(res)
7797	if err := googleapi.CheckResponse(res); err != nil {
7798		return nil, err
7799	}
7800	ret := &ObjectAccessControl{
7801		ServerResponse: googleapi.ServerResponse{
7802			Header:         res.Header,
7803			HTTPStatusCode: res.StatusCode,
7804		},
7805	}
7806	target := &ret
7807	if err := gensupport.DecodeResponse(target, res); err != nil {
7808		return nil, err
7809	}
7810	return ret, nil
7811	// {
7812	//   "description": "Creates a new ACL entry on the specified object.",
7813	//   "httpMethod": "POST",
7814	//   "id": "storage.objectAccessControls.insert",
7815	//   "parameterOrder": [
7816	//     "bucket",
7817	//     "object"
7818	//   ],
7819	//   "parameters": {
7820	//     "bucket": {
7821	//       "description": "Name of a bucket.",
7822	//       "location": "path",
7823	//       "required": true,
7824	//       "type": "string"
7825	//     },
7826	//     "generation": {
7827	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7828	//       "format": "int64",
7829	//       "location": "query",
7830	//       "type": "string"
7831	//     },
7832	//     "object": {
7833	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7834	//       "location": "path",
7835	//       "required": true,
7836	//       "type": "string"
7837	//     },
7838	//     "provisionalUserProject": {
7839	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7840	//       "location": "query",
7841	//       "type": "string"
7842	//     },
7843	//     "userProject": {
7844	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7845	//       "location": "query",
7846	//       "type": "string"
7847	//     }
7848	//   },
7849	//   "path": "b/{bucket}/o/{object}/acl",
7850	//   "request": {
7851	//     "$ref": "ObjectAccessControl"
7852	//   },
7853	//   "response": {
7854	//     "$ref": "ObjectAccessControl"
7855	//   },
7856	//   "scopes": [
7857	//     "https://www.googleapis.com/auth/cloud-platform",
7858	//     "https://www.googleapis.com/auth/devstorage.full_control"
7859	//   ]
7860	// }
7861
7862}
7863
7864// method id "storage.objectAccessControls.list":
7865
7866type ObjectAccessControlsListCall struct {
7867	s            *Service
7868	bucket       string
7869	object       string
7870	urlParams_   gensupport.URLParams
7871	ifNoneMatch_ string
7872	ctx_         context.Context
7873	header_      http.Header
7874}
7875
7876// List: Retrieves ACL entries on the specified object.
7877func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
7878	c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7879	c.bucket = bucket
7880	c.object = object
7881	return c
7882}
7883
7884// Generation sets the optional parameter "generation": If present,
7885// selects a specific revision of this object (as opposed to the latest
7886// version, the default).
7887func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall {
7888	c.urlParams_.Set("generation", fmt.Sprint(generation))
7889	return c
7890}
7891
7892// ProvisionalUserProject sets the optional parameter
7893// "provisionalUserProject": The project to be billed for this request
7894// if the target bucket is requester-pays bucket.
7895func (c *ObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsListCall {
7896	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7897	return c
7898}
7899
7900// UserProject sets the optional parameter "userProject": The project to
7901// be billed for this request. Required for Requester Pays buckets.
7902func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
7903	c.urlParams_.Set("userProject", userProject)
7904	return c
7905}
7906
7907// Fields allows partial responses to be retrieved. See
7908// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7909// for more information.
7910func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
7911	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7912	return c
7913}
7914
7915// IfNoneMatch sets the optional parameter which makes the operation
7916// fail if the object's ETag matches the given value. This is useful for
7917// getting updates only after the object has changed since the last
7918// request. Use googleapi.IsNotModified to check whether the response
7919// error from Do is the result of In-None-Match.
7920func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
7921	c.ifNoneMatch_ = entityTag
7922	return c
7923}
7924
7925// Context sets the context to be used in this call's Do method. Any
7926// pending HTTP request will be aborted if the provided context is
7927// canceled.
7928func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
7929	c.ctx_ = ctx
7930	return c
7931}
7932
7933// Header returns an http.Header that can be modified by the caller to
7934// add HTTP headers to the request.
7935func (c *ObjectAccessControlsListCall) Header() http.Header {
7936	if c.header_ == nil {
7937		c.header_ = make(http.Header)
7938	}
7939	return c.header_
7940}
7941
7942func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
7943	reqHeaders := make(http.Header)
7944	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
7945	for k, v := range c.header_ {
7946		reqHeaders[k] = v
7947	}
7948	reqHeaders.Set("User-Agent", c.s.userAgent())
7949	if c.ifNoneMatch_ != "" {
7950		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7951	}
7952	var body io.Reader = nil
7953	c.urlParams_.Set("alt", alt)
7954	c.urlParams_.Set("prettyPrint", "false")
7955	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7956	urls += "?" + c.urlParams_.Encode()
7957	req, err := http.NewRequest("GET", urls, body)
7958	if err != nil {
7959		return nil, err
7960	}
7961	req.Header = reqHeaders
7962	googleapi.Expand(req.URL, map[string]string{
7963		"bucket": c.bucket,
7964		"object": c.object,
7965	})
7966	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7967}
7968
7969// Do executes the "storage.objectAccessControls.list" call.
7970// Exactly one of *ObjectAccessControls or error will be non-nil. Any
7971// non-2xx status code is an error. Response headers are in either
7972// *ObjectAccessControls.ServerResponse.Header or (if a response was
7973// returned at all) in error.(*googleapi.Error).Header. Use
7974// googleapi.IsNotModified to check whether the returned error was
7975// because http.StatusNotModified was returned.
7976func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
7977	gensupport.SetOptions(c.urlParams_, opts...)
7978	res, err := c.doRequest("json")
7979	if res != nil && res.StatusCode == http.StatusNotModified {
7980		if res.Body != nil {
7981			res.Body.Close()
7982		}
7983		return nil, &googleapi.Error{
7984			Code:   res.StatusCode,
7985			Header: res.Header,
7986		}
7987	}
7988	if err != nil {
7989		return nil, err
7990	}
7991	defer googleapi.CloseBody(res)
7992	if err := googleapi.CheckResponse(res); err != nil {
7993		return nil, err
7994	}
7995	ret := &ObjectAccessControls{
7996		ServerResponse: googleapi.ServerResponse{
7997			Header:         res.Header,
7998			HTTPStatusCode: res.StatusCode,
7999		},
8000	}
8001	target := &ret
8002	if err := gensupport.DecodeResponse(target, res); err != nil {
8003		return nil, err
8004	}
8005	return ret, nil
8006	// {
8007	//   "description": "Retrieves ACL entries on the specified object.",
8008	//   "httpMethod": "GET",
8009	//   "id": "storage.objectAccessControls.list",
8010	//   "parameterOrder": [
8011	//     "bucket",
8012	//     "object"
8013	//   ],
8014	//   "parameters": {
8015	//     "bucket": {
8016	//       "description": "Name of a bucket.",
8017	//       "location": "path",
8018	//       "required": true,
8019	//       "type": "string"
8020	//     },
8021	//     "generation": {
8022	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8023	//       "format": "int64",
8024	//       "location": "query",
8025	//       "type": "string"
8026	//     },
8027	//     "object": {
8028	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8029	//       "location": "path",
8030	//       "required": true,
8031	//       "type": "string"
8032	//     },
8033	//     "provisionalUserProject": {
8034	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8035	//       "location": "query",
8036	//       "type": "string"
8037	//     },
8038	//     "userProject": {
8039	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8040	//       "location": "query",
8041	//       "type": "string"
8042	//     }
8043	//   },
8044	//   "path": "b/{bucket}/o/{object}/acl",
8045	//   "response": {
8046	//     "$ref": "ObjectAccessControls"
8047	//   },
8048	//   "scopes": [
8049	//     "https://www.googleapis.com/auth/cloud-platform",
8050	//     "https://www.googleapis.com/auth/devstorage.full_control"
8051	//   ]
8052	// }
8053
8054}
8055
8056// method id "storage.objectAccessControls.patch":
8057
8058type ObjectAccessControlsPatchCall struct {
8059	s                   *Service
8060	bucket              string
8061	object              string
8062	entity              string
8063	objectaccesscontrol *ObjectAccessControl
8064	urlParams_          gensupport.URLParams
8065	ctx_                context.Context
8066	header_             http.Header
8067}
8068
8069// Patch: Patches an ACL entry on the specified object.
8070func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
8071	c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8072	c.bucket = bucket
8073	c.object = object
8074	c.entity = entity
8075	c.objectaccesscontrol = objectaccesscontrol
8076	return c
8077}
8078
8079// Generation sets the optional parameter "generation": If present,
8080// selects a specific revision of this object (as opposed to the latest
8081// version, the default).
8082func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall {
8083	c.urlParams_.Set("generation", fmt.Sprint(generation))
8084	return c
8085}
8086
8087// ProvisionalUserProject sets the optional parameter
8088// "provisionalUserProject": The project to be billed for this request
8089// if the target bucket is requester-pays bucket.
8090func (c *ObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsPatchCall {
8091	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8092	return c
8093}
8094
8095// UserProject sets the optional parameter "userProject": The project to
8096// be billed for this request. Required for Requester Pays buckets.
8097func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
8098	c.urlParams_.Set("userProject", userProject)
8099	return c
8100}
8101
8102// Fields allows partial responses to be retrieved. See
8103// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8104// for more information.
8105func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
8106	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8107	return c
8108}
8109
8110// Context sets the context to be used in this call's Do method. Any
8111// pending HTTP request will be aborted if the provided context is
8112// canceled.
8113func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
8114	c.ctx_ = ctx
8115	return c
8116}
8117
8118// Header returns an http.Header that can be modified by the caller to
8119// add HTTP headers to the request.
8120func (c *ObjectAccessControlsPatchCall) Header() http.Header {
8121	if c.header_ == nil {
8122		c.header_ = make(http.Header)
8123	}
8124	return c.header_
8125}
8126
8127func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
8128	reqHeaders := make(http.Header)
8129	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
8130	for k, v := range c.header_ {
8131		reqHeaders[k] = v
8132	}
8133	reqHeaders.Set("User-Agent", c.s.userAgent())
8134	var body io.Reader = nil
8135	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
8136	if err != nil {
8137		return nil, err
8138	}
8139	reqHeaders.Set("Content-Type", "application/json")
8140	c.urlParams_.Set("alt", alt)
8141	c.urlParams_.Set("prettyPrint", "false")
8142	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
8143	urls += "?" + c.urlParams_.Encode()
8144	req, err := http.NewRequest("PATCH", urls, body)
8145	if err != nil {
8146		return nil, err
8147	}
8148	req.Header = reqHeaders
8149	googleapi.Expand(req.URL, map[string]string{
8150		"bucket": c.bucket,
8151		"object": c.object,
8152		"entity": c.entity,
8153	})
8154	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8155}
8156
8157// Do executes the "storage.objectAccessControls.patch" call.
8158// Exactly one of *ObjectAccessControl or error will be non-nil. Any
8159// non-2xx status code is an error. Response headers are in either
8160// *ObjectAccessControl.ServerResponse.Header or (if a response was
8161// returned at all) in error.(*googleapi.Error).Header. Use
8162// googleapi.IsNotModified to check whether the returned error was
8163// because http.StatusNotModified was returned.
8164func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
8165	gensupport.SetOptions(c.urlParams_, opts...)
8166	res, err := c.doRequest("json")
8167	if res != nil && res.StatusCode == http.StatusNotModified {
8168		if res.Body != nil {
8169			res.Body.Close()
8170		}
8171		return nil, &googleapi.Error{
8172			Code:   res.StatusCode,
8173			Header: res.Header,
8174		}
8175	}
8176	if err != nil {
8177		return nil, err
8178	}
8179	defer googleapi.CloseBody(res)
8180	if err := googleapi.CheckResponse(res); err != nil {
8181		return nil, err
8182	}
8183	ret := &ObjectAccessControl{
8184		ServerResponse: googleapi.ServerResponse{
8185			Header:         res.Header,
8186			HTTPStatusCode: res.StatusCode,
8187		},
8188	}
8189	target := &ret
8190	if err := gensupport.DecodeResponse(target, res); err != nil {
8191		return nil, err
8192	}
8193	return ret, nil
8194	// {
8195	//   "description": "Patches an ACL entry on the specified object.",
8196	//   "httpMethod": "PATCH",
8197	//   "id": "storage.objectAccessControls.patch",
8198	//   "parameterOrder": [
8199	//     "bucket",
8200	//     "object",
8201	//     "entity"
8202	//   ],
8203	//   "parameters": {
8204	//     "bucket": {
8205	//       "description": "Name of a bucket.",
8206	//       "location": "path",
8207	//       "required": true,
8208	//       "type": "string"
8209	//     },
8210	//     "entity": {
8211	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
8212	//       "location": "path",
8213	//       "required": true,
8214	//       "type": "string"
8215	//     },
8216	//     "generation": {
8217	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8218	//       "format": "int64",
8219	//       "location": "query",
8220	//       "type": "string"
8221	//     },
8222	//     "object": {
8223	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8224	//       "location": "path",
8225	//       "required": true,
8226	//       "type": "string"
8227	//     },
8228	//     "provisionalUserProject": {
8229	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8230	//       "location": "query",
8231	//       "type": "string"
8232	//     },
8233	//     "userProject": {
8234	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8235	//       "location": "query",
8236	//       "type": "string"
8237	//     }
8238	//   },
8239	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
8240	//   "request": {
8241	//     "$ref": "ObjectAccessControl"
8242	//   },
8243	//   "response": {
8244	//     "$ref": "ObjectAccessControl"
8245	//   },
8246	//   "scopes": [
8247	//     "https://www.googleapis.com/auth/cloud-platform",
8248	//     "https://www.googleapis.com/auth/devstorage.full_control"
8249	//   ]
8250	// }
8251
8252}
8253
8254// method id "storage.objectAccessControls.update":
8255
8256type ObjectAccessControlsUpdateCall struct {
8257	s                   *Service
8258	bucket              string
8259	object              string
8260	entity              string
8261	objectaccesscontrol *ObjectAccessControl
8262	urlParams_          gensupport.URLParams
8263	ctx_                context.Context
8264	header_             http.Header
8265}
8266
8267// Update: Updates an ACL entry on the specified object.
8268func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
8269	c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8270	c.bucket = bucket
8271	c.object = object
8272	c.entity = entity
8273	c.objectaccesscontrol = objectaccesscontrol
8274	return c
8275}
8276
8277// Generation sets the optional parameter "generation": If present,
8278// selects a specific revision of this object (as opposed to the latest
8279// version, the default).
8280func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall {
8281	c.urlParams_.Set("generation", fmt.Sprint(generation))
8282	return c
8283}
8284
8285// ProvisionalUserProject sets the optional parameter
8286// "provisionalUserProject": The project to be billed for this request
8287// if the target bucket is requester-pays bucket.
8288func (c *ObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsUpdateCall {
8289	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8290	return c
8291}
8292
8293// UserProject sets the optional parameter "userProject": The project to
8294// be billed for this request. Required for Requester Pays buckets.
8295func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
8296	c.urlParams_.Set("userProject", userProject)
8297	return c
8298}
8299
8300// Fields allows partial responses to be retrieved. See
8301// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8302// for more information.
8303func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
8304	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8305	return c
8306}
8307
8308// Context sets the context to be used in this call's Do method. Any
8309// pending HTTP request will be aborted if the provided context is
8310// canceled.
8311func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
8312	c.ctx_ = ctx
8313	return c
8314}
8315
8316// Header returns an http.Header that can be modified by the caller to
8317// add HTTP headers to the request.
8318func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
8319	if c.header_ == nil {
8320		c.header_ = make(http.Header)
8321	}
8322	return c.header_
8323}
8324
8325func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
8326	reqHeaders := make(http.Header)
8327	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
8328	for k, v := range c.header_ {
8329		reqHeaders[k] = v
8330	}
8331	reqHeaders.Set("User-Agent", c.s.userAgent())
8332	var body io.Reader = nil
8333	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
8334	if err != nil {
8335		return nil, err
8336	}
8337	reqHeaders.Set("Content-Type", "application/json")
8338	c.urlParams_.Set("alt", alt)
8339	c.urlParams_.Set("prettyPrint", "false")
8340	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
8341	urls += "?" + c.urlParams_.Encode()
8342	req, err := http.NewRequest("PUT", urls, body)
8343	if err != nil {
8344		return nil, err
8345	}
8346	req.Header = reqHeaders
8347	googleapi.Expand(req.URL, map[string]string{
8348		"bucket": c.bucket,
8349		"object": c.object,
8350		"entity": c.entity,
8351	})
8352	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8353}
8354
8355// Do executes the "storage.objectAccessControls.update" call.
8356// Exactly one of *ObjectAccessControl or error will be non-nil. Any
8357// non-2xx status code is an error. Response headers are in either
8358// *ObjectAccessControl.ServerResponse.Header or (if a response was
8359// returned at all) in error.(*googleapi.Error).Header. Use
8360// googleapi.IsNotModified to check whether the returned error was
8361// because http.StatusNotModified was returned.
8362func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
8363	gensupport.SetOptions(c.urlParams_, opts...)
8364	res, err := c.doRequest("json")
8365	if res != nil && res.StatusCode == http.StatusNotModified {
8366		if res.Body != nil {
8367			res.Body.Close()
8368		}
8369		return nil, &googleapi.Error{
8370			Code:   res.StatusCode,
8371			Header: res.Header,
8372		}
8373	}
8374	if err != nil {
8375		return nil, err
8376	}
8377	defer googleapi.CloseBody(res)
8378	if err := googleapi.CheckResponse(res); err != nil {
8379		return nil, err
8380	}
8381	ret := &ObjectAccessControl{
8382		ServerResponse: googleapi.ServerResponse{
8383			Header:         res.Header,
8384			HTTPStatusCode: res.StatusCode,
8385		},
8386	}
8387	target := &ret
8388	if err := gensupport.DecodeResponse(target, res); err != nil {
8389		return nil, err
8390	}
8391	return ret, nil
8392	// {
8393	//   "description": "Updates an ACL entry on the specified object.",
8394	//   "httpMethod": "PUT",
8395	//   "id": "storage.objectAccessControls.update",
8396	//   "parameterOrder": [
8397	//     "bucket",
8398	//     "object",
8399	//     "entity"
8400	//   ],
8401	//   "parameters": {
8402	//     "bucket": {
8403	//       "description": "Name of a bucket.",
8404	//       "location": "path",
8405	//       "required": true,
8406	//       "type": "string"
8407	//     },
8408	//     "entity": {
8409	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
8410	//       "location": "path",
8411	//       "required": true,
8412	//       "type": "string"
8413	//     },
8414	//     "generation": {
8415	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8416	//       "format": "int64",
8417	//       "location": "query",
8418	//       "type": "string"
8419	//     },
8420	//     "object": {
8421	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8422	//       "location": "path",
8423	//       "required": true,
8424	//       "type": "string"
8425	//     },
8426	//     "provisionalUserProject": {
8427	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8428	//       "location": "query",
8429	//       "type": "string"
8430	//     },
8431	//     "userProject": {
8432	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8433	//       "location": "query",
8434	//       "type": "string"
8435	//     }
8436	//   },
8437	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
8438	//   "request": {
8439	//     "$ref": "ObjectAccessControl"
8440	//   },
8441	//   "response": {
8442	//     "$ref": "ObjectAccessControl"
8443	//   },
8444	//   "scopes": [
8445	//     "https://www.googleapis.com/auth/cloud-platform",
8446	//     "https://www.googleapis.com/auth/devstorage.full_control"
8447	//   ]
8448	// }
8449
8450}
8451
8452// method id "storage.objects.compose":
8453
8454type ObjectsComposeCall struct {
8455	s                 *Service
8456	destinationBucket string
8457	destinationObject string
8458	composerequest    *ComposeRequest
8459	urlParams_        gensupport.URLParams
8460	ctx_              context.Context
8461	header_           http.Header
8462}
8463
8464// Compose: Concatenates a list of existing objects into a new object in
8465// the same bucket.
8466func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
8467	c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8468	c.destinationBucket = destinationBucket
8469	c.destinationObject = destinationObject
8470	c.composerequest = composerequest
8471	return c
8472}
8473
8474// DestinationPredefinedAcl sets the optional parameter
8475// "destinationPredefinedAcl": Apply a predefined set of access controls
8476// to the destination object.
8477//
8478// Possible values:
8479//   "authenticatedRead" - Object owner gets OWNER access, and
8480// allAuthenticatedUsers get READER access.
8481//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
8482// project team owners get OWNER access.
8483//   "bucketOwnerRead" - Object owner gets OWNER access, and project
8484// team owners get READER access.
8485//   "private" - Object owner gets OWNER access.
8486//   "projectPrivate" - Object owner gets OWNER access, and project team
8487// members get access according to their roles.
8488//   "publicRead" - Object owner gets OWNER access, and allUsers get
8489// READER access.
8490func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
8491	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
8492	return c
8493}
8494
8495// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8496// Makes the operation conditional on whether the object's current
8497// generation matches the given value. Setting to 0 makes the operation
8498// succeed only if there are no live versions of the object.
8499func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
8500	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8501	return c
8502}
8503
8504// IfMetagenerationMatch sets the optional parameter
8505// "ifMetagenerationMatch": Makes the operation conditional on whether
8506// the object's current metageneration matches the given value.
8507func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall {
8508	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8509	return c
8510}
8511
8512// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
8513// the Cloud KMS key, of the form
8514// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
8515//  that will be used to encrypt the object. Overrides the object
8516// metadata's kms_key_name value, if any.
8517func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall {
8518	c.urlParams_.Set("kmsKeyName", kmsKeyName)
8519	return c
8520}
8521
8522// ProvisionalUserProject sets the optional parameter
8523// "provisionalUserProject": The project to be billed for this request
8524// if the target bucket is requester-pays bucket.
8525func (c *ObjectsComposeCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsComposeCall {
8526	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8527	return c
8528}
8529
8530// UserProject sets the optional parameter "userProject": The project to
8531// be billed for this request. Required for Requester Pays buckets.
8532func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
8533	c.urlParams_.Set("userProject", userProject)
8534	return c
8535}
8536
8537// Fields allows partial responses to be retrieved. See
8538// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8539// for more information.
8540func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
8541	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8542	return c
8543}
8544
8545// Context sets the context to be used in this call's Do method. Any
8546// pending HTTP request will be aborted if the provided context is
8547// canceled.
8548func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
8549	c.ctx_ = ctx
8550	return c
8551}
8552
8553// Header returns an http.Header that can be modified by the caller to
8554// add HTTP headers to the request.
8555func (c *ObjectsComposeCall) Header() http.Header {
8556	if c.header_ == nil {
8557		c.header_ = make(http.Header)
8558	}
8559	return c.header_
8560}
8561
8562func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
8563	reqHeaders := make(http.Header)
8564	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
8565	for k, v := range c.header_ {
8566		reqHeaders[k] = v
8567	}
8568	reqHeaders.Set("User-Agent", c.s.userAgent())
8569	var body io.Reader = nil
8570	body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
8571	if err != nil {
8572		return nil, err
8573	}
8574	reqHeaders.Set("Content-Type", "application/json")
8575	c.urlParams_.Set("alt", alt)
8576	c.urlParams_.Set("prettyPrint", "false")
8577	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
8578	urls += "?" + c.urlParams_.Encode()
8579	req, err := http.NewRequest("POST", urls, body)
8580	if err != nil {
8581		return nil, err
8582	}
8583	req.Header = reqHeaders
8584	googleapi.Expand(req.URL, map[string]string{
8585		"destinationBucket": c.destinationBucket,
8586		"destinationObject": c.destinationObject,
8587	})
8588	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8589}
8590
8591// Do executes the "storage.objects.compose" call.
8592// Exactly one of *Object or error will be non-nil. Any non-2xx status
8593// code is an error. Response headers are in either
8594// *Object.ServerResponse.Header or (if a response was returned at all)
8595// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8596// check whether the returned error was because http.StatusNotModified
8597// was returned.
8598func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8599	gensupport.SetOptions(c.urlParams_, opts...)
8600	res, err := c.doRequest("json")
8601	if res != nil && res.StatusCode == http.StatusNotModified {
8602		if res.Body != nil {
8603			res.Body.Close()
8604		}
8605		return nil, &googleapi.Error{
8606			Code:   res.StatusCode,
8607			Header: res.Header,
8608		}
8609	}
8610	if err != nil {
8611		return nil, err
8612	}
8613	defer googleapi.CloseBody(res)
8614	if err := googleapi.CheckResponse(res); err != nil {
8615		return nil, err
8616	}
8617	ret := &Object{
8618		ServerResponse: googleapi.ServerResponse{
8619			Header:         res.Header,
8620			HTTPStatusCode: res.StatusCode,
8621		},
8622	}
8623	target := &ret
8624	if err := gensupport.DecodeResponse(target, res); err != nil {
8625		return nil, err
8626	}
8627	return ret, nil
8628	// {
8629	//   "description": "Concatenates a list of existing objects into a new object in the same bucket.",
8630	//   "httpMethod": "POST",
8631	//   "id": "storage.objects.compose",
8632	//   "parameterOrder": [
8633	//     "destinationBucket",
8634	//     "destinationObject"
8635	//   ],
8636	//   "parameters": {
8637	//     "destinationBucket": {
8638	//       "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
8639	//       "location": "path",
8640	//       "required": true,
8641	//       "type": "string"
8642	//     },
8643	//     "destinationObject": {
8644	//       "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8645	//       "location": "path",
8646	//       "required": true,
8647	//       "type": "string"
8648	//     },
8649	//     "destinationPredefinedAcl": {
8650	//       "description": "Apply a predefined set of access controls to the destination object.",
8651	//       "enum": [
8652	//         "authenticatedRead",
8653	//         "bucketOwnerFullControl",
8654	//         "bucketOwnerRead",
8655	//         "private",
8656	//         "projectPrivate",
8657	//         "publicRead"
8658	//       ],
8659	//       "enumDescriptions": [
8660	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8661	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
8662	//         "Object owner gets OWNER access, and project team owners get READER access.",
8663	//         "Object owner gets OWNER access.",
8664	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
8665	//         "Object owner gets OWNER access, and allUsers get READER access."
8666	//       ],
8667	//       "location": "query",
8668	//       "type": "string"
8669	//     },
8670	//     "ifGenerationMatch": {
8671	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
8672	//       "format": "int64",
8673	//       "location": "query",
8674	//       "type": "string"
8675	//     },
8676	//     "ifMetagenerationMatch": {
8677	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
8678	//       "format": "int64",
8679	//       "location": "query",
8680	//       "type": "string"
8681	//     },
8682	//     "kmsKeyName": {
8683	//       "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
8684	//       "location": "query",
8685	//       "type": "string"
8686	//     },
8687	//     "provisionalUserProject": {
8688	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8689	//       "location": "query",
8690	//       "type": "string"
8691	//     },
8692	//     "userProject": {
8693	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8694	//       "location": "query",
8695	//       "type": "string"
8696	//     }
8697	//   },
8698	//   "path": "b/{destinationBucket}/o/{destinationObject}/compose",
8699	//   "request": {
8700	//     "$ref": "ComposeRequest"
8701	//   },
8702	//   "response": {
8703	//     "$ref": "Object"
8704	//   },
8705	//   "scopes": [
8706	//     "https://www.googleapis.com/auth/cloud-platform",
8707	//     "https://www.googleapis.com/auth/devstorage.full_control",
8708	//     "https://www.googleapis.com/auth/devstorage.read_write"
8709	//   ]
8710	// }
8711
8712}
8713
8714// method id "storage.objects.copy":
8715
8716type ObjectsCopyCall struct {
8717	s                 *Service
8718	sourceBucket      string
8719	sourceObject      string
8720	destinationBucket string
8721	destinationObject string
8722	object            *Object
8723	urlParams_        gensupport.URLParams
8724	ctx_              context.Context
8725	header_           http.Header
8726}
8727
8728// Copy: Copies a source object to a destination object. Optionally
8729// overrides metadata.
8730func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
8731	c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8732	c.sourceBucket = sourceBucket
8733	c.sourceObject = sourceObject
8734	c.destinationBucket = destinationBucket
8735	c.destinationObject = destinationObject
8736	c.object = object
8737	return c
8738}
8739
8740// DestinationPredefinedAcl sets the optional parameter
8741// "destinationPredefinedAcl": Apply a predefined set of access controls
8742// to the destination object.
8743//
8744// Possible values:
8745//   "authenticatedRead" - Object owner gets OWNER access, and
8746// allAuthenticatedUsers get READER access.
8747//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
8748// project team owners get OWNER access.
8749//   "bucketOwnerRead" - Object owner gets OWNER access, and project
8750// team owners get READER access.
8751//   "private" - Object owner gets OWNER access.
8752//   "projectPrivate" - Object owner gets OWNER access, and project team
8753// members get access according to their roles.
8754//   "publicRead" - Object owner gets OWNER access, and allUsers get
8755// READER access.
8756func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
8757	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
8758	return c
8759}
8760
8761// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8762// Makes the operation conditional on whether the destination object's
8763// current generation matches the given value. Setting to 0 makes the
8764// operation succeed only if there are no live versions of the object.
8765func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
8766	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8767	return c
8768}
8769
8770// IfGenerationNotMatch sets the optional parameter
8771// "ifGenerationNotMatch": Makes the operation conditional on whether
8772// the destination object's current generation does not match the given
8773// value. If no live object exists, the precondition fails. Setting to 0
8774// makes the operation succeed only if there is a live version of the
8775// object.
8776func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
8777	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
8778	return c
8779}
8780
8781// IfMetagenerationMatch sets the optional parameter
8782// "ifMetagenerationMatch": Makes the operation conditional on whether
8783// the destination object's current metageneration matches the given
8784// value.
8785func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
8786	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8787	return c
8788}
8789
8790// IfMetagenerationNotMatch sets the optional parameter
8791// "ifMetagenerationNotMatch": Makes the operation conditional on
8792// whether the destination object's current metageneration does not
8793// match the given value.
8794func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall {
8795	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8796	return c
8797}
8798
8799// IfSourceGenerationMatch sets the optional parameter
8800// "ifSourceGenerationMatch": Makes the operation conditional on whether
8801// the source object's current generation matches the given value.
8802func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
8803	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
8804	return c
8805}
8806
8807// IfSourceGenerationNotMatch sets the optional parameter
8808// "ifSourceGenerationNotMatch": Makes the operation conditional on
8809// whether the source object's current generation does not match the
8810// given value.
8811func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
8812	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
8813	return c
8814}
8815
8816// IfSourceMetagenerationMatch sets the optional parameter
8817// "ifSourceMetagenerationMatch": Makes the operation conditional on
8818// whether the source object's current metageneration matches the given
8819// value.
8820func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
8821	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
8822	return c
8823}
8824
8825// IfSourceMetagenerationNotMatch sets the optional parameter
8826// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
8827// whether the source object's current metageneration does not match the
8828// given value.
8829func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
8830	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
8831	return c
8832}
8833
8834// Projection sets the optional parameter "projection": Set of
8835// properties to return. Defaults to noAcl, unless the object resource
8836// specifies the acl property, when it defaults to full.
8837//
8838// Possible values:
8839//   "full" - Include all properties.
8840//   "noAcl" - Omit the owner, acl property.
8841func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
8842	c.urlParams_.Set("projection", projection)
8843	return c
8844}
8845
8846// ProvisionalUserProject sets the optional parameter
8847// "provisionalUserProject": The project to be billed for this request
8848// if the target bucket is requester-pays bucket.
8849func (c *ObjectsCopyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsCopyCall {
8850	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8851	return c
8852}
8853
8854// SourceGeneration sets the optional parameter "sourceGeneration": If
8855// present, selects a specific revision of the source object (as opposed
8856// to the latest version, the default).
8857func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall {
8858	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
8859	return c
8860}
8861
8862// UserProject sets the optional parameter "userProject": The project to
8863// be billed for this request. Required for Requester Pays buckets.
8864func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
8865	c.urlParams_.Set("userProject", userProject)
8866	return c
8867}
8868
8869// Fields allows partial responses to be retrieved. See
8870// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8871// for more information.
8872func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
8873	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8874	return c
8875}
8876
8877// Context sets the context to be used in this call's Do method. Any
8878// pending HTTP request will be aborted if the provided context is
8879// canceled.
8880func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
8881	c.ctx_ = ctx
8882	return c
8883}
8884
8885// Header returns an http.Header that can be modified by the caller to
8886// add HTTP headers to the request.
8887func (c *ObjectsCopyCall) Header() http.Header {
8888	if c.header_ == nil {
8889		c.header_ = make(http.Header)
8890	}
8891	return c.header_
8892}
8893
8894func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
8895	reqHeaders := make(http.Header)
8896	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
8897	for k, v := range c.header_ {
8898		reqHeaders[k] = v
8899	}
8900	reqHeaders.Set("User-Agent", c.s.userAgent())
8901	var body io.Reader = nil
8902	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
8903	if err != nil {
8904		return nil, err
8905	}
8906	reqHeaders.Set("Content-Type", "application/json")
8907	c.urlParams_.Set("alt", alt)
8908	c.urlParams_.Set("prettyPrint", "false")
8909	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
8910	urls += "?" + c.urlParams_.Encode()
8911	req, err := http.NewRequest("POST", urls, body)
8912	if err != nil {
8913		return nil, err
8914	}
8915	req.Header = reqHeaders
8916	googleapi.Expand(req.URL, map[string]string{
8917		"sourceBucket":      c.sourceBucket,
8918		"sourceObject":      c.sourceObject,
8919		"destinationBucket": c.destinationBucket,
8920		"destinationObject": c.destinationObject,
8921	})
8922	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8923}
8924
8925// Do executes the "storage.objects.copy" call.
8926// Exactly one of *Object or error will be non-nil. Any non-2xx status
8927// code is an error. Response headers are in either
8928// *Object.ServerResponse.Header or (if a response was returned at all)
8929// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8930// check whether the returned error was because http.StatusNotModified
8931// was returned.
8932func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8933	gensupport.SetOptions(c.urlParams_, opts...)
8934	res, err := c.doRequest("json")
8935	if res != nil && res.StatusCode == http.StatusNotModified {
8936		if res.Body != nil {
8937			res.Body.Close()
8938		}
8939		return nil, &googleapi.Error{
8940			Code:   res.StatusCode,
8941			Header: res.Header,
8942		}
8943	}
8944	if err != nil {
8945		return nil, err
8946	}
8947	defer googleapi.CloseBody(res)
8948	if err := googleapi.CheckResponse(res); err != nil {
8949		return nil, err
8950	}
8951	ret := &Object{
8952		ServerResponse: googleapi.ServerResponse{
8953			Header:         res.Header,
8954			HTTPStatusCode: res.StatusCode,
8955		},
8956	}
8957	target := &ret
8958	if err := gensupport.DecodeResponse(target, res); err != nil {
8959		return nil, err
8960	}
8961	return ret, nil
8962	// {
8963	//   "description": "Copies a source object to a destination object. Optionally overrides metadata.",
8964	//   "httpMethod": "POST",
8965	//   "id": "storage.objects.copy",
8966	//   "parameterOrder": [
8967	//     "sourceBucket",
8968	//     "sourceObject",
8969	//     "destinationBucket",
8970	//     "destinationObject"
8971	//   ],
8972	//   "parameters": {
8973	//     "destinationBucket": {
8974	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8975	//       "location": "path",
8976	//       "required": true,
8977	//       "type": "string"
8978	//     },
8979	//     "destinationObject": {
8980	//       "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
8981	//       "location": "path",
8982	//       "required": true,
8983	//       "type": "string"
8984	//     },
8985	//     "destinationPredefinedAcl": {
8986	//       "description": "Apply a predefined set of access controls to the destination object.",
8987	//       "enum": [
8988	//         "authenticatedRead",
8989	//         "bucketOwnerFullControl",
8990	//         "bucketOwnerRead",
8991	//         "private",
8992	//         "projectPrivate",
8993	//         "publicRead"
8994	//       ],
8995	//       "enumDescriptions": [
8996	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8997	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
8998	//         "Object owner gets OWNER access, and project team owners get READER access.",
8999	//         "Object owner gets OWNER access.",
9000	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
9001	//         "Object owner gets OWNER access, and allUsers get READER access."
9002	//       ],
9003	//       "location": "query",
9004	//       "type": "string"
9005	//     },
9006	//     "ifGenerationMatch": {
9007	//       "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
9008	//       "format": "int64",
9009	//       "location": "query",
9010	//       "type": "string"
9011	//     },
9012	//     "ifGenerationNotMatch": {
9013	//       "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
9014	//       "format": "int64",
9015	//       "location": "query",
9016	//       "type": "string"
9017	//     },
9018	//     "ifMetagenerationMatch": {
9019	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
9020	//       "format": "int64",
9021	//       "location": "query",
9022	//       "type": "string"
9023	//     },
9024	//     "ifMetagenerationNotMatch": {
9025	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
9026	//       "format": "int64",
9027	//       "location": "query",
9028	//       "type": "string"
9029	//     },
9030	//     "ifSourceGenerationMatch": {
9031	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
9032	//       "format": "int64",
9033	//       "location": "query",
9034	//       "type": "string"
9035	//     },
9036	//     "ifSourceGenerationNotMatch": {
9037	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
9038	//       "format": "int64",
9039	//       "location": "query",
9040	//       "type": "string"
9041	//     },
9042	//     "ifSourceMetagenerationMatch": {
9043	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
9044	//       "format": "int64",
9045	//       "location": "query",
9046	//       "type": "string"
9047	//     },
9048	//     "ifSourceMetagenerationNotMatch": {
9049	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
9050	//       "format": "int64",
9051	//       "location": "query",
9052	//       "type": "string"
9053	//     },
9054	//     "projection": {
9055	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
9056	//       "enum": [
9057	//         "full",
9058	//         "noAcl"
9059	//       ],
9060	//       "enumDescriptions": [
9061	//         "Include all properties.",
9062	//         "Omit the owner, acl property."
9063	//       ],
9064	//       "location": "query",
9065	//       "type": "string"
9066	//     },
9067	//     "provisionalUserProject": {
9068	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9069	//       "location": "query",
9070	//       "type": "string"
9071	//     },
9072	//     "sourceBucket": {
9073	//       "description": "Name of the bucket in which to find the source object.",
9074	//       "location": "path",
9075	//       "required": true,
9076	//       "type": "string"
9077	//     },
9078	//     "sourceGeneration": {
9079	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
9080	//       "format": "int64",
9081	//       "location": "query",
9082	//       "type": "string"
9083	//     },
9084	//     "sourceObject": {
9085	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9086	//       "location": "path",
9087	//       "required": true,
9088	//       "type": "string"
9089	//     },
9090	//     "userProject": {
9091	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9092	//       "location": "query",
9093	//       "type": "string"
9094	//     }
9095	//   },
9096	//   "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
9097	//   "request": {
9098	//     "$ref": "Object"
9099	//   },
9100	//   "response": {
9101	//     "$ref": "Object"
9102	//   },
9103	//   "scopes": [
9104	//     "https://www.googleapis.com/auth/cloud-platform",
9105	//     "https://www.googleapis.com/auth/devstorage.full_control",
9106	//     "https://www.googleapis.com/auth/devstorage.read_write"
9107	//   ]
9108	// }
9109
9110}
9111
9112// method id "storage.objects.delete":
9113
9114type ObjectsDeleteCall struct {
9115	s          *Service
9116	bucket     string
9117	object     string
9118	urlParams_ gensupport.URLParams
9119	ctx_       context.Context
9120	header_    http.Header
9121}
9122
9123// Delete: Deletes an object and its metadata. Deletions are permanent
9124// if versioning is not enabled for the bucket, or if the generation
9125// parameter is used.
9126func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
9127	c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9128	c.bucket = bucket
9129	c.object = object
9130	return c
9131}
9132
9133// Generation sets the optional parameter "generation": If present,
9134// permanently deletes a specific revision of this object (as opposed to
9135// the latest version, the default).
9136func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
9137	c.urlParams_.Set("generation", fmt.Sprint(generation))
9138	return c
9139}
9140
9141// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9142// Makes the operation conditional on whether the object's current
9143// generation matches the given value. Setting to 0 makes the operation
9144// succeed only if there are no live versions of the object.
9145func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
9146	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9147	return c
9148}
9149
9150// IfGenerationNotMatch sets the optional parameter
9151// "ifGenerationNotMatch": Makes the operation conditional on whether
9152// the object's current generation does not match the given value. If no
9153// live object exists, the precondition fails. Setting to 0 makes the
9154// operation succeed only if there is a live version of the object.
9155func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
9156	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9157	return c
9158}
9159
9160// IfMetagenerationMatch sets the optional parameter
9161// "ifMetagenerationMatch": Makes the operation conditional on whether
9162// the object's current metageneration matches the given value.
9163func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall {
9164	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9165	return c
9166}
9167
9168// IfMetagenerationNotMatch sets the optional parameter
9169// "ifMetagenerationNotMatch": Makes the operation conditional on
9170// whether the object's current metageneration does not match the given
9171// value.
9172func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
9173	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9174	return c
9175}
9176
9177// ProvisionalUserProject sets the optional parameter
9178// "provisionalUserProject": The project to be billed for this request
9179// if the target bucket is requester-pays bucket.
9180func (c *ObjectsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsDeleteCall {
9181	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9182	return c
9183}
9184
9185// UserProject sets the optional parameter "userProject": The project to
9186// be billed for this request. Required for Requester Pays buckets.
9187func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
9188	c.urlParams_.Set("userProject", userProject)
9189	return c
9190}
9191
9192// Fields allows partial responses to be retrieved. See
9193// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9194// for more information.
9195func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
9196	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9197	return c
9198}
9199
9200// Context sets the context to be used in this call's Do method. Any
9201// pending HTTP request will be aborted if the provided context is
9202// canceled.
9203func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
9204	c.ctx_ = ctx
9205	return c
9206}
9207
9208// Header returns an http.Header that can be modified by the caller to
9209// add HTTP headers to the request.
9210func (c *ObjectsDeleteCall) Header() http.Header {
9211	if c.header_ == nil {
9212		c.header_ = make(http.Header)
9213	}
9214	return c.header_
9215}
9216
9217func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
9218	reqHeaders := make(http.Header)
9219	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
9220	for k, v := range c.header_ {
9221		reqHeaders[k] = v
9222	}
9223	reqHeaders.Set("User-Agent", c.s.userAgent())
9224	var body io.Reader = nil
9225	c.urlParams_.Set("alt", alt)
9226	c.urlParams_.Set("prettyPrint", "false")
9227	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9228	urls += "?" + c.urlParams_.Encode()
9229	req, err := http.NewRequest("DELETE", urls, body)
9230	if err != nil {
9231		return nil, err
9232	}
9233	req.Header = reqHeaders
9234	googleapi.Expand(req.URL, map[string]string{
9235		"bucket": c.bucket,
9236		"object": c.object,
9237	})
9238	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9239}
9240
9241// Do executes the "storage.objects.delete" call.
9242func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
9243	gensupport.SetOptions(c.urlParams_, opts...)
9244	res, err := c.doRequest("json")
9245	if err != nil {
9246		return err
9247	}
9248	defer googleapi.CloseBody(res)
9249	if err := googleapi.CheckResponse(res); err != nil {
9250		return err
9251	}
9252	return nil
9253	// {
9254	//   "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
9255	//   "httpMethod": "DELETE",
9256	//   "id": "storage.objects.delete",
9257	//   "parameterOrder": [
9258	//     "bucket",
9259	//     "object"
9260	//   ],
9261	//   "parameters": {
9262	//     "bucket": {
9263	//       "description": "Name of the bucket in which the object resides.",
9264	//       "location": "path",
9265	//       "required": true,
9266	//       "type": "string"
9267	//     },
9268	//     "generation": {
9269	//       "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
9270	//       "format": "int64",
9271	//       "location": "query",
9272	//       "type": "string"
9273	//     },
9274	//     "ifGenerationMatch": {
9275	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
9276	//       "format": "int64",
9277	//       "location": "query",
9278	//       "type": "string"
9279	//     },
9280	//     "ifGenerationNotMatch": {
9281	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
9282	//       "format": "int64",
9283	//       "location": "query",
9284	//       "type": "string"
9285	//     },
9286	//     "ifMetagenerationMatch": {
9287	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9288	//       "format": "int64",
9289	//       "location": "query",
9290	//       "type": "string"
9291	//     },
9292	//     "ifMetagenerationNotMatch": {
9293	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9294	//       "format": "int64",
9295	//       "location": "query",
9296	//       "type": "string"
9297	//     },
9298	//     "object": {
9299	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9300	//       "location": "path",
9301	//       "required": true,
9302	//       "type": "string"
9303	//     },
9304	//     "provisionalUserProject": {
9305	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9306	//       "location": "query",
9307	//       "type": "string"
9308	//     },
9309	//     "userProject": {
9310	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9311	//       "location": "query",
9312	//       "type": "string"
9313	//     }
9314	//   },
9315	//   "path": "b/{bucket}/o/{object}",
9316	//   "scopes": [
9317	//     "https://www.googleapis.com/auth/cloud-platform",
9318	//     "https://www.googleapis.com/auth/devstorage.full_control",
9319	//     "https://www.googleapis.com/auth/devstorage.read_write"
9320	//   ]
9321	// }
9322
9323}
9324
9325// method id "storage.objects.get":
9326
9327type ObjectsGetCall struct {
9328	s            *Service
9329	bucket       string
9330	object       string
9331	urlParams_   gensupport.URLParams
9332	ifNoneMatch_ string
9333	ctx_         context.Context
9334	header_      http.Header
9335}
9336
9337// Get: Retrieves an object or its metadata.
9338func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
9339	c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9340	c.bucket = bucket
9341	c.object = object
9342	return c
9343}
9344
9345// Generation sets the optional parameter "generation": If present,
9346// selects a specific revision of this object (as opposed to the latest
9347// version, the default).
9348func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
9349	c.urlParams_.Set("generation", fmt.Sprint(generation))
9350	return c
9351}
9352
9353// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9354// Makes the operation conditional on whether the object's current
9355// generation matches the given value. Setting to 0 makes the operation
9356// succeed only if there are no live versions of the object.
9357func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
9358	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9359	return c
9360}
9361
9362// IfGenerationNotMatch sets the optional parameter
9363// "ifGenerationNotMatch": Makes the operation conditional on whether
9364// the object's current generation does not match the given value. If no
9365// live object exists, the precondition fails. Setting to 0 makes the
9366// operation succeed only if there is a live version of the object.
9367func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
9368	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9369	return c
9370}
9371
9372// IfMetagenerationMatch sets the optional parameter
9373// "ifMetagenerationMatch": Makes the operation conditional on whether
9374// the object's current metageneration matches the given value.
9375func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall {
9376	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9377	return c
9378}
9379
9380// IfMetagenerationNotMatch sets the optional parameter
9381// "ifMetagenerationNotMatch": Makes the operation conditional on
9382// whether the object's current metageneration does not match the given
9383// value.
9384func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
9385	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9386	return c
9387}
9388
9389// Projection sets the optional parameter "projection": Set of
9390// properties to return. Defaults to noAcl.
9391//
9392// Possible values:
9393//   "full" - Include all properties.
9394//   "noAcl" - Omit the owner, acl property.
9395func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
9396	c.urlParams_.Set("projection", projection)
9397	return c
9398}
9399
9400// ProvisionalUserProject sets the optional parameter
9401// "provisionalUserProject": The project to be billed for this request
9402// if the target bucket is requester-pays bucket.
9403func (c *ObjectsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetCall {
9404	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9405	return c
9406}
9407
9408// UserProject sets the optional parameter "userProject": The project to
9409// be billed for this request. Required for Requester Pays buckets.
9410func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
9411	c.urlParams_.Set("userProject", userProject)
9412	return c
9413}
9414
9415// Fields allows partial responses to be retrieved. See
9416// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9417// for more information.
9418func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
9419	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9420	return c
9421}
9422
9423// IfNoneMatch sets the optional parameter which makes the operation
9424// fail if the object's ETag matches the given value. This is useful for
9425// getting updates only after the object has changed since the last
9426// request. Use googleapi.IsNotModified to check whether the response
9427// error from Do is the result of In-None-Match.
9428func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
9429	c.ifNoneMatch_ = entityTag
9430	return c
9431}
9432
9433// Context sets the context to be used in this call's Do and Download
9434// methods. Any pending HTTP request will be aborted if the provided
9435// context is canceled.
9436func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
9437	c.ctx_ = ctx
9438	return c
9439}
9440
9441// Header returns an http.Header that can be modified by the caller to
9442// add HTTP headers to the request.
9443func (c *ObjectsGetCall) Header() http.Header {
9444	if c.header_ == nil {
9445		c.header_ = make(http.Header)
9446	}
9447	return c.header_
9448}
9449
9450func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
9451	reqHeaders := make(http.Header)
9452	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
9453	for k, v := range c.header_ {
9454		reqHeaders[k] = v
9455	}
9456	reqHeaders.Set("User-Agent", c.s.userAgent())
9457	if c.ifNoneMatch_ != "" {
9458		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9459	}
9460	var body io.Reader = nil
9461	c.urlParams_.Set("alt", alt)
9462	c.urlParams_.Set("prettyPrint", "false")
9463	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9464	urls += "?" + c.urlParams_.Encode()
9465	req, err := http.NewRequest("GET", urls, body)
9466	if err != nil {
9467		return nil, err
9468	}
9469	req.Header = reqHeaders
9470	googleapi.Expand(req.URL, map[string]string{
9471		"bucket": c.bucket,
9472		"object": c.object,
9473	})
9474	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9475}
9476
9477// Download fetches the API endpoint's "media" value, instead of the normal
9478// API response value. If the returned error is nil, the Response is guaranteed to
9479// have a 2xx status code. Callers must close the Response.Body as usual.
9480func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
9481	gensupport.SetOptions(c.urlParams_, opts...)
9482	res, err := c.doRequest("media")
9483	if err != nil {
9484		return nil, err
9485	}
9486	if err := googleapi.CheckMediaResponse(res); err != nil {
9487		res.Body.Close()
9488		return nil, err
9489	}
9490	return res, nil
9491}
9492
9493// Do executes the "storage.objects.get" call.
9494// Exactly one of *Object or error will be non-nil. Any non-2xx status
9495// code is an error. Response headers are in either
9496// *Object.ServerResponse.Header or (if a response was returned at all)
9497// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9498// check whether the returned error was because http.StatusNotModified
9499// was returned.
9500func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
9501	gensupport.SetOptions(c.urlParams_, opts...)
9502	res, err := c.doRequest("json")
9503	if res != nil && res.StatusCode == http.StatusNotModified {
9504		if res.Body != nil {
9505			res.Body.Close()
9506		}
9507		return nil, &googleapi.Error{
9508			Code:   res.StatusCode,
9509			Header: res.Header,
9510		}
9511	}
9512	if err != nil {
9513		return nil, err
9514	}
9515	defer googleapi.CloseBody(res)
9516	if err := googleapi.CheckResponse(res); err != nil {
9517		return nil, err
9518	}
9519	ret := &Object{
9520		ServerResponse: googleapi.ServerResponse{
9521			Header:         res.Header,
9522			HTTPStatusCode: res.StatusCode,
9523		},
9524	}
9525	target := &ret
9526	if err := gensupport.DecodeResponse(target, res); err != nil {
9527		return nil, err
9528	}
9529	return ret, nil
9530	// {
9531	//   "description": "Retrieves an object or its metadata.",
9532	//   "httpMethod": "GET",
9533	//   "id": "storage.objects.get",
9534	//   "parameterOrder": [
9535	//     "bucket",
9536	//     "object"
9537	//   ],
9538	//   "parameters": {
9539	//     "bucket": {
9540	//       "description": "Name of the bucket in which the object resides.",
9541	//       "location": "path",
9542	//       "required": true,
9543	//       "type": "string"
9544	//     },
9545	//     "generation": {
9546	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9547	//       "format": "int64",
9548	//       "location": "query",
9549	//       "type": "string"
9550	//     },
9551	//     "ifGenerationMatch": {
9552	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
9553	//       "format": "int64",
9554	//       "location": "query",
9555	//       "type": "string"
9556	//     },
9557	//     "ifGenerationNotMatch": {
9558	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
9559	//       "format": "int64",
9560	//       "location": "query",
9561	//       "type": "string"
9562	//     },
9563	//     "ifMetagenerationMatch": {
9564	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9565	//       "format": "int64",
9566	//       "location": "query",
9567	//       "type": "string"
9568	//     },
9569	//     "ifMetagenerationNotMatch": {
9570	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9571	//       "format": "int64",
9572	//       "location": "query",
9573	//       "type": "string"
9574	//     },
9575	//     "object": {
9576	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9577	//       "location": "path",
9578	//       "required": true,
9579	//       "type": "string"
9580	//     },
9581	//     "projection": {
9582	//       "description": "Set of properties to return. Defaults to noAcl.",
9583	//       "enum": [
9584	//         "full",
9585	//         "noAcl"
9586	//       ],
9587	//       "enumDescriptions": [
9588	//         "Include all properties.",
9589	//         "Omit the owner, acl property."
9590	//       ],
9591	//       "location": "query",
9592	//       "type": "string"
9593	//     },
9594	//     "provisionalUserProject": {
9595	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9596	//       "location": "query",
9597	//       "type": "string"
9598	//     },
9599	//     "userProject": {
9600	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9601	//       "location": "query",
9602	//       "type": "string"
9603	//     }
9604	//   },
9605	//   "path": "b/{bucket}/o/{object}",
9606	//   "response": {
9607	//     "$ref": "Object"
9608	//   },
9609	//   "scopes": [
9610	//     "https://www.googleapis.com/auth/cloud-platform",
9611	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9612	//     "https://www.googleapis.com/auth/devstorage.full_control",
9613	//     "https://www.googleapis.com/auth/devstorage.read_only",
9614	//     "https://www.googleapis.com/auth/devstorage.read_write"
9615	//   ],
9616	//   "supportsMediaDownload": true,
9617	//   "useMediaDownloadService": true
9618	// }
9619
9620}
9621
9622// method id "storage.objects.getIamPolicy":
9623
9624type ObjectsGetIamPolicyCall struct {
9625	s            *Service
9626	bucket       string
9627	object       string
9628	urlParams_   gensupport.URLParams
9629	ifNoneMatch_ string
9630	ctx_         context.Context
9631	header_      http.Header
9632}
9633
9634// GetIamPolicy: Returns an IAM policy for the specified object.
9635func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall {
9636	c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9637	c.bucket = bucket
9638	c.object = object
9639	return c
9640}
9641
9642// Generation sets the optional parameter "generation": If present,
9643// selects a specific revision of this object (as opposed to the latest
9644// version, the default).
9645func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall {
9646	c.urlParams_.Set("generation", fmt.Sprint(generation))
9647	return c
9648}
9649
9650// ProvisionalUserProject sets the optional parameter
9651// "provisionalUserProject": The project to be billed for this request
9652// if the target bucket is requester-pays bucket.
9653func (c *ObjectsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetIamPolicyCall {
9654	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9655	return c
9656}
9657
9658// UserProject sets the optional parameter "userProject": The project to
9659// be billed for this request. Required for Requester Pays buckets.
9660func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
9661	c.urlParams_.Set("userProject", userProject)
9662	return c
9663}
9664
9665// Fields allows partial responses to be retrieved. See
9666// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9667// for more information.
9668func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall {
9669	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9670	return c
9671}
9672
9673// IfNoneMatch sets the optional parameter which makes the operation
9674// fail if the object's ETag matches the given value. This is useful for
9675// getting updates only after the object has changed since the last
9676// request. Use googleapi.IsNotModified to check whether the response
9677// error from Do is the result of In-None-Match.
9678func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall {
9679	c.ifNoneMatch_ = entityTag
9680	return c
9681}
9682
9683// Context sets the context to be used in this call's Do method. Any
9684// pending HTTP request will be aborted if the provided context is
9685// canceled.
9686func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
9687	c.ctx_ = ctx
9688	return c
9689}
9690
9691// Header returns an http.Header that can be modified by the caller to
9692// add HTTP headers to the request.
9693func (c *ObjectsGetIamPolicyCall) Header() http.Header {
9694	if c.header_ == nil {
9695		c.header_ = make(http.Header)
9696	}
9697	return c.header_
9698}
9699
9700func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9701	reqHeaders := make(http.Header)
9702	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
9703	for k, v := range c.header_ {
9704		reqHeaders[k] = v
9705	}
9706	reqHeaders.Set("User-Agent", c.s.userAgent())
9707	if c.ifNoneMatch_ != "" {
9708		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9709	}
9710	var body io.Reader = nil
9711	c.urlParams_.Set("alt", alt)
9712	c.urlParams_.Set("prettyPrint", "false")
9713	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
9714	urls += "?" + c.urlParams_.Encode()
9715	req, err := http.NewRequest("GET", urls, body)
9716	if err != nil {
9717		return nil, err
9718	}
9719	req.Header = reqHeaders
9720	googleapi.Expand(req.URL, map[string]string{
9721		"bucket": c.bucket,
9722		"object": c.object,
9723	})
9724	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9725}
9726
9727// Do executes the "storage.objects.getIamPolicy" call.
9728// Exactly one of *Policy or error will be non-nil. Any non-2xx status
9729// code is an error. Response headers are in either
9730// *Policy.ServerResponse.Header or (if a response was returned at all)
9731// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9732// check whether the returned error was because http.StatusNotModified
9733// was returned.
9734func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9735	gensupport.SetOptions(c.urlParams_, opts...)
9736	res, err := c.doRequest("json")
9737	if res != nil && res.StatusCode == http.StatusNotModified {
9738		if res.Body != nil {
9739			res.Body.Close()
9740		}
9741		return nil, &googleapi.Error{
9742			Code:   res.StatusCode,
9743			Header: res.Header,
9744		}
9745	}
9746	if err != nil {
9747		return nil, err
9748	}
9749	defer googleapi.CloseBody(res)
9750	if err := googleapi.CheckResponse(res); err != nil {
9751		return nil, err
9752	}
9753	ret := &Policy{
9754		ServerResponse: googleapi.ServerResponse{
9755			Header:         res.Header,
9756			HTTPStatusCode: res.StatusCode,
9757		},
9758	}
9759	target := &ret
9760	if err := gensupport.DecodeResponse(target, res); err != nil {
9761		return nil, err
9762	}
9763	return ret, nil
9764	// {
9765	//   "description": "Returns an IAM policy for the specified object.",
9766	//   "httpMethod": "GET",
9767	//   "id": "storage.objects.getIamPolicy",
9768	//   "parameterOrder": [
9769	//     "bucket",
9770	//     "object"
9771	//   ],
9772	//   "parameters": {
9773	//     "bucket": {
9774	//       "description": "Name of the bucket in which the object resides.",
9775	//       "location": "path",
9776	//       "required": true,
9777	//       "type": "string"
9778	//     },
9779	//     "generation": {
9780	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9781	//       "format": "int64",
9782	//       "location": "query",
9783	//       "type": "string"
9784	//     },
9785	//     "object": {
9786	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9787	//       "location": "path",
9788	//       "required": true,
9789	//       "type": "string"
9790	//     },
9791	//     "provisionalUserProject": {
9792	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9793	//       "location": "query",
9794	//       "type": "string"
9795	//     },
9796	//     "userProject": {
9797	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9798	//       "location": "query",
9799	//       "type": "string"
9800	//     }
9801	//   },
9802	//   "path": "b/{bucket}/o/{object}/iam",
9803	//   "response": {
9804	//     "$ref": "Policy"
9805	//   },
9806	//   "scopes": [
9807	//     "https://www.googleapis.com/auth/cloud-platform",
9808	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9809	//     "https://www.googleapis.com/auth/devstorage.full_control",
9810	//     "https://www.googleapis.com/auth/devstorage.read_only",
9811	//     "https://www.googleapis.com/auth/devstorage.read_write"
9812	//   ]
9813	// }
9814
9815}
9816
9817// method id "storage.objects.insert":
9818
9819type ObjectsInsertCall struct {
9820	s          *Service
9821	bucket     string
9822	object     *Object
9823	urlParams_ gensupport.URLParams
9824	mediaInfo_ *gensupport.MediaInfo
9825	ctx_       context.Context
9826	header_    http.Header
9827}
9828
9829// Insert: Stores a new object and metadata.
9830func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
9831	c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9832	c.bucket = bucket
9833	c.object = object
9834	return c
9835}
9836
9837// ContentEncoding sets the optional parameter "contentEncoding": If
9838// set, sets the contentEncoding property of the final object to this
9839// value. Setting this parameter is equivalent to setting the
9840// contentEncoding metadata property. This can be useful when uploading
9841// an object with uploadType=media to indicate the encoding of the
9842// content being uploaded.
9843func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall {
9844	c.urlParams_.Set("contentEncoding", contentEncoding)
9845	return c
9846}
9847
9848// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9849// Makes the operation conditional on whether the object's current
9850// generation matches the given value. Setting to 0 makes the operation
9851// succeed only if there are no live versions of the object.
9852func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
9853	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9854	return c
9855}
9856
9857// IfGenerationNotMatch sets the optional parameter
9858// "ifGenerationNotMatch": Makes the operation conditional on whether
9859// the object's current generation does not match the given value. If no
9860// live object exists, the precondition fails. Setting to 0 makes the
9861// operation succeed only if there is a live version of the object.
9862func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
9863	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9864	return c
9865}
9866
9867// IfMetagenerationMatch sets the optional parameter
9868// "ifMetagenerationMatch": Makes the operation conditional on whether
9869// the object's current metageneration matches the given value.
9870func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall {
9871	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9872	return c
9873}
9874
9875// IfMetagenerationNotMatch sets the optional parameter
9876// "ifMetagenerationNotMatch": Makes the operation conditional on
9877// whether the object's current metageneration does not match the given
9878// value.
9879func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
9880	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9881	return c
9882}
9883
9884// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
9885// the Cloud KMS key, of the form
9886// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
9887//  that will be used to encrypt the object. Overrides the object
9888// metadata's kms_key_name value, if any.
9889func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall {
9890	c.urlParams_.Set("kmsKeyName", kmsKeyName)
9891	return c
9892}
9893
9894// Name sets the optional parameter "name": Name of the object. Required
9895// when the object metadata is not otherwise provided. Overrides the
9896// object metadata's name value, if any. For information about how to
9897// URL encode object names to be path safe, see Encoding URI Path Parts.
9898func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
9899	c.urlParams_.Set("name", name)
9900	return c
9901}
9902
9903// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9904// predefined set of access controls to this object.
9905//
9906// Possible values:
9907//   "authenticatedRead" - Object owner gets OWNER access, and
9908// allAuthenticatedUsers get READER access.
9909//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
9910// project team owners get OWNER access.
9911//   "bucketOwnerRead" - Object owner gets OWNER access, and project
9912// team owners get READER access.
9913//   "private" - Object owner gets OWNER access.
9914//   "projectPrivate" - Object owner gets OWNER access, and project team
9915// members get access according to their roles.
9916//   "publicRead" - Object owner gets OWNER access, and allUsers get
9917// READER access.
9918func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
9919	c.urlParams_.Set("predefinedAcl", predefinedAcl)
9920	return c
9921}
9922
9923// Projection sets the optional parameter "projection": Set of
9924// properties to return. Defaults to noAcl, unless the object resource
9925// specifies the acl property, when it defaults to full.
9926//
9927// Possible values:
9928//   "full" - Include all properties.
9929//   "noAcl" - Omit the owner, acl property.
9930func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
9931	c.urlParams_.Set("projection", projection)
9932	return c
9933}
9934
9935// ProvisionalUserProject sets the optional parameter
9936// "provisionalUserProject": The project to be billed for this request
9937// if the target bucket is requester-pays bucket.
9938func (c *ObjectsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsInsertCall {
9939	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9940	return c
9941}
9942
9943// UserProject sets the optional parameter "userProject": The project to
9944// be billed for this request. Required for Requester Pays buckets.
9945func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
9946	c.urlParams_.Set("userProject", userProject)
9947	return c
9948}
9949
9950// Media specifies the media to upload in one or more chunks. The chunk
9951// size may be controlled by supplying a MediaOption generated by
9952// googleapi.ChunkSize. The chunk size defaults to
9953// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
9954// upload request will be determined by sniffing the contents of r,
9955// unless a MediaOption generated by googleapi.ContentType is
9956// supplied.
9957// At most one of Media and ResumableMedia may be set.
9958func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
9959	if ct := c.object.ContentType; ct != "" {
9960		options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
9961	}
9962	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9963	return c
9964}
9965
9966// ResumableMedia specifies the media to upload in chunks and can be
9967// canceled with ctx.
9968//
9969// Deprecated: use Media instead.
9970//
9971// At most one of Media and ResumableMedia may be set. mediaType
9972// identifies the MIME media type of the upload, such as "image/png". If
9973// mediaType is "", it will be auto-detected. The provided ctx will
9974// supersede any context previously provided to the Context method.
9975func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
9976	c.ctx_ = ctx
9977	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
9978	return c
9979}
9980
9981// ProgressUpdater provides a callback function that will be called
9982// after every chunk. It should be a low-latency function in order to
9983// not slow down the upload operation. This should only be called when
9984// using ResumableMedia (as opposed to Media).
9985func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
9986	c.mediaInfo_.SetProgressUpdater(pu)
9987	return c
9988}
9989
9990// Fields allows partial responses to be retrieved. See
9991// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9992// for more information.
9993func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
9994	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9995	return c
9996}
9997
9998// Context sets the context to be used in this call's Do method. Any
9999// pending HTTP request will be aborted if the provided context is
10000// canceled.
10001// This context will supersede any context previously provided to the
10002// ResumableMedia method.
10003func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
10004	c.ctx_ = ctx
10005	return c
10006}
10007
10008// Header returns an http.Header that can be modified by the caller to
10009// add HTTP headers to the request.
10010func (c *ObjectsInsertCall) Header() http.Header {
10011	if c.header_ == nil {
10012		c.header_ = make(http.Header)
10013	}
10014	return c.header_
10015}
10016
10017func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
10018	reqHeaders := make(http.Header)
10019	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
10020	for k, v := range c.header_ {
10021		reqHeaders[k] = v
10022	}
10023	reqHeaders.Set("User-Agent", c.s.userAgent())
10024	var body io.Reader = nil
10025	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
10026	if err != nil {
10027		return nil, err
10028	}
10029	reqHeaders.Set("Content-Type", "application/json")
10030	c.urlParams_.Set("alt", alt)
10031	c.urlParams_.Set("prettyPrint", "false")
10032	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
10033	if c.mediaInfo_ != nil {
10034		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1/b/{bucket}/o")
10035		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
10036	}
10037	if body == nil {
10038		body = new(bytes.Buffer)
10039		reqHeaders.Set("Content-Type", "application/json")
10040	}
10041	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
10042	defer cleanup()
10043	urls += "?" + c.urlParams_.Encode()
10044	req, err := http.NewRequest("POST", urls, body)
10045	if err != nil {
10046		return nil, err
10047	}
10048	req.Header = reqHeaders
10049	req.GetBody = getBody
10050	googleapi.Expand(req.URL, map[string]string{
10051		"bucket": c.bucket,
10052	})
10053	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10054}
10055
10056// Do executes the "storage.objects.insert" call.
10057// Exactly one of *Object or error will be non-nil. Any non-2xx status
10058// code is an error. Response headers are in either
10059// *Object.ServerResponse.Header or (if a response was returned at all)
10060// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10061// check whether the returned error was because http.StatusNotModified
10062// was returned.
10063func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
10064	gensupport.SetOptions(c.urlParams_, opts...)
10065	res, err := c.doRequest("json")
10066	if res != nil && res.StatusCode == http.StatusNotModified {
10067		if res.Body != nil {
10068			res.Body.Close()
10069		}
10070		return nil, &googleapi.Error{
10071			Code:   res.StatusCode,
10072			Header: res.Header,
10073		}
10074	}
10075	if err != nil {
10076		return nil, err
10077	}
10078	defer googleapi.CloseBody(res)
10079	if err := googleapi.CheckResponse(res); err != nil {
10080		return nil, err
10081	}
10082	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
10083	if rx != nil {
10084		rx.Client = c.s.client
10085		rx.UserAgent = c.s.userAgent()
10086		ctx := c.ctx_
10087		if ctx == nil {
10088			ctx = context.TODO()
10089		}
10090		res, err = rx.Upload(ctx)
10091		if err != nil {
10092			return nil, err
10093		}
10094		defer res.Body.Close()
10095		if err := googleapi.CheckResponse(res); err != nil {
10096			return nil, err
10097		}
10098	}
10099	ret := &Object{
10100		ServerResponse: googleapi.ServerResponse{
10101			Header:         res.Header,
10102			HTTPStatusCode: res.StatusCode,
10103		},
10104	}
10105	target := &ret
10106	if err := gensupport.DecodeResponse(target, res); err != nil {
10107		return nil, err
10108	}
10109	return ret, nil
10110	// {
10111	//   "description": "Stores a new object and metadata.",
10112	//   "httpMethod": "POST",
10113	//   "id": "storage.objects.insert",
10114	//   "mediaUpload": {
10115	//     "accept": [
10116	//       "*/*"
10117	//     ],
10118	//     "protocols": {
10119	//       "resumable": {
10120	//         "multipart": true,
10121	//         "path": "/resumable/upload/storage/v1/b/{bucket}/o"
10122	//       },
10123	//       "simple": {
10124	//         "multipart": true,
10125	//         "path": "/upload/storage/v1/b/{bucket}/o"
10126	//       }
10127	//     }
10128	//   },
10129	//   "parameterOrder": [
10130	//     "bucket"
10131	//   ],
10132	//   "parameters": {
10133	//     "bucket": {
10134	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
10135	//       "location": "path",
10136	//       "required": true,
10137	//       "type": "string"
10138	//     },
10139	//     "contentEncoding": {
10140	//       "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.",
10141	//       "location": "query",
10142	//       "type": "string"
10143	//     },
10144	//     "ifGenerationMatch": {
10145	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
10146	//       "format": "int64",
10147	//       "location": "query",
10148	//       "type": "string"
10149	//     },
10150	//     "ifGenerationNotMatch": {
10151	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
10152	//       "format": "int64",
10153	//       "location": "query",
10154	//       "type": "string"
10155	//     },
10156	//     "ifMetagenerationMatch": {
10157	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10158	//       "format": "int64",
10159	//       "location": "query",
10160	//       "type": "string"
10161	//     },
10162	//     "ifMetagenerationNotMatch": {
10163	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10164	//       "format": "int64",
10165	//       "location": "query",
10166	//       "type": "string"
10167	//     },
10168	//     "kmsKeyName": {
10169	//       "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
10170	//       "location": "query",
10171	//       "type": "string"
10172	//     },
10173	//     "name": {
10174	//       "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10175	//       "location": "query",
10176	//       "type": "string"
10177	//     },
10178	//     "predefinedAcl": {
10179	//       "description": "Apply a predefined set of access controls to this object.",
10180	//       "enum": [
10181	//         "authenticatedRead",
10182	//         "bucketOwnerFullControl",
10183	//         "bucketOwnerRead",
10184	//         "private",
10185	//         "projectPrivate",
10186	//         "publicRead"
10187	//       ],
10188	//       "enumDescriptions": [
10189	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10190	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
10191	//         "Object owner gets OWNER access, and project team owners get READER access.",
10192	//         "Object owner gets OWNER access.",
10193	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
10194	//         "Object owner gets OWNER access, and allUsers get READER access."
10195	//       ],
10196	//       "location": "query",
10197	//       "type": "string"
10198	//     },
10199	//     "projection": {
10200	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
10201	//       "enum": [
10202	//         "full",
10203	//         "noAcl"
10204	//       ],
10205	//       "enumDescriptions": [
10206	//         "Include all properties.",
10207	//         "Omit the owner, acl property."
10208	//       ],
10209	//       "location": "query",
10210	//       "type": "string"
10211	//     },
10212	//     "provisionalUserProject": {
10213	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10214	//       "location": "query",
10215	//       "type": "string"
10216	//     },
10217	//     "userProject": {
10218	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10219	//       "location": "query",
10220	//       "type": "string"
10221	//     }
10222	//   },
10223	//   "path": "b/{bucket}/o",
10224	//   "request": {
10225	//     "$ref": "Object"
10226	//   },
10227	//   "response": {
10228	//     "$ref": "Object"
10229	//   },
10230	//   "scopes": [
10231	//     "https://www.googleapis.com/auth/cloud-platform",
10232	//     "https://www.googleapis.com/auth/devstorage.full_control",
10233	//     "https://www.googleapis.com/auth/devstorage.read_write"
10234	//   ],
10235	//   "supportsMediaUpload": true
10236	// }
10237
10238}
10239
10240// method id "storage.objects.list":
10241
10242type ObjectsListCall struct {
10243	s            *Service
10244	bucket       string
10245	urlParams_   gensupport.URLParams
10246	ifNoneMatch_ string
10247	ctx_         context.Context
10248	header_      http.Header
10249}
10250
10251// List: Retrieves a list of objects matching the criteria.
10252func (r *ObjectsService) List(bucket string) *ObjectsListCall {
10253	c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10254	c.bucket = bucket
10255	return c
10256}
10257
10258// Delimiter sets the optional parameter "delimiter": Returns results in
10259// a directory-like mode. items will contain only objects whose names,
10260// aside from the prefix, do not contain delimiter. Objects whose names,
10261// aside from the prefix, contain delimiter will have their name,
10262// truncated after the delimiter, returned in prefixes. Duplicate
10263// prefixes are omitted.
10264func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
10265	c.urlParams_.Set("delimiter", delimiter)
10266	return c
10267}
10268
10269// IncludeTrailingDelimiter sets the optional parameter
10270// "includeTrailingDelimiter": If true, objects that end in exactly one
10271// instance of delimiter will have their metadata included in items in
10272// addition to prefixes.
10273func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall {
10274	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
10275	return c
10276}
10277
10278// MaxResults sets the optional parameter "maxResults": Maximum number
10279// of items plus prefixes to return in a single page of responses. As
10280// duplicate prefixes are omitted, fewer total results may be returned
10281// than requested. The service will use this parameter or 1,000 items,
10282// whichever is smaller.
10283func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
10284	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
10285	return c
10286}
10287
10288// PageToken sets the optional parameter "pageToken": A
10289// previously-returned page token representing part of the larger set of
10290// results to view.
10291func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
10292	c.urlParams_.Set("pageToken", pageToken)
10293	return c
10294}
10295
10296// Prefix sets the optional parameter "prefix": Filter results to
10297// objects whose names begin with this prefix.
10298func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
10299	c.urlParams_.Set("prefix", prefix)
10300	return c
10301}
10302
10303// Projection sets the optional parameter "projection": Set of
10304// properties to return. Defaults to noAcl.
10305//
10306// Possible values:
10307//   "full" - Include all properties.
10308//   "noAcl" - Omit the owner, acl property.
10309func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
10310	c.urlParams_.Set("projection", projection)
10311	return c
10312}
10313
10314// ProvisionalUserProject sets the optional parameter
10315// "provisionalUserProject": The project to be billed for this request
10316// if the target bucket is requester-pays bucket.
10317func (c *ObjectsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsListCall {
10318	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
10319	return c
10320}
10321
10322// UserProject sets the optional parameter "userProject": The project to
10323// be billed for this request. Required for Requester Pays buckets.
10324func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
10325	c.urlParams_.Set("userProject", userProject)
10326	return c
10327}
10328
10329// Versions sets the optional parameter "versions": If true, lists all
10330// versions of an object as distinct results. The default is false. For
10331// more information, see Object Versioning.
10332func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
10333	c.urlParams_.Set("versions", fmt.Sprint(versions))
10334	return c
10335}
10336
10337// Fields allows partial responses to be retrieved. See
10338// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10339// for more information.
10340func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
10341	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10342	return c
10343}
10344
10345// IfNoneMatch sets the optional parameter which makes the operation
10346// fail if the object's ETag matches the given value. This is useful for
10347// getting updates only after the object has changed since the last
10348// request. Use googleapi.IsNotModified to check whether the response
10349// error from Do is the result of In-None-Match.
10350func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
10351	c.ifNoneMatch_ = entityTag
10352	return c
10353}
10354
10355// Context sets the context to be used in this call's Do method. Any
10356// pending HTTP request will be aborted if the provided context is
10357// canceled.
10358func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
10359	c.ctx_ = ctx
10360	return c
10361}
10362
10363// Header returns an http.Header that can be modified by the caller to
10364// add HTTP headers to the request.
10365func (c *ObjectsListCall) Header() http.Header {
10366	if c.header_ == nil {
10367		c.header_ = make(http.Header)
10368	}
10369	return c.header_
10370}
10371
10372func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
10373	reqHeaders := make(http.Header)
10374	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
10375	for k, v := range c.header_ {
10376		reqHeaders[k] = v
10377	}
10378	reqHeaders.Set("User-Agent", c.s.userAgent())
10379	if c.ifNoneMatch_ != "" {
10380		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10381	}
10382	var body io.Reader = nil
10383	c.urlParams_.Set("alt", alt)
10384	c.urlParams_.Set("prettyPrint", "false")
10385	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
10386	urls += "?" + c.urlParams_.Encode()
10387	req, err := http.NewRequest("GET", urls, body)
10388	if err != nil {
10389		return nil, err
10390	}
10391	req.Header = reqHeaders
10392	googleapi.Expand(req.URL, map[string]string{
10393		"bucket": c.bucket,
10394	})
10395	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10396}
10397
10398// Do executes the "storage.objects.list" call.
10399// Exactly one of *Objects or error will be non-nil. Any non-2xx status
10400// code is an error. Response headers are in either
10401// *Objects.ServerResponse.Header or (if a response was returned at all)
10402// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10403// check whether the returned error was because http.StatusNotModified
10404// was returned.
10405func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
10406	gensupport.SetOptions(c.urlParams_, opts...)
10407	res, err := c.doRequest("json")
10408	if res != nil && res.StatusCode == http.StatusNotModified {
10409		if res.Body != nil {
10410			res.Body.Close()
10411		}
10412		return nil, &googleapi.Error{
10413			Code:   res.StatusCode,
10414			Header: res.Header,
10415		}
10416	}
10417	if err != nil {
10418		return nil, err
10419	}
10420	defer googleapi.CloseBody(res)
10421	if err := googleapi.CheckResponse(res); err != nil {
10422		return nil, err
10423	}
10424	ret := &Objects{
10425		ServerResponse: googleapi.ServerResponse{
10426			Header:         res.Header,
10427			HTTPStatusCode: res.StatusCode,
10428		},
10429	}
10430	target := &ret
10431	if err := gensupport.DecodeResponse(target, res); err != nil {
10432		return nil, err
10433	}
10434	return ret, nil
10435	// {
10436	//   "description": "Retrieves a list of objects matching the criteria.",
10437	//   "httpMethod": "GET",
10438	//   "id": "storage.objects.list",
10439	//   "parameterOrder": [
10440	//     "bucket"
10441	//   ],
10442	//   "parameters": {
10443	//     "bucket": {
10444	//       "description": "Name of the bucket in which to look for objects.",
10445	//       "location": "path",
10446	//       "required": true,
10447	//       "type": "string"
10448	//     },
10449	//     "delimiter": {
10450	//       "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.",
10451	//       "location": "query",
10452	//       "type": "string"
10453	//     },
10454	//     "includeTrailingDelimiter": {
10455	//       "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
10456	//       "location": "query",
10457	//       "type": "boolean"
10458	//     },
10459	//     "maxResults": {
10460	//       "default": "1000",
10461	//       "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
10462	//       "format": "uint32",
10463	//       "location": "query",
10464	//       "minimum": "0",
10465	//       "type": "integer"
10466	//     },
10467	//     "pageToken": {
10468	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
10469	//       "location": "query",
10470	//       "type": "string"
10471	//     },
10472	//     "prefix": {
10473	//       "description": "Filter results to objects whose names begin with this prefix.",
10474	//       "location": "query",
10475	//       "type": "string"
10476	//     },
10477	//     "projection": {
10478	//       "description": "Set of properties to return. Defaults to noAcl.",
10479	//       "enum": [
10480	//         "full",
10481	//         "noAcl"
10482	//       ],
10483	//       "enumDescriptions": [
10484	//         "Include all properties.",
10485	//         "Omit the owner, acl property."
10486	//       ],
10487	//       "location": "query",
10488	//       "type": "string"
10489	//     },
10490	//     "provisionalUserProject": {
10491	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10492	//       "location": "query",
10493	//       "type": "string"
10494	//     },
10495	//     "userProject": {
10496	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10497	//       "location": "query",
10498	//       "type": "string"
10499	//     },
10500	//     "versions": {
10501	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
10502	//       "location": "query",
10503	//       "type": "boolean"
10504	//     }
10505	//   },
10506	//   "path": "b/{bucket}/o",
10507	//   "response": {
10508	//     "$ref": "Objects"
10509	//   },
10510	//   "scopes": [
10511	//     "https://www.googleapis.com/auth/cloud-platform",
10512	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10513	//     "https://www.googleapis.com/auth/devstorage.full_control",
10514	//     "https://www.googleapis.com/auth/devstorage.read_only",
10515	//     "https://www.googleapis.com/auth/devstorage.read_write"
10516	//   ],
10517	//   "supportsSubscription": true
10518	// }
10519
10520}
10521
10522// Pages invokes f for each page of results.
10523// A non-nil error returned from f will halt the iteration.
10524// The provided context supersedes any context provided to the Context method.
10525func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
10526	c.ctx_ = ctx
10527	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
10528	for {
10529		x, err := c.Do()
10530		if err != nil {
10531			return err
10532		}
10533		if err := f(x); err != nil {
10534			return err
10535		}
10536		if x.NextPageToken == "" {
10537			return nil
10538		}
10539		c.PageToken(x.NextPageToken)
10540	}
10541}
10542
10543// method id "storage.objects.patch":
10544
10545type ObjectsPatchCall struct {
10546	s          *Service
10547	bucket     string
10548	object     string
10549	object2    *Object
10550	urlParams_ gensupport.URLParams
10551	ctx_       context.Context
10552	header_    http.Header
10553}
10554
10555// Patch: Patches an object's metadata.
10556func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
10557	c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10558	c.bucket = bucket
10559	c.object = object
10560	c.object2 = object2
10561	return c
10562}
10563
10564// Generation sets the optional parameter "generation": If present,
10565// selects a specific revision of this object (as opposed to the latest
10566// version, the default).
10567func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
10568	c.urlParams_.Set("generation", fmt.Sprint(generation))
10569	return c
10570}
10571
10572// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10573// Makes the operation conditional on whether the object's current
10574// generation matches the given value. Setting to 0 makes the operation
10575// succeed only if there are no live versions of the object.
10576func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
10577	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10578	return c
10579}
10580
10581// IfGenerationNotMatch sets the optional parameter
10582// "ifGenerationNotMatch": Makes the operation conditional on whether
10583// the object's current generation does not match the given value. If no
10584// live object exists, the precondition fails. Setting to 0 makes the
10585// operation succeed only if there is a live version of the object.
10586func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
10587	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10588	return c
10589}
10590
10591// IfMetagenerationMatch sets the optional parameter
10592// "ifMetagenerationMatch": Makes the operation conditional on whether
10593// the object's current metageneration matches the given value.
10594func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall {
10595	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10596	return c
10597}
10598
10599// IfMetagenerationNotMatch sets the optional parameter
10600// "ifMetagenerationNotMatch": Makes the operation conditional on
10601// whether the object's current metageneration does not match the given
10602// value.
10603func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
10604	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10605	return c
10606}
10607
10608// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
10609// predefined set of access controls to this object.
10610//
10611// Possible values:
10612//   "authenticatedRead" - Object owner gets OWNER access, and
10613// allAuthenticatedUsers get READER access.
10614//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
10615// project team owners get OWNER access.
10616//   "bucketOwnerRead" - Object owner gets OWNER access, and project
10617// team owners get READER access.
10618//   "private" - Object owner gets OWNER access.
10619//   "projectPrivate" - Object owner gets OWNER access, and project team
10620// members get access according to their roles.
10621//   "publicRead" - Object owner gets OWNER access, and allUsers get
10622// READER access.
10623func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
10624	c.urlParams_.Set("predefinedAcl", predefinedAcl)
10625	return c
10626}
10627
10628// Projection sets the optional parameter "projection": Set of
10629// properties to return. Defaults to full.
10630//
10631// Possible values:
10632//   "full" - Include all properties.
10633//   "noAcl" - Omit the owner, acl property.
10634func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
10635	c.urlParams_.Set("projection", projection)
10636	return c
10637}
10638
10639// ProvisionalUserProject sets the optional parameter
10640// "provisionalUserProject": The project to be billed for this request
10641// if the target bucket is requester-pays bucket.
10642func (c *ObjectsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsPatchCall {
10643	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
10644	return c
10645}
10646
10647// UserProject sets the optional parameter "userProject": The project to
10648// be billed for this request, for Requester Pays buckets.
10649func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
10650	c.urlParams_.Set("userProject", userProject)
10651	return c
10652}
10653
10654// Fields allows partial responses to be retrieved. See
10655// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10656// for more information.
10657func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
10658	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10659	return c
10660}
10661
10662// Context sets the context to be used in this call's Do method. Any
10663// pending HTTP request will be aborted if the provided context is
10664// canceled.
10665func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
10666	c.ctx_ = ctx
10667	return c
10668}
10669
10670// Header returns an http.Header that can be modified by the caller to
10671// add HTTP headers to the request.
10672func (c *ObjectsPatchCall) Header() http.Header {
10673	if c.header_ == nil {
10674		c.header_ = make(http.Header)
10675	}
10676	return c.header_
10677}
10678
10679func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
10680	reqHeaders := make(http.Header)
10681	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
10682	for k, v := range c.header_ {
10683		reqHeaders[k] = v
10684	}
10685	reqHeaders.Set("User-Agent", c.s.userAgent())
10686	var body io.Reader = nil
10687	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
10688	if err != nil {
10689		return nil, err
10690	}
10691	reqHeaders.Set("Content-Type", "application/json")
10692	c.urlParams_.Set("alt", alt)
10693	c.urlParams_.Set("prettyPrint", "false")
10694	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
10695	urls += "?" + c.urlParams_.Encode()
10696	req, err := http.NewRequest("PATCH", urls, body)
10697	if err != nil {
10698		return nil, err
10699	}
10700	req.Header = reqHeaders
10701	googleapi.Expand(req.URL, map[string]string{
10702		"bucket": c.bucket,
10703		"object": c.object,
10704	})
10705	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10706}
10707
10708// Do executes the "storage.objects.patch" call.
10709// Exactly one of *Object or error will be non-nil. Any non-2xx status
10710// code is an error. Response headers are in either
10711// *Object.ServerResponse.Header or (if a response was returned at all)
10712// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10713// check whether the returned error was because http.StatusNotModified
10714// was returned.
10715func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
10716	gensupport.SetOptions(c.urlParams_, opts...)
10717	res, err := c.doRequest("json")
10718	if res != nil && res.StatusCode == http.StatusNotModified {
10719		if res.Body != nil {
10720			res.Body.Close()
10721		}
10722		return nil, &googleapi.Error{
10723			Code:   res.StatusCode,
10724			Header: res.Header,
10725		}
10726	}
10727	if err != nil {
10728		return nil, err
10729	}
10730	defer googleapi.CloseBody(res)
10731	if err := googleapi.CheckResponse(res); err != nil {
10732		return nil, err
10733	}
10734	ret := &Object{
10735		ServerResponse: googleapi.ServerResponse{
10736			Header:         res.Header,
10737			HTTPStatusCode: res.StatusCode,
10738		},
10739	}
10740	target := &ret
10741	if err := gensupport.DecodeResponse(target, res); err != nil {
10742		return nil, err
10743	}
10744	return ret, nil
10745	// {
10746	//   "description": "Patches an object's metadata.",
10747	//   "httpMethod": "PATCH",
10748	//   "id": "storage.objects.patch",
10749	//   "parameterOrder": [
10750	//     "bucket",
10751	//     "object"
10752	//   ],
10753	//   "parameters": {
10754	//     "bucket": {
10755	//       "description": "Name of the bucket in which the object resides.",
10756	//       "location": "path",
10757	//       "required": true,
10758	//       "type": "string"
10759	//     },
10760	//     "generation": {
10761	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10762	//       "format": "int64",
10763	//       "location": "query",
10764	//       "type": "string"
10765	//     },
10766	//     "ifGenerationMatch": {
10767	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
10768	//       "format": "int64",
10769	//       "location": "query",
10770	//       "type": "string"
10771	//     },
10772	//     "ifGenerationNotMatch": {
10773	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
10774	//       "format": "int64",
10775	//       "location": "query",
10776	//       "type": "string"
10777	//     },
10778	//     "ifMetagenerationMatch": {
10779	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10780	//       "format": "int64",
10781	//       "location": "query",
10782	//       "type": "string"
10783	//     },
10784	//     "ifMetagenerationNotMatch": {
10785	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10786	//       "format": "int64",
10787	//       "location": "query",
10788	//       "type": "string"
10789	//     },
10790	//     "object": {
10791	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10792	//       "location": "path",
10793	//       "required": true,
10794	//       "type": "string"
10795	//     },
10796	//     "predefinedAcl": {
10797	//       "description": "Apply a predefined set of access controls to this object.",
10798	//       "enum": [
10799	//         "authenticatedRead",
10800	//         "bucketOwnerFullControl",
10801	//         "bucketOwnerRead",
10802	//         "private",
10803	//         "projectPrivate",
10804	//         "publicRead"
10805	//       ],
10806	//       "enumDescriptions": [
10807	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10808	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
10809	//         "Object owner gets OWNER access, and project team owners get READER access.",
10810	//         "Object owner gets OWNER access.",
10811	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
10812	//         "Object owner gets OWNER access, and allUsers get READER access."
10813	//       ],
10814	//       "location": "query",
10815	//       "type": "string"
10816	//     },
10817	//     "projection": {
10818	//       "description": "Set of properties to return. Defaults to full.",
10819	//       "enum": [
10820	//         "full",
10821	//         "noAcl"
10822	//       ],
10823	//       "enumDescriptions": [
10824	//         "Include all properties.",
10825	//         "Omit the owner, acl property."
10826	//       ],
10827	//       "location": "query",
10828	//       "type": "string"
10829	//     },
10830	//     "provisionalUserProject": {
10831	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10832	//       "location": "query",
10833	//       "type": "string"
10834	//     },
10835	//     "userProject": {
10836	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
10837	//       "location": "query",
10838	//       "type": "string"
10839	//     }
10840	//   },
10841	//   "path": "b/{bucket}/o/{object}",
10842	//   "request": {
10843	//     "$ref": "Object"
10844	//   },
10845	//   "response": {
10846	//     "$ref": "Object"
10847	//   },
10848	//   "scopes": [
10849	//     "https://www.googleapis.com/auth/cloud-platform",
10850	//     "https://www.googleapis.com/auth/devstorage.full_control"
10851	//   ]
10852	// }
10853
10854}
10855
10856// method id "storage.objects.rewrite":
10857
10858type ObjectsRewriteCall struct {
10859	s                 *Service
10860	sourceBucket      string
10861	sourceObject      string
10862	destinationBucket string
10863	destinationObject string
10864	object            *Object
10865	urlParams_        gensupport.URLParams
10866	ctx_              context.Context
10867	header_           http.Header
10868}
10869
10870// Rewrite: Rewrites a source object to a destination object. Optionally
10871// overrides metadata.
10872func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall {
10873	c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10874	c.sourceBucket = sourceBucket
10875	c.sourceObject = sourceObject
10876	c.destinationBucket = destinationBucket
10877	c.destinationObject = destinationObject
10878	c.object = object
10879	return c
10880}
10881
10882// DestinationKmsKeyName sets the optional parameter
10883// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the
10884// form
10885// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
10886//  that will be used to encrypt the object. Overrides the object
10887// metadata's kms_key_name value, if any.
10888func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall {
10889	c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
10890	return c
10891}
10892
10893// DestinationPredefinedAcl sets the optional parameter
10894// "destinationPredefinedAcl": Apply a predefined set of access controls
10895// to the destination object.
10896//
10897// Possible values:
10898//   "authenticatedRead" - Object owner gets OWNER access, and
10899// allAuthenticatedUsers get READER access.
10900//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
10901// project team owners get OWNER access.
10902//   "bucketOwnerRead" - Object owner gets OWNER access, and project
10903// team owners get READER access.
10904//   "private" - Object owner gets OWNER access.
10905//   "projectPrivate" - Object owner gets OWNER access, and project team
10906// members get access according to their roles.
10907//   "publicRead" - Object owner gets OWNER access, and allUsers get
10908// READER access.
10909func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
10910	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
10911	return c
10912}
10913
10914// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10915// Makes the operation conditional on whether the object's current
10916// generation matches the given value. Setting to 0 makes the operation
10917// succeed only if there are no live versions of the object.
10918func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
10919	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10920	return c
10921}
10922
10923// IfGenerationNotMatch sets the optional parameter
10924// "ifGenerationNotMatch": Makes the operation conditional on whether
10925// the object's current generation does not match the given value. If no
10926// live object exists, the precondition fails. Setting to 0 makes the
10927// operation succeed only if there is a live version of the object.
10928func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
10929	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10930	return c
10931}
10932
10933// IfMetagenerationMatch sets the optional parameter
10934// "ifMetagenerationMatch": Makes the operation conditional on whether
10935// the destination object's current metageneration matches the given
10936// value.
10937func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
10938	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10939	return c
10940}
10941
10942// IfMetagenerationNotMatch sets the optional parameter
10943// "ifMetagenerationNotMatch": Makes the operation conditional on
10944// whether the destination object's current metageneration does not
10945// match the given value.
10946func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall {
10947	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10948	return c
10949}
10950
10951// IfSourceGenerationMatch sets the optional parameter
10952// "ifSourceGenerationMatch": Makes the operation conditional on whether
10953// the source object's current generation matches the given value.
10954func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
10955	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
10956	return c
10957}
10958
10959// IfSourceGenerationNotMatch sets the optional parameter
10960// "ifSourceGenerationNotMatch": Makes the operation conditional on
10961// whether the source object's current generation does not match the
10962// given value.
10963func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
10964	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
10965	return c
10966}
10967
10968// IfSourceMetagenerationMatch sets the optional parameter
10969// "ifSourceMetagenerationMatch": Makes the operation conditional on
10970// whether the source object's current metageneration matches the given
10971// value.
10972func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
10973	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
10974	return c
10975}
10976
10977// IfSourceMetagenerationNotMatch sets the optional parameter
10978// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
10979// whether the source object's current metageneration does not match the
10980// given value.
10981func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
10982	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
10983	return c
10984}
10985
10986// MaxBytesRewrittenPerCall sets the optional parameter
10987// "maxBytesRewrittenPerCall": The maximum number of bytes that will be
10988// rewritten per rewrite request. Most callers shouldn't need to specify
10989// this parameter - it is primarily in place to support testing. If
10990// specified the value must be an integral multiple of 1 MiB (1048576).
10991// Also, this only applies to requests where the source and destination
10992// span locations and/or storage classes. Finally, this value must not
10993// change across rewrite calls else you'll get an error that the
10994// rewriteToken is invalid.
10995func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall {
10996	c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall))
10997	return c
10998}
10999
11000// Projection sets the optional parameter "projection": Set of
11001// properties to return. Defaults to noAcl, unless the object resource
11002// specifies the acl property, when it defaults to full.
11003//
11004// Possible values:
11005//   "full" - Include all properties.
11006//   "noAcl" - Omit the owner, acl property.
11007func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall {
11008	c.urlParams_.Set("projection", projection)
11009	return c
11010}
11011
11012// ProvisionalUserProject sets the optional parameter
11013// "provisionalUserProject": The project to be billed for this request
11014// if the target bucket is requester-pays bucket.
11015func (c *ObjectsRewriteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsRewriteCall {
11016	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11017	return c
11018}
11019
11020// RewriteToken sets the optional parameter "rewriteToken": Include this
11021// field (from the previous rewrite response) on each rewrite request
11022// after the first one, until the rewrite response 'done' flag is true.
11023// Calls that provide a rewriteToken can omit all other request fields,
11024// but if included those fields must match the values provided in the
11025// first rewrite request.
11026func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall {
11027	c.urlParams_.Set("rewriteToken", rewriteToken)
11028	return c
11029}
11030
11031// SourceGeneration sets the optional parameter "sourceGeneration": If
11032// present, selects a specific revision of the source object (as opposed
11033// to the latest version, the default).
11034func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall {
11035	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
11036	return c
11037}
11038
11039// UserProject sets the optional parameter "userProject": The project to
11040// be billed for this request. Required for Requester Pays buckets.
11041func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
11042	c.urlParams_.Set("userProject", userProject)
11043	return c
11044}
11045
11046// Fields allows partial responses to be retrieved. See
11047// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11048// for more information.
11049func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall {
11050	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11051	return c
11052}
11053
11054// Context sets the context to be used in this call's Do method. Any
11055// pending HTTP request will be aborted if the provided context is
11056// canceled.
11057func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
11058	c.ctx_ = ctx
11059	return c
11060}
11061
11062// Header returns an http.Header that can be modified by the caller to
11063// add HTTP headers to the request.
11064func (c *ObjectsRewriteCall) Header() http.Header {
11065	if c.header_ == nil {
11066		c.header_ = make(http.Header)
11067	}
11068	return c.header_
11069}
11070
11071func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
11072	reqHeaders := make(http.Header)
11073	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
11074	for k, v := range c.header_ {
11075		reqHeaders[k] = v
11076	}
11077	reqHeaders.Set("User-Agent", c.s.userAgent())
11078	var body io.Reader = nil
11079	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
11080	if err != nil {
11081		return nil, err
11082	}
11083	reqHeaders.Set("Content-Type", "application/json")
11084	c.urlParams_.Set("alt", alt)
11085	c.urlParams_.Set("prettyPrint", "false")
11086	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}")
11087	urls += "?" + c.urlParams_.Encode()
11088	req, err := http.NewRequest("POST", urls, body)
11089	if err != nil {
11090		return nil, err
11091	}
11092	req.Header = reqHeaders
11093	googleapi.Expand(req.URL, map[string]string{
11094		"sourceBucket":      c.sourceBucket,
11095		"sourceObject":      c.sourceObject,
11096		"destinationBucket": c.destinationBucket,
11097		"destinationObject": c.destinationObject,
11098	})
11099	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11100}
11101
11102// Do executes the "storage.objects.rewrite" call.
11103// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx
11104// status code is an error. Response headers are in either
11105// *RewriteResponse.ServerResponse.Header or (if a response was returned
11106// at all) in error.(*googleapi.Error).Header. Use
11107// googleapi.IsNotModified to check whether the returned error was
11108// because http.StatusNotModified was returned.
11109func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) {
11110	gensupport.SetOptions(c.urlParams_, opts...)
11111	res, err := c.doRequest("json")
11112	if res != nil && res.StatusCode == http.StatusNotModified {
11113		if res.Body != nil {
11114			res.Body.Close()
11115		}
11116		return nil, &googleapi.Error{
11117			Code:   res.StatusCode,
11118			Header: res.Header,
11119		}
11120	}
11121	if err != nil {
11122		return nil, err
11123	}
11124	defer googleapi.CloseBody(res)
11125	if err := googleapi.CheckResponse(res); err != nil {
11126		return nil, err
11127	}
11128	ret := &RewriteResponse{
11129		ServerResponse: googleapi.ServerResponse{
11130			Header:         res.Header,
11131			HTTPStatusCode: res.StatusCode,
11132		},
11133	}
11134	target := &ret
11135	if err := gensupport.DecodeResponse(target, res); err != nil {
11136		return nil, err
11137	}
11138	return ret, nil
11139	// {
11140	//   "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
11141	//   "httpMethod": "POST",
11142	//   "id": "storage.objects.rewrite",
11143	//   "parameterOrder": [
11144	//     "sourceBucket",
11145	//     "sourceObject",
11146	//     "destinationBucket",
11147	//     "destinationObject"
11148	//   ],
11149	//   "parameters": {
11150	//     "destinationBucket": {
11151	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
11152	//       "location": "path",
11153	//       "required": true,
11154	//       "type": "string"
11155	//     },
11156	//     "destinationKmsKeyName": {
11157	//       "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
11158	//       "location": "query",
11159	//       "type": "string"
11160	//     },
11161	//     "destinationObject": {
11162	//       "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11163	//       "location": "path",
11164	//       "required": true,
11165	//       "type": "string"
11166	//     },
11167	//     "destinationPredefinedAcl": {
11168	//       "description": "Apply a predefined set of access controls to the destination object.",
11169	//       "enum": [
11170	//         "authenticatedRead",
11171	//         "bucketOwnerFullControl",
11172	//         "bucketOwnerRead",
11173	//         "private",
11174	//         "projectPrivate",
11175	//         "publicRead"
11176	//       ],
11177	//       "enumDescriptions": [
11178	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
11179	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
11180	//         "Object owner gets OWNER access, and project team owners get READER access.",
11181	//         "Object owner gets OWNER access.",
11182	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
11183	//         "Object owner gets OWNER access, and allUsers get READER access."
11184	//       ],
11185	//       "location": "query",
11186	//       "type": "string"
11187	//     },
11188	//     "ifGenerationMatch": {
11189	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
11190	//       "format": "int64",
11191	//       "location": "query",
11192	//       "type": "string"
11193	//     },
11194	//     "ifGenerationNotMatch": {
11195	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
11196	//       "format": "int64",
11197	//       "location": "query",
11198	//       "type": "string"
11199	//     },
11200	//     "ifMetagenerationMatch": {
11201	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
11202	//       "format": "int64",
11203	//       "location": "query",
11204	//       "type": "string"
11205	//     },
11206	//     "ifMetagenerationNotMatch": {
11207	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
11208	//       "format": "int64",
11209	//       "location": "query",
11210	//       "type": "string"
11211	//     },
11212	//     "ifSourceGenerationMatch": {
11213	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
11214	//       "format": "int64",
11215	//       "location": "query",
11216	//       "type": "string"
11217	//     },
11218	//     "ifSourceGenerationNotMatch": {
11219	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
11220	//       "format": "int64",
11221	//       "location": "query",
11222	//       "type": "string"
11223	//     },
11224	//     "ifSourceMetagenerationMatch": {
11225	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
11226	//       "format": "int64",
11227	//       "location": "query",
11228	//       "type": "string"
11229	//     },
11230	//     "ifSourceMetagenerationNotMatch": {
11231	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
11232	//       "format": "int64",
11233	//       "location": "query",
11234	//       "type": "string"
11235	//     },
11236	//     "maxBytesRewrittenPerCall": {
11237	//       "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.",
11238	//       "format": "int64",
11239	//       "location": "query",
11240	//       "type": "string"
11241	//     },
11242	//     "projection": {
11243	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
11244	//       "enum": [
11245	//         "full",
11246	//         "noAcl"
11247	//       ],
11248	//       "enumDescriptions": [
11249	//         "Include all properties.",
11250	//         "Omit the owner, acl property."
11251	//       ],
11252	//       "location": "query",
11253	//       "type": "string"
11254	//     },
11255	//     "provisionalUserProject": {
11256	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11257	//       "location": "query",
11258	//       "type": "string"
11259	//     },
11260	//     "rewriteToken": {
11261	//       "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.",
11262	//       "location": "query",
11263	//       "type": "string"
11264	//     },
11265	//     "sourceBucket": {
11266	//       "description": "Name of the bucket in which to find the source object.",
11267	//       "location": "path",
11268	//       "required": true,
11269	//       "type": "string"
11270	//     },
11271	//     "sourceGeneration": {
11272	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
11273	//       "format": "int64",
11274	//       "location": "query",
11275	//       "type": "string"
11276	//     },
11277	//     "sourceObject": {
11278	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11279	//       "location": "path",
11280	//       "required": true,
11281	//       "type": "string"
11282	//     },
11283	//     "userProject": {
11284	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11285	//       "location": "query",
11286	//       "type": "string"
11287	//     }
11288	//   },
11289	//   "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
11290	//   "request": {
11291	//     "$ref": "Object"
11292	//   },
11293	//   "response": {
11294	//     "$ref": "RewriteResponse"
11295	//   },
11296	//   "scopes": [
11297	//     "https://www.googleapis.com/auth/cloud-platform",
11298	//     "https://www.googleapis.com/auth/devstorage.full_control",
11299	//     "https://www.googleapis.com/auth/devstorage.read_write"
11300	//   ]
11301	// }
11302
11303}
11304
11305// method id "storage.objects.setIamPolicy":
11306
11307type ObjectsSetIamPolicyCall struct {
11308	s          *Service
11309	bucket     string
11310	object     string
11311	policy     *Policy
11312	urlParams_ gensupport.URLParams
11313	ctx_       context.Context
11314	header_    http.Header
11315}
11316
11317// SetIamPolicy: Updates an IAM policy for the specified object.
11318func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall {
11319	c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11320	c.bucket = bucket
11321	c.object = object
11322	c.policy = policy
11323	return c
11324}
11325
11326// Generation sets the optional parameter "generation": If present,
11327// selects a specific revision of this object (as opposed to the latest
11328// version, the default).
11329func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall {
11330	c.urlParams_.Set("generation", fmt.Sprint(generation))
11331	return c
11332}
11333
11334// ProvisionalUserProject sets the optional parameter
11335// "provisionalUserProject": The project to be billed for this request
11336// if the target bucket is requester-pays bucket.
11337func (c *ObjectsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsSetIamPolicyCall {
11338	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11339	return c
11340}
11341
11342// UserProject sets the optional parameter "userProject": The project to
11343// be billed for this request. Required for Requester Pays buckets.
11344func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
11345	c.urlParams_.Set("userProject", userProject)
11346	return c
11347}
11348
11349// Fields allows partial responses to be retrieved. See
11350// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11351// for more information.
11352func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall {
11353	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11354	return c
11355}
11356
11357// Context sets the context to be used in this call's Do method. Any
11358// pending HTTP request will be aborted if the provided context is
11359// canceled.
11360func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
11361	c.ctx_ = ctx
11362	return c
11363}
11364
11365// Header returns an http.Header that can be modified by the caller to
11366// add HTTP headers to the request.
11367func (c *ObjectsSetIamPolicyCall) Header() http.Header {
11368	if c.header_ == nil {
11369		c.header_ = make(http.Header)
11370	}
11371	return c.header_
11372}
11373
11374func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11375	reqHeaders := make(http.Header)
11376	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
11377	for k, v := range c.header_ {
11378		reqHeaders[k] = v
11379	}
11380	reqHeaders.Set("User-Agent", c.s.userAgent())
11381	var body io.Reader = nil
11382	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
11383	if err != nil {
11384		return nil, err
11385	}
11386	reqHeaders.Set("Content-Type", "application/json")
11387	c.urlParams_.Set("alt", alt)
11388	c.urlParams_.Set("prettyPrint", "false")
11389	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
11390	urls += "?" + c.urlParams_.Encode()
11391	req, err := http.NewRequest("PUT", urls, body)
11392	if err != nil {
11393		return nil, err
11394	}
11395	req.Header = reqHeaders
11396	googleapi.Expand(req.URL, map[string]string{
11397		"bucket": c.bucket,
11398		"object": c.object,
11399	})
11400	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11401}
11402
11403// Do executes the "storage.objects.setIamPolicy" call.
11404// Exactly one of *Policy or error will be non-nil. Any non-2xx status
11405// code is an error. Response headers are in either
11406// *Policy.ServerResponse.Header or (if a response was returned at all)
11407// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11408// check whether the returned error was because http.StatusNotModified
11409// was returned.
11410func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11411	gensupport.SetOptions(c.urlParams_, opts...)
11412	res, err := c.doRequest("json")
11413	if res != nil && res.StatusCode == http.StatusNotModified {
11414		if res.Body != nil {
11415			res.Body.Close()
11416		}
11417		return nil, &googleapi.Error{
11418			Code:   res.StatusCode,
11419			Header: res.Header,
11420		}
11421	}
11422	if err != nil {
11423		return nil, err
11424	}
11425	defer googleapi.CloseBody(res)
11426	if err := googleapi.CheckResponse(res); err != nil {
11427		return nil, err
11428	}
11429	ret := &Policy{
11430		ServerResponse: googleapi.ServerResponse{
11431			Header:         res.Header,
11432			HTTPStatusCode: res.StatusCode,
11433		},
11434	}
11435	target := &ret
11436	if err := gensupport.DecodeResponse(target, res); err != nil {
11437		return nil, err
11438	}
11439	return ret, nil
11440	// {
11441	//   "description": "Updates an IAM policy for the specified object.",
11442	//   "httpMethod": "PUT",
11443	//   "id": "storage.objects.setIamPolicy",
11444	//   "parameterOrder": [
11445	//     "bucket",
11446	//     "object"
11447	//   ],
11448	//   "parameters": {
11449	//     "bucket": {
11450	//       "description": "Name of the bucket in which the object resides.",
11451	//       "location": "path",
11452	//       "required": true,
11453	//       "type": "string"
11454	//     },
11455	//     "generation": {
11456	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11457	//       "format": "int64",
11458	//       "location": "query",
11459	//       "type": "string"
11460	//     },
11461	//     "object": {
11462	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11463	//       "location": "path",
11464	//       "required": true,
11465	//       "type": "string"
11466	//     },
11467	//     "provisionalUserProject": {
11468	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11469	//       "location": "query",
11470	//       "type": "string"
11471	//     },
11472	//     "userProject": {
11473	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11474	//       "location": "query",
11475	//       "type": "string"
11476	//     }
11477	//   },
11478	//   "path": "b/{bucket}/o/{object}/iam",
11479	//   "request": {
11480	//     "$ref": "Policy"
11481	//   },
11482	//   "response": {
11483	//     "$ref": "Policy"
11484	//   },
11485	//   "scopes": [
11486	//     "https://www.googleapis.com/auth/cloud-platform",
11487	//     "https://www.googleapis.com/auth/devstorage.full_control",
11488	//     "https://www.googleapis.com/auth/devstorage.read_write"
11489	//   ]
11490	// }
11491
11492}
11493
11494// method id "storage.objects.testIamPermissions":
11495
11496type ObjectsTestIamPermissionsCall struct {
11497	s            *Service
11498	bucket       string
11499	object       string
11500	urlParams_   gensupport.URLParams
11501	ifNoneMatch_ string
11502	ctx_         context.Context
11503	header_      http.Header
11504}
11505
11506// TestIamPermissions: Tests a set of permissions on the given object to
11507// see which, if any, are held by the caller.
11508func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall {
11509	c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11510	c.bucket = bucket
11511	c.object = object
11512	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
11513	return c
11514}
11515
11516// Generation sets the optional parameter "generation": If present,
11517// selects a specific revision of this object (as opposed to the latest
11518// version, the default).
11519func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall {
11520	c.urlParams_.Set("generation", fmt.Sprint(generation))
11521	return c
11522}
11523
11524// ProvisionalUserProject sets the optional parameter
11525// "provisionalUserProject": The project to be billed for this request
11526// if the target bucket is requester-pays bucket.
11527func (c *ObjectsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsTestIamPermissionsCall {
11528	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11529	return c
11530}
11531
11532// UserProject sets the optional parameter "userProject": The project to
11533// be billed for this request. Required for Requester Pays buckets.
11534func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
11535	c.urlParams_.Set("userProject", userProject)
11536	return c
11537}
11538
11539// Fields allows partial responses to be retrieved. See
11540// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11541// for more information.
11542func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall {
11543	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11544	return c
11545}
11546
11547// IfNoneMatch sets the optional parameter which makes the operation
11548// fail if the object's ETag matches the given value. This is useful for
11549// getting updates only after the object has changed since the last
11550// request. Use googleapi.IsNotModified to check whether the response
11551// error from Do is the result of In-None-Match.
11552func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall {
11553	c.ifNoneMatch_ = entityTag
11554	return c
11555}
11556
11557// Context sets the context to be used in this call's Do method. Any
11558// pending HTTP request will be aborted if the provided context is
11559// canceled.
11560func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
11561	c.ctx_ = ctx
11562	return c
11563}
11564
11565// Header returns an http.Header that can be modified by the caller to
11566// add HTTP headers to the request.
11567func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
11568	if c.header_ == nil {
11569		c.header_ = make(http.Header)
11570	}
11571	return c.header_
11572}
11573
11574func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
11575	reqHeaders := make(http.Header)
11576	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
11577	for k, v := range c.header_ {
11578		reqHeaders[k] = v
11579	}
11580	reqHeaders.Set("User-Agent", c.s.userAgent())
11581	if c.ifNoneMatch_ != "" {
11582		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11583	}
11584	var body io.Reader = nil
11585	c.urlParams_.Set("alt", alt)
11586	c.urlParams_.Set("prettyPrint", "false")
11587	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions")
11588	urls += "?" + c.urlParams_.Encode()
11589	req, err := http.NewRequest("GET", urls, body)
11590	if err != nil {
11591		return nil, err
11592	}
11593	req.Header = reqHeaders
11594	googleapi.Expand(req.URL, map[string]string{
11595		"bucket": c.bucket,
11596		"object": c.object,
11597	})
11598	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11599}
11600
11601// Do executes the "storage.objects.testIamPermissions" call.
11602// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
11603// Any non-2xx status code is an error. Response headers are in either
11604// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
11605// was returned at all) in error.(*googleapi.Error).Header. Use
11606// googleapi.IsNotModified to check whether the returned error was
11607// because http.StatusNotModified was returned.
11608func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
11609	gensupport.SetOptions(c.urlParams_, opts...)
11610	res, err := c.doRequest("json")
11611	if res != nil && res.StatusCode == http.StatusNotModified {
11612		if res.Body != nil {
11613			res.Body.Close()
11614		}
11615		return nil, &googleapi.Error{
11616			Code:   res.StatusCode,
11617			Header: res.Header,
11618		}
11619	}
11620	if err != nil {
11621		return nil, err
11622	}
11623	defer googleapi.CloseBody(res)
11624	if err := googleapi.CheckResponse(res); err != nil {
11625		return nil, err
11626	}
11627	ret := &TestIamPermissionsResponse{
11628		ServerResponse: googleapi.ServerResponse{
11629			Header:         res.Header,
11630			HTTPStatusCode: res.StatusCode,
11631		},
11632	}
11633	target := &ret
11634	if err := gensupport.DecodeResponse(target, res); err != nil {
11635		return nil, err
11636	}
11637	return ret, nil
11638	// {
11639	//   "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
11640	//   "httpMethod": "GET",
11641	//   "id": "storage.objects.testIamPermissions",
11642	//   "parameterOrder": [
11643	//     "bucket",
11644	//     "object",
11645	//     "permissions"
11646	//   ],
11647	//   "parameters": {
11648	//     "bucket": {
11649	//       "description": "Name of the bucket in which the object resides.",
11650	//       "location": "path",
11651	//       "required": true,
11652	//       "type": "string"
11653	//     },
11654	//     "generation": {
11655	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11656	//       "format": "int64",
11657	//       "location": "query",
11658	//       "type": "string"
11659	//     },
11660	//     "object": {
11661	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11662	//       "location": "path",
11663	//       "required": true,
11664	//       "type": "string"
11665	//     },
11666	//     "permissions": {
11667	//       "description": "Permissions to test.",
11668	//       "location": "query",
11669	//       "repeated": true,
11670	//       "required": true,
11671	//       "type": "string"
11672	//     },
11673	//     "provisionalUserProject": {
11674	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11675	//       "location": "query",
11676	//       "type": "string"
11677	//     },
11678	//     "userProject": {
11679	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11680	//       "location": "query",
11681	//       "type": "string"
11682	//     }
11683	//   },
11684	//   "path": "b/{bucket}/o/{object}/iam/testPermissions",
11685	//   "response": {
11686	//     "$ref": "TestIamPermissionsResponse"
11687	//   },
11688	//   "scopes": [
11689	//     "https://www.googleapis.com/auth/cloud-platform",
11690	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11691	//     "https://www.googleapis.com/auth/devstorage.full_control",
11692	//     "https://www.googleapis.com/auth/devstorage.read_only",
11693	//     "https://www.googleapis.com/auth/devstorage.read_write"
11694	//   ]
11695	// }
11696
11697}
11698
11699// method id "storage.objects.update":
11700
11701type ObjectsUpdateCall struct {
11702	s          *Service
11703	bucket     string
11704	object     string
11705	object2    *Object
11706	urlParams_ gensupport.URLParams
11707	ctx_       context.Context
11708	header_    http.Header
11709}
11710
11711// Update: Updates an object's metadata.
11712func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
11713	c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11714	c.bucket = bucket
11715	c.object = object
11716	c.object2 = object2
11717	return c
11718}
11719
11720// Generation sets the optional parameter "generation": If present,
11721// selects a specific revision of this object (as opposed to the latest
11722// version, the default).
11723func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
11724	c.urlParams_.Set("generation", fmt.Sprint(generation))
11725	return c
11726}
11727
11728// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
11729// Makes the operation conditional on whether the object's current
11730// generation matches the given value. Setting to 0 makes the operation
11731// succeed only if there are no live versions of the object.
11732func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
11733	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
11734	return c
11735}
11736
11737// IfGenerationNotMatch sets the optional parameter
11738// "ifGenerationNotMatch": Makes the operation conditional on whether
11739// the object's current generation does not match the given value. If no
11740// live object exists, the precondition fails. Setting to 0 makes the
11741// operation succeed only if there is a live version of the object.
11742func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
11743	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
11744	return c
11745}
11746
11747// IfMetagenerationMatch sets the optional parameter
11748// "ifMetagenerationMatch": Makes the operation conditional on whether
11749// the object's current metageneration matches the given value.
11750func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall {
11751	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
11752	return c
11753}
11754
11755// IfMetagenerationNotMatch sets the optional parameter
11756// "ifMetagenerationNotMatch": Makes the operation conditional on
11757// whether the object's current metageneration does not match the given
11758// value.
11759func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
11760	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
11761	return c
11762}
11763
11764// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
11765// predefined set of access controls to this object.
11766//
11767// Possible values:
11768//   "authenticatedRead" - Object owner gets OWNER access, and
11769// allAuthenticatedUsers get READER access.
11770//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
11771// project team owners get OWNER access.
11772//   "bucketOwnerRead" - Object owner gets OWNER access, and project
11773// team owners get READER access.
11774//   "private" - Object owner gets OWNER access.
11775//   "projectPrivate" - Object owner gets OWNER access, and project team
11776// members get access according to their roles.
11777//   "publicRead" - Object owner gets OWNER access, and allUsers get
11778// READER access.
11779func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
11780	c.urlParams_.Set("predefinedAcl", predefinedAcl)
11781	return c
11782}
11783
11784// Projection sets the optional parameter "projection": Set of
11785// properties to return. Defaults to full.
11786//
11787// Possible values:
11788//   "full" - Include all properties.
11789//   "noAcl" - Omit the owner, acl property.
11790func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
11791	c.urlParams_.Set("projection", projection)
11792	return c
11793}
11794
11795// ProvisionalUserProject sets the optional parameter
11796// "provisionalUserProject": The project to be billed for this request
11797// if the target bucket is requester-pays bucket.
11798func (c *ObjectsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsUpdateCall {
11799	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11800	return c
11801}
11802
11803// UserProject sets the optional parameter "userProject": The project to
11804// be billed for this request. Required for Requester Pays buckets.
11805func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
11806	c.urlParams_.Set("userProject", userProject)
11807	return c
11808}
11809
11810// Fields allows partial responses to be retrieved. See
11811// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11812// for more information.
11813func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
11814	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11815	return c
11816}
11817
11818// Context sets the context to be used in this call's Do method. Any
11819// pending HTTP request will be aborted if the provided context is
11820// canceled.
11821func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
11822	c.ctx_ = ctx
11823	return c
11824}
11825
11826// Header returns an http.Header that can be modified by the caller to
11827// add HTTP headers to the request.
11828func (c *ObjectsUpdateCall) Header() http.Header {
11829	if c.header_ == nil {
11830		c.header_ = make(http.Header)
11831	}
11832	return c.header_
11833}
11834
11835func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
11836	reqHeaders := make(http.Header)
11837	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
11838	for k, v := range c.header_ {
11839		reqHeaders[k] = v
11840	}
11841	reqHeaders.Set("User-Agent", c.s.userAgent())
11842	var body io.Reader = nil
11843	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
11844	if err != nil {
11845		return nil, err
11846	}
11847	reqHeaders.Set("Content-Type", "application/json")
11848	c.urlParams_.Set("alt", alt)
11849	c.urlParams_.Set("prettyPrint", "false")
11850	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
11851	urls += "?" + c.urlParams_.Encode()
11852	req, err := http.NewRequest("PUT", urls, body)
11853	if err != nil {
11854		return nil, err
11855	}
11856	req.Header = reqHeaders
11857	googleapi.Expand(req.URL, map[string]string{
11858		"bucket": c.bucket,
11859		"object": c.object,
11860	})
11861	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11862}
11863
11864// Do executes the "storage.objects.update" call.
11865// Exactly one of *Object or error will be non-nil. Any non-2xx status
11866// code is an error. Response headers are in either
11867// *Object.ServerResponse.Header or (if a response was returned at all)
11868// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11869// check whether the returned error was because http.StatusNotModified
11870// was returned.
11871func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
11872	gensupport.SetOptions(c.urlParams_, opts...)
11873	res, err := c.doRequest("json")
11874	if res != nil && res.StatusCode == http.StatusNotModified {
11875		if res.Body != nil {
11876			res.Body.Close()
11877		}
11878		return nil, &googleapi.Error{
11879			Code:   res.StatusCode,
11880			Header: res.Header,
11881		}
11882	}
11883	if err != nil {
11884		return nil, err
11885	}
11886	defer googleapi.CloseBody(res)
11887	if err := googleapi.CheckResponse(res); err != nil {
11888		return nil, err
11889	}
11890	ret := &Object{
11891		ServerResponse: googleapi.ServerResponse{
11892			Header:         res.Header,
11893			HTTPStatusCode: res.StatusCode,
11894		},
11895	}
11896	target := &ret
11897	if err := gensupport.DecodeResponse(target, res); err != nil {
11898		return nil, err
11899	}
11900	return ret, nil
11901	// {
11902	//   "description": "Updates an object's metadata.",
11903	//   "httpMethod": "PUT",
11904	//   "id": "storage.objects.update",
11905	//   "parameterOrder": [
11906	//     "bucket",
11907	//     "object"
11908	//   ],
11909	//   "parameters": {
11910	//     "bucket": {
11911	//       "description": "Name of the bucket in which the object resides.",
11912	//       "location": "path",
11913	//       "required": true,
11914	//       "type": "string"
11915	//     },
11916	//     "generation": {
11917	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11918	//       "format": "int64",
11919	//       "location": "query",
11920	//       "type": "string"
11921	//     },
11922	//     "ifGenerationMatch": {
11923	//       "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
11924	//       "format": "int64",
11925	//       "location": "query",
11926	//       "type": "string"
11927	//     },
11928	//     "ifGenerationNotMatch": {
11929	//       "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
11930	//       "format": "int64",
11931	//       "location": "query",
11932	//       "type": "string"
11933	//     },
11934	//     "ifMetagenerationMatch": {
11935	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
11936	//       "format": "int64",
11937	//       "location": "query",
11938	//       "type": "string"
11939	//     },
11940	//     "ifMetagenerationNotMatch": {
11941	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
11942	//       "format": "int64",
11943	//       "location": "query",
11944	//       "type": "string"
11945	//     },
11946	//     "object": {
11947	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11948	//       "location": "path",
11949	//       "required": true,
11950	//       "type": "string"
11951	//     },
11952	//     "predefinedAcl": {
11953	//       "description": "Apply a predefined set of access controls to this object.",
11954	//       "enum": [
11955	//         "authenticatedRead",
11956	//         "bucketOwnerFullControl",
11957	//         "bucketOwnerRead",
11958	//         "private",
11959	//         "projectPrivate",
11960	//         "publicRead"
11961	//       ],
11962	//       "enumDescriptions": [
11963	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
11964	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
11965	//         "Object owner gets OWNER access, and project team owners get READER access.",
11966	//         "Object owner gets OWNER access.",
11967	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
11968	//         "Object owner gets OWNER access, and allUsers get READER access."
11969	//       ],
11970	//       "location": "query",
11971	//       "type": "string"
11972	//     },
11973	//     "projection": {
11974	//       "description": "Set of properties to return. Defaults to full.",
11975	//       "enum": [
11976	//         "full",
11977	//         "noAcl"
11978	//       ],
11979	//       "enumDescriptions": [
11980	//         "Include all properties.",
11981	//         "Omit the owner, acl property."
11982	//       ],
11983	//       "location": "query",
11984	//       "type": "string"
11985	//     },
11986	//     "provisionalUserProject": {
11987	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11988	//       "location": "query",
11989	//       "type": "string"
11990	//     },
11991	//     "userProject": {
11992	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11993	//       "location": "query",
11994	//       "type": "string"
11995	//     }
11996	//   },
11997	//   "path": "b/{bucket}/o/{object}",
11998	//   "request": {
11999	//     "$ref": "Object"
12000	//   },
12001	//   "response": {
12002	//     "$ref": "Object"
12003	//   },
12004	//   "scopes": [
12005	//     "https://www.googleapis.com/auth/cloud-platform",
12006	//     "https://www.googleapis.com/auth/devstorage.full_control"
12007	//   ]
12008	// }
12009
12010}
12011
12012// method id "storage.objects.watchAll":
12013
12014type ObjectsWatchAllCall struct {
12015	s          *Service
12016	bucket     string
12017	channel    *Channel
12018	urlParams_ gensupport.URLParams
12019	ctx_       context.Context
12020	header_    http.Header
12021}
12022
12023// WatchAll: Watch for changes on all objects in a bucket.
12024func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
12025	c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12026	c.bucket = bucket
12027	c.channel = channel
12028	return c
12029}
12030
12031// Delimiter sets the optional parameter "delimiter": Returns results in
12032// a directory-like mode. items will contain only objects whose names,
12033// aside from the prefix, do not contain delimiter. Objects whose names,
12034// aside from the prefix, contain delimiter will have their name,
12035// truncated after the delimiter, returned in prefixes. Duplicate
12036// prefixes are omitted.
12037func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
12038	c.urlParams_.Set("delimiter", delimiter)
12039	return c
12040}
12041
12042// IncludeTrailingDelimiter sets the optional parameter
12043// "includeTrailingDelimiter": If true, objects that end in exactly one
12044// instance of delimiter will have their metadata included in items in
12045// addition to prefixes.
12046func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall {
12047	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
12048	return c
12049}
12050
12051// MaxResults sets the optional parameter "maxResults": Maximum number
12052// of items plus prefixes to return in a single page of responses. As
12053// duplicate prefixes are omitted, fewer total results may be returned
12054// than requested. The service will use this parameter or 1,000 items,
12055// whichever is smaller.
12056func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
12057	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12058	return c
12059}
12060
12061// PageToken sets the optional parameter "pageToken": A
12062// previously-returned page token representing part of the larger set of
12063// results to view.
12064func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
12065	c.urlParams_.Set("pageToken", pageToken)
12066	return c
12067}
12068
12069// Prefix sets the optional parameter "prefix": Filter results to
12070// objects whose names begin with this prefix.
12071func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
12072	c.urlParams_.Set("prefix", prefix)
12073	return c
12074}
12075
12076// Projection sets the optional parameter "projection": Set of
12077// properties to return. Defaults to noAcl.
12078//
12079// Possible values:
12080//   "full" - Include all properties.
12081//   "noAcl" - Omit the owner, acl property.
12082func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
12083	c.urlParams_.Set("projection", projection)
12084	return c
12085}
12086
12087// ProvisionalUserProject sets the optional parameter
12088// "provisionalUserProject": The project to be billed for this request
12089// if the target bucket is requester-pays bucket.
12090func (c *ObjectsWatchAllCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsWatchAllCall {
12091	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
12092	return c
12093}
12094
12095// UserProject sets the optional parameter "userProject": The project to
12096// be billed for this request. Required for Requester Pays buckets.
12097func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
12098	c.urlParams_.Set("userProject", userProject)
12099	return c
12100}
12101
12102// Versions sets the optional parameter "versions": If true, lists all
12103// versions of an object as distinct results. The default is false. For
12104// more information, see Object Versioning.
12105func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
12106	c.urlParams_.Set("versions", fmt.Sprint(versions))
12107	return c
12108}
12109
12110// Fields allows partial responses to be retrieved. See
12111// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12112// for more information.
12113func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
12114	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12115	return c
12116}
12117
12118// Context sets the context to be used in this call's Do method. Any
12119// pending HTTP request will be aborted if the provided context is
12120// canceled.
12121func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
12122	c.ctx_ = ctx
12123	return c
12124}
12125
12126// Header returns an http.Header that can be modified by the caller to
12127// add HTTP headers to the request.
12128func (c *ObjectsWatchAllCall) Header() http.Header {
12129	if c.header_ == nil {
12130		c.header_ = make(http.Header)
12131	}
12132	return c.header_
12133}
12134
12135func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
12136	reqHeaders := make(http.Header)
12137	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
12138	for k, v := range c.header_ {
12139		reqHeaders[k] = v
12140	}
12141	reqHeaders.Set("User-Agent", c.s.userAgent())
12142	var body io.Reader = nil
12143	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
12144	if err != nil {
12145		return nil, err
12146	}
12147	reqHeaders.Set("Content-Type", "application/json")
12148	c.urlParams_.Set("alt", alt)
12149	c.urlParams_.Set("prettyPrint", "false")
12150	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
12151	urls += "?" + c.urlParams_.Encode()
12152	req, err := http.NewRequest("POST", urls, body)
12153	if err != nil {
12154		return nil, err
12155	}
12156	req.Header = reqHeaders
12157	googleapi.Expand(req.URL, map[string]string{
12158		"bucket": c.bucket,
12159	})
12160	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12161}
12162
12163// Do executes the "storage.objects.watchAll" call.
12164// Exactly one of *Channel or error will be non-nil. Any non-2xx status
12165// code is an error. Response headers are in either
12166// *Channel.ServerResponse.Header or (if a response was returned at all)
12167// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12168// check whether the returned error was because http.StatusNotModified
12169// was returned.
12170func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
12171	gensupport.SetOptions(c.urlParams_, opts...)
12172	res, err := c.doRequest("json")
12173	if res != nil && res.StatusCode == http.StatusNotModified {
12174		if res.Body != nil {
12175			res.Body.Close()
12176		}
12177		return nil, &googleapi.Error{
12178			Code:   res.StatusCode,
12179			Header: res.Header,
12180		}
12181	}
12182	if err != nil {
12183		return nil, err
12184	}
12185	defer googleapi.CloseBody(res)
12186	if err := googleapi.CheckResponse(res); err != nil {
12187		return nil, err
12188	}
12189	ret := &Channel{
12190		ServerResponse: googleapi.ServerResponse{
12191			Header:         res.Header,
12192			HTTPStatusCode: res.StatusCode,
12193		},
12194	}
12195	target := &ret
12196	if err := gensupport.DecodeResponse(target, res); err != nil {
12197		return nil, err
12198	}
12199	return ret, nil
12200	// {
12201	//   "description": "Watch for changes on all objects in a bucket.",
12202	//   "httpMethod": "POST",
12203	//   "id": "storage.objects.watchAll",
12204	//   "parameterOrder": [
12205	//     "bucket"
12206	//   ],
12207	//   "parameters": {
12208	//     "bucket": {
12209	//       "description": "Name of the bucket in which to look for objects.",
12210	//       "location": "path",
12211	//       "required": true,
12212	//       "type": "string"
12213	//     },
12214	//     "delimiter": {
12215	//       "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.",
12216	//       "location": "query",
12217	//       "type": "string"
12218	//     },
12219	//     "includeTrailingDelimiter": {
12220	//       "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
12221	//       "location": "query",
12222	//       "type": "boolean"
12223	//     },
12224	//     "maxResults": {
12225	//       "default": "1000",
12226	//       "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
12227	//       "format": "uint32",
12228	//       "location": "query",
12229	//       "minimum": "0",
12230	//       "type": "integer"
12231	//     },
12232	//     "pageToken": {
12233	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
12234	//       "location": "query",
12235	//       "type": "string"
12236	//     },
12237	//     "prefix": {
12238	//       "description": "Filter results to objects whose names begin with this prefix.",
12239	//       "location": "query",
12240	//       "type": "string"
12241	//     },
12242	//     "projection": {
12243	//       "description": "Set of properties to return. Defaults to noAcl.",
12244	//       "enum": [
12245	//         "full",
12246	//         "noAcl"
12247	//       ],
12248	//       "enumDescriptions": [
12249	//         "Include all properties.",
12250	//         "Omit the owner, acl property."
12251	//       ],
12252	//       "location": "query",
12253	//       "type": "string"
12254	//     },
12255	//     "provisionalUserProject": {
12256	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
12257	//       "location": "query",
12258	//       "type": "string"
12259	//     },
12260	//     "userProject": {
12261	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
12262	//       "location": "query",
12263	//       "type": "string"
12264	//     },
12265	//     "versions": {
12266	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
12267	//       "location": "query",
12268	//       "type": "boolean"
12269	//     }
12270	//   },
12271	//   "path": "b/{bucket}/o/watch",
12272	//   "request": {
12273	//     "$ref": "Channel",
12274	//     "parameterName": "resource"
12275	//   },
12276	//   "response": {
12277	//     "$ref": "Channel"
12278	//   },
12279	//   "scopes": [
12280	//     "https://www.googleapis.com/auth/cloud-platform",
12281	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12282	//     "https://www.googleapis.com/auth/devstorage.full_control",
12283	//     "https://www.googleapis.com/auth/devstorage.read_only",
12284	//     "https://www.googleapis.com/auth/devstorage.read_write"
12285	//   ],
12286	//   "supportsSubscription": true
12287	// }
12288
12289}
12290
12291// method id "storage.projects.hmacKeys.create":
12292
12293type ProjectsHmacKeysCreateCall struct {
12294	s          *Service
12295	projectId  string
12296	urlParams_ gensupport.URLParams
12297	ctx_       context.Context
12298	header_    http.Header
12299}
12300
12301// Create: Creates a new HMAC key for the specified service account.
12302func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall {
12303	c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12304	c.projectId = projectId
12305	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
12306	return c
12307}
12308
12309// UserProject sets the optional parameter "userProject": The project to
12310// be billed for this request.
12311func (c *ProjectsHmacKeysCreateCall) UserProject(userProject string) *ProjectsHmacKeysCreateCall {
12312	c.urlParams_.Set("userProject", userProject)
12313	return c
12314}
12315
12316// Fields allows partial responses to be retrieved. See
12317// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12318// for more information.
12319func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall {
12320	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12321	return c
12322}
12323
12324// Context sets the context to be used in this call's Do method. Any
12325// pending HTTP request will be aborted if the provided context is
12326// canceled.
12327func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall {
12328	c.ctx_ = ctx
12329	return c
12330}
12331
12332// Header returns an http.Header that can be modified by the caller to
12333// add HTTP headers to the request.
12334func (c *ProjectsHmacKeysCreateCall) Header() http.Header {
12335	if c.header_ == nil {
12336		c.header_ = make(http.Header)
12337	}
12338	return c.header_
12339}
12340
12341func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) {
12342	reqHeaders := make(http.Header)
12343	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
12344	for k, v := range c.header_ {
12345		reqHeaders[k] = v
12346	}
12347	reqHeaders.Set("User-Agent", c.s.userAgent())
12348	var body io.Reader = nil
12349	c.urlParams_.Set("alt", alt)
12350	c.urlParams_.Set("prettyPrint", "false")
12351	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
12352	urls += "?" + c.urlParams_.Encode()
12353	req, err := http.NewRequest("POST", urls, body)
12354	if err != nil {
12355		return nil, err
12356	}
12357	req.Header = reqHeaders
12358	googleapi.Expand(req.URL, map[string]string{
12359		"projectId": c.projectId,
12360	})
12361	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12362}
12363
12364// Do executes the "storage.projects.hmacKeys.create" call.
12365// Exactly one of *HmacKey or error will be non-nil. Any non-2xx status
12366// code is an error. Response headers are in either
12367// *HmacKey.ServerResponse.Header or (if a response was returned at all)
12368// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12369// check whether the returned error was because http.StatusNotModified
12370// was returned.
12371func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) {
12372	gensupport.SetOptions(c.urlParams_, opts...)
12373	res, err := c.doRequest("json")
12374	if res != nil && res.StatusCode == http.StatusNotModified {
12375		if res.Body != nil {
12376			res.Body.Close()
12377		}
12378		return nil, &googleapi.Error{
12379			Code:   res.StatusCode,
12380			Header: res.Header,
12381		}
12382	}
12383	if err != nil {
12384		return nil, err
12385	}
12386	defer googleapi.CloseBody(res)
12387	if err := googleapi.CheckResponse(res); err != nil {
12388		return nil, err
12389	}
12390	ret := &HmacKey{
12391		ServerResponse: googleapi.ServerResponse{
12392			Header:         res.Header,
12393			HTTPStatusCode: res.StatusCode,
12394		},
12395	}
12396	target := &ret
12397	if err := gensupport.DecodeResponse(target, res); err != nil {
12398		return nil, err
12399	}
12400	return ret, nil
12401	// {
12402	//   "description": "Creates a new HMAC key for the specified service account.",
12403	//   "httpMethod": "POST",
12404	//   "id": "storage.projects.hmacKeys.create",
12405	//   "parameterOrder": [
12406	//     "projectId",
12407	//     "serviceAccountEmail"
12408	//   ],
12409	//   "parameters": {
12410	//     "projectId": {
12411	//       "description": "Project ID owning the service account.",
12412	//       "location": "path",
12413	//       "required": true,
12414	//       "type": "string"
12415	//     },
12416	//     "serviceAccountEmail": {
12417	//       "description": "Email address of the service account.",
12418	//       "location": "query",
12419	//       "required": true,
12420	//       "type": "string"
12421	//     },
12422	//     "userProject": {
12423	//       "description": "The project to be billed for this request.",
12424	//       "location": "query",
12425	//       "type": "string"
12426	//     }
12427	//   },
12428	//   "path": "projects/{projectId}/hmacKeys",
12429	//   "response": {
12430	//     "$ref": "HmacKey"
12431	//   },
12432	//   "scopes": [
12433	//     "https://www.googleapis.com/auth/cloud-platform",
12434	//     "https://www.googleapis.com/auth/devstorage.full_control"
12435	//   ]
12436	// }
12437
12438}
12439
12440// method id "storage.projects.hmacKeys.delete":
12441
12442type ProjectsHmacKeysDeleteCall struct {
12443	s          *Service
12444	projectId  string
12445	accessId   string
12446	urlParams_ gensupport.URLParams
12447	ctx_       context.Context
12448	header_    http.Header
12449}
12450
12451// Delete: Deletes an HMAC key.
12452func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall {
12453	c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12454	c.projectId = projectId
12455	c.accessId = accessId
12456	return c
12457}
12458
12459// UserProject sets the optional parameter "userProject": The project to
12460// be billed for this request.
12461func (c *ProjectsHmacKeysDeleteCall) UserProject(userProject string) *ProjectsHmacKeysDeleteCall {
12462	c.urlParams_.Set("userProject", userProject)
12463	return c
12464}
12465
12466// Fields allows partial responses to be retrieved. See
12467// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12468// for more information.
12469func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall {
12470	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12471	return c
12472}
12473
12474// Context sets the context to be used in this call's Do method. Any
12475// pending HTTP request will be aborted if the provided context is
12476// canceled.
12477func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall {
12478	c.ctx_ = ctx
12479	return c
12480}
12481
12482// Header returns an http.Header that can be modified by the caller to
12483// add HTTP headers to the request.
12484func (c *ProjectsHmacKeysDeleteCall) Header() http.Header {
12485	if c.header_ == nil {
12486		c.header_ = make(http.Header)
12487	}
12488	return c.header_
12489}
12490
12491func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
12492	reqHeaders := make(http.Header)
12493	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
12494	for k, v := range c.header_ {
12495		reqHeaders[k] = v
12496	}
12497	reqHeaders.Set("User-Agent", c.s.userAgent())
12498	var body io.Reader = nil
12499	c.urlParams_.Set("alt", alt)
12500	c.urlParams_.Set("prettyPrint", "false")
12501	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
12502	urls += "?" + c.urlParams_.Encode()
12503	req, err := http.NewRequest("DELETE", urls, body)
12504	if err != nil {
12505		return nil, err
12506	}
12507	req.Header = reqHeaders
12508	googleapi.Expand(req.URL, map[string]string{
12509		"projectId": c.projectId,
12510		"accessId":  c.accessId,
12511	})
12512	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12513}
12514
12515// Do executes the "storage.projects.hmacKeys.delete" call.
12516func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
12517	gensupport.SetOptions(c.urlParams_, opts...)
12518	res, err := c.doRequest("json")
12519	if err != nil {
12520		return err
12521	}
12522	defer googleapi.CloseBody(res)
12523	if err := googleapi.CheckResponse(res); err != nil {
12524		return err
12525	}
12526	return nil
12527	// {
12528	//   "description": "Deletes an HMAC key.",
12529	//   "httpMethod": "DELETE",
12530	//   "id": "storage.projects.hmacKeys.delete",
12531	//   "parameterOrder": [
12532	//     "projectId",
12533	//     "accessId"
12534	//   ],
12535	//   "parameters": {
12536	//     "accessId": {
12537	//       "description": "Name of the HMAC key to be deleted.",
12538	//       "location": "path",
12539	//       "required": true,
12540	//       "type": "string"
12541	//     },
12542	//     "projectId": {
12543	//       "description": "Project ID owning the requested key",
12544	//       "location": "path",
12545	//       "required": true,
12546	//       "type": "string"
12547	//     },
12548	//     "userProject": {
12549	//       "description": "The project to be billed for this request.",
12550	//       "location": "query",
12551	//       "type": "string"
12552	//     }
12553	//   },
12554	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
12555	//   "scopes": [
12556	//     "https://www.googleapis.com/auth/cloud-platform",
12557	//     "https://www.googleapis.com/auth/devstorage.full_control",
12558	//     "https://www.googleapis.com/auth/devstorage.read_write"
12559	//   ]
12560	// }
12561
12562}
12563
12564// method id "storage.projects.hmacKeys.get":
12565
12566type ProjectsHmacKeysGetCall struct {
12567	s            *Service
12568	projectId    string
12569	accessId     string
12570	urlParams_   gensupport.URLParams
12571	ifNoneMatch_ string
12572	ctx_         context.Context
12573	header_      http.Header
12574}
12575
12576// Get: Retrieves an HMAC key's metadata
12577func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall {
12578	c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12579	c.projectId = projectId
12580	c.accessId = accessId
12581	return c
12582}
12583
12584// UserProject sets the optional parameter "userProject": The project to
12585// be billed for this request.
12586func (c *ProjectsHmacKeysGetCall) UserProject(userProject string) *ProjectsHmacKeysGetCall {
12587	c.urlParams_.Set("userProject", userProject)
12588	return c
12589}
12590
12591// Fields allows partial responses to be retrieved. See
12592// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12593// for more information.
12594func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall {
12595	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12596	return c
12597}
12598
12599// IfNoneMatch sets the optional parameter which makes the operation
12600// fail if the object's ETag matches the given value. This is useful for
12601// getting updates only after the object has changed since the last
12602// request. Use googleapi.IsNotModified to check whether the response
12603// error from Do is the result of In-None-Match.
12604func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall {
12605	c.ifNoneMatch_ = entityTag
12606	return c
12607}
12608
12609// Context sets the context to be used in this call's Do method. Any
12610// pending HTTP request will be aborted if the provided context is
12611// canceled.
12612func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall {
12613	c.ctx_ = ctx
12614	return c
12615}
12616
12617// Header returns an http.Header that can be modified by the caller to
12618// add HTTP headers to the request.
12619func (c *ProjectsHmacKeysGetCall) Header() http.Header {
12620	if c.header_ == nil {
12621		c.header_ = make(http.Header)
12622	}
12623	return c.header_
12624}
12625
12626func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) {
12627	reqHeaders := make(http.Header)
12628	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
12629	for k, v := range c.header_ {
12630		reqHeaders[k] = v
12631	}
12632	reqHeaders.Set("User-Agent", c.s.userAgent())
12633	if c.ifNoneMatch_ != "" {
12634		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12635	}
12636	var body io.Reader = nil
12637	c.urlParams_.Set("alt", alt)
12638	c.urlParams_.Set("prettyPrint", "false")
12639	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
12640	urls += "?" + c.urlParams_.Encode()
12641	req, err := http.NewRequest("GET", urls, body)
12642	if err != nil {
12643		return nil, err
12644	}
12645	req.Header = reqHeaders
12646	googleapi.Expand(req.URL, map[string]string{
12647		"projectId": c.projectId,
12648		"accessId":  c.accessId,
12649	})
12650	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12651}
12652
12653// Do executes the "storage.projects.hmacKeys.get" call.
12654// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
12655// status code is an error. Response headers are in either
12656// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
12657// at all) in error.(*googleapi.Error).Header. Use
12658// googleapi.IsNotModified to check whether the returned error was
12659// because http.StatusNotModified was returned.
12660func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
12661	gensupport.SetOptions(c.urlParams_, opts...)
12662	res, err := c.doRequest("json")
12663	if res != nil && res.StatusCode == http.StatusNotModified {
12664		if res.Body != nil {
12665			res.Body.Close()
12666		}
12667		return nil, &googleapi.Error{
12668			Code:   res.StatusCode,
12669			Header: res.Header,
12670		}
12671	}
12672	if err != nil {
12673		return nil, err
12674	}
12675	defer googleapi.CloseBody(res)
12676	if err := googleapi.CheckResponse(res); err != nil {
12677		return nil, err
12678	}
12679	ret := &HmacKeyMetadata{
12680		ServerResponse: googleapi.ServerResponse{
12681			Header:         res.Header,
12682			HTTPStatusCode: res.StatusCode,
12683		},
12684	}
12685	target := &ret
12686	if err := gensupport.DecodeResponse(target, res); err != nil {
12687		return nil, err
12688	}
12689	return ret, nil
12690	// {
12691	//   "description": "Retrieves an HMAC key's metadata",
12692	//   "httpMethod": "GET",
12693	//   "id": "storage.projects.hmacKeys.get",
12694	//   "parameterOrder": [
12695	//     "projectId",
12696	//     "accessId"
12697	//   ],
12698	//   "parameters": {
12699	//     "accessId": {
12700	//       "description": "Name of the HMAC key.",
12701	//       "location": "path",
12702	//       "required": true,
12703	//       "type": "string"
12704	//     },
12705	//     "projectId": {
12706	//       "description": "Project ID owning the service account of the requested key.",
12707	//       "location": "path",
12708	//       "required": true,
12709	//       "type": "string"
12710	//     },
12711	//     "userProject": {
12712	//       "description": "The project to be billed for this request.",
12713	//       "location": "query",
12714	//       "type": "string"
12715	//     }
12716	//   },
12717	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
12718	//   "response": {
12719	//     "$ref": "HmacKeyMetadata"
12720	//   },
12721	//   "scopes": [
12722	//     "https://www.googleapis.com/auth/cloud-platform",
12723	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12724	//     "https://www.googleapis.com/auth/devstorage.full_control",
12725	//     "https://www.googleapis.com/auth/devstorage.read_only"
12726	//   ]
12727	// }
12728
12729}
12730
12731// method id "storage.projects.hmacKeys.list":
12732
12733type ProjectsHmacKeysListCall struct {
12734	s            *Service
12735	projectId    string
12736	urlParams_   gensupport.URLParams
12737	ifNoneMatch_ string
12738	ctx_         context.Context
12739	header_      http.Header
12740}
12741
12742// List: Retrieves a list of HMAC keys matching the criteria.
12743func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall {
12744	c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12745	c.projectId = projectId
12746	return c
12747}
12748
12749// MaxResults sets the optional parameter "maxResults": Maximum number
12750// of items to return in a single page of responses. The service uses
12751// this parameter or 250 items, whichever is smaller. The max number of
12752// items per page will also be limited by the number of distinct service
12753// accounts in the response. If the number of service accounts in a
12754// single response is too high, the page will truncated and a next page
12755// token will be returned.
12756func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall {
12757	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12758	return c
12759}
12760
12761// PageToken sets the optional parameter "pageToken": A
12762// previously-returned page token representing part of the larger set of
12763// results to view.
12764func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall {
12765	c.urlParams_.Set("pageToken", pageToken)
12766	return c
12767}
12768
12769// ServiceAccountEmail sets the optional parameter
12770// "serviceAccountEmail": If present, only keys for the given service
12771// account are returned.
12772func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall {
12773	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
12774	return c
12775}
12776
12777// ShowDeletedKeys sets the optional parameter "showDeletedKeys":
12778// Whether or not to show keys in the DELETED state.
12779func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall {
12780	c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys))
12781	return c
12782}
12783
12784// UserProject sets the optional parameter "userProject": The project to
12785// be billed for this request.
12786func (c *ProjectsHmacKeysListCall) UserProject(userProject string) *ProjectsHmacKeysListCall {
12787	c.urlParams_.Set("userProject", userProject)
12788	return c
12789}
12790
12791// Fields allows partial responses to be retrieved. See
12792// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12793// for more information.
12794func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall {
12795	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12796	return c
12797}
12798
12799// IfNoneMatch sets the optional parameter which makes the operation
12800// fail if the object's ETag matches the given value. This is useful for
12801// getting updates only after the object has changed since the last
12802// request. Use googleapi.IsNotModified to check whether the response
12803// error from Do is the result of In-None-Match.
12804func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall {
12805	c.ifNoneMatch_ = entityTag
12806	return c
12807}
12808
12809// Context sets the context to be used in this call's Do method. Any
12810// pending HTTP request will be aborted if the provided context is
12811// canceled.
12812func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall {
12813	c.ctx_ = ctx
12814	return c
12815}
12816
12817// Header returns an http.Header that can be modified by the caller to
12818// add HTTP headers to the request.
12819func (c *ProjectsHmacKeysListCall) Header() http.Header {
12820	if c.header_ == nil {
12821		c.header_ = make(http.Header)
12822	}
12823	return c.header_
12824}
12825
12826func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) {
12827	reqHeaders := make(http.Header)
12828	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
12829	for k, v := range c.header_ {
12830		reqHeaders[k] = v
12831	}
12832	reqHeaders.Set("User-Agent", c.s.userAgent())
12833	if c.ifNoneMatch_ != "" {
12834		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12835	}
12836	var body io.Reader = nil
12837	c.urlParams_.Set("alt", alt)
12838	c.urlParams_.Set("prettyPrint", "false")
12839	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
12840	urls += "?" + c.urlParams_.Encode()
12841	req, err := http.NewRequest("GET", urls, body)
12842	if err != nil {
12843		return nil, err
12844	}
12845	req.Header = reqHeaders
12846	googleapi.Expand(req.URL, map[string]string{
12847		"projectId": c.projectId,
12848	})
12849	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12850}
12851
12852// Do executes the "storage.projects.hmacKeys.list" call.
12853// Exactly one of *HmacKeysMetadata or error will be non-nil. Any
12854// non-2xx status code is an error. Response headers are in either
12855// *HmacKeysMetadata.ServerResponse.Header or (if a response was
12856// returned at all) in error.(*googleapi.Error).Header. Use
12857// googleapi.IsNotModified to check whether the returned error was
12858// because http.StatusNotModified was returned.
12859func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) {
12860	gensupport.SetOptions(c.urlParams_, opts...)
12861	res, err := c.doRequest("json")
12862	if res != nil && res.StatusCode == http.StatusNotModified {
12863		if res.Body != nil {
12864			res.Body.Close()
12865		}
12866		return nil, &googleapi.Error{
12867			Code:   res.StatusCode,
12868			Header: res.Header,
12869		}
12870	}
12871	if err != nil {
12872		return nil, err
12873	}
12874	defer googleapi.CloseBody(res)
12875	if err := googleapi.CheckResponse(res); err != nil {
12876		return nil, err
12877	}
12878	ret := &HmacKeysMetadata{
12879		ServerResponse: googleapi.ServerResponse{
12880			Header:         res.Header,
12881			HTTPStatusCode: res.StatusCode,
12882		},
12883	}
12884	target := &ret
12885	if err := gensupport.DecodeResponse(target, res); err != nil {
12886		return nil, err
12887	}
12888	return ret, nil
12889	// {
12890	//   "description": "Retrieves a list of HMAC keys matching the criteria.",
12891	//   "httpMethod": "GET",
12892	//   "id": "storage.projects.hmacKeys.list",
12893	//   "parameterOrder": [
12894	//     "projectId"
12895	//   ],
12896	//   "parameters": {
12897	//     "maxResults": {
12898	//       "default": "250",
12899	//       "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.",
12900	//       "format": "uint32",
12901	//       "location": "query",
12902	//       "minimum": "0",
12903	//       "type": "integer"
12904	//     },
12905	//     "pageToken": {
12906	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
12907	//       "location": "query",
12908	//       "type": "string"
12909	//     },
12910	//     "projectId": {
12911	//       "description": "Name of the project in which to look for HMAC keys.",
12912	//       "location": "path",
12913	//       "required": true,
12914	//       "type": "string"
12915	//     },
12916	//     "serviceAccountEmail": {
12917	//       "description": "If present, only keys for the given service account are returned.",
12918	//       "location": "query",
12919	//       "type": "string"
12920	//     },
12921	//     "showDeletedKeys": {
12922	//       "description": "Whether or not to show keys in the DELETED state.",
12923	//       "location": "query",
12924	//       "type": "boolean"
12925	//     },
12926	//     "userProject": {
12927	//       "description": "The project to be billed for this request.",
12928	//       "location": "query",
12929	//       "type": "string"
12930	//     }
12931	//   },
12932	//   "path": "projects/{projectId}/hmacKeys",
12933	//   "response": {
12934	//     "$ref": "HmacKeysMetadata"
12935	//   },
12936	//   "scopes": [
12937	//     "https://www.googleapis.com/auth/cloud-platform",
12938	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12939	//     "https://www.googleapis.com/auth/devstorage.full_control",
12940	//     "https://www.googleapis.com/auth/devstorage.read_only"
12941	//   ]
12942	// }
12943
12944}
12945
12946// Pages invokes f for each page of results.
12947// A non-nil error returned from f will halt the iteration.
12948// The provided context supersedes any context provided to the Context method.
12949func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error {
12950	c.ctx_ = ctx
12951	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12952	for {
12953		x, err := c.Do()
12954		if err != nil {
12955			return err
12956		}
12957		if err := f(x); err != nil {
12958			return err
12959		}
12960		if x.NextPageToken == "" {
12961			return nil
12962		}
12963		c.PageToken(x.NextPageToken)
12964	}
12965}
12966
12967// method id "storage.projects.hmacKeys.update":
12968
12969type ProjectsHmacKeysUpdateCall struct {
12970	s               *Service
12971	projectId       string
12972	accessId        string
12973	hmackeymetadata *HmacKeyMetadata
12974	urlParams_      gensupport.URLParams
12975	ctx_            context.Context
12976	header_         http.Header
12977}
12978
12979// Update: Updates the state of an HMAC key. See the HMAC Key resource
12980// descriptor for valid states.
12981func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall {
12982	c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12983	c.projectId = projectId
12984	c.accessId = accessId
12985	c.hmackeymetadata = hmackeymetadata
12986	return c
12987}
12988
12989// UserProject sets the optional parameter "userProject": The project to
12990// be billed for this request.
12991func (c *ProjectsHmacKeysUpdateCall) UserProject(userProject string) *ProjectsHmacKeysUpdateCall {
12992	c.urlParams_.Set("userProject", userProject)
12993	return c
12994}
12995
12996// Fields allows partial responses to be retrieved. See
12997// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12998// for more information.
12999func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall {
13000	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13001	return c
13002}
13003
13004// Context sets the context to be used in this call's Do method. Any
13005// pending HTTP request will be aborted if the provided context is
13006// canceled.
13007func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall {
13008	c.ctx_ = ctx
13009	return c
13010}
13011
13012// Header returns an http.Header that can be modified by the caller to
13013// add HTTP headers to the request.
13014func (c *ProjectsHmacKeysUpdateCall) Header() http.Header {
13015	if c.header_ == nil {
13016		c.header_ = make(http.Header)
13017	}
13018	return c.header_
13019}
13020
13021func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) {
13022	reqHeaders := make(http.Header)
13023	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
13024	for k, v := range c.header_ {
13025		reqHeaders[k] = v
13026	}
13027	reqHeaders.Set("User-Agent", c.s.userAgent())
13028	var body io.Reader = nil
13029	body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata)
13030	if err != nil {
13031		return nil, err
13032	}
13033	reqHeaders.Set("Content-Type", "application/json")
13034	c.urlParams_.Set("alt", alt)
13035	c.urlParams_.Set("prettyPrint", "false")
13036	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
13037	urls += "?" + c.urlParams_.Encode()
13038	req, err := http.NewRequest("PUT", urls, body)
13039	if err != nil {
13040		return nil, err
13041	}
13042	req.Header = reqHeaders
13043	googleapi.Expand(req.URL, map[string]string{
13044		"projectId": c.projectId,
13045		"accessId":  c.accessId,
13046	})
13047	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13048}
13049
13050// Do executes the "storage.projects.hmacKeys.update" call.
13051// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
13052// status code is an error. Response headers are in either
13053// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
13054// at all) in error.(*googleapi.Error).Header. Use
13055// googleapi.IsNotModified to check whether the returned error was
13056// because http.StatusNotModified was returned.
13057func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
13058	gensupport.SetOptions(c.urlParams_, opts...)
13059	res, err := c.doRequest("json")
13060	if res != nil && res.StatusCode == http.StatusNotModified {
13061		if res.Body != nil {
13062			res.Body.Close()
13063		}
13064		return nil, &googleapi.Error{
13065			Code:   res.StatusCode,
13066			Header: res.Header,
13067		}
13068	}
13069	if err != nil {
13070		return nil, err
13071	}
13072	defer googleapi.CloseBody(res)
13073	if err := googleapi.CheckResponse(res); err != nil {
13074		return nil, err
13075	}
13076	ret := &HmacKeyMetadata{
13077		ServerResponse: googleapi.ServerResponse{
13078			Header:         res.Header,
13079			HTTPStatusCode: res.StatusCode,
13080		},
13081	}
13082	target := &ret
13083	if err := gensupport.DecodeResponse(target, res); err != nil {
13084		return nil, err
13085	}
13086	return ret, nil
13087	// {
13088	//   "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
13089	//   "httpMethod": "PUT",
13090	//   "id": "storage.projects.hmacKeys.update",
13091	//   "parameterOrder": [
13092	//     "projectId",
13093	//     "accessId"
13094	//   ],
13095	//   "parameters": {
13096	//     "accessId": {
13097	//       "description": "Name of the HMAC key being updated.",
13098	//       "location": "path",
13099	//       "required": true,
13100	//       "type": "string"
13101	//     },
13102	//     "projectId": {
13103	//       "description": "Project ID owning the service account of the updated key.",
13104	//       "location": "path",
13105	//       "required": true,
13106	//       "type": "string"
13107	//     },
13108	//     "userProject": {
13109	//       "description": "The project to be billed for this request.",
13110	//       "location": "query",
13111	//       "type": "string"
13112	//     }
13113	//   },
13114	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
13115	//   "request": {
13116	//     "$ref": "HmacKeyMetadata"
13117	//   },
13118	//   "response": {
13119	//     "$ref": "HmacKeyMetadata"
13120	//   },
13121	//   "scopes": [
13122	//     "https://www.googleapis.com/auth/cloud-platform",
13123	//     "https://www.googleapis.com/auth/devstorage.full_control"
13124	//   ]
13125	// }
13126
13127}
13128
13129// method id "storage.projects.serviceAccount.get":
13130
13131type ProjectsServiceAccountGetCall struct {
13132	s            *Service
13133	projectId    string
13134	urlParams_   gensupport.URLParams
13135	ifNoneMatch_ string
13136	ctx_         context.Context
13137	header_      http.Header
13138}
13139
13140// Get: Get the email address of this project's Google Cloud Storage
13141// service account.
13142func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
13143	c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13144	c.projectId = projectId
13145	return c
13146}
13147
13148// ProvisionalUserProject sets the optional parameter
13149// "provisionalUserProject": The project to be billed for this request
13150// if the target bucket is requester-pays bucket.
13151func (c *ProjectsServiceAccountGetCall) ProvisionalUserProject(provisionalUserProject string) *ProjectsServiceAccountGetCall {
13152	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
13153	return c
13154}
13155
13156// UserProject sets the optional parameter "userProject": The project to
13157// be billed for this request.
13158func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall {
13159	c.urlParams_.Set("userProject", userProject)
13160	return c
13161}
13162
13163// Fields allows partial responses to be retrieved. See
13164// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13165// for more information.
13166func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
13167	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13168	return c
13169}
13170
13171// IfNoneMatch sets the optional parameter which makes the operation
13172// fail if the object's ETag matches the given value. This is useful for
13173// getting updates only after the object has changed since the last
13174// request. Use googleapi.IsNotModified to check whether the response
13175// error from Do is the result of In-None-Match.
13176func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
13177	c.ifNoneMatch_ = entityTag
13178	return c
13179}
13180
13181// Context sets the context to be used in this call's Do method. Any
13182// pending HTTP request will be aborted if the provided context is
13183// canceled.
13184func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
13185	c.ctx_ = ctx
13186	return c
13187}
13188
13189// Header returns an http.Header that can be modified by the caller to
13190// add HTTP headers to the request.
13191func (c *ProjectsServiceAccountGetCall) Header() http.Header {
13192	if c.header_ == nil {
13193		c.header_ = make(http.Header)
13194	}
13195	return c.header_
13196}
13197
13198func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
13199	reqHeaders := make(http.Header)
13200	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302")
13201	for k, v := range c.header_ {
13202		reqHeaders[k] = v
13203	}
13204	reqHeaders.Set("User-Agent", c.s.userAgent())
13205	if c.ifNoneMatch_ != "" {
13206		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13207	}
13208	var body io.Reader = nil
13209	c.urlParams_.Set("alt", alt)
13210	c.urlParams_.Set("prettyPrint", "false")
13211	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
13212	urls += "?" + c.urlParams_.Encode()
13213	req, err := http.NewRequest("GET", urls, body)
13214	if err != nil {
13215		return nil, err
13216	}
13217	req.Header = reqHeaders
13218	googleapi.Expand(req.URL, map[string]string{
13219		"projectId": c.projectId,
13220	})
13221	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13222}
13223
13224// Do executes the "storage.projects.serviceAccount.get" call.
13225// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
13226// status code is an error. Response headers are in either
13227// *ServiceAccount.ServerResponse.Header or (if a response was returned
13228// at all) in error.(*googleapi.Error).Header. Use
13229// googleapi.IsNotModified to check whether the returned error was
13230// because http.StatusNotModified was returned.
13231func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
13232	gensupport.SetOptions(c.urlParams_, opts...)
13233	res, err := c.doRequest("json")
13234	if res != nil && res.StatusCode == http.StatusNotModified {
13235		if res.Body != nil {
13236			res.Body.Close()
13237		}
13238		return nil, &googleapi.Error{
13239			Code:   res.StatusCode,
13240			Header: res.Header,
13241		}
13242	}
13243	if err != nil {
13244		return nil, err
13245	}
13246	defer googleapi.CloseBody(res)
13247	if err := googleapi.CheckResponse(res); err != nil {
13248		return nil, err
13249	}
13250	ret := &ServiceAccount{
13251		ServerResponse: googleapi.ServerResponse{
13252			Header:         res.Header,
13253			HTTPStatusCode: res.StatusCode,
13254		},
13255	}
13256	target := &ret
13257	if err := gensupport.DecodeResponse(target, res); err != nil {
13258		return nil, err
13259	}
13260	return ret, nil
13261	// {
13262	//   "description": "Get the email address of this project's Google Cloud Storage service account.",
13263	//   "httpMethod": "GET",
13264	//   "id": "storage.projects.serviceAccount.get",
13265	//   "parameterOrder": [
13266	//     "projectId"
13267	//   ],
13268	//   "parameters": {
13269	//     "projectId": {
13270	//       "description": "Project ID",
13271	//       "location": "path",
13272	//       "required": true,
13273	//       "type": "string"
13274	//     },
13275	//     "provisionalUserProject": {
13276	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
13277	//       "location": "query",
13278	//       "type": "string"
13279	//     },
13280	//     "userProject": {
13281	//       "description": "The project to be billed for this request.",
13282	//       "location": "query",
13283	//       "type": "string"
13284	//     }
13285	//   },
13286	//   "path": "projects/{projectId}/serviceAccount",
13287	//   "response": {
13288	//     "$ref": "ServiceAccount"
13289	//   },
13290	//   "scopes": [
13291	//     "https://www.googleapis.com/auth/cloud-platform",
13292	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13293	//     "https://www.googleapis.com/auth/devstorage.full_control",
13294	//     "https://www.googleapis.com/auth/devstorage.read_only",
13295	//     "https://www.googleapis.com/auth/devstorage.read_write"
13296	//   ]
13297	// }
13298
13299}
13300