1// Copyright 2019 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	htransport "google.golang.org/api/transport/http"
62)
63
64// Always reference these packages, just in case the auto-generated code
65// below doesn't.
66var _ = bytes.NewBuffer
67var _ = strconv.Itoa
68var _ = fmt.Sprintf
69var _ = json.NewDecoder
70var _ = io.Copy
71var _ = url.Parse
72var _ = gensupport.MarshalJSON
73var _ = googleapi.Version
74var _ = errors.New
75var _ = strings.Replace
76var _ = context.Canceled
77
78const apiId = "storage:v1"
79const apiName = "storage"
80const apiVersion = "v1"
81const basePath = "https://www.googleapis.com/storage/v1/"
82
83// OAuth2 scopes used by this API.
84const (
85	// View and manage your data across Google Cloud Platform services
86	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
87
88	// View your data across Google Cloud Platform services
89	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
90
91	// Manage your data and permissions in Google Cloud Storage
92	DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
93
94	// View your data in Google Cloud Storage
95	DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
96
97	// Manage your data in Google Cloud Storage
98	DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
99)
100
101// NewService creates a new Service.
102func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
103	scopesOption := option.WithScopes(
104		"https://www.googleapis.com/auth/cloud-platform",
105		"https://www.googleapis.com/auth/cloud-platform.read-only",
106		"https://www.googleapis.com/auth/devstorage.full_control",
107		"https://www.googleapis.com/auth/devstorage.read_only",
108		"https://www.googleapis.com/auth/devstorage.read_write",
109	)
110	// NOTE: prepend, so we don't override user-specified scopes.
111	opts = append([]option.ClientOption{scopesOption}, opts...)
112	client, endpoint, err := htransport.NewClient(ctx, opts...)
113	if err != nil {
114		return nil, err
115	}
116	s, err := New(client)
117	if err != nil {
118		return nil, err
119	}
120	if endpoint != "" {
121		s.BasePath = endpoint
122	}
123	return s, nil
124}
125
126// New creates a new Service. It uses the provided http.Client for requests.
127//
128// Deprecated: please use NewService instead.
129// To provide a custom HTTP client, use option.WithHTTPClient.
130// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
131func New(client *http.Client) (*Service, error) {
132	if client == nil {
133		return nil, errors.New("client is nil")
134	}
135	s := &Service{client: client, BasePath: basePath}
136	s.BucketAccessControls = NewBucketAccessControlsService(s)
137	s.Buckets = NewBucketsService(s)
138	s.Channels = NewChannelsService(s)
139	s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
140	s.Notifications = NewNotificationsService(s)
141	s.ObjectAccessControls = NewObjectAccessControlsService(s)
142	s.Objects = NewObjectsService(s)
143	s.Projects = NewProjectsService(s)
144	return s, nil
145}
146
147type Service struct {
148	client    *http.Client
149	BasePath  string // API endpoint base URL
150	UserAgent string // optional additional User-Agent fragment
151
152	BucketAccessControls *BucketAccessControlsService
153
154	Buckets *BucketsService
155
156	Channels *ChannelsService
157
158	DefaultObjectAccessControls *DefaultObjectAccessControlsService
159
160	Notifications *NotificationsService
161
162	ObjectAccessControls *ObjectAccessControlsService
163
164	Objects *ObjectsService
165
166	Projects *ProjectsService
167}
168
169func (s *Service) userAgent() string {
170	if s.UserAgent == "" {
171		return googleapi.UserAgent
172	}
173	return googleapi.UserAgent + " " + s.UserAgent
174}
175
176func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
177	rs := &BucketAccessControlsService{s: s}
178	return rs
179}
180
181type BucketAccessControlsService struct {
182	s *Service
183}
184
185func NewBucketsService(s *Service) *BucketsService {
186	rs := &BucketsService{s: s}
187	return rs
188}
189
190type BucketsService struct {
191	s *Service
192}
193
194func NewChannelsService(s *Service) *ChannelsService {
195	rs := &ChannelsService{s: s}
196	return rs
197}
198
199type ChannelsService struct {
200	s *Service
201}
202
203func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
204	rs := &DefaultObjectAccessControlsService{s: s}
205	return rs
206}
207
208type DefaultObjectAccessControlsService struct {
209	s *Service
210}
211
212func NewNotificationsService(s *Service) *NotificationsService {
213	rs := &NotificationsService{s: s}
214	return rs
215}
216
217type NotificationsService struct {
218	s *Service
219}
220
221func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
222	rs := &ObjectAccessControlsService{s: s}
223	return rs
224}
225
226type ObjectAccessControlsService struct {
227	s *Service
228}
229
230func NewObjectsService(s *Service) *ObjectsService {
231	rs := &ObjectsService{s: s}
232	return rs
233}
234
235type ObjectsService struct {
236	s *Service
237}
238
239func NewProjectsService(s *Service) *ProjectsService {
240	rs := &ProjectsService{s: s}
241	rs.HmacKeys = NewProjectsHmacKeysService(s)
242	rs.ServiceAccount = NewProjectsServiceAccountService(s)
243	return rs
244}
245
246type ProjectsService struct {
247	s *Service
248
249	HmacKeys *ProjectsHmacKeysService
250
251	ServiceAccount *ProjectsServiceAccountService
252}
253
254func NewProjectsHmacKeysService(s *Service) *ProjectsHmacKeysService {
255	rs := &ProjectsHmacKeysService{s: s}
256	return rs
257}
258
259type ProjectsHmacKeysService struct {
260	s *Service
261}
262
263func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
264	rs := &ProjectsServiceAccountService{s: s}
265	return rs
266}
267
268type ProjectsServiceAccountService struct {
269	s *Service
270}
271
272// Bucket: A bucket.
273type Bucket struct {
274	// Acl: Access controls on the bucket.
275	Acl []*BucketAccessControl `json:"acl,omitempty"`
276
277	// Billing: The bucket's billing configuration.
278	Billing *BucketBilling `json:"billing,omitempty"`
279
280	// Cors: The bucket's Cross-Origin Resource Sharing (CORS)
281	// configuration.
282	Cors []*BucketCors `json:"cors,omitempty"`
283
284	// DefaultEventBasedHold: The default value for event-based hold on
285	// newly created objects in this bucket. Event-based hold is a way to
286	// retain objects indefinitely until an event occurs, signified by the
287	// hold's release. After being released, such objects will be subject to
288	// bucket-level retention (if any). One sample use case of this flag is
289	// for banks to hold loan documents for at least 3 years after loan is
290	// paid in full. Here, bucket-level retention is 3 years and the event
291	// is loan being paid in full. In this example, these objects will be
292	// held intact for any number of years until the event has occurred
293	// (event-based hold on the object is released) and then 3 more years
294	// after that. That means retention duration of the objects begins from
295	// the moment event-based hold transitioned from true to false. Objects
296	// under event-based hold cannot be deleted, overwritten or archived
297	// until the hold is removed.
298	DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
299
300	// DefaultObjectAcl: Default access controls to apply to new objects
301	// when no ACL is provided.
302	DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
303
304	// Encryption: Encryption configuration for a bucket.
305	Encryption *BucketEncryption `json:"encryption,omitempty"`
306
307	// Etag: HTTP 1.1 Entity tag for the bucket.
308	Etag string `json:"etag,omitempty"`
309
310	// IamConfiguration: The bucket's IAM configuration.
311	IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"`
312
313	// Id: The ID of the bucket. For buckets, the id and name properties are
314	// the same.
315	Id string `json:"id,omitempty"`
316
317	// Kind: The kind of item this is. For buckets, this is always
318	// storage#bucket.
319	Kind string `json:"kind,omitempty"`
320
321	// Labels: User-provided labels, in key/value pairs.
322	Labels map[string]string `json:"labels,omitempty"`
323
324	// Lifecycle: The bucket's lifecycle configuration. See lifecycle
325	// management for more information.
326	Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
327
328	// Location: The location of the bucket. Object data for objects in the
329	// bucket resides in physical storage within this region. Defaults to
330	// US. See the developer's guide for the authoritative list.
331	Location string `json:"location,omitempty"`
332
333	// LocationType: The type of the bucket location.
334	LocationType string `json:"locationType,omitempty"`
335
336	// Logging: The bucket's logging configuration, which defines the
337	// destination bucket and optional name prefix for the current bucket's
338	// logs.
339	Logging *BucketLogging `json:"logging,omitempty"`
340
341	// Metageneration: The metadata generation of this bucket.
342	Metageneration int64 `json:"metageneration,omitempty,string"`
343
344	// Name: The name of the bucket.
345	Name string `json:"name,omitempty"`
346
347	// Owner: The owner of the bucket. This is always the project team's
348	// owner group.
349	Owner *BucketOwner `json:"owner,omitempty"`
350
351	// ProjectNumber: The project number of the project the bucket belongs
352	// to.
353	ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
354
355	// RetentionPolicy: The bucket's retention policy. The retention policy
356	// enforces a minimum retention time for all objects contained in the
357	// bucket, based on their creation time. Any attempt to overwrite or
358	// delete objects younger than the retention period will result in a
359	// PERMISSION_DENIED error. An unlocked retention policy can be modified
360	// or removed from the bucket via a storage.buckets.update operation. A
361	// locked retention policy cannot be removed or shortened in duration
362	// for the lifetime of the bucket. Attempting to remove or decrease
363	// period of a locked retention policy will result in a
364	// PERMISSION_DENIED error.
365	RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"`
366
367	// SelfLink: The URI of this bucket.
368	SelfLink string `json:"selfLink,omitempty"`
369
370	// StorageClass: The bucket's default storage class, used whenever no
371	// storageClass is specified for a newly-created object. This defines
372	// how objects in the bucket are stored and determines the SLA and the
373	// cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD,
374	// NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value
375	// is not specified when the bucket is created, it will default to
376	// STANDARD. For more information, see storage classes.
377	StorageClass string `json:"storageClass,omitempty"`
378
379	// TimeCreated: The creation time of the bucket in RFC 3339 format.
380	TimeCreated string `json:"timeCreated,omitempty"`
381
382	// Updated: The modification time of the bucket in RFC 3339 format.
383	Updated string `json:"updated,omitempty"`
384
385	// Versioning: The bucket's versioning configuration.
386	Versioning *BucketVersioning `json:"versioning,omitempty"`
387
388	// Website: The bucket's website configuration, controlling how the
389	// service behaves when accessing bucket contents as a web site. See the
390	// Static Website Examples for more information.
391	Website *BucketWebsite `json:"website,omitempty"`
392
393	// ServerResponse contains the HTTP response code and headers from the
394	// server.
395	googleapi.ServerResponse `json:"-"`
396
397	// ForceSendFields is a list of field names (e.g. "Acl") to
398	// unconditionally include in API requests. By default, fields with
399	// empty values are omitted from API requests. However, any non-pointer,
400	// non-interface field appearing in ForceSendFields will be sent to the
401	// server regardless of whether the field is empty or not. This may be
402	// used to include empty fields in Patch requests.
403	ForceSendFields []string `json:"-"`
404
405	// NullFields is a list of field names (e.g. "Acl") to include in API
406	// requests with the JSON null value. By default, fields with empty
407	// values are omitted from API requests. However, any field with an
408	// empty value appearing in NullFields will be sent to the server as
409	// null. It is an error if a field in this list has a non-empty value.
410	// This may be used to include null fields in Patch requests.
411	NullFields []string `json:"-"`
412}
413
414func (s *Bucket) MarshalJSON() ([]byte, error) {
415	type NoMethod Bucket
416	raw := NoMethod(*s)
417	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
418}
419
420// BucketBilling: The bucket's billing configuration.
421type BucketBilling struct {
422	// RequesterPays: When set to true, Requester Pays is enabled for this
423	// bucket.
424	RequesterPays bool `json:"requesterPays,omitempty"`
425
426	// ForceSendFields is a list of field names (e.g. "RequesterPays") to
427	// unconditionally include in API requests. By default, fields with
428	// empty values are omitted from API requests. However, any non-pointer,
429	// non-interface field appearing in ForceSendFields will be sent to the
430	// server regardless of whether the field is empty or not. This may be
431	// used to include empty fields in Patch requests.
432	ForceSendFields []string `json:"-"`
433
434	// NullFields is a list of field names (e.g. "RequesterPays") to include
435	// in API requests with the JSON null value. By default, fields with
436	// empty values are omitted from API requests. However, any field with
437	// an empty value appearing in NullFields will be sent to the server as
438	// null. It is an error if a field in this list has a non-empty value.
439	// This may be used to include null fields in Patch requests.
440	NullFields []string `json:"-"`
441}
442
443func (s *BucketBilling) MarshalJSON() ([]byte, error) {
444	type NoMethod BucketBilling
445	raw := NoMethod(*s)
446	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
447}
448
449type BucketCors struct {
450	// MaxAgeSeconds: The value, in seconds, to return in the
451	// Access-Control-Max-Age header used in preflight responses.
452	MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
453
454	// Method: The list of HTTP methods on which to include CORS response
455	// headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list
456	// of methods, and means "any method".
457	Method []string `json:"method,omitempty"`
458
459	// Origin: The list of Origins eligible to receive CORS response
460	// headers. Note: "*" is permitted in the list of origins, and means
461	// "any Origin".
462	Origin []string `json:"origin,omitempty"`
463
464	// ResponseHeader: The list of HTTP headers other than the simple
465	// response headers to give permission for the user-agent to share
466	// across domains.
467	ResponseHeader []string `json:"responseHeader,omitempty"`
468
469	// ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
470	// unconditionally include in API requests. By default, fields with
471	// empty values are omitted from API requests. However, any non-pointer,
472	// non-interface field appearing in ForceSendFields will be sent to the
473	// server regardless of whether the field is empty or not. This may be
474	// used to include empty fields in Patch requests.
475	ForceSendFields []string `json:"-"`
476
477	// NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
478	// in API requests with the JSON null value. By default, fields with
479	// empty values are omitted from API requests. However, any field with
480	// an empty value appearing in NullFields will be sent to the server as
481	// null. It is an error if a field in this list has a non-empty value.
482	// This may be used to include null fields in Patch requests.
483	NullFields []string `json:"-"`
484}
485
486func (s *BucketCors) MarshalJSON() ([]byte, error) {
487	type NoMethod BucketCors
488	raw := NoMethod(*s)
489	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
490}
491
492// BucketEncryption: Encryption configuration for a bucket.
493type BucketEncryption struct {
494	// DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt
495	// objects inserted into this bucket, if no encryption method is
496	// specified.
497	DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
498
499	// ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName")
500	// to unconditionally include in API requests. By default, fields with
501	// empty values are omitted from API requests. However, any non-pointer,
502	// non-interface field appearing in ForceSendFields will be sent to the
503	// server regardless of whether the field is empty or not. This may be
504	// used to include empty fields in Patch requests.
505	ForceSendFields []string `json:"-"`
506
507	// NullFields is a list of field names (e.g. "DefaultKmsKeyName") to
508	// include in API requests with the JSON null value. By default, fields
509	// with empty values are omitted from API requests. However, any field
510	// with an empty value appearing in NullFields will be sent to the
511	// server as null. It is an error if a field in this list has a
512	// non-empty value. This may be used to include null fields in Patch
513	// requests.
514	NullFields []string `json:"-"`
515}
516
517func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
518	type NoMethod BucketEncryption
519	raw := NoMethod(*s)
520	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
521}
522
523// BucketIamConfiguration: The bucket's IAM configuration.
524type BucketIamConfiguration struct {
525	// BucketPolicyOnly: The bucket's Bucket Policy Only configuration.
526	BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"`
527
528	// UniformBucketLevelAccess: The bucket's uniform bucket-level access
529	// configuration.
530	UniformBucketLevelAccess *BucketIamConfigurationUniformBucketLevelAccess `json:"uniformBucketLevelAccess,omitempty"`
531
532	// ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to
533	// unconditionally include in API requests. By default, fields with
534	// empty values are omitted from API requests. However, any non-pointer,
535	// non-interface field appearing in ForceSendFields will be sent to the
536	// server regardless of whether the field is empty or not. This may be
537	// used to include empty fields in Patch requests.
538	ForceSendFields []string `json:"-"`
539
540	// NullFields is a list of field names (e.g. "BucketPolicyOnly") to
541	// include in API requests with the JSON null value. By default, fields
542	// with empty values are omitted from API requests. However, any field
543	// with an empty value appearing in NullFields will be sent to the
544	// server as null. It is an error if a field in this list has a
545	// non-empty value. This may be used to include null fields in Patch
546	// requests.
547	NullFields []string `json:"-"`
548}
549
550func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) {
551	type NoMethod BucketIamConfiguration
552	raw := NoMethod(*s)
553	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
554}
555
556// BucketIamConfigurationBucketPolicyOnly: The bucket's Bucket Policy
557// Only configuration.
558type BucketIamConfigurationBucketPolicyOnly struct {
559	// Enabled: If set, access is controlled only by bucket-level or above
560	// IAM policies.
561	Enabled bool `json:"enabled,omitempty"`
562
563	// LockedTime: The deadline for changing
564	// iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC
565	// 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed
566	// from true to false until the locked time, after which the field is
567	// immutable.
568	LockedTime string `json:"lockedTime,omitempty"`
569
570	// ForceSendFields is a list of field names (e.g. "Enabled") to
571	// unconditionally include in API requests. By default, fields with
572	// empty values are omitted from API requests. However, any non-pointer,
573	// non-interface field appearing in ForceSendFields will be sent to the
574	// server regardless of whether the field is empty or not. This may be
575	// used to include empty fields in Patch requests.
576	ForceSendFields []string `json:"-"`
577
578	// NullFields is a list of field names (e.g. "Enabled") to include in
579	// API requests with the JSON null value. By default, fields with empty
580	// values are omitted from API requests. However, any field with an
581	// empty value appearing in NullFields will be sent to the server as
582	// null. It is an error if a field in this list has a non-empty value.
583	// This may be used to include null fields in Patch requests.
584	NullFields []string `json:"-"`
585}
586
587func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) {
588	type NoMethod BucketIamConfigurationBucketPolicyOnly
589	raw := NoMethod(*s)
590	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
591}
592
593// BucketIamConfigurationUniformBucketLevelAccess: The bucket's uniform
594// bucket-level access configuration.
595type BucketIamConfigurationUniformBucketLevelAccess struct {
596	// Enabled: If set, access is controlled only by bucket-level or above
597	// IAM policies.
598	Enabled bool `json:"enabled,omitempty"`
599
600	// LockedTime: The deadline for changing
601	// iamConfiguration.uniformBucketLevelAccess.enabled from true to false
602	// in RFC 3339  format.
603	// iamConfiguration.uniformBucketLevelAccess.enabled may be changed from
604	// true to false until the locked time, after which the field is
605	// immutable.
606	LockedTime string `json:"lockedTime,omitempty"`
607
608	// ForceSendFields is a list of field names (e.g. "Enabled") to
609	// unconditionally include in API requests. By default, fields with
610	// empty values are omitted from API requests. However, any non-pointer,
611	// non-interface field appearing in ForceSendFields will be sent to the
612	// server regardless of whether the field is empty or not. This may be
613	// used to include empty fields in Patch requests.
614	ForceSendFields []string `json:"-"`
615
616	// NullFields is a list of field names (e.g. "Enabled") to include in
617	// API requests with the JSON null value. By default, fields with empty
618	// values are omitted from API requests. However, any field with an
619	// empty value appearing in NullFields will be sent to the server as
620	// null. It is an error if a field in this list has a non-empty value.
621	// This may be used to include null fields in Patch requests.
622	NullFields []string `json:"-"`
623}
624
625func (s *BucketIamConfigurationUniformBucketLevelAccess) MarshalJSON() ([]byte, error) {
626	type NoMethod BucketIamConfigurationUniformBucketLevelAccess
627	raw := NoMethod(*s)
628	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
629}
630
631// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
632// management for more information.
633type BucketLifecycle struct {
634	// Rule: A lifecycle management rule, which is made of an action to take
635	// and the condition(s) under which the action will be taken.
636	Rule []*BucketLifecycleRule `json:"rule,omitempty"`
637
638	// ForceSendFields is a list of field names (e.g. "Rule") to
639	// unconditionally include in API requests. By default, fields with
640	// empty values are omitted from API requests. However, any non-pointer,
641	// non-interface field appearing in ForceSendFields will be sent to the
642	// server regardless of whether the field is empty or not. This may be
643	// used to include empty fields in Patch requests.
644	ForceSendFields []string `json:"-"`
645
646	// NullFields is a list of field names (e.g. "Rule") to include in API
647	// requests with the JSON null value. By default, fields with empty
648	// values are omitted from API requests. However, any field with an
649	// empty value appearing in NullFields will be sent to the server as
650	// null. It is an error if a field in this list has a non-empty value.
651	// This may be used to include null fields in Patch requests.
652	NullFields []string `json:"-"`
653}
654
655func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
656	type NoMethod BucketLifecycle
657	raw := NoMethod(*s)
658	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
659}
660
661type BucketLifecycleRule struct {
662	// Action: The action to take.
663	Action *BucketLifecycleRuleAction `json:"action,omitempty"`
664
665	// Condition: The condition(s) under which the action will be taken.
666	Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
667
668	// ForceSendFields is a list of field names (e.g. "Action") to
669	// unconditionally include in API requests. By default, fields with
670	// empty values are omitted from API requests. However, any non-pointer,
671	// non-interface field appearing in ForceSendFields will be sent to the
672	// server regardless of whether the field is empty or not. This may be
673	// used to include empty fields in Patch requests.
674	ForceSendFields []string `json:"-"`
675
676	// NullFields is a list of field names (e.g. "Action") to include in API
677	// requests with the JSON null value. By default, fields with empty
678	// values are omitted from API requests. However, any field with an
679	// empty value appearing in NullFields will be sent to the server as
680	// null. It is an error if a field in this list has a non-empty value.
681	// This may be used to include null fields in Patch requests.
682	NullFields []string `json:"-"`
683}
684
685func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
686	type NoMethod BucketLifecycleRule
687	raw := NoMethod(*s)
688	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
689}
690
691// BucketLifecycleRuleAction: The action to take.
692type BucketLifecycleRuleAction struct {
693	// StorageClass: Target storage class. Required iff the type of the
694	// action is SetStorageClass.
695	StorageClass string `json:"storageClass,omitempty"`
696
697	// Type: Type of the action. Currently, only Delete and SetStorageClass
698	// are supported.
699	Type string `json:"type,omitempty"`
700
701	// ForceSendFields is a list of field names (e.g. "StorageClass") to
702	// unconditionally include in API requests. By default, fields with
703	// empty values are omitted from API requests. However, any non-pointer,
704	// non-interface field appearing in ForceSendFields will be sent to the
705	// server regardless of whether the field is empty or not. This may be
706	// used to include empty fields in Patch requests.
707	ForceSendFields []string `json:"-"`
708
709	// NullFields is a list of field names (e.g. "StorageClass") to include
710	// in API requests with the JSON null value. By default, fields with
711	// empty values are omitted from API requests. However, any field with
712	// an empty value appearing in NullFields will be sent to the server as
713	// null. It is an error if a field in this list has a non-empty value.
714	// This may be used to include null fields in Patch requests.
715	NullFields []string `json:"-"`
716}
717
718func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
719	type NoMethod BucketLifecycleRuleAction
720	raw := NoMethod(*s)
721	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
722}
723
724// BucketLifecycleRuleCondition: The condition(s) under which the action
725// will be taken.
726type BucketLifecycleRuleCondition struct {
727	// Age: Age of an object (in days). This condition is satisfied when an
728	// object reaches the specified age.
729	Age int64 `json:"age,omitempty"`
730
731	// CreatedBefore: A date in RFC 3339 format with only the date part (for
732	// instance, "2013-01-15"). This condition is satisfied when an object
733	// is created before midnight of the specified date in UTC.
734	CreatedBefore string `json:"createdBefore,omitempty"`
735
736	// IsLive: Relevant only for versioned objects. If the value is true,
737	// this condition matches live objects; if the value is false, it
738	// matches archived objects.
739	IsLive *bool `json:"isLive,omitempty"`
740
741	// MatchesPattern: A regular expression that satisfies the RE2 syntax.
742	// This condition is satisfied when the name of the object matches the
743	// RE2 pattern. Note: This feature is currently in the "Early Access"
744	// launch stage and is only available to a whitelisted set of users;
745	// that means that this feature may be changed in backward-incompatible
746	// ways and that it is not guaranteed to be released.
747	MatchesPattern string `json:"matchesPattern,omitempty"`
748
749	// MatchesStorageClass: Objects having any of the storage classes
750	// specified by this condition will be matched. Values include
751	// MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and
752	// DURABLE_REDUCED_AVAILABILITY.
753	MatchesStorageClass []string `json:"matchesStorageClass,omitempty"`
754
755	// NumNewerVersions: Relevant only for versioned objects. If the value
756	// is N, this condition is satisfied when there are at least N versions
757	// (including the live version) newer than this version of the object.
758	NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
759
760	// ForceSendFields is a list of field names (e.g. "Age") to
761	// unconditionally include in API requests. By default, fields with
762	// empty values are omitted from API requests. However, any non-pointer,
763	// non-interface field appearing in ForceSendFields will be sent to the
764	// server regardless of whether the field is empty or not. This may be
765	// used to include empty fields in Patch requests.
766	ForceSendFields []string `json:"-"`
767
768	// NullFields is a list of field names (e.g. "Age") to include in API
769	// requests with the JSON null value. By default, fields with empty
770	// values are omitted from API requests. However, any field with an
771	// empty value appearing in NullFields will be sent to the server as
772	// null. It is an error if a field in this list has a non-empty value.
773	// This may be used to include null fields in Patch requests.
774	NullFields []string `json:"-"`
775}
776
777func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
778	type NoMethod BucketLifecycleRuleCondition
779	raw := NoMethod(*s)
780	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
781}
782
783// BucketLogging: The bucket's logging configuration, which defines the
784// destination bucket and optional name prefix for the current bucket's
785// logs.
786type BucketLogging struct {
787	// LogBucket: The destination bucket where the current bucket's logs
788	// should be placed.
789	LogBucket string `json:"logBucket,omitempty"`
790
791	// LogObjectPrefix: A prefix for log object names.
792	LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
793
794	// ForceSendFields is a list of field names (e.g. "LogBucket") to
795	// unconditionally include in API requests. By default, fields with
796	// empty values are omitted from API requests. However, any non-pointer,
797	// non-interface field appearing in ForceSendFields will be sent to the
798	// server regardless of whether the field is empty or not. This may be
799	// used to include empty fields in Patch requests.
800	ForceSendFields []string `json:"-"`
801
802	// NullFields is a list of field names (e.g. "LogBucket") to include in
803	// API requests with the JSON null value. By default, fields with empty
804	// values are omitted from API requests. However, any field with an
805	// empty value appearing in NullFields will be sent to the server as
806	// null. It is an error if a field in this list has a non-empty value.
807	// This may be used to include null fields in Patch requests.
808	NullFields []string `json:"-"`
809}
810
811func (s *BucketLogging) MarshalJSON() ([]byte, error) {
812	type NoMethod BucketLogging
813	raw := NoMethod(*s)
814	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
815}
816
817// BucketOwner: The owner of the bucket. This is always the project
818// team's owner group.
819type BucketOwner struct {
820	// Entity: The entity, in the form project-owner-projectId.
821	Entity string `json:"entity,omitempty"`
822
823	// EntityId: The ID for the entity.
824	EntityId string `json:"entityId,omitempty"`
825
826	// ForceSendFields is a list of field names (e.g. "Entity") to
827	// unconditionally include in API requests. By default, fields with
828	// empty values are omitted from API requests. However, any non-pointer,
829	// non-interface field appearing in ForceSendFields will be sent to the
830	// server regardless of whether the field is empty or not. This may be
831	// used to include empty fields in Patch requests.
832	ForceSendFields []string `json:"-"`
833
834	// NullFields is a list of field names (e.g. "Entity") to include in API
835	// requests with the JSON null value. By default, fields with empty
836	// values are omitted from API requests. However, any field with an
837	// empty value appearing in NullFields will be sent to the server as
838	// null. It is an error if a field in this list has a non-empty value.
839	// This may be used to include null fields in Patch requests.
840	NullFields []string `json:"-"`
841}
842
843func (s *BucketOwner) MarshalJSON() ([]byte, error) {
844	type NoMethod BucketOwner
845	raw := NoMethod(*s)
846	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
847}
848
849// BucketRetentionPolicy: The bucket's retention policy. The retention
850// policy enforces a minimum retention time for all objects contained in
851// the bucket, based on their creation time. Any attempt to overwrite or
852// delete objects younger than the retention period will result in a
853// PERMISSION_DENIED error. An unlocked retention policy can be modified
854// or removed from the bucket via a storage.buckets.update operation. A
855// locked retention policy cannot be removed or shortened in duration
856// for the lifetime of the bucket. Attempting to remove or decrease
857// period of a locked retention policy will result in a
858// PERMISSION_DENIED error.
859type BucketRetentionPolicy struct {
860	// EffectiveTime: Server-determined value that indicates the time from
861	// which policy was enforced and effective. This value is in RFC 3339
862	// format.
863	EffectiveTime string `json:"effectiveTime,omitempty"`
864
865	// IsLocked: Once locked, an object retention policy cannot be modified.
866	IsLocked bool `json:"isLocked,omitempty"`
867
868	// RetentionPeriod: The duration in seconds that objects need to be
869	// retained. Retention duration must be greater than zero and less than
870	// 100 years. Note that enforcement of retention periods less than a day
871	// is not guaranteed. Such periods should only be used for testing
872	// purposes.
873	RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"`
874
875	// ForceSendFields is a list of field names (e.g. "EffectiveTime") to
876	// unconditionally include in API requests. By default, fields with
877	// empty values are omitted from API requests. However, any non-pointer,
878	// non-interface field appearing in ForceSendFields will be sent to the
879	// server regardless of whether the field is empty or not. This may be
880	// used to include empty fields in Patch requests.
881	ForceSendFields []string `json:"-"`
882
883	// NullFields is a list of field names (e.g. "EffectiveTime") to include
884	// in API requests with the JSON null value. By default, fields with
885	// empty values are omitted from API requests. However, any field with
886	// an empty value appearing in NullFields will be sent to the server as
887	// null. It is an error if a field in this list has a non-empty value.
888	// This may be used to include null fields in Patch requests.
889	NullFields []string `json:"-"`
890}
891
892func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) {
893	type NoMethod BucketRetentionPolicy
894	raw := NoMethod(*s)
895	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
896}
897
898// BucketVersioning: The bucket's versioning configuration.
899type BucketVersioning struct {
900	// Enabled: While set to true, versioning is fully enabled for this
901	// bucket.
902	Enabled bool `json:"enabled,omitempty"`
903
904	// ForceSendFields is a list of field names (e.g. "Enabled") to
905	// unconditionally include in API requests. By default, fields with
906	// empty values are omitted from API requests. However, any non-pointer,
907	// non-interface field appearing in ForceSendFields will be sent to the
908	// server regardless of whether the field is empty or not. This may be
909	// used to include empty fields in Patch requests.
910	ForceSendFields []string `json:"-"`
911
912	// NullFields is a list of field names (e.g. "Enabled") to include in
913	// API requests with the JSON null value. By default, fields with empty
914	// values are omitted from API requests. However, any field with an
915	// empty value appearing in NullFields will be sent to the server as
916	// null. It is an error if a field in this list has a non-empty value.
917	// This may be used to include null fields in Patch requests.
918	NullFields []string `json:"-"`
919}
920
921func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
922	type NoMethod BucketVersioning
923	raw := NoMethod(*s)
924	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
925}
926
927// BucketWebsite: The bucket's website configuration, controlling how
928// the service behaves when accessing bucket contents as a web site. See
929// the Static Website Examples for more information.
930type BucketWebsite struct {
931	// MainPageSuffix: If the requested object path is missing, the service
932	// will ensure the path has a trailing '/', append this suffix, and
933	// attempt to retrieve the resulting object. This allows the creation of
934	// index.html objects to represent directory pages.
935	MainPageSuffix string `json:"mainPageSuffix,omitempty"`
936
937	// NotFoundPage: If the requested object path is missing, and any
938	// mainPageSuffix object is missing, if applicable, the service will
939	// return the named object from this bucket as the content for a 404 Not
940	// Found result.
941	NotFoundPage string `json:"notFoundPage,omitempty"`
942
943	// ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
944	// unconditionally include in API requests. By default, fields with
945	// empty values are omitted from API requests. However, any non-pointer,
946	// non-interface field appearing in ForceSendFields will be sent to the
947	// server regardless of whether the field is empty or not. This may be
948	// used to include empty fields in Patch requests.
949	ForceSendFields []string `json:"-"`
950
951	// NullFields is a list of field names (e.g. "MainPageSuffix") to
952	// include in API requests with the JSON null value. By default, fields
953	// with empty values are omitted from API requests. However, any field
954	// with an empty value appearing in NullFields will be sent to the
955	// server as null. It is an error if a field in this list has a
956	// non-empty value. This may be used to include null fields in Patch
957	// requests.
958	NullFields []string `json:"-"`
959}
960
961func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
962	type NoMethod BucketWebsite
963	raw := NoMethod(*s)
964	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
965}
966
967// BucketAccessControl: An access-control entry.
968type BucketAccessControl struct {
969	// Bucket: The name of the bucket.
970	Bucket string `json:"bucket,omitempty"`
971
972	// Domain: The domain associated with the entity, if any.
973	Domain string `json:"domain,omitempty"`
974
975	// Email: The email address associated with the entity, if any.
976	Email string `json:"email,omitempty"`
977
978	// Entity: The entity holding the permission, in one of the following
979	// forms:
980	// - user-userId
981	// - user-email
982	// - group-groupId
983	// - group-email
984	// - domain-domain
985	// - project-team-projectId
986	// - allUsers
987	// - allAuthenticatedUsers Examples:
988	// - The user liz@example.com would be user-liz@example.com.
989	// - The group example@googlegroups.com would be
990	// group-example@googlegroups.com.
991	// - To refer to all members of the Google Apps for Business domain
992	// example.com, the entity would be domain-example.com.
993	Entity string `json:"entity,omitempty"`
994
995	// EntityId: The ID for the entity, if any.
996	EntityId string `json:"entityId,omitempty"`
997
998	// Etag: HTTP 1.1 Entity tag for the access-control entry.
999	Etag string `json:"etag,omitempty"`
1000
1001	// Id: The ID of the access-control entry.
1002	Id string `json:"id,omitempty"`
1003
1004	// Kind: The kind of item this is. For bucket access control entries,
1005	// this is always storage#bucketAccessControl.
1006	Kind string `json:"kind,omitempty"`
1007
1008	// ProjectTeam: The project team associated with the entity, if any.
1009	ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
1010
1011	// Role: The access permission for the entity.
1012	Role string `json:"role,omitempty"`
1013
1014	// SelfLink: The link to this access-control entry.
1015	SelfLink string `json:"selfLink,omitempty"`
1016
1017	// ServerResponse contains the HTTP response code and headers from the
1018	// server.
1019	googleapi.ServerResponse `json:"-"`
1020
1021	// ForceSendFields is a list of field names (e.g. "Bucket") to
1022	// unconditionally include in API requests. By default, fields with
1023	// empty values are omitted from API requests. However, any non-pointer,
1024	// non-interface field appearing in ForceSendFields will be sent to the
1025	// server regardless of whether the field is empty or not. This may be
1026	// used to include empty fields in Patch requests.
1027	ForceSendFields []string `json:"-"`
1028
1029	// NullFields is a list of field names (e.g. "Bucket") to include in API
1030	// requests with the JSON null value. By default, fields with empty
1031	// values are omitted from API requests. However, any field with an
1032	// empty value appearing in NullFields will be sent to the server as
1033	// null. It is an error if a field in this list has a non-empty value.
1034	// This may be used to include null fields in Patch requests.
1035	NullFields []string `json:"-"`
1036}
1037
1038func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
1039	type NoMethod BucketAccessControl
1040	raw := NoMethod(*s)
1041	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1042}
1043
1044// BucketAccessControlProjectTeam: The project team associated with the
1045// entity, if any.
1046type BucketAccessControlProjectTeam struct {
1047	// ProjectNumber: The project number.
1048	ProjectNumber string `json:"projectNumber,omitempty"`
1049
1050	// Team: The team.
1051	Team string `json:"team,omitempty"`
1052
1053	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1054	// unconditionally include in API requests. By default, fields with
1055	// empty values are omitted from API requests. However, any non-pointer,
1056	// non-interface field appearing in ForceSendFields will be sent to the
1057	// server regardless of whether the field is empty or not. This may be
1058	// used to include empty fields in Patch requests.
1059	ForceSendFields []string `json:"-"`
1060
1061	// NullFields is a list of field names (e.g. "ProjectNumber") to include
1062	// in API requests with the JSON null value. By default, fields with
1063	// empty values are omitted from API requests. However, any field with
1064	// an empty value appearing in NullFields will be sent to the server as
1065	// null. It is an error if a field in this list has a non-empty value.
1066	// This may be used to include null fields in Patch requests.
1067	NullFields []string `json:"-"`
1068}
1069
1070func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1071	type NoMethod BucketAccessControlProjectTeam
1072	raw := NoMethod(*s)
1073	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1074}
1075
1076// BucketAccessControls: An access-control list.
1077type BucketAccessControls struct {
1078	// Items: The list of items.
1079	Items []*BucketAccessControl `json:"items,omitempty"`
1080
1081	// Kind: The kind of item this is. For lists of bucket access control
1082	// entries, this is always storage#bucketAccessControls.
1083	Kind string `json:"kind,omitempty"`
1084
1085	// ServerResponse contains the HTTP response code and headers from the
1086	// server.
1087	googleapi.ServerResponse `json:"-"`
1088
1089	// ForceSendFields is a list of field names (e.g. "Items") to
1090	// unconditionally include in API requests. By default, fields with
1091	// empty values are omitted from API requests. However, any non-pointer,
1092	// non-interface field appearing in ForceSendFields will be sent to the
1093	// server regardless of whether the field is empty or not. This may be
1094	// used to include empty fields in Patch requests.
1095	ForceSendFields []string `json:"-"`
1096
1097	// NullFields is a list of field names (e.g. "Items") to include in API
1098	// requests with the JSON null value. By default, fields with empty
1099	// values are omitted from API requests. However, any field with an
1100	// empty value appearing in NullFields will be sent to the server as
1101	// null. It is an error if a field in this list has a non-empty value.
1102	// This may be used to include null fields in Patch requests.
1103	NullFields []string `json:"-"`
1104}
1105
1106func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
1107	type NoMethod BucketAccessControls
1108	raw := NoMethod(*s)
1109	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1110}
1111
1112// Buckets: A list of buckets.
1113type Buckets struct {
1114	// Items: The list of items.
1115	Items []*Bucket `json:"items,omitempty"`
1116
1117	// Kind: The kind of item this is. For lists of buckets, this is always
1118	// storage#buckets.
1119	Kind string `json:"kind,omitempty"`
1120
1121	// NextPageToken: The continuation token, used to page through large
1122	// result sets. Provide this value in a subsequent request to return the
1123	// next page of results.
1124	NextPageToken string `json:"nextPageToken,omitempty"`
1125
1126	// ServerResponse contains the HTTP response code and headers from the
1127	// server.
1128	googleapi.ServerResponse `json:"-"`
1129
1130	// ForceSendFields is a list of field names (e.g. "Items") to
1131	// unconditionally include in API requests. By default, fields with
1132	// empty values are omitted from API requests. However, any non-pointer,
1133	// non-interface field appearing in ForceSendFields will be sent to the
1134	// server regardless of whether the field is empty or not. This may be
1135	// used to include empty fields in Patch requests.
1136	ForceSendFields []string `json:"-"`
1137
1138	// NullFields is a list of field names (e.g. "Items") to include in API
1139	// requests with the JSON null value. By default, fields with empty
1140	// values are omitted from API requests. However, any field with an
1141	// empty value appearing in NullFields will be sent to the server as
1142	// null. It is an error if a field in this list has a non-empty value.
1143	// This may be used to include null fields in Patch requests.
1144	NullFields []string `json:"-"`
1145}
1146
1147func (s *Buckets) MarshalJSON() ([]byte, error) {
1148	type NoMethod Buckets
1149	raw := NoMethod(*s)
1150	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1151}
1152
1153// Channel: An notification channel used to watch for resource changes.
1154type Channel struct {
1155	// Address: The address where notifications are delivered for this
1156	// channel.
1157	Address string `json:"address,omitempty"`
1158
1159	// Expiration: Date and time of notification channel expiration,
1160	// expressed as a Unix timestamp, in milliseconds. Optional.
1161	Expiration int64 `json:"expiration,omitempty,string"`
1162
1163	// Id: A UUID or similar unique string that identifies this channel.
1164	Id string `json:"id,omitempty"`
1165
1166	// Kind: Identifies this as a notification channel used to watch for
1167	// changes to a resource, which is "api#channel".
1168	Kind string `json:"kind,omitempty"`
1169
1170	// Params: Additional parameters controlling delivery channel behavior.
1171	// Optional.
1172	Params map[string]string `json:"params,omitempty"`
1173
1174	// Payload: A Boolean value to indicate whether payload is wanted.
1175	// Optional.
1176	Payload bool `json:"payload,omitempty"`
1177
1178	// ResourceId: An opaque ID that identifies the resource being watched
1179	// on this channel. Stable across different API versions.
1180	ResourceId string `json:"resourceId,omitempty"`
1181
1182	// ResourceUri: A version-specific identifier for the watched resource.
1183	ResourceUri string `json:"resourceUri,omitempty"`
1184
1185	// Token: An arbitrary string delivered to the target address with each
1186	// notification delivered over this channel. Optional.
1187	Token string `json:"token,omitempty"`
1188
1189	// Type: The type of delivery mechanism used for this channel.
1190	Type string `json:"type,omitempty"`
1191
1192	// ServerResponse contains the HTTP response code and headers from the
1193	// server.
1194	googleapi.ServerResponse `json:"-"`
1195
1196	// ForceSendFields is a list of field names (e.g. "Address") to
1197	// unconditionally include in API requests. By default, fields with
1198	// empty values are omitted from API requests. However, any non-pointer,
1199	// non-interface field appearing in ForceSendFields will be sent to the
1200	// server regardless of whether the field is empty or not. This may be
1201	// used to include empty fields in Patch requests.
1202	ForceSendFields []string `json:"-"`
1203
1204	// NullFields is a list of field names (e.g. "Address") to include in
1205	// API requests with the JSON null value. By default, fields with empty
1206	// values are omitted from API requests. However, any field with an
1207	// empty value appearing in NullFields will be sent to the server as
1208	// null. It is an error if a field in this list has a non-empty value.
1209	// This may be used to include null fields in Patch requests.
1210	NullFields []string `json:"-"`
1211}
1212
1213func (s *Channel) MarshalJSON() ([]byte, error) {
1214	type NoMethod Channel
1215	raw := NoMethod(*s)
1216	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1217}
1218
1219// ComposeRequest: A Compose request.
1220type ComposeRequest struct {
1221	// Destination: Properties of the resulting object.
1222	Destination *Object `json:"destination,omitempty"`
1223
1224	// Kind: The kind of item this is.
1225	Kind string `json:"kind,omitempty"`
1226
1227	// SourceObjects: The list of source objects that will be concatenated
1228	// into a single object.
1229	SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
1230
1231	// ForceSendFields is a list of field names (e.g. "Destination") to
1232	// unconditionally include in API requests. By default, fields with
1233	// empty values are omitted from API requests. However, any non-pointer,
1234	// non-interface field appearing in ForceSendFields will be sent to the
1235	// server regardless of whether the field is empty or not. This may be
1236	// used to include empty fields in Patch requests.
1237	ForceSendFields []string `json:"-"`
1238
1239	// NullFields is a list of field names (e.g. "Destination") to include
1240	// in API requests with the JSON null value. By default, fields with
1241	// empty values are omitted from API requests. However, any field with
1242	// an empty value appearing in NullFields will be sent to the server as
1243	// null. It is an error if a field in this list has a non-empty value.
1244	// This may be used to include null fields in Patch requests.
1245	NullFields []string `json:"-"`
1246}
1247
1248func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
1249	type NoMethod ComposeRequest
1250	raw := NoMethod(*s)
1251	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1252}
1253
1254type ComposeRequestSourceObjects struct {
1255	// Generation: The generation of this object to use as the source.
1256	Generation int64 `json:"generation,omitempty,string"`
1257
1258	// Name: The source object's name. All source objects must reside in the
1259	// same bucket.
1260	Name string `json:"name,omitempty"`
1261
1262	// ObjectPreconditions: Conditions that must be met for this operation
1263	// to execute.
1264	ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
1265
1266	// ForceSendFields is a list of field names (e.g. "Generation") to
1267	// unconditionally include in API requests. By default, fields with
1268	// empty values are omitted from API requests. However, any non-pointer,
1269	// non-interface field appearing in ForceSendFields will be sent to the
1270	// server regardless of whether the field is empty or not. This may be
1271	// used to include empty fields in Patch requests.
1272	ForceSendFields []string `json:"-"`
1273
1274	// NullFields is a list of field names (e.g. "Generation") to include in
1275	// API requests with the JSON null value. By default, fields with empty
1276	// values are omitted from API requests. However, any field with an
1277	// empty value appearing in NullFields will be sent to the server as
1278	// null. It is an error if a field in this list has a non-empty value.
1279	// This may be used to include null fields in Patch requests.
1280	NullFields []string `json:"-"`
1281}
1282
1283func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
1284	type NoMethod ComposeRequestSourceObjects
1285	raw := NoMethod(*s)
1286	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1287}
1288
1289// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
1290// be met for this operation to execute.
1291type ComposeRequestSourceObjectsObjectPreconditions struct {
1292	// IfGenerationMatch: Only perform the composition if the generation of
1293	// the source object that would be used matches this value. If this
1294	// value and a generation are both specified, they must be the same
1295	// value or the call will fail.
1296	IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
1297
1298	// ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
1299	// to unconditionally include in API requests. By default, fields with
1300	// empty values are omitted from API requests. However, any non-pointer,
1301	// non-interface field appearing in ForceSendFields will be sent to the
1302	// server regardless of whether the field is empty or not. This may be
1303	// used to include empty fields in Patch requests.
1304	ForceSendFields []string `json:"-"`
1305
1306	// NullFields is a list of field names (e.g. "IfGenerationMatch") to
1307	// include in API requests with the JSON null value. By default, fields
1308	// with empty values are omitted from API requests. However, any field
1309	// with an empty value appearing in NullFields will be sent to the
1310	// server as null. It is an error if a field in this list has a
1311	// non-empty value. This may be used to include null fields in Patch
1312	// requests.
1313	NullFields []string `json:"-"`
1314}
1315
1316func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
1317	type NoMethod ComposeRequestSourceObjectsObjectPreconditions
1318	raw := NoMethod(*s)
1319	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1320}
1321
1322// Expr: Represents an expression text. Example: title: "User account
1323// presence" description: "Determines whether the request has a user
1324// account" expression: "size(request.user) > 0"
1325type Expr struct {
1326	// Description: An optional description of the expression. This is a
1327	// longer text which describes the expression, e.g. when hovered over it
1328	// in a UI.
1329	Description string `json:"description,omitempty"`
1330
1331	// Expression: Textual representation of an expression in Common
1332	// Expression Language syntax. The application context of the containing
1333	// message determines which well-known feature set of CEL is supported.
1334	Expression string `json:"expression,omitempty"`
1335
1336	// Location: An optional string indicating the location of the
1337	// expression for error reporting, e.g. a file name and a position in
1338	// the file.
1339	Location string `json:"location,omitempty"`
1340
1341	// Title: An optional title for the expression, i.e. a short string
1342	// describing its purpose. This can be used e.g. in UIs which allow to
1343	// enter the expression.
1344	Title string `json:"title,omitempty"`
1345
1346	// ForceSendFields is a list of field names (e.g. "Description") to
1347	// unconditionally include in API requests. By default, fields with
1348	// empty values are omitted from API requests. However, any non-pointer,
1349	// non-interface field appearing in ForceSendFields will be sent to the
1350	// server regardless of whether the field is empty or not. This may be
1351	// used to include empty fields in Patch requests.
1352	ForceSendFields []string `json:"-"`
1353
1354	// NullFields is a list of field names (e.g. "Description") to include
1355	// in API requests with the JSON null value. By default, fields with
1356	// empty values are omitted from API requests. However, any field with
1357	// an empty value appearing in NullFields will be sent to the server as
1358	// null. It is an error if a field in this list has a non-empty value.
1359	// This may be used to include null fields in Patch requests.
1360	NullFields []string `json:"-"`
1361}
1362
1363func (s *Expr) MarshalJSON() ([]byte, error) {
1364	type NoMethod Expr
1365	raw := NoMethod(*s)
1366	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1367}
1368
1369// HmacKey: JSON template to produce a JSON-style HMAC Key resource for
1370// Create responses.
1371type HmacKey struct {
1372	// Kind: The kind of item this is. For HMAC keys, this is always
1373	// storage#hmacKey.
1374	Kind string `json:"kind,omitempty"`
1375
1376	// Metadata: Key metadata.
1377	Metadata *HmacKeyMetadata `json:"metadata,omitempty"`
1378
1379	// Secret: HMAC secret key material.
1380	Secret string `json:"secret,omitempty"`
1381
1382	// ServerResponse contains the HTTP response code and headers from the
1383	// server.
1384	googleapi.ServerResponse `json:"-"`
1385
1386	// ForceSendFields is a list of field names (e.g. "Kind") to
1387	// unconditionally include in API requests. By default, fields with
1388	// empty values are omitted from API requests. However, any non-pointer,
1389	// non-interface field appearing in ForceSendFields will be sent to the
1390	// server regardless of whether the field is empty or not. This may be
1391	// used to include empty fields in Patch requests.
1392	ForceSendFields []string `json:"-"`
1393
1394	// NullFields is a list of field names (e.g. "Kind") to include in API
1395	// requests with the JSON null value. By default, fields with empty
1396	// values are omitted from API requests. However, any field with an
1397	// empty value appearing in NullFields will be sent to the server as
1398	// null. It is an error if a field in this list has a non-empty value.
1399	// This may be used to include null fields in Patch requests.
1400	NullFields []string `json:"-"`
1401}
1402
1403func (s *HmacKey) MarshalJSON() ([]byte, error) {
1404	type NoMethod HmacKey
1405	raw := NoMethod(*s)
1406	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1407}
1408
1409// HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key
1410// metadata resource.
1411type HmacKeyMetadata struct {
1412	// AccessId: The ID of the HMAC Key.
1413	AccessId string `json:"accessId,omitempty"`
1414
1415	// Etag: HTTP 1.1 Entity tag for the HMAC key.
1416	Etag string `json:"etag,omitempty"`
1417
1418	// Id: The ID of the HMAC key, including the Project ID and the Access
1419	// ID.
1420	Id string `json:"id,omitempty"`
1421
1422	// Kind: The kind of item this is. For HMAC Key metadata, this is always
1423	// storage#hmacKeyMetadata.
1424	Kind string `json:"kind,omitempty"`
1425
1426	// ProjectId: Project ID owning the service account to which the key
1427	// authenticates.
1428	ProjectId string `json:"projectId,omitempty"`
1429
1430	// SelfLink: The link to this resource.
1431	SelfLink string `json:"selfLink,omitempty"`
1432
1433	// ServiceAccountEmail: The email address of the key's associated
1434	// service account.
1435	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
1436
1437	// State: The state of the key. Can be one of ACTIVE, INACTIVE, or
1438	// DELETED.
1439	State string `json:"state,omitempty"`
1440
1441	// TimeCreated: The creation time of the HMAC key in RFC 3339 format.
1442	TimeCreated string `json:"timeCreated,omitempty"`
1443
1444	// Updated: The last modification time of the HMAC key metadata in RFC
1445	// 3339 format.
1446	Updated string `json:"updated,omitempty"`
1447
1448	// ServerResponse contains the HTTP response code and headers from the
1449	// server.
1450	googleapi.ServerResponse `json:"-"`
1451
1452	// ForceSendFields is a list of field names (e.g. "AccessId") to
1453	// unconditionally include in API requests. By default, fields with
1454	// empty values are omitted from API requests. However, any non-pointer,
1455	// non-interface field appearing in ForceSendFields will be sent to the
1456	// server regardless of whether the field is empty or not. This may be
1457	// used to include empty fields in Patch requests.
1458	ForceSendFields []string `json:"-"`
1459
1460	// NullFields is a list of field names (e.g. "AccessId") to include in
1461	// API requests with the JSON null value. By default, fields with empty
1462	// values are omitted from API requests. However, any field with an
1463	// empty value appearing in NullFields will be sent to the server as
1464	// null. It is an error if a field in this list has a non-empty value.
1465	// This may be used to include null fields in Patch requests.
1466	NullFields []string `json:"-"`
1467}
1468
1469func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) {
1470	type NoMethod HmacKeyMetadata
1471	raw := NoMethod(*s)
1472	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1473}
1474
1475// HmacKeysMetadata: A list of hmacKeys.
1476type HmacKeysMetadata struct {
1477	// Items: The list of items.
1478	Items []*HmacKeyMetadata `json:"items,omitempty"`
1479
1480	// Kind: The kind of item this is. For lists of hmacKeys, this is always
1481	// storage#hmacKeysMetadata.
1482	Kind string `json:"kind,omitempty"`
1483
1484	// NextPageToken: The continuation token, used to page through large
1485	// result sets. Provide this value in a subsequent request to return the
1486	// next page of results.
1487	NextPageToken string `json:"nextPageToken,omitempty"`
1488
1489	// ServerResponse contains the HTTP response code and headers from the
1490	// server.
1491	googleapi.ServerResponse `json:"-"`
1492
1493	// ForceSendFields is a list of field names (e.g. "Items") to
1494	// unconditionally include in API requests. By default, fields with
1495	// empty values are omitted from API requests. However, any non-pointer,
1496	// non-interface field appearing in ForceSendFields will be sent to the
1497	// server regardless of whether the field is empty or not. This may be
1498	// used to include empty fields in Patch requests.
1499	ForceSendFields []string `json:"-"`
1500
1501	// NullFields is a list of field names (e.g. "Items") to include in API
1502	// requests with the JSON null value. By default, fields with empty
1503	// values are omitted from API requests. However, any field with an
1504	// empty value appearing in NullFields will be sent to the server as
1505	// null. It is an error if a field in this list has a non-empty value.
1506	// This may be used to include null fields in Patch requests.
1507	NullFields []string `json:"-"`
1508}
1509
1510func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) {
1511	type NoMethod HmacKeysMetadata
1512	raw := NoMethod(*s)
1513	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1514}
1515
1516// Notification: A subscription to receive Google PubSub notifications.
1517type Notification struct {
1518	// CustomAttributes: An optional list of additional attributes to attach
1519	// to each Cloud PubSub message published for this notification
1520	// subscription.
1521	CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
1522
1523	// Etag: HTTP 1.1 Entity tag for this subscription notification.
1524	Etag string `json:"etag,omitempty"`
1525
1526	// EventTypes: If present, only send notifications about listed event
1527	// types. If empty, sent notifications for all event types.
1528	EventTypes []string `json:"event_types,omitempty"`
1529
1530	// Id: The ID of the notification.
1531	Id string `json:"id,omitempty"`
1532
1533	// Kind: The kind of item this is. For notifications, this is always
1534	// storage#notification.
1535	Kind string `json:"kind,omitempty"`
1536
1537	// ObjectNamePrefix: If present, only apply this notification
1538	// configuration to object names that begin with this prefix.
1539	ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
1540
1541	// PayloadFormat: The desired content of the Payload.
1542	PayloadFormat string `json:"payload_format,omitempty"`
1543
1544	// SelfLink: The canonical URL of this notification.
1545	SelfLink string `json:"selfLink,omitempty"`
1546
1547	// Topic: The Cloud PubSub topic to which this subscription publishes.
1548	// Formatted as:
1549	// '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
1550	// c}'
1551	Topic string `json:"topic,omitempty"`
1552
1553	// ServerResponse contains the HTTP response code and headers from the
1554	// server.
1555	googleapi.ServerResponse `json:"-"`
1556
1557	// ForceSendFields is a list of field names (e.g. "CustomAttributes") to
1558	// unconditionally include in API requests. By default, fields with
1559	// empty values are omitted from API requests. However, any non-pointer,
1560	// non-interface field appearing in ForceSendFields will be sent to the
1561	// server regardless of whether the field is empty or not. This may be
1562	// used to include empty fields in Patch requests.
1563	ForceSendFields []string `json:"-"`
1564
1565	// NullFields is a list of field names (e.g. "CustomAttributes") to
1566	// include in API requests with the JSON null value. By default, fields
1567	// with empty values are omitted from API requests. However, any field
1568	// with an empty value appearing in NullFields will be sent to the
1569	// server as null. It is an error if a field in this list has a
1570	// non-empty value. This may be used to include null fields in Patch
1571	// requests.
1572	NullFields []string `json:"-"`
1573}
1574
1575func (s *Notification) MarshalJSON() ([]byte, error) {
1576	type NoMethod Notification
1577	raw := NoMethod(*s)
1578	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1579}
1580
1581// Notifications: A list of notification subscriptions.
1582type Notifications struct {
1583	// Items: The list of items.
1584	Items []*Notification `json:"items,omitempty"`
1585
1586	// Kind: The kind of item this is. For lists of notifications, this is
1587	// always storage#notifications.
1588	Kind string `json:"kind,omitempty"`
1589
1590	// ServerResponse contains the HTTP response code and headers from the
1591	// server.
1592	googleapi.ServerResponse `json:"-"`
1593
1594	// ForceSendFields is a list of field names (e.g. "Items") to
1595	// unconditionally include in API requests. By default, fields with
1596	// empty values are omitted from API requests. However, any non-pointer,
1597	// non-interface field appearing in ForceSendFields will be sent to the
1598	// server regardless of whether the field is empty or not. This may be
1599	// used to include empty fields in Patch requests.
1600	ForceSendFields []string `json:"-"`
1601
1602	// NullFields is a list of field names (e.g. "Items") to include in API
1603	// requests with the JSON null value. By default, fields with empty
1604	// values are omitted from API requests. However, any field with an
1605	// empty value appearing in NullFields will be sent to the server as
1606	// null. It is an error if a field in this list has a non-empty value.
1607	// This may be used to include null fields in Patch requests.
1608	NullFields []string `json:"-"`
1609}
1610
1611func (s *Notifications) MarshalJSON() ([]byte, error) {
1612	type NoMethod Notifications
1613	raw := NoMethod(*s)
1614	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1615}
1616
1617// Object: An object.
1618type Object struct {
1619	// Acl: Access controls on the object.
1620	Acl []*ObjectAccessControl `json:"acl,omitempty"`
1621
1622	// Bucket: The name of the bucket containing this object.
1623	Bucket string `json:"bucket,omitempty"`
1624
1625	// CacheControl: Cache-Control directive for the object data. If
1626	// omitted, and the object is accessible to all anonymous users, the
1627	// default will be public, max-age=3600.
1628	CacheControl string `json:"cacheControl,omitempty"`
1629
1630	// ComponentCount: Number of underlying components that make up this
1631	// object. Components are accumulated by compose operations.
1632	ComponentCount int64 `json:"componentCount,omitempty"`
1633
1634	// ContentDisposition: Content-Disposition of the object data.
1635	ContentDisposition string `json:"contentDisposition,omitempty"`
1636
1637	// ContentEncoding: Content-Encoding of the object data.
1638	ContentEncoding string `json:"contentEncoding,omitempty"`
1639
1640	// ContentLanguage: Content-Language of the object data.
1641	ContentLanguage string `json:"contentLanguage,omitempty"`
1642
1643	// ContentType: Content-Type of the object data. If an object is stored
1644	// without a Content-Type, it is served as application/octet-stream.
1645	ContentType string `json:"contentType,omitempty"`
1646
1647	// Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
1648	// encoded using base64 in big-endian byte order. For more information
1649	// about using the CRC32c checksum, see Hashes and ETags: Best
1650	// Practices.
1651	Crc32c string `json:"crc32c,omitempty"`
1652
1653	// CustomerEncryption: Metadata of customer-supplied encryption key, if
1654	// the object is encrypted by such a key.
1655	CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
1656
1657	// Etag: HTTP 1.1 Entity tag for the object.
1658	Etag string `json:"etag,omitempty"`
1659
1660	// EventBasedHold: Whether an object is under event-based hold.
1661	// Event-based hold is a way to retain objects until an event occurs,
1662	// which is signified by the hold's release (i.e. this value is set to
1663	// false). After being released (set to false), such objects will be
1664	// subject to bucket-level retention (if any). One sample use case of
1665	// this flag is for banks to hold loan documents for at least 3 years
1666	// after loan is paid in full. Here, bucket-level retention is 3 years
1667	// and the event is the loan being paid in full. In this example, these
1668	// objects will be held intact for any number of years until the event
1669	// has occurred (event-based hold on the object is released) and then 3
1670	// more years after that. That means retention duration of the objects
1671	// begins from the moment event-based hold transitioned from true to
1672	// false.
1673	EventBasedHold bool `json:"eventBasedHold,omitempty"`
1674
1675	// Generation: The content generation of this object. Used for object
1676	// versioning.
1677	Generation int64 `json:"generation,omitempty,string"`
1678
1679	// Id: The ID of the object, including the bucket name, object name, and
1680	// generation number.
1681	Id string `json:"id,omitempty"`
1682
1683	// Kind: The kind of item this is. For objects, this is always
1684	// storage#object.
1685	Kind string `json:"kind,omitempty"`
1686
1687	// KmsKeyName: Cloud KMS Key used to encrypt this object, if the object
1688	// is encrypted by such a key.
1689	KmsKeyName string `json:"kmsKeyName,omitempty"`
1690
1691	// Md5Hash: MD5 hash of the data; encoded using base64. For more
1692	// information about using the MD5 hash, see Hashes and ETags: Best
1693	// Practices.
1694	Md5Hash string `json:"md5Hash,omitempty"`
1695
1696	// MediaLink: Media download link.
1697	MediaLink string `json:"mediaLink,omitempty"`
1698
1699	// Metadata: User-provided metadata, in key/value pairs.
1700	Metadata map[string]string `json:"metadata,omitempty"`
1701
1702	// Metageneration: The version of the metadata for this object at this
1703	// generation. Used for preconditions and for detecting changes in
1704	// metadata. A metageneration number is only meaningful in the context
1705	// of a particular generation of a particular object.
1706	Metageneration int64 `json:"metageneration,omitempty,string"`
1707
1708	// Name: The name of the object. Required if not specified by URL
1709	// parameter.
1710	Name string `json:"name,omitempty"`
1711
1712	// Owner: The owner of the object. This will always be the uploader of
1713	// the object.
1714	Owner *ObjectOwner `json:"owner,omitempty"`
1715
1716	// RetentionExpirationTime: A server-determined value that specifies the
1717	// earliest time that the object's retention period expires. This value
1718	// is in RFC 3339 format. Note 1: This field is not provided for objects
1719	// with an active event-based hold, since retention expiration is
1720	// unknown until the hold is removed. Note 2: This value can be provided
1721	// even when temporary hold is set (so that the user can reason about
1722	// policy without having to first unset the temporary hold).
1723	RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"`
1724
1725	// SelfLink: The link to this object.
1726	SelfLink string `json:"selfLink,omitempty"`
1727
1728	// Size: Content-Length of the data in bytes.
1729	Size uint64 `json:"size,omitempty,string"`
1730
1731	// StorageClass: Storage class of the object.
1732	StorageClass string `json:"storageClass,omitempty"`
1733
1734	// TemporaryHold: Whether an object is under temporary hold. While this
1735	// flag is set to true, the object is protected against deletion and
1736	// overwrites. A common use case of this flag is regulatory
1737	// investigations where objects need to be retained while the
1738	// investigation is ongoing. Note that unlike event-based hold,
1739	// temporary hold does not impact retention expiration time of an
1740	// object.
1741	TemporaryHold bool `json:"temporaryHold,omitempty"`
1742
1743	// TimeCreated: The creation time of the object in RFC 3339 format.
1744	TimeCreated string `json:"timeCreated,omitempty"`
1745
1746	// TimeDeleted: The deletion time of the object in RFC 3339 format. Will
1747	// be returned if and only if this version of the object has been
1748	// deleted.
1749	TimeDeleted string `json:"timeDeleted,omitempty"`
1750
1751	// TimeStorageClassUpdated: The time at which the object's storage class
1752	// was last changed. When the object is initially created, it will be
1753	// set to timeCreated.
1754	TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
1755
1756	// Updated: The modification time of the object metadata in RFC 3339
1757	// format.
1758	Updated string `json:"updated,omitempty"`
1759
1760	// ServerResponse contains the HTTP response code and headers from the
1761	// server.
1762	googleapi.ServerResponse `json:"-"`
1763
1764	// ForceSendFields is a list of field names (e.g. "Acl") to
1765	// unconditionally include in API requests. By default, fields with
1766	// empty values are omitted from API requests. However, any non-pointer,
1767	// non-interface field appearing in ForceSendFields will be sent to the
1768	// server regardless of whether the field is empty or not. This may be
1769	// used to include empty fields in Patch requests.
1770	ForceSendFields []string `json:"-"`
1771
1772	// NullFields is a list of field names (e.g. "Acl") to include in API
1773	// requests with the JSON null value. By default, fields with empty
1774	// values are omitted from API requests. However, any field with an
1775	// empty value appearing in NullFields will be sent to the server as
1776	// null. It is an error if a field in this list has a non-empty value.
1777	// This may be used to include null fields in Patch requests.
1778	NullFields []string `json:"-"`
1779}
1780
1781func (s *Object) MarshalJSON() ([]byte, error) {
1782	type NoMethod Object
1783	raw := NoMethod(*s)
1784	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1785}
1786
1787// ObjectCustomerEncryption: Metadata of customer-supplied encryption
1788// key, if the object is encrypted by such a key.
1789type ObjectCustomerEncryption struct {
1790	// EncryptionAlgorithm: The encryption algorithm.
1791	EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"`
1792
1793	// KeySha256: SHA256 hash value of the encryption key.
1794	KeySha256 string `json:"keySha256,omitempty"`
1795
1796	// ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm")
1797	// to unconditionally include in API requests. By default, fields with
1798	// empty values are omitted from API requests. However, any non-pointer,
1799	// non-interface field appearing in ForceSendFields will be sent to the
1800	// server regardless of whether the field is empty or not. This may be
1801	// used to include empty fields in Patch requests.
1802	ForceSendFields []string `json:"-"`
1803
1804	// NullFields is a list of field names (e.g. "EncryptionAlgorithm") to
1805	// include in API requests with the JSON null value. By default, fields
1806	// with empty values are omitted from API requests. However, any field
1807	// with an empty value appearing in NullFields will be sent to the
1808	// server as null. It is an error if a field in this list has a
1809	// non-empty value. This may be used to include null fields in Patch
1810	// requests.
1811	NullFields []string `json:"-"`
1812}
1813
1814func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
1815	type NoMethod ObjectCustomerEncryption
1816	raw := NoMethod(*s)
1817	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1818}
1819
1820// ObjectOwner: The owner of the object. This will always be the
1821// uploader of the object.
1822type ObjectOwner struct {
1823	// Entity: The entity, in the form user-userId.
1824	Entity string `json:"entity,omitempty"`
1825
1826	// EntityId: The ID for the entity.
1827	EntityId string `json:"entityId,omitempty"`
1828
1829	// ForceSendFields is a list of field names (e.g. "Entity") to
1830	// unconditionally include in API requests. By default, fields with
1831	// empty values are omitted from API requests. However, any non-pointer,
1832	// non-interface field appearing in ForceSendFields will be sent to the
1833	// server regardless of whether the field is empty or not. This may be
1834	// used to include empty fields in Patch requests.
1835	ForceSendFields []string `json:"-"`
1836
1837	// NullFields is a list of field names (e.g. "Entity") to include in API
1838	// requests with the JSON null value. By default, fields with empty
1839	// values are omitted from API requests. However, any field with an
1840	// empty value appearing in NullFields will be sent to the server as
1841	// null. It is an error if a field in this list has a non-empty value.
1842	// This may be used to include null fields in Patch requests.
1843	NullFields []string `json:"-"`
1844}
1845
1846func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
1847	type NoMethod ObjectOwner
1848	raw := NoMethod(*s)
1849	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1850}
1851
1852// ObjectAccessControl: An access-control entry.
1853type ObjectAccessControl struct {
1854	// Bucket: The name of the bucket.
1855	Bucket string `json:"bucket,omitempty"`
1856
1857	// Domain: The domain associated with the entity, if any.
1858	Domain string `json:"domain,omitempty"`
1859
1860	// Email: The email address associated with the entity, if any.
1861	Email string `json:"email,omitempty"`
1862
1863	// Entity: The entity holding the permission, in one of the following
1864	// forms:
1865	// - user-userId
1866	// - user-email
1867	// - group-groupId
1868	// - group-email
1869	// - domain-domain
1870	// - project-team-projectId
1871	// - allUsers
1872	// - allAuthenticatedUsers Examples:
1873	// - The user liz@example.com would be user-liz@example.com.
1874	// - The group example@googlegroups.com would be
1875	// group-example@googlegroups.com.
1876	// - To refer to all members of the Google Apps for Business domain
1877	// example.com, the entity would be domain-example.com.
1878	Entity string `json:"entity,omitempty"`
1879
1880	// EntityId: The ID for the entity, if any.
1881	EntityId string `json:"entityId,omitempty"`
1882
1883	// Etag: HTTP 1.1 Entity tag for the access-control entry.
1884	Etag string `json:"etag,omitempty"`
1885
1886	// Generation: The content generation of the object, if applied to an
1887	// object.
1888	Generation int64 `json:"generation,omitempty,string"`
1889
1890	// Id: The ID of the access-control entry.
1891	Id string `json:"id,omitempty"`
1892
1893	// Kind: The kind of item this is. For object access control entries,
1894	// this is always storage#objectAccessControl.
1895	Kind string `json:"kind,omitempty"`
1896
1897	// Object: The name of the object, if applied to an object.
1898	Object string `json:"object,omitempty"`
1899
1900	// ProjectTeam: The project team associated with the entity, if any.
1901	ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
1902
1903	// Role: The access permission for the entity.
1904	Role string `json:"role,omitempty"`
1905
1906	// SelfLink: The link to this access-control entry.
1907	SelfLink string `json:"selfLink,omitempty"`
1908
1909	// ServerResponse contains the HTTP response code and headers from the
1910	// server.
1911	googleapi.ServerResponse `json:"-"`
1912
1913	// ForceSendFields is a list of field names (e.g. "Bucket") to
1914	// unconditionally include in API requests. By default, fields with
1915	// empty values are omitted from API requests. However, any non-pointer,
1916	// non-interface field appearing in ForceSendFields will be sent to the
1917	// server regardless of whether the field is empty or not. This may be
1918	// used to include empty fields in Patch requests.
1919	ForceSendFields []string `json:"-"`
1920
1921	// NullFields is a list of field names (e.g. "Bucket") to include in API
1922	// requests with the JSON null value. By default, fields with empty
1923	// values are omitted from API requests. However, any field with an
1924	// empty value appearing in NullFields will be sent to the server as
1925	// null. It is an error if a field in this list has a non-empty value.
1926	// This may be used to include null fields in Patch requests.
1927	NullFields []string `json:"-"`
1928}
1929
1930func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
1931	type NoMethod ObjectAccessControl
1932	raw := NoMethod(*s)
1933	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1934}
1935
1936// ObjectAccessControlProjectTeam: The project team associated with the
1937// entity, if any.
1938type ObjectAccessControlProjectTeam struct {
1939	// ProjectNumber: The project number.
1940	ProjectNumber string `json:"projectNumber,omitempty"`
1941
1942	// Team: The team.
1943	Team string `json:"team,omitempty"`
1944
1945	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1946	// unconditionally include in API requests. By default, fields with
1947	// empty values are omitted from API requests. However, any non-pointer,
1948	// non-interface field appearing in ForceSendFields will be sent to the
1949	// server regardless of whether the field is empty or not. This may be
1950	// used to include empty fields in Patch requests.
1951	ForceSendFields []string `json:"-"`
1952
1953	// NullFields is a list of field names (e.g. "ProjectNumber") to include
1954	// in API requests with the JSON null value. By default, fields with
1955	// empty values are omitted from API requests. However, any field with
1956	// an empty value appearing in NullFields will be sent to the server as
1957	// null. It is an error if a field in this list has a non-empty value.
1958	// This may be used to include null fields in Patch requests.
1959	NullFields []string `json:"-"`
1960}
1961
1962func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1963	type NoMethod ObjectAccessControlProjectTeam
1964	raw := NoMethod(*s)
1965	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1966}
1967
1968// ObjectAccessControls: An access-control list.
1969type ObjectAccessControls struct {
1970	// Items: The list of items.
1971	Items []*ObjectAccessControl `json:"items,omitempty"`
1972
1973	// Kind: The kind of item this is. For lists of object access control
1974	// entries, this is always storage#objectAccessControls.
1975	Kind string `json:"kind,omitempty"`
1976
1977	// ServerResponse contains the HTTP response code and headers from the
1978	// server.
1979	googleapi.ServerResponse `json:"-"`
1980
1981	// ForceSendFields is a list of field names (e.g. "Items") to
1982	// unconditionally include in API requests. By default, fields with
1983	// empty values are omitted from API requests. However, any non-pointer,
1984	// non-interface field appearing in ForceSendFields will be sent to the
1985	// server regardless of whether the field is empty or not. This may be
1986	// used to include empty fields in Patch requests.
1987	ForceSendFields []string `json:"-"`
1988
1989	// NullFields is a list of field names (e.g. "Items") to include in API
1990	// requests with the JSON null value. By default, fields with empty
1991	// values are omitted from API requests. However, any field with an
1992	// empty value appearing in NullFields will be sent to the server as
1993	// null. It is an error if a field in this list has a non-empty value.
1994	// This may be used to include null fields in Patch requests.
1995	NullFields []string `json:"-"`
1996}
1997
1998func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
1999	type NoMethod ObjectAccessControls
2000	raw := NoMethod(*s)
2001	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2002}
2003
2004// Objects: A list of objects.
2005type Objects struct {
2006	// Items: The list of items.
2007	Items []*Object `json:"items,omitempty"`
2008
2009	// Kind: The kind of item this is. For lists of objects, this is always
2010	// storage#objects.
2011	Kind string `json:"kind,omitempty"`
2012
2013	// NextPageToken: The continuation token, used to page through large
2014	// result sets. Provide this value in a subsequent request to return the
2015	// next page of results.
2016	NextPageToken string `json:"nextPageToken,omitempty"`
2017
2018	// Prefixes: The list of prefixes of objects matching-but-not-listed up
2019	// to and including the requested delimiter.
2020	Prefixes []string `json:"prefixes,omitempty"`
2021
2022	// ServerResponse contains the HTTP response code and headers from the
2023	// server.
2024	googleapi.ServerResponse `json:"-"`
2025
2026	// ForceSendFields is a list of field names (e.g. "Items") to
2027	// unconditionally include in API requests. By default, fields with
2028	// empty values are omitted from API requests. However, any non-pointer,
2029	// non-interface field appearing in ForceSendFields will be sent to the
2030	// server regardless of whether the field is empty or not. This may be
2031	// used to include empty fields in Patch requests.
2032	ForceSendFields []string `json:"-"`
2033
2034	// NullFields is a list of field names (e.g. "Items") to include in API
2035	// requests with the JSON null value. By default, fields with empty
2036	// values are omitted from API requests. However, any field with an
2037	// empty value appearing in NullFields will be sent to the server as
2038	// null. It is an error if a field in this list has a non-empty value.
2039	// This may be used to include null fields in Patch requests.
2040	NullFields []string `json:"-"`
2041}
2042
2043func (s *Objects) MarshalJSON() ([]byte, error) {
2044	type NoMethod Objects
2045	raw := NoMethod(*s)
2046	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2047}
2048
2049// Policy: A bucket/object IAM policy.
2050type Policy struct {
2051	// Bindings: An association between a role, which comes with a set of
2052	// permissions, and members who may assume that role.
2053	Bindings []*PolicyBindings `json:"bindings,omitempty"`
2054
2055	// Etag: HTTP 1.1  Entity tag for the policy.
2056	Etag string `json:"etag,omitempty"`
2057
2058	// Kind: The kind of item this is. For policies, this is always
2059	// storage#policy. This field is ignored on input.
2060	Kind string `json:"kind,omitempty"`
2061
2062	// ResourceId: The ID of the resource to which this policy belongs. Will
2063	// be of the form projects/_/buckets/bucket for buckets, and
2064	// projects/_/buckets/bucket/objects/object for objects. A specific
2065	// generation may be specified by appending #generationNumber to the end
2066	// of the object name, e.g.
2067	// projects/_/buckets/my-bucket/objects/data.txt#17. The current
2068	// generation can be denoted with #0. This field is ignored on input.
2069	ResourceId string `json:"resourceId,omitempty"`
2070
2071	// Version: The IAM policy format version.
2072	Version int64 `json:"version,omitempty"`
2073
2074	// ServerResponse contains the HTTP response code and headers from the
2075	// server.
2076	googleapi.ServerResponse `json:"-"`
2077
2078	// ForceSendFields is a list of field names (e.g. "Bindings") to
2079	// unconditionally include in API requests. By default, fields with
2080	// empty values are omitted from API requests. However, any non-pointer,
2081	// non-interface field appearing in ForceSendFields will be sent to the
2082	// server regardless of whether the field is empty or not. This may be
2083	// used to include empty fields in Patch requests.
2084	ForceSendFields []string `json:"-"`
2085
2086	// NullFields is a list of field names (e.g. "Bindings") to include in
2087	// API requests with the JSON null value. By default, fields with empty
2088	// values are omitted from API requests. However, any field with an
2089	// empty value appearing in NullFields will be sent to the server as
2090	// null. It is an error if a field in this list has a non-empty value.
2091	// This may be used to include null fields in Patch requests.
2092	NullFields []string `json:"-"`
2093}
2094
2095func (s *Policy) MarshalJSON() ([]byte, error) {
2096	type NoMethod Policy
2097	raw := NoMethod(*s)
2098	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2099}
2100
2101type PolicyBindings struct {
2102	// Condition: The condition that is associated with this binding. NOTE:
2103	// an unsatisfied condition will not allow user access via current
2104	// binding. Different bindings, including their conditions, are examined
2105	// independently.
2106	Condition *Expr `json:"condition,omitempty"`
2107
2108	// Members: A collection of identifiers for members who may assume the
2109	// provided role. Recognized identifiers are as follows:
2110	// - allUsers — A special identifier that represents anyone on the
2111	// internet; with or without a Google account.
2112	// - allAuthenticatedUsers — A special identifier that represents
2113	// anyone who is authenticated with a Google account or a service
2114	// account.
2115	// - user:emailid — An email address that represents a specific
2116	// account. For example, user:alice@gmail.com or user:joe@example.com.
2117	//
2118	// - serviceAccount:emailid — An email address that represents a
2119	// service account. For example,
2120	// serviceAccount:my-other-app@appspot.gserviceaccount.com .
2121	// - group:emailid — An email address that represents a Google group.
2122	// For example, group:admins@example.com.
2123	// - domain:domain — A Google Apps domain name that represents all the
2124	// users of that domain. For example, domain:google.com or
2125	// domain:example.com.
2126	// - projectOwner:projectid — Owners of the given project. For
2127	// example, projectOwner:my-example-project
2128	// - projectEditor:projectid — Editors of the given project. For
2129	// example, projectEditor:my-example-project
2130	// - projectViewer:projectid — Viewers of the given project. For
2131	// example, projectViewer:my-example-project
2132	Members []string `json:"members,omitempty"`
2133
2134	// Role: The role to which members belong. Two types of roles are
2135	// supported: new IAM roles, which grant permissions that do not map
2136	// directly to those provided by ACLs, and legacy IAM roles, which do
2137	// map directly to ACL permissions. All roles are of the format
2138	// roles/storage.specificRole.
2139	// The new IAM roles are:
2140	// - roles/storage.admin — Full control of Google Cloud Storage
2141	// resources.
2142	// - roles/storage.objectViewer — Read-Only access to Google Cloud
2143	// Storage objects.
2144	// - roles/storage.objectCreator — Access to create objects in Google
2145	// Cloud Storage.
2146	// - roles/storage.objectAdmin — Full control of Google Cloud Storage
2147	// objects.   The legacy IAM roles are:
2148	// - roles/storage.legacyObjectReader — Read-only access to objects
2149	// without listing. Equivalent to an ACL entry on an object with the
2150	// READER role.
2151	// - roles/storage.legacyObjectOwnerRead/write access to existing
2152	// objects without listing. Equivalent to an ACL entry on an object with
2153	// the OWNER role.
2154	// - roles/storage.legacyBucketReader — Read access to buckets with
2155	// object listing. Equivalent to an ACL entry on a bucket with the
2156	// READER role.
2157	// - roles/storage.legacyBucketWriter — Read access to buckets with
2158	// object listing/creation/deletion. Equivalent to an ACL entry on a
2159	// bucket with the WRITER role.
2160	// - roles/storage.legacyBucketOwner — Read and write access to
2161	// existing buckets with object listing/creation/deletion. Equivalent to
2162	// an ACL entry on a bucket with the OWNER role.
2163	Role string `json:"role,omitempty"`
2164
2165	// ForceSendFields is a list of field names (e.g. "Condition") to
2166	// unconditionally include in API requests. By default, fields with
2167	// empty values are omitted from API requests. However, any non-pointer,
2168	// non-interface field appearing in ForceSendFields will be sent to the
2169	// server regardless of whether the field is empty or not. This may be
2170	// used to include empty fields in Patch requests.
2171	ForceSendFields []string `json:"-"`
2172
2173	// NullFields is a list of field names (e.g. "Condition") to include in
2174	// API requests with the JSON null value. By default, fields with empty
2175	// values are omitted from API requests. However, any field with an
2176	// empty value appearing in NullFields will be sent to the server as
2177	// null. It is an error if a field in this list has a non-empty value.
2178	// This may be used to include null fields in Patch requests.
2179	NullFields []string `json:"-"`
2180}
2181
2182func (s *PolicyBindings) MarshalJSON() ([]byte, error) {
2183	type NoMethod PolicyBindings
2184	raw := NoMethod(*s)
2185	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2186}
2187
2188// RewriteResponse: A rewrite response.
2189type RewriteResponse struct {
2190	// Done: true if the copy is finished; otherwise, false if the copy is
2191	// in progress. This property is always present in the response.
2192	Done bool `json:"done,omitempty"`
2193
2194	// Kind: The kind of item this is.
2195	Kind string `json:"kind,omitempty"`
2196
2197	// ObjectSize: The total size of the object being copied in bytes. This
2198	// property is always present in the response.
2199	ObjectSize int64 `json:"objectSize,omitempty,string"`
2200
2201	// Resource: A resource containing the metadata for the copied-to
2202	// object. This property is present in the response only when copying
2203	// completes.
2204	Resource *Object `json:"resource,omitempty"`
2205
2206	// RewriteToken: A token to use in subsequent requests to continue
2207	// copying data. This token is present in the response only when there
2208	// is more data to copy.
2209	RewriteToken string `json:"rewriteToken,omitempty"`
2210
2211	// TotalBytesRewritten: The total bytes written so far, which can be
2212	// used to provide a waiting user with a progress indicator. This
2213	// property is always present in the response.
2214	TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
2215
2216	// ServerResponse contains the HTTP response code and headers from the
2217	// server.
2218	googleapi.ServerResponse `json:"-"`
2219
2220	// ForceSendFields is a list of field names (e.g. "Done") to
2221	// unconditionally include in API requests. By default, fields with
2222	// empty values are omitted from API requests. However, any non-pointer,
2223	// non-interface field appearing in ForceSendFields will be sent to the
2224	// server regardless of whether the field is empty or not. This may be
2225	// used to include empty fields in Patch requests.
2226	ForceSendFields []string `json:"-"`
2227
2228	// NullFields is a list of field names (e.g. "Done") to include in API
2229	// requests with the JSON null value. By default, fields with empty
2230	// values are omitted from API requests. However, any field with an
2231	// empty value appearing in NullFields will be sent to the server as
2232	// null. It is an error if a field in this list has a non-empty value.
2233	// This may be used to include null fields in Patch requests.
2234	NullFields []string `json:"-"`
2235}
2236
2237func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
2238	type NoMethod RewriteResponse
2239	raw := NoMethod(*s)
2240	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2241}
2242
2243// ServiceAccount: A subscription to receive Google PubSub
2244// notifications.
2245type ServiceAccount struct {
2246	// EmailAddress: The ID of the notification.
2247	EmailAddress string `json:"email_address,omitempty"`
2248
2249	// Kind: The kind of item this is. For notifications, this is always
2250	// storage#notification.
2251	Kind string `json:"kind,omitempty"`
2252
2253	// ServerResponse contains the HTTP response code and headers from the
2254	// server.
2255	googleapi.ServerResponse `json:"-"`
2256
2257	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
2258	// unconditionally include in API requests. By default, fields with
2259	// empty values are omitted from API requests. However, any non-pointer,
2260	// non-interface field appearing in ForceSendFields will be sent to the
2261	// server regardless of whether the field is empty or not. This may be
2262	// used to include empty fields in Patch requests.
2263	ForceSendFields []string `json:"-"`
2264
2265	// NullFields is a list of field names (e.g. "EmailAddress") to include
2266	// in API requests with the JSON null value. By default, fields with
2267	// empty values are omitted from API requests. However, any field with
2268	// an empty value appearing in NullFields will be sent to the server as
2269	// null. It is an error if a field in this list has a non-empty value.
2270	// This may be used to include null fields in Patch requests.
2271	NullFields []string `json:"-"`
2272}
2273
2274func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
2275	type NoMethod ServiceAccount
2276	raw := NoMethod(*s)
2277	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2278}
2279
2280// TestIamPermissionsResponse: A
2281// storage.(buckets|objects).testIamPermissions response.
2282type TestIamPermissionsResponse struct {
2283	// Kind: The kind of item this is.
2284	Kind string `json:"kind,omitempty"`
2285
2286	// Permissions: The permissions held by the caller. Permissions are
2287	// always of the format storage.resource.capability, where resource is
2288	// one of buckets or objects. The supported permissions are as follows:
2289	//
2290	// - storage.buckets.delete — Delete bucket.
2291	// - storage.buckets.get — Read bucket metadata.
2292	// - storage.buckets.getIamPolicy — Read bucket IAM policy.
2293	// - storage.buckets.create — Create bucket.
2294	// - storage.buckets.list — List buckets.
2295	// - storage.buckets.setIamPolicy — Update bucket IAM policy.
2296	// - storage.buckets.update — Update bucket metadata.
2297	// - storage.objects.delete — Delete object.
2298	// - storage.objects.get — Read object data and metadata.
2299	// - storage.objects.getIamPolicy — Read object IAM policy.
2300	// - storage.objects.create — Create object.
2301	// - storage.objects.list — List objects.
2302	// - storage.objects.setIamPolicy — Update object IAM policy.
2303	// - storage.objects.update — Update object metadata.
2304	Permissions []string `json:"permissions,omitempty"`
2305
2306	// ServerResponse contains the HTTP response code and headers from the
2307	// server.
2308	googleapi.ServerResponse `json:"-"`
2309
2310	// ForceSendFields is a list of field names (e.g. "Kind") to
2311	// unconditionally include in API requests. By default, fields with
2312	// empty values are omitted from API requests. However, any non-pointer,
2313	// non-interface field appearing in ForceSendFields will be sent to the
2314	// server regardless of whether the field is empty or not. This may be
2315	// used to include empty fields in Patch requests.
2316	ForceSendFields []string `json:"-"`
2317
2318	// NullFields is a list of field names (e.g. "Kind") to include in API
2319	// requests with the JSON null value. By default, fields with empty
2320	// values are omitted from API requests. However, any field with an
2321	// empty value appearing in NullFields will be sent to the server as
2322	// null. It is an error if a field in this list has a non-empty value.
2323	// This may be used to include null fields in Patch requests.
2324	NullFields []string `json:"-"`
2325}
2326
2327func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
2328	type NoMethod TestIamPermissionsResponse
2329	raw := NoMethod(*s)
2330	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2331}
2332
2333// method id "storage.bucketAccessControls.delete":
2334
2335type BucketAccessControlsDeleteCall struct {
2336	s          *Service
2337	bucket     string
2338	entity     string
2339	urlParams_ gensupport.URLParams
2340	ctx_       context.Context
2341	header_    http.Header
2342}
2343
2344// Delete: Permanently deletes the ACL entry for the specified entity on
2345// the specified bucket.
2346func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
2347	c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2348	c.bucket = bucket
2349	c.entity = entity
2350	return c
2351}
2352
2353// ProvisionalUserProject sets the optional parameter
2354// "provisionalUserProject": The project to be billed for this request
2355// if the target bucket is requester-pays bucket.
2356func (c *BucketAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsDeleteCall {
2357	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2358	return c
2359}
2360
2361// UserProject sets the optional parameter "userProject": The project to
2362// be billed for this request. Required for Requester Pays buckets.
2363func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
2364	c.urlParams_.Set("userProject", userProject)
2365	return c
2366}
2367
2368// Fields allows partial responses to be retrieved. See
2369// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2370// for more information.
2371func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
2372	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2373	return c
2374}
2375
2376// Context sets the context to be used in this call's Do method. Any
2377// pending HTTP request will be aborted if the provided context is
2378// canceled.
2379func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
2380	c.ctx_ = ctx
2381	return c
2382}
2383
2384// Header returns an http.Header that can be modified by the caller to
2385// add HTTP headers to the request.
2386func (c *BucketAccessControlsDeleteCall) Header() http.Header {
2387	if c.header_ == nil {
2388		c.header_ = make(http.Header)
2389	}
2390	return c.header_
2391}
2392
2393func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
2394	reqHeaders := make(http.Header)
2395	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
2396	for k, v := range c.header_ {
2397		reqHeaders[k] = v
2398	}
2399	reqHeaders.Set("User-Agent", c.s.userAgent())
2400	var body io.Reader = nil
2401	c.urlParams_.Set("alt", alt)
2402	c.urlParams_.Set("prettyPrint", "false")
2403	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2404	urls += "?" + c.urlParams_.Encode()
2405	req, err := http.NewRequest("DELETE", urls, body)
2406	if err != nil {
2407		return nil, err
2408	}
2409	req.Header = reqHeaders
2410	googleapi.Expand(req.URL, map[string]string{
2411		"bucket": c.bucket,
2412		"entity": c.entity,
2413	})
2414	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2415}
2416
2417// Do executes the "storage.bucketAccessControls.delete" call.
2418func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
2419	gensupport.SetOptions(c.urlParams_, opts...)
2420	res, err := c.doRequest("json")
2421	if err != nil {
2422		return err
2423	}
2424	defer googleapi.CloseBody(res)
2425	if err := googleapi.CheckResponse(res); err != nil {
2426		return err
2427	}
2428	return nil
2429	// {
2430	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
2431	//   "httpMethod": "DELETE",
2432	//   "id": "storage.bucketAccessControls.delete",
2433	//   "parameterOrder": [
2434	//     "bucket",
2435	//     "entity"
2436	//   ],
2437	//   "parameters": {
2438	//     "bucket": {
2439	//       "description": "Name of a bucket.",
2440	//       "location": "path",
2441	//       "required": true,
2442	//       "type": "string"
2443	//     },
2444	//     "entity": {
2445	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2446	//       "location": "path",
2447	//       "required": true,
2448	//       "type": "string"
2449	//     },
2450	//     "provisionalUserProject": {
2451	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2452	//       "location": "query",
2453	//       "type": "string"
2454	//     },
2455	//     "userProject": {
2456	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2457	//       "location": "query",
2458	//       "type": "string"
2459	//     }
2460	//   },
2461	//   "path": "b/{bucket}/acl/{entity}",
2462	//   "scopes": [
2463	//     "https://www.googleapis.com/auth/cloud-platform",
2464	//     "https://www.googleapis.com/auth/devstorage.full_control"
2465	//   ]
2466	// }
2467
2468}
2469
2470// method id "storage.bucketAccessControls.get":
2471
2472type BucketAccessControlsGetCall struct {
2473	s            *Service
2474	bucket       string
2475	entity       string
2476	urlParams_   gensupport.URLParams
2477	ifNoneMatch_ string
2478	ctx_         context.Context
2479	header_      http.Header
2480}
2481
2482// Get: Returns the ACL entry for the specified entity on the specified
2483// bucket.
2484func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
2485	c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2486	c.bucket = bucket
2487	c.entity = entity
2488	return c
2489}
2490
2491// ProvisionalUserProject sets the optional parameter
2492// "provisionalUserProject": The project to be billed for this request
2493// if the target bucket is requester-pays bucket.
2494func (c *BucketAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsGetCall {
2495	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2496	return c
2497}
2498
2499// UserProject sets the optional parameter "userProject": The project to
2500// be billed for this request. Required for Requester Pays buckets.
2501func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
2502	c.urlParams_.Set("userProject", userProject)
2503	return c
2504}
2505
2506// Fields allows partial responses to be retrieved. See
2507// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2508// for more information.
2509func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
2510	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2511	return c
2512}
2513
2514// IfNoneMatch sets the optional parameter which makes the operation
2515// fail if the object's ETag matches the given value. This is useful for
2516// getting updates only after the object has changed since the last
2517// request. Use googleapi.IsNotModified to check whether the response
2518// error from Do is the result of In-None-Match.
2519func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
2520	c.ifNoneMatch_ = entityTag
2521	return c
2522}
2523
2524// Context sets the context to be used in this call's Do method. Any
2525// pending HTTP request will be aborted if the provided context is
2526// canceled.
2527func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
2528	c.ctx_ = ctx
2529	return c
2530}
2531
2532// Header returns an http.Header that can be modified by the caller to
2533// add HTTP headers to the request.
2534func (c *BucketAccessControlsGetCall) Header() http.Header {
2535	if c.header_ == nil {
2536		c.header_ = make(http.Header)
2537	}
2538	return c.header_
2539}
2540
2541func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
2542	reqHeaders := make(http.Header)
2543	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
2544	for k, v := range c.header_ {
2545		reqHeaders[k] = v
2546	}
2547	reqHeaders.Set("User-Agent", c.s.userAgent())
2548	if c.ifNoneMatch_ != "" {
2549		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2550	}
2551	var body io.Reader = nil
2552	c.urlParams_.Set("alt", alt)
2553	c.urlParams_.Set("prettyPrint", "false")
2554	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2555	urls += "?" + c.urlParams_.Encode()
2556	req, err := http.NewRequest("GET", urls, body)
2557	if err != nil {
2558		return nil, err
2559	}
2560	req.Header = reqHeaders
2561	googleapi.Expand(req.URL, map[string]string{
2562		"bucket": c.bucket,
2563		"entity": c.entity,
2564	})
2565	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2566}
2567
2568// Do executes the "storage.bucketAccessControls.get" call.
2569// Exactly one of *BucketAccessControl or error will be non-nil. Any
2570// non-2xx status code is an error. Response headers are in either
2571// *BucketAccessControl.ServerResponse.Header or (if a response was
2572// returned at all) in error.(*googleapi.Error).Header. Use
2573// googleapi.IsNotModified to check whether the returned error was
2574// because http.StatusNotModified was returned.
2575func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2576	gensupport.SetOptions(c.urlParams_, opts...)
2577	res, err := c.doRequest("json")
2578	if res != nil && res.StatusCode == http.StatusNotModified {
2579		if res.Body != nil {
2580			res.Body.Close()
2581		}
2582		return nil, &googleapi.Error{
2583			Code:   res.StatusCode,
2584			Header: res.Header,
2585		}
2586	}
2587	if err != nil {
2588		return nil, err
2589	}
2590	defer googleapi.CloseBody(res)
2591	if err := googleapi.CheckResponse(res); err != nil {
2592		return nil, err
2593	}
2594	ret := &BucketAccessControl{
2595		ServerResponse: googleapi.ServerResponse{
2596			Header:         res.Header,
2597			HTTPStatusCode: res.StatusCode,
2598		},
2599	}
2600	target := &ret
2601	if err := gensupport.DecodeResponse(target, res); err != nil {
2602		return nil, err
2603	}
2604	return ret, nil
2605	// {
2606	//   "description": "Returns the ACL entry for the specified entity on the specified bucket.",
2607	//   "httpMethod": "GET",
2608	//   "id": "storage.bucketAccessControls.get",
2609	//   "parameterOrder": [
2610	//     "bucket",
2611	//     "entity"
2612	//   ],
2613	//   "parameters": {
2614	//     "bucket": {
2615	//       "description": "Name of a bucket.",
2616	//       "location": "path",
2617	//       "required": true,
2618	//       "type": "string"
2619	//     },
2620	//     "entity": {
2621	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2622	//       "location": "path",
2623	//       "required": true,
2624	//       "type": "string"
2625	//     },
2626	//     "provisionalUserProject": {
2627	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2628	//       "location": "query",
2629	//       "type": "string"
2630	//     },
2631	//     "userProject": {
2632	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2633	//       "location": "query",
2634	//       "type": "string"
2635	//     }
2636	//   },
2637	//   "path": "b/{bucket}/acl/{entity}",
2638	//   "response": {
2639	//     "$ref": "BucketAccessControl"
2640	//   },
2641	//   "scopes": [
2642	//     "https://www.googleapis.com/auth/cloud-platform",
2643	//     "https://www.googleapis.com/auth/devstorage.full_control"
2644	//   ]
2645	// }
2646
2647}
2648
2649// method id "storage.bucketAccessControls.insert":
2650
2651type BucketAccessControlsInsertCall struct {
2652	s                   *Service
2653	bucket              string
2654	bucketaccesscontrol *BucketAccessControl
2655	urlParams_          gensupport.URLParams
2656	ctx_                context.Context
2657	header_             http.Header
2658}
2659
2660// Insert: Creates a new ACL entry on the specified bucket.
2661func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
2662	c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2663	c.bucket = bucket
2664	c.bucketaccesscontrol = bucketaccesscontrol
2665	return c
2666}
2667
2668// ProvisionalUserProject sets the optional parameter
2669// "provisionalUserProject": The project to be billed for this request
2670// if the target bucket is requester-pays bucket.
2671func (c *BucketAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsInsertCall {
2672	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2673	return c
2674}
2675
2676// UserProject sets the optional parameter "userProject": The project to
2677// be billed for this request. Required for Requester Pays buckets.
2678func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
2679	c.urlParams_.Set("userProject", userProject)
2680	return c
2681}
2682
2683// Fields allows partial responses to be retrieved. See
2684// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2685// for more information.
2686func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
2687	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2688	return c
2689}
2690
2691// Context sets the context to be used in this call's Do method. Any
2692// pending HTTP request will be aborted if the provided context is
2693// canceled.
2694func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
2695	c.ctx_ = ctx
2696	return c
2697}
2698
2699// Header returns an http.Header that can be modified by the caller to
2700// add HTTP headers to the request.
2701func (c *BucketAccessControlsInsertCall) Header() http.Header {
2702	if c.header_ == nil {
2703		c.header_ = make(http.Header)
2704	}
2705	return c.header_
2706}
2707
2708func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
2709	reqHeaders := make(http.Header)
2710	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
2711	for k, v := range c.header_ {
2712		reqHeaders[k] = v
2713	}
2714	reqHeaders.Set("User-Agent", c.s.userAgent())
2715	var body io.Reader = nil
2716	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2717	if err != nil {
2718		return nil, err
2719	}
2720	reqHeaders.Set("Content-Type", "application/json")
2721	c.urlParams_.Set("alt", alt)
2722	c.urlParams_.Set("prettyPrint", "false")
2723	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2724	urls += "?" + c.urlParams_.Encode()
2725	req, err := http.NewRequest("POST", urls, body)
2726	if err != nil {
2727		return nil, err
2728	}
2729	req.Header = reqHeaders
2730	googleapi.Expand(req.URL, map[string]string{
2731		"bucket": c.bucket,
2732	})
2733	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2734}
2735
2736// Do executes the "storage.bucketAccessControls.insert" call.
2737// Exactly one of *BucketAccessControl or error will be non-nil. Any
2738// non-2xx status code is an error. Response headers are in either
2739// *BucketAccessControl.ServerResponse.Header or (if a response was
2740// returned at all) in error.(*googleapi.Error).Header. Use
2741// googleapi.IsNotModified to check whether the returned error was
2742// because http.StatusNotModified was returned.
2743func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2744	gensupport.SetOptions(c.urlParams_, opts...)
2745	res, err := c.doRequest("json")
2746	if res != nil && res.StatusCode == http.StatusNotModified {
2747		if res.Body != nil {
2748			res.Body.Close()
2749		}
2750		return nil, &googleapi.Error{
2751			Code:   res.StatusCode,
2752			Header: res.Header,
2753		}
2754	}
2755	if err != nil {
2756		return nil, err
2757	}
2758	defer googleapi.CloseBody(res)
2759	if err := googleapi.CheckResponse(res); err != nil {
2760		return nil, err
2761	}
2762	ret := &BucketAccessControl{
2763		ServerResponse: googleapi.ServerResponse{
2764			Header:         res.Header,
2765			HTTPStatusCode: res.StatusCode,
2766		},
2767	}
2768	target := &ret
2769	if err := gensupport.DecodeResponse(target, res); err != nil {
2770		return nil, err
2771	}
2772	return ret, nil
2773	// {
2774	//   "description": "Creates a new ACL entry on the specified bucket.",
2775	//   "httpMethod": "POST",
2776	//   "id": "storage.bucketAccessControls.insert",
2777	//   "parameterOrder": [
2778	//     "bucket"
2779	//   ],
2780	//   "parameters": {
2781	//     "bucket": {
2782	//       "description": "Name of a bucket.",
2783	//       "location": "path",
2784	//       "required": true,
2785	//       "type": "string"
2786	//     },
2787	//     "provisionalUserProject": {
2788	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2789	//       "location": "query",
2790	//       "type": "string"
2791	//     },
2792	//     "userProject": {
2793	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2794	//       "location": "query",
2795	//       "type": "string"
2796	//     }
2797	//   },
2798	//   "path": "b/{bucket}/acl",
2799	//   "request": {
2800	//     "$ref": "BucketAccessControl"
2801	//   },
2802	//   "response": {
2803	//     "$ref": "BucketAccessControl"
2804	//   },
2805	//   "scopes": [
2806	//     "https://www.googleapis.com/auth/cloud-platform",
2807	//     "https://www.googleapis.com/auth/devstorage.full_control"
2808	//   ]
2809	// }
2810
2811}
2812
2813// method id "storage.bucketAccessControls.list":
2814
2815type BucketAccessControlsListCall struct {
2816	s            *Service
2817	bucket       string
2818	urlParams_   gensupport.URLParams
2819	ifNoneMatch_ string
2820	ctx_         context.Context
2821	header_      http.Header
2822}
2823
2824// List: Retrieves ACL entries on the specified bucket.
2825func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
2826	c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2827	c.bucket = bucket
2828	return c
2829}
2830
2831// ProvisionalUserProject sets the optional parameter
2832// "provisionalUserProject": The project to be billed for this request
2833// if the target bucket is requester-pays bucket.
2834func (c *BucketAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsListCall {
2835	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2836	return c
2837}
2838
2839// UserProject sets the optional parameter "userProject": The project to
2840// be billed for this request. Required for Requester Pays buckets.
2841func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
2842	c.urlParams_.Set("userProject", userProject)
2843	return c
2844}
2845
2846// Fields allows partial responses to be retrieved. See
2847// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2848// for more information.
2849func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
2850	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2851	return c
2852}
2853
2854// IfNoneMatch sets the optional parameter which makes the operation
2855// fail if the object's ETag matches the given value. This is useful for
2856// getting updates only after the object has changed since the last
2857// request. Use googleapi.IsNotModified to check whether the response
2858// error from Do is the result of In-None-Match.
2859func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
2860	c.ifNoneMatch_ = entityTag
2861	return c
2862}
2863
2864// Context sets the context to be used in this call's Do method. Any
2865// pending HTTP request will be aborted if the provided context is
2866// canceled.
2867func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
2868	c.ctx_ = ctx
2869	return c
2870}
2871
2872// Header returns an http.Header that can be modified by the caller to
2873// add HTTP headers to the request.
2874func (c *BucketAccessControlsListCall) Header() http.Header {
2875	if c.header_ == nil {
2876		c.header_ = make(http.Header)
2877	}
2878	return c.header_
2879}
2880
2881func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
2882	reqHeaders := make(http.Header)
2883	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
2884	for k, v := range c.header_ {
2885		reqHeaders[k] = v
2886	}
2887	reqHeaders.Set("User-Agent", c.s.userAgent())
2888	if c.ifNoneMatch_ != "" {
2889		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2890	}
2891	var body io.Reader = nil
2892	c.urlParams_.Set("alt", alt)
2893	c.urlParams_.Set("prettyPrint", "false")
2894	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2895	urls += "?" + c.urlParams_.Encode()
2896	req, err := http.NewRequest("GET", urls, body)
2897	if err != nil {
2898		return nil, err
2899	}
2900	req.Header = reqHeaders
2901	googleapi.Expand(req.URL, map[string]string{
2902		"bucket": c.bucket,
2903	})
2904	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2905}
2906
2907// Do executes the "storage.bucketAccessControls.list" call.
2908// Exactly one of *BucketAccessControls or error will be non-nil. Any
2909// non-2xx status code is an error. Response headers are in either
2910// *BucketAccessControls.ServerResponse.Header or (if a response was
2911// returned at all) in error.(*googleapi.Error).Header. Use
2912// googleapi.IsNotModified to check whether the returned error was
2913// because http.StatusNotModified was returned.
2914func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
2915	gensupport.SetOptions(c.urlParams_, opts...)
2916	res, err := c.doRequest("json")
2917	if res != nil && res.StatusCode == http.StatusNotModified {
2918		if res.Body != nil {
2919			res.Body.Close()
2920		}
2921		return nil, &googleapi.Error{
2922			Code:   res.StatusCode,
2923			Header: res.Header,
2924		}
2925	}
2926	if err != nil {
2927		return nil, err
2928	}
2929	defer googleapi.CloseBody(res)
2930	if err := googleapi.CheckResponse(res); err != nil {
2931		return nil, err
2932	}
2933	ret := &BucketAccessControls{
2934		ServerResponse: googleapi.ServerResponse{
2935			Header:         res.Header,
2936			HTTPStatusCode: res.StatusCode,
2937		},
2938	}
2939	target := &ret
2940	if err := gensupport.DecodeResponse(target, res); err != nil {
2941		return nil, err
2942	}
2943	return ret, nil
2944	// {
2945	//   "description": "Retrieves ACL entries on the specified bucket.",
2946	//   "httpMethod": "GET",
2947	//   "id": "storage.bucketAccessControls.list",
2948	//   "parameterOrder": [
2949	//     "bucket"
2950	//   ],
2951	//   "parameters": {
2952	//     "bucket": {
2953	//       "description": "Name of a bucket.",
2954	//       "location": "path",
2955	//       "required": true,
2956	//       "type": "string"
2957	//     },
2958	//     "provisionalUserProject": {
2959	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2960	//       "location": "query",
2961	//       "type": "string"
2962	//     },
2963	//     "userProject": {
2964	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2965	//       "location": "query",
2966	//       "type": "string"
2967	//     }
2968	//   },
2969	//   "path": "b/{bucket}/acl",
2970	//   "response": {
2971	//     "$ref": "BucketAccessControls"
2972	//   },
2973	//   "scopes": [
2974	//     "https://www.googleapis.com/auth/cloud-platform",
2975	//     "https://www.googleapis.com/auth/devstorage.full_control"
2976	//   ]
2977	// }
2978
2979}
2980
2981// method id "storage.bucketAccessControls.patch":
2982
2983type BucketAccessControlsPatchCall struct {
2984	s                   *Service
2985	bucket              string
2986	entity              string
2987	bucketaccesscontrol *BucketAccessControl
2988	urlParams_          gensupport.URLParams
2989	ctx_                context.Context
2990	header_             http.Header
2991}
2992
2993// Patch: Patches an ACL entry on the specified bucket.
2994func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
2995	c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2996	c.bucket = bucket
2997	c.entity = entity
2998	c.bucketaccesscontrol = bucketaccesscontrol
2999	return c
3000}
3001
3002// ProvisionalUserProject sets the optional parameter
3003// "provisionalUserProject": The project to be billed for this request
3004// if the target bucket is requester-pays bucket.
3005func (c *BucketAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsPatchCall {
3006	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3007	return c
3008}
3009
3010// UserProject sets the optional parameter "userProject": The project to
3011// be billed for this request. Required for Requester Pays buckets.
3012func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
3013	c.urlParams_.Set("userProject", userProject)
3014	return c
3015}
3016
3017// Fields allows partial responses to be retrieved. See
3018// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3019// for more information.
3020func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
3021	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3022	return c
3023}
3024
3025// Context sets the context to be used in this call's Do method. Any
3026// pending HTTP request will be aborted if the provided context is
3027// canceled.
3028func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
3029	c.ctx_ = ctx
3030	return c
3031}
3032
3033// Header returns an http.Header that can be modified by the caller to
3034// add HTTP headers to the request.
3035func (c *BucketAccessControlsPatchCall) Header() http.Header {
3036	if c.header_ == nil {
3037		c.header_ = make(http.Header)
3038	}
3039	return c.header_
3040}
3041
3042func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
3043	reqHeaders := make(http.Header)
3044	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3045	for k, v := range c.header_ {
3046		reqHeaders[k] = v
3047	}
3048	reqHeaders.Set("User-Agent", c.s.userAgent())
3049	var body io.Reader = nil
3050	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
3051	if err != nil {
3052		return nil, err
3053	}
3054	reqHeaders.Set("Content-Type", "application/json")
3055	c.urlParams_.Set("alt", alt)
3056	c.urlParams_.Set("prettyPrint", "false")
3057	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
3058	urls += "?" + c.urlParams_.Encode()
3059	req, err := http.NewRequest("PATCH", urls, body)
3060	if err != nil {
3061		return nil, err
3062	}
3063	req.Header = reqHeaders
3064	googleapi.Expand(req.URL, map[string]string{
3065		"bucket": c.bucket,
3066		"entity": c.entity,
3067	})
3068	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3069}
3070
3071// Do executes the "storage.bucketAccessControls.patch" call.
3072// Exactly one of *BucketAccessControl or error will be non-nil. Any
3073// non-2xx status code is an error. Response headers are in either
3074// *BucketAccessControl.ServerResponse.Header or (if a response was
3075// returned at all) in error.(*googleapi.Error).Header. Use
3076// googleapi.IsNotModified to check whether the returned error was
3077// because http.StatusNotModified was returned.
3078func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
3079	gensupport.SetOptions(c.urlParams_, opts...)
3080	res, err := c.doRequest("json")
3081	if res != nil && res.StatusCode == http.StatusNotModified {
3082		if res.Body != nil {
3083			res.Body.Close()
3084		}
3085		return nil, &googleapi.Error{
3086			Code:   res.StatusCode,
3087			Header: res.Header,
3088		}
3089	}
3090	if err != nil {
3091		return nil, err
3092	}
3093	defer googleapi.CloseBody(res)
3094	if err := googleapi.CheckResponse(res); err != nil {
3095		return nil, err
3096	}
3097	ret := &BucketAccessControl{
3098		ServerResponse: googleapi.ServerResponse{
3099			Header:         res.Header,
3100			HTTPStatusCode: res.StatusCode,
3101		},
3102	}
3103	target := &ret
3104	if err := gensupport.DecodeResponse(target, res); err != nil {
3105		return nil, err
3106	}
3107	return ret, nil
3108	// {
3109	//   "description": "Patches an ACL entry on the specified bucket.",
3110	//   "httpMethod": "PATCH",
3111	//   "id": "storage.bucketAccessControls.patch",
3112	//   "parameterOrder": [
3113	//     "bucket",
3114	//     "entity"
3115	//   ],
3116	//   "parameters": {
3117	//     "bucket": {
3118	//       "description": "Name of a bucket.",
3119	//       "location": "path",
3120	//       "required": true,
3121	//       "type": "string"
3122	//     },
3123	//     "entity": {
3124	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
3125	//       "location": "path",
3126	//       "required": true,
3127	//       "type": "string"
3128	//     },
3129	//     "provisionalUserProject": {
3130	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3131	//       "location": "query",
3132	//       "type": "string"
3133	//     },
3134	//     "userProject": {
3135	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3136	//       "location": "query",
3137	//       "type": "string"
3138	//     }
3139	//   },
3140	//   "path": "b/{bucket}/acl/{entity}",
3141	//   "request": {
3142	//     "$ref": "BucketAccessControl"
3143	//   },
3144	//   "response": {
3145	//     "$ref": "BucketAccessControl"
3146	//   },
3147	//   "scopes": [
3148	//     "https://www.googleapis.com/auth/cloud-platform",
3149	//     "https://www.googleapis.com/auth/devstorage.full_control"
3150	//   ]
3151	// }
3152
3153}
3154
3155// method id "storage.bucketAccessControls.update":
3156
3157type BucketAccessControlsUpdateCall struct {
3158	s                   *Service
3159	bucket              string
3160	entity              string
3161	bucketaccesscontrol *BucketAccessControl
3162	urlParams_          gensupport.URLParams
3163	ctx_                context.Context
3164	header_             http.Header
3165}
3166
3167// Update: Updates an ACL entry on the specified bucket.
3168func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
3169	c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3170	c.bucket = bucket
3171	c.entity = entity
3172	c.bucketaccesscontrol = bucketaccesscontrol
3173	return c
3174}
3175
3176// ProvisionalUserProject sets the optional parameter
3177// "provisionalUserProject": The project to be billed for this request
3178// if the target bucket is requester-pays bucket.
3179func (c *BucketAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsUpdateCall {
3180	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3181	return c
3182}
3183
3184// UserProject sets the optional parameter "userProject": The project to
3185// be billed for this request. Required for Requester Pays buckets.
3186func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
3187	c.urlParams_.Set("userProject", userProject)
3188	return c
3189}
3190
3191// Fields allows partial responses to be retrieved. See
3192// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3193// for more information.
3194func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
3195	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3196	return c
3197}
3198
3199// Context sets the context to be used in this call's Do method. Any
3200// pending HTTP request will be aborted if the provided context is
3201// canceled.
3202func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
3203	c.ctx_ = ctx
3204	return c
3205}
3206
3207// Header returns an http.Header that can be modified by the caller to
3208// add HTTP headers to the request.
3209func (c *BucketAccessControlsUpdateCall) Header() http.Header {
3210	if c.header_ == nil {
3211		c.header_ = make(http.Header)
3212	}
3213	return c.header_
3214}
3215
3216func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
3217	reqHeaders := make(http.Header)
3218	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3219	for k, v := range c.header_ {
3220		reqHeaders[k] = v
3221	}
3222	reqHeaders.Set("User-Agent", c.s.userAgent())
3223	var body io.Reader = nil
3224	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
3225	if err != nil {
3226		return nil, err
3227	}
3228	reqHeaders.Set("Content-Type", "application/json")
3229	c.urlParams_.Set("alt", alt)
3230	c.urlParams_.Set("prettyPrint", "false")
3231	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
3232	urls += "?" + c.urlParams_.Encode()
3233	req, err := http.NewRequest("PUT", urls, body)
3234	if err != nil {
3235		return nil, err
3236	}
3237	req.Header = reqHeaders
3238	googleapi.Expand(req.URL, map[string]string{
3239		"bucket": c.bucket,
3240		"entity": c.entity,
3241	})
3242	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3243}
3244
3245// Do executes the "storage.bucketAccessControls.update" call.
3246// Exactly one of *BucketAccessControl or error will be non-nil. Any
3247// non-2xx status code is an error. Response headers are in either
3248// *BucketAccessControl.ServerResponse.Header or (if a response was
3249// returned at all) in error.(*googleapi.Error).Header. Use
3250// googleapi.IsNotModified to check whether the returned error was
3251// because http.StatusNotModified was returned.
3252func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
3253	gensupport.SetOptions(c.urlParams_, opts...)
3254	res, err := c.doRequest("json")
3255	if res != nil && res.StatusCode == http.StatusNotModified {
3256		if res.Body != nil {
3257			res.Body.Close()
3258		}
3259		return nil, &googleapi.Error{
3260			Code:   res.StatusCode,
3261			Header: res.Header,
3262		}
3263	}
3264	if err != nil {
3265		return nil, err
3266	}
3267	defer googleapi.CloseBody(res)
3268	if err := googleapi.CheckResponse(res); err != nil {
3269		return nil, err
3270	}
3271	ret := &BucketAccessControl{
3272		ServerResponse: googleapi.ServerResponse{
3273			Header:         res.Header,
3274			HTTPStatusCode: res.StatusCode,
3275		},
3276	}
3277	target := &ret
3278	if err := gensupport.DecodeResponse(target, res); err != nil {
3279		return nil, err
3280	}
3281	return ret, nil
3282	// {
3283	//   "description": "Updates an ACL entry on the specified bucket.",
3284	//   "httpMethod": "PUT",
3285	//   "id": "storage.bucketAccessControls.update",
3286	//   "parameterOrder": [
3287	//     "bucket",
3288	//     "entity"
3289	//   ],
3290	//   "parameters": {
3291	//     "bucket": {
3292	//       "description": "Name of a bucket.",
3293	//       "location": "path",
3294	//       "required": true,
3295	//       "type": "string"
3296	//     },
3297	//     "entity": {
3298	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
3299	//       "location": "path",
3300	//       "required": true,
3301	//       "type": "string"
3302	//     },
3303	//     "provisionalUserProject": {
3304	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3305	//       "location": "query",
3306	//       "type": "string"
3307	//     },
3308	//     "userProject": {
3309	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3310	//       "location": "query",
3311	//       "type": "string"
3312	//     }
3313	//   },
3314	//   "path": "b/{bucket}/acl/{entity}",
3315	//   "request": {
3316	//     "$ref": "BucketAccessControl"
3317	//   },
3318	//   "response": {
3319	//     "$ref": "BucketAccessControl"
3320	//   },
3321	//   "scopes": [
3322	//     "https://www.googleapis.com/auth/cloud-platform",
3323	//     "https://www.googleapis.com/auth/devstorage.full_control"
3324	//   ]
3325	// }
3326
3327}
3328
3329// method id "storage.buckets.delete":
3330
3331type BucketsDeleteCall struct {
3332	s          *Service
3333	bucket     string
3334	urlParams_ gensupport.URLParams
3335	ctx_       context.Context
3336	header_    http.Header
3337}
3338
3339// Delete: Permanently deletes an empty bucket.
3340func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
3341	c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3342	c.bucket = bucket
3343	return c
3344}
3345
3346// IfMetagenerationMatch sets the optional parameter
3347// "ifMetagenerationMatch": If set, only deletes the bucket if its
3348// metageneration matches this value.
3349func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall {
3350	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3351	return c
3352}
3353
3354// IfMetagenerationNotMatch sets the optional parameter
3355// "ifMetagenerationNotMatch": If set, only deletes the bucket if its
3356// metageneration does not match this value.
3357func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall {
3358	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3359	return c
3360}
3361
3362// ProvisionalUserProject sets the optional parameter
3363// "provisionalUserProject": The project to be billed for this request
3364// if the target bucket is requester-pays bucket.
3365func (c *BucketsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketsDeleteCall {
3366	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3367	return c
3368}
3369
3370// UserProject sets the optional parameter "userProject": The project to
3371// be billed for this request. Required for Requester Pays buckets.
3372func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
3373	c.urlParams_.Set("userProject", userProject)
3374	return c
3375}
3376
3377// Fields allows partial responses to be retrieved. See
3378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3379// for more information.
3380func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
3381	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3382	return c
3383}
3384
3385// Context sets the context to be used in this call's Do method. Any
3386// pending HTTP request will be aborted if the provided context is
3387// canceled.
3388func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
3389	c.ctx_ = ctx
3390	return c
3391}
3392
3393// Header returns an http.Header that can be modified by the caller to
3394// add HTTP headers to the request.
3395func (c *BucketsDeleteCall) Header() http.Header {
3396	if c.header_ == nil {
3397		c.header_ = make(http.Header)
3398	}
3399	return c.header_
3400}
3401
3402func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
3403	reqHeaders := make(http.Header)
3404	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3405	for k, v := range c.header_ {
3406		reqHeaders[k] = v
3407	}
3408	reqHeaders.Set("User-Agent", c.s.userAgent())
3409	var body io.Reader = nil
3410	c.urlParams_.Set("alt", alt)
3411	c.urlParams_.Set("prettyPrint", "false")
3412	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3413	urls += "?" + c.urlParams_.Encode()
3414	req, err := http.NewRequest("DELETE", urls, body)
3415	if err != nil {
3416		return nil, err
3417	}
3418	req.Header = reqHeaders
3419	googleapi.Expand(req.URL, map[string]string{
3420		"bucket": c.bucket,
3421	})
3422	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3423}
3424
3425// Do executes the "storage.buckets.delete" call.
3426func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
3427	gensupport.SetOptions(c.urlParams_, opts...)
3428	res, err := c.doRequest("json")
3429	if err != nil {
3430		return err
3431	}
3432	defer googleapi.CloseBody(res)
3433	if err := googleapi.CheckResponse(res); err != nil {
3434		return err
3435	}
3436	return nil
3437	// {
3438	//   "description": "Permanently deletes an empty bucket.",
3439	//   "httpMethod": "DELETE",
3440	//   "id": "storage.buckets.delete",
3441	//   "parameterOrder": [
3442	//     "bucket"
3443	//   ],
3444	//   "parameters": {
3445	//     "bucket": {
3446	//       "description": "Name of a bucket.",
3447	//       "location": "path",
3448	//       "required": true,
3449	//       "type": "string"
3450	//     },
3451	//     "ifMetagenerationMatch": {
3452	//       "description": "If set, only deletes the bucket if its metageneration matches this value.",
3453	//       "format": "int64",
3454	//       "location": "query",
3455	//       "type": "string"
3456	//     },
3457	//     "ifMetagenerationNotMatch": {
3458	//       "description": "If set, only deletes the bucket if its metageneration does not match this value.",
3459	//       "format": "int64",
3460	//       "location": "query",
3461	//       "type": "string"
3462	//     },
3463	//     "provisionalUserProject": {
3464	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3465	//       "location": "query",
3466	//       "type": "string"
3467	//     },
3468	//     "userProject": {
3469	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3470	//       "location": "query",
3471	//       "type": "string"
3472	//     }
3473	//   },
3474	//   "path": "b/{bucket}",
3475	//   "scopes": [
3476	//     "https://www.googleapis.com/auth/cloud-platform",
3477	//     "https://www.googleapis.com/auth/devstorage.full_control",
3478	//     "https://www.googleapis.com/auth/devstorage.read_write"
3479	//   ]
3480	// }
3481
3482}
3483
3484// method id "storage.buckets.get":
3485
3486type BucketsGetCall struct {
3487	s            *Service
3488	bucket       string
3489	urlParams_   gensupport.URLParams
3490	ifNoneMatch_ string
3491	ctx_         context.Context
3492	header_      http.Header
3493}
3494
3495// Get: Returns metadata for the specified bucket.
3496func (r *BucketsService) Get(bucket string) *BucketsGetCall {
3497	c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3498	c.bucket = bucket
3499	return c
3500}
3501
3502// IfMetagenerationMatch sets the optional parameter
3503// "ifMetagenerationMatch": Makes the return of the bucket metadata
3504// conditional on whether the bucket's current metageneration matches
3505// the given value.
3506func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
3507	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3508	return c
3509}
3510
3511// IfMetagenerationNotMatch sets the optional parameter
3512// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
3513// conditional on whether the bucket's current metageneration does not
3514// match the given value.
3515func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall {
3516	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3517	return c
3518}
3519
3520// Projection sets the optional parameter "projection": Set of
3521// properties to return. Defaults to noAcl.
3522//
3523// Possible values:
3524//   "full" - Include all properties.
3525//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3526func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
3527	c.urlParams_.Set("projection", projection)
3528	return c
3529}
3530
3531// ProvisionalUserProject sets the optional parameter
3532// "provisionalUserProject": The project to be billed for this request
3533// if the target bucket is requester-pays bucket.
3534func (c *BucketsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetCall {
3535	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3536	return c
3537}
3538
3539// UserProject sets the optional parameter "userProject": The project to
3540// be billed for this request. Required for Requester Pays buckets.
3541func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
3542	c.urlParams_.Set("userProject", userProject)
3543	return c
3544}
3545
3546// Fields allows partial responses to be retrieved. See
3547// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3548// for more information.
3549func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
3550	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3551	return c
3552}
3553
3554// IfNoneMatch sets the optional parameter which makes the operation
3555// fail if the object's ETag matches the given value. This is useful for
3556// getting updates only after the object has changed since the last
3557// request. Use googleapi.IsNotModified to check whether the response
3558// error from Do is the result of In-None-Match.
3559func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
3560	c.ifNoneMatch_ = entityTag
3561	return c
3562}
3563
3564// Context sets the context to be used in this call's Do method. Any
3565// pending HTTP request will be aborted if the provided context is
3566// canceled.
3567func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
3568	c.ctx_ = ctx
3569	return c
3570}
3571
3572// Header returns an http.Header that can be modified by the caller to
3573// add HTTP headers to the request.
3574func (c *BucketsGetCall) Header() http.Header {
3575	if c.header_ == nil {
3576		c.header_ = make(http.Header)
3577	}
3578	return c.header_
3579}
3580
3581func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
3582	reqHeaders := make(http.Header)
3583	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3584	for k, v := range c.header_ {
3585		reqHeaders[k] = v
3586	}
3587	reqHeaders.Set("User-Agent", c.s.userAgent())
3588	if c.ifNoneMatch_ != "" {
3589		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3590	}
3591	var body io.Reader = nil
3592	c.urlParams_.Set("alt", alt)
3593	c.urlParams_.Set("prettyPrint", "false")
3594	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3595	urls += "?" + c.urlParams_.Encode()
3596	req, err := http.NewRequest("GET", urls, body)
3597	if err != nil {
3598		return nil, err
3599	}
3600	req.Header = reqHeaders
3601	googleapi.Expand(req.URL, map[string]string{
3602		"bucket": c.bucket,
3603	})
3604	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3605}
3606
3607// Do executes the "storage.buckets.get" call.
3608// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3609// code is an error. Response headers are in either
3610// *Bucket.ServerResponse.Header or (if a response was returned at all)
3611// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3612// check whether the returned error was because http.StatusNotModified
3613// was returned.
3614func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3615	gensupport.SetOptions(c.urlParams_, opts...)
3616	res, err := c.doRequest("json")
3617	if res != nil && res.StatusCode == http.StatusNotModified {
3618		if res.Body != nil {
3619			res.Body.Close()
3620		}
3621		return nil, &googleapi.Error{
3622			Code:   res.StatusCode,
3623			Header: res.Header,
3624		}
3625	}
3626	if err != nil {
3627		return nil, err
3628	}
3629	defer googleapi.CloseBody(res)
3630	if err := googleapi.CheckResponse(res); err != nil {
3631		return nil, err
3632	}
3633	ret := &Bucket{
3634		ServerResponse: googleapi.ServerResponse{
3635			Header:         res.Header,
3636			HTTPStatusCode: res.StatusCode,
3637		},
3638	}
3639	target := &ret
3640	if err := gensupport.DecodeResponse(target, res); err != nil {
3641		return nil, err
3642	}
3643	return ret, nil
3644	// {
3645	//   "description": "Returns metadata for the specified bucket.",
3646	//   "httpMethod": "GET",
3647	//   "id": "storage.buckets.get",
3648	//   "parameterOrder": [
3649	//     "bucket"
3650	//   ],
3651	//   "parameters": {
3652	//     "bucket": {
3653	//       "description": "Name of a bucket.",
3654	//       "location": "path",
3655	//       "required": true,
3656	//       "type": "string"
3657	//     },
3658	//     "ifMetagenerationMatch": {
3659	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
3660	//       "format": "int64",
3661	//       "location": "query",
3662	//       "type": "string"
3663	//     },
3664	//     "ifMetagenerationNotMatch": {
3665	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
3666	//       "format": "int64",
3667	//       "location": "query",
3668	//       "type": "string"
3669	//     },
3670	//     "projection": {
3671	//       "description": "Set of properties to return. Defaults to noAcl.",
3672	//       "enum": [
3673	//         "full",
3674	//         "noAcl"
3675	//       ],
3676	//       "enumDescriptions": [
3677	//         "Include all properties.",
3678	//         "Omit owner, acl and defaultObjectAcl properties."
3679	//       ],
3680	//       "location": "query",
3681	//       "type": "string"
3682	//     },
3683	//     "provisionalUserProject": {
3684	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3685	//       "location": "query",
3686	//       "type": "string"
3687	//     },
3688	//     "userProject": {
3689	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3690	//       "location": "query",
3691	//       "type": "string"
3692	//     }
3693	//   },
3694	//   "path": "b/{bucket}",
3695	//   "response": {
3696	//     "$ref": "Bucket"
3697	//   },
3698	//   "scopes": [
3699	//     "https://www.googleapis.com/auth/cloud-platform",
3700	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3701	//     "https://www.googleapis.com/auth/devstorage.full_control",
3702	//     "https://www.googleapis.com/auth/devstorage.read_only",
3703	//     "https://www.googleapis.com/auth/devstorage.read_write"
3704	//   ]
3705	// }
3706
3707}
3708
3709// method id "storage.buckets.getIamPolicy":
3710
3711type BucketsGetIamPolicyCall struct {
3712	s            *Service
3713	bucket       string
3714	urlParams_   gensupport.URLParams
3715	ifNoneMatch_ string
3716	ctx_         context.Context
3717	header_      http.Header
3718}
3719
3720// GetIamPolicy: Returns an IAM policy for the specified bucket.
3721func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
3722	c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3723	c.bucket = bucket
3724	return c
3725}
3726
3727// OptionsRequestedPolicyVersion sets the optional parameter
3728// "optionsRequestedPolicyVersion": The IAM policy format version to be
3729// returned. If the optionsRequestedPolicyVersion is for an older
3730// version that doesn't support part of the requested IAM policy, the
3731// request fails.
3732func (c *BucketsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BucketsGetIamPolicyCall {
3733	c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3734	return c
3735}
3736
3737// ProvisionalUserProject sets the optional parameter
3738// "provisionalUserProject": The project to be billed for this request
3739// if the target bucket is requester-pays bucket.
3740func (c *BucketsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetIamPolicyCall {
3741	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3742	return c
3743}
3744
3745// UserProject sets the optional parameter "userProject": The project to
3746// be billed for this request. Required for Requester Pays buckets.
3747func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
3748	c.urlParams_.Set("userProject", userProject)
3749	return c
3750}
3751
3752// Fields allows partial responses to be retrieved. See
3753// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3754// for more information.
3755func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall {
3756	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3757	return c
3758}
3759
3760// IfNoneMatch sets the optional parameter which makes the operation
3761// fail if the object's ETag matches the given value. This is useful for
3762// getting updates only after the object has changed since the last
3763// request. Use googleapi.IsNotModified to check whether the response
3764// error from Do is the result of In-None-Match.
3765func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall {
3766	c.ifNoneMatch_ = entityTag
3767	return c
3768}
3769
3770// Context sets the context to be used in this call's Do method. Any
3771// pending HTTP request will be aborted if the provided context is
3772// canceled.
3773func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
3774	c.ctx_ = ctx
3775	return c
3776}
3777
3778// Header returns an http.Header that can be modified by the caller to
3779// add HTTP headers to the request.
3780func (c *BucketsGetIamPolicyCall) Header() http.Header {
3781	if c.header_ == nil {
3782		c.header_ = make(http.Header)
3783	}
3784	return c.header_
3785}
3786
3787func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3788	reqHeaders := make(http.Header)
3789	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
3790	for k, v := range c.header_ {
3791		reqHeaders[k] = v
3792	}
3793	reqHeaders.Set("User-Agent", c.s.userAgent())
3794	if c.ifNoneMatch_ != "" {
3795		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3796	}
3797	var body io.Reader = nil
3798	c.urlParams_.Set("alt", alt)
3799	c.urlParams_.Set("prettyPrint", "false")
3800	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
3801	urls += "?" + c.urlParams_.Encode()
3802	req, err := http.NewRequest("GET", urls, body)
3803	if err != nil {
3804		return nil, err
3805	}
3806	req.Header = reqHeaders
3807	googleapi.Expand(req.URL, map[string]string{
3808		"bucket": c.bucket,
3809	})
3810	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3811}
3812
3813// Do executes the "storage.buckets.getIamPolicy" call.
3814// Exactly one of *Policy or error will be non-nil. Any non-2xx status
3815// code is an error. Response headers are in either
3816// *Policy.ServerResponse.Header or (if a response was returned at all)
3817// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3818// check whether the returned error was because http.StatusNotModified
3819// was returned.
3820func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3821	gensupport.SetOptions(c.urlParams_, opts...)
3822	res, err := c.doRequest("json")
3823	if res != nil && res.StatusCode == http.StatusNotModified {
3824		if res.Body != nil {
3825			res.Body.Close()
3826		}
3827		return nil, &googleapi.Error{
3828			Code:   res.StatusCode,
3829			Header: res.Header,
3830		}
3831	}
3832	if err != nil {
3833		return nil, err
3834	}
3835	defer googleapi.CloseBody(res)
3836	if err := googleapi.CheckResponse(res); err != nil {
3837		return nil, err
3838	}
3839	ret := &Policy{
3840		ServerResponse: googleapi.ServerResponse{
3841			Header:         res.Header,
3842			HTTPStatusCode: res.StatusCode,
3843		},
3844	}
3845	target := &ret
3846	if err := gensupport.DecodeResponse(target, res); err != nil {
3847		return nil, err
3848	}
3849	return ret, nil
3850	// {
3851	//   "description": "Returns an IAM policy for the specified bucket.",
3852	//   "httpMethod": "GET",
3853	//   "id": "storage.buckets.getIamPolicy",
3854	//   "parameterOrder": [
3855	//     "bucket"
3856	//   ],
3857	//   "parameters": {
3858	//     "bucket": {
3859	//       "description": "Name of a bucket.",
3860	//       "location": "path",
3861	//       "required": true,
3862	//       "type": "string"
3863	//     },
3864	//     "optionsRequestedPolicyVersion": {
3865	//       "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.",
3866	//       "format": "int32",
3867	//       "location": "query",
3868	//       "minimum": "1",
3869	//       "type": "integer"
3870	//     },
3871	//     "provisionalUserProject": {
3872	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3873	//       "location": "query",
3874	//       "type": "string"
3875	//     },
3876	//     "userProject": {
3877	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3878	//       "location": "query",
3879	//       "type": "string"
3880	//     }
3881	//   },
3882	//   "path": "b/{bucket}/iam",
3883	//   "response": {
3884	//     "$ref": "Policy"
3885	//   },
3886	//   "scopes": [
3887	//     "https://www.googleapis.com/auth/cloud-platform",
3888	//     "https://www.googleapis.com/auth/devstorage.full_control"
3889	//   ]
3890	// }
3891
3892}
3893
3894// method id "storage.buckets.insert":
3895
3896type BucketsInsertCall struct {
3897	s          *Service
3898	bucket     *Bucket
3899	urlParams_ gensupport.URLParams
3900	ctx_       context.Context
3901	header_    http.Header
3902}
3903
3904// Insert: Creates a new bucket.
3905func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
3906	c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3907	c.urlParams_.Set("project", projectid)
3908	c.bucket = bucket
3909	return c
3910}
3911
3912// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
3913// predefined set of access controls to this bucket.
3914//
3915// Possible values:
3916//   "authenticatedRead" - Project team owners get OWNER access, and
3917// allAuthenticatedUsers get READER access.
3918//   "private" - Project team owners get OWNER access.
3919//   "projectPrivate" - Project team members get access according to
3920// their roles.
3921//   "publicRead" - Project team owners get OWNER access, and allUsers
3922// get READER access.
3923//   "publicReadWrite" - Project team owners get OWNER access, and
3924// allUsers get WRITER access.
3925func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall {
3926	c.urlParams_.Set("predefinedAcl", predefinedAcl)
3927	return c
3928}
3929
3930// PredefinedDefaultObjectAcl sets the optional parameter
3931// "predefinedDefaultObjectAcl": Apply a predefined set of default
3932// object access controls to this bucket.
3933//
3934// Possible values:
3935//   "authenticatedRead" - Object owner gets OWNER access, and
3936// allAuthenticatedUsers get READER access.
3937//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
3938// project team owners get OWNER access.
3939//   "bucketOwnerRead" - Object owner gets OWNER access, and project
3940// team owners get READER access.
3941//   "private" - Object owner gets OWNER access.
3942//   "projectPrivate" - Object owner gets OWNER access, and project team
3943// members get access according to their roles.
3944//   "publicRead" - Object owner gets OWNER access, and allUsers get
3945// READER access.
3946func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
3947	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
3948	return c
3949}
3950
3951// Projection sets the optional parameter "projection": Set of
3952// properties to return. Defaults to noAcl, unless the bucket resource
3953// specifies acl or defaultObjectAcl properties, when it defaults to
3954// full.
3955//
3956// Possible values:
3957//   "full" - Include all properties.
3958//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3959func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
3960	c.urlParams_.Set("projection", projection)
3961	return c
3962}
3963
3964// ProvisionalUserProject sets the optional parameter
3965// "provisionalUserProject": The project to be billed for this request
3966// if the target bucket is requester-pays bucket.
3967func (c *BucketsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketsInsertCall {
3968	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3969	return c
3970}
3971
3972// UserProject sets the optional parameter "userProject": The project to
3973// be billed for this request.
3974func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall {
3975	c.urlParams_.Set("userProject", userProject)
3976	return c
3977}
3978
3979// Fields allows partial responses to be retrieved. See
3980// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3981// for more information.
3982func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
3983	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3984	return c
3985}
3986
3987// Context sets the context to be used in this call's Do method. Any
3988// pending HTTP request will be aborted if the provided context is
3989// canceled.
3990func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
3991	c.ctx_ = ctx
3992	return c
3993}
3994
3995// Header returns an http.Header that can be modified by the caller to
3996// add HTTP headers to the request.
3997func (c *BucketsInsertCall) Header() http.Header {
3998	if c.header_ == nil {
3999		c.header_ = make(http.Header)
4000	}
4001	return c.header_
4002}
4003
4004func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
4005	reqHeaders := make(http.Header)
4006	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4007	for k, v := range c.header_ {
4008		reqHeaders[k] = v
4009	}
4010	reqHeaders.Set("User-Agent", c.s.userAgent())
4011	var body io.Reader = nil
4012	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
4013	if err != nil {
4014		return nil, err
4015	}
4016	reqHeaders.Set("Content-Type", "application/json")
4017	c.urlParams_.Set("alt", alt)
4018	c.urlParams_.Set("prettyPrint", "false")
4019	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
4020	urls += "?" + c.urlParams_.Encode()
4021	req, err := http.NewRequest("POST", urls, body)
4022	if err != nil {
4023		return nil, err
4024	}
4025	req.Header = reqHeaders
4026	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4027}
4028
4029// Do executes the "storage.buckets.insert" call.
4030// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4031// code is an error. Response headers are in either
4032// *Bucket.ServerResponse.Header or (if a response was returned at all)
4033// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4034// check whether the returned error was because http.StatusNotModified
4035// was returned.
4036func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4037	gensupport.SetOptions(c.urlParams_, opts...)
4038	res, err := c.doRequest("json")
4039	if res != nil && res.StatusCode == http.StatusNotModified {
4040		if res.Body != nil {
4041			res.Body.Close()
4042		}
4043		return nil, &googleapi.Error{
4044			Code:   res.StatusCode,
4045			Header: res.Header,
4046		}
4047	}
4048	if err != nil {
4049		return nil, err
4050	}
4051	defer googleapi.CloseBody(res)
4052	if err := googleapi.CheckResponse(res); err != nil {
4053		return nil, err
4054	}
4055	ret := &Bucket{
4056		ServerResponse: googleapi.ServerResponse{
4057			Header:         res.Header,
4058			HTTPStatusCode: res.StatusCode,
4059		},
4060	}
4061	target := &ret
4062	if err := gensupport.DecodeResponse(target, res); err != nil {
4063		return nil, err
4064	}
4065	return ret, nil
4066	// {
4067	//   "description": "Creates a new bucket.",
4068	//   "httpMethod": "POST",
4069	//   "id": "storage.buckets.insert",
4070	//   "parameterOrder": [
4071	//     "project"
4072	//   ],
4073	//   "parameters": {
4074	//     "predefinedAcl": {
4075	//       "description": "Apply a predefined set of access controls to this bucket.",
4076	//       "enum": [
4077	//         "authenticatedRead",
4078	//         "private",
4079	//         "projectPrivate",
4080	//         "publicRead",
4081	//         "publicReadWrite"
4082	//       ],
4083	//       "enumDescriptions": [
4084	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4085	//         "Project team owners get OWNER access.",
4086	//         "Project team members get access according to their roles.",
4087	//         "Project team owners get OWNER access, and allUsers get READER access.",
4088	//         "Project team owners get OWNER access, and allUsers get WRITER access."
4089	//       ],
4090	//       "location": "query",
4091	//       "type": "string"
4092	//     },
4093	//     "predefinedDefaultObjectAcl": {
4094	//       "description": "Apply a predefined set of default object access controls to this bucket.",
4095	//       "enum": [
4096	//         "authenticatedRead",
4097	//         "bucketOwnerFullControl",
4098	//         "bucketOwnerRead",
4099	//         "private",
4100	//         "projectPrivate",
4101	//         "publicRead"
4102	//       ],
4103	//       "enumDescriptions": [
4104	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4105	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
4106	//         "Object owner gets OWNER access, and project team owners get READER access.",
4107	//         "Object owner gets OWNER access.",
4108	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
4109	//         "Object owner gets OWNER access, and allUsers get READER access."
4110	//       ],
4111	//       "location": "query",
4112	//       "type": "string"
4113	//     },
4114	//     "project": {
4115	//       "description": "A valid API project identifier.",
4116	//       "location": "query",
4117	//       "required": true,
4118	//       "type": "string"
4119	//     },
4120	//     "projection": {
4121	//       "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
4122	//       "enum": [
4123	//         "full",
4124	//         "noAcl"
4125	//       ],
4126	//       "enumDescriptions": [
4127	//         "Include all properties.",
4128	//         "Omit owner, acl and defaultObjectAcl properties."
4129	//       ],
4130	//       "location": "query",
4131	//       "type": "string"
4132	//     },
4133	//     "provisionalUserProject": {
4134	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4135	//       "location": "query",
4136	//       "type": "string"
4137	//     },
4138	//     "userProject": {
4139	//       "description": "The project to be billed for this request.",
4140	//       "location": "query",
4141	//       "type": "string"
4142	//     }
4143	//   },
4144	//   "path": "b",
4145	//   "request": {
4146	//     "$ref": "Bucket"
4147	//   },
4148	//   "response": {
4149	//     "$ref": "Bucket"
4150	//   },
4151	//   "scopes": [
4152	//     "https://www.googleapis.com/auth/cloud-platform",
4153	//     "https://www.googleapis.com/auth/devstorage.full_control",
4154	//     "https://www.googleapis.com/auth/devstorage.read_write"
4155	//   ]
4156	// }
4157
4158}
4159
4160// method id "storage.buckets.list":
4161
4162type BucketsListCall struct {
4163	s            *Service
4164	urlParams_   gensupport.URLParams
4165	ifNoneMatch_ string
4166	ctx_         context.Context
4167	header_      http.Header
4168}
4169
4170// List: Retrieves a list of buckets for a given project.
4171func (r *BucketsService) List(projectid string) *BucketsListCall {
4172	c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4173	c.urlParams_.Set("project", projectid)
4174	return c
4175}
4176
4177// MaxResults sets the optional parameter "maxResults": Maximum number
4178// of buckets to return in a single response. The service will use this
4179// parameter or 1,000 items, whichever is smaller.
4180func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
4181	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4182	return c
4183}
4184
4185// PageToken sets the optional parameter "pageToken": A
4186// previously-returned page token representing part of the larger set of
4187// results to view.
4188func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
4189	c.urlParams_.Set("pageToken", pageToken)
4190	return c
4191}
4192
4193// Prefix sets the optional parameter "prefix": Filter results to
4194// buckets whose names begin with this prefix.
4195func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall {
4196	c.urlParams_.Set("prefix", prefix)
4197	return c
4198}
4199
4200// Projection sets the optional parameter "projection": Set of
4201// properties to return. Defaults to noAcl.
4202//
4203// Possible values:
4204//   "full" - Include all properties.
4205//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4206func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
4207	c.urlParams_.Set("projection", projection)
4208	return c
4209}
4210
4211// ProvisionalUserProject sets the optional parameter
4212// "provisionalUserProject": The project to be billed for this request
4213// if the target bucket is requester-pays bucket.
4214func (c *BucketsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketsListCall {
4215	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4216	return c
4217}
4218
4219// UserProject sets the optional parameter "userProject": The project to
4220// be billed for this request.
4221func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall {
4222	c.urlParams_.Set("userProject", userProject)
4223	return c
4224}
4225
4226// Fields allows partial responses to be retrieved. See
4227// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4228// for more information.
4229func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
4230	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4231	return c
4232}
4233
4234// IfNoneMatch sets the optional parameter which makes the operation
4235// fail if the object's ETag matches the given value. This is useful for
4236// getting updates only after the object has changed since the last
4237// request. Use googleapi.IsNotModified to check whether the response
4238// error from Do is the result of In-None-Match.
4239func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
4240	c.ifNoneMatch_ = entityTag
4241	return c
4242}
4243
4244// Context sets the context to be used in this call's Do method. Any
4245// pending HTTP request will be aborted if the provided context is
4246// canceled.
4247func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
4248	c.ctx_ = ctx
4249	return c
4250}
4251
4252// Header returns an http.Header that can be modified by the caller to
4253// add HTTP headers to the request.
4254func (c *BucketsListCall) Header() http.Header {
4255	if c.header_ == nil {
4256		c.header_ = make(http.Header)
4257	}
4258	return c.header_
4259}
4260
4261func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
4262	reqHeaders := make(http.Header)
4263	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4264	for k, v := range c.header_ {
4265		reqHeaders[k] = v
4266	}
4267	reqHeaders.Set("User-Agent", c.s.userAgent())
4268	if c.ifNoneMatch_ != "" {
4269		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4270	}
4271	var body io.Reader = nil
4272	c.urlParams_.Set("alt", alt)
4273	c.urlParams_.Set("prettyPrint", "false")
4274	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
4275	urls += "?" + c.urlParams_.Encode()
4276	req, err := http.NewRequest("GET", urls, body)
4277	if err != nil {
4278		return nil, err
4279	}
4280	req.Header = reqHeaders
4281	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4282}
4283
4284// Do executes the "storage.buckets.list" call.
4285// Exactly one of *Buckets or error will be non-nil. Any non-2xx status
4286// code is an error. Response headers are in either
4287// *Buckets.ServerResponse.Header or (if a response was returned at all)
4288// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4289// check whether the returned error was because http.StatusNotModified
4290// was returned.
4291func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
4292	gensupport.SetOptions(c.urlParams_, opts...)
4293	res, err := c.doRequest("json")
4294	if res != nil && res.StatusCode == http.StatusNotModified {
4295		if res.Body != nil {
4296			res.Body.Close()
4297		}
4298		return nil, &googleapi.Error{
4299			Code:   res.StatusCode,
4300			Header: res.Header,
4301		}
4302	}
4303	if err != nil {
4304		return nil, err
4305	}
4306	defer googleapi.CloseBody(res)
4307	if err := googleapi.CheckResponse(res); err != nil {
4308		return nil, err
4309	}
4310	ret := &Buckets{
4311		ServerResponse: googleapi.ServerResponse{
4312			Header:         res.Header,
4313			HTTPStatusCode: res.StatusCode,
4314		},
4315	}
4316	target := &ret
4317	if err := gensupport.DecodeResponse(target, res); err != nil {
4318		return nil, err
4319	}
4320	return ret, nil
4321	// {
4322	//   "description": "Retrieves a list of buckets for a given project.",
4323	//   "httpMethod": "GET",
4324	//   "id": "storage.buckets.list",
4325	//   "parameterOrder": [
4326	//     "project"
4327	//   ],
4328	//   "parameters": {
4329	//     "maxResults": {
4330	//       "default": "1000",
4331	//       "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
4332	//       "format": "uint32",
4333	//       "location": "query",
4334	//       "minimum": "0",
4335	//       "type": "integer"
4336	//     },
4337	//     "pageToken": {
4338	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
4339	//       "location": "query",
4340	//       "type": "string"
4341	//     },
4342	//     "prefix": {
4343	//       "description": "Filter results to buckets whose names begin with this prefix.",
4344	//       "location": "query",
4345	//       "type": "string"
4346	//     },
4347	//     "project": {
4348	//       "description": "A valid API project identifier.",
4349	//       "location": "query",
4350	//       "required": true,
4351	//       "type": "string"
4352	//     },
4353	//     "projection": {
4354	//       "description": "Set of properties to return. Defaults to noAcl.",
4355	//       "enum": [
4356	//         "full",
4357	//         "noAcl"
4358	//       ],
4359	//       "enumDescriptions": [
4360	//         "Include all properties.",
4361	//         "Omit owner, acl and defaultObjectAcl properties."
4362	//       ],
4363	//       "location": "query",
4364	//       "type": "string"
4365	//     },
4366	//     "provisionalUserProject": {
4367	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4368	//       "location": "query",
4369	//       "type": "string"
4370	//     },
4371	//     "userProject": {
4372	//       "description": "The project to be billed for this request.",
4373	//       "location": "query",
4374	//       "type": "string"
4375	//     }
4376	//   },
4377	//   "path": "b",
4378	//   "response": {
4379	//     "$ref": "Buckets"
4380	//   },
4381	//   "scopes": [
4382	//     "https://www.googleapis.com/auth/cloud-platform",
4383	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4384	//     "https://www.googleapis.com/auth/devstorage.full_control",
4385	//     "https://www.googleapis.com/auth/devstorage.read_only",
4386	//     "https://www.googleapis.com/auth/devstorage.read_write"
4387	//   ]
4388	// }
4389
4390}
4391
4392// Pages invokes f for each page of results.
4393// A non-nil error returned from f will halt the iteration.
4394// The provided context supersedes any context provided to the Context method.
4395func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
4396	c.ctx_ = ctx
4397	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4398	for {
4399		x, err := c.Do()
4400		if err != nil {
4401			return err
4402		}
4403		if err := f(x); err != nil {
4404			return err
4405		}
4406		if x.NextPageToken == "" {
4407			return nil
4408		}
4409		c.PageToken(x.NextPageToken)
4410	}
4411}
4412
4413// method id "storage.buckets.lockRetentionPolicy":
4414
4415type BucketsLockRetentionPolicyCall struct {
4416	s          *Service
4417	bucket     string
4418	urlParams_ gensupport.URLParams
4419	ctx_       context.Context
4420	header_    http.Header
4421}
4422
4423// LockRetentionPolicy: Locks retention policy on a bucket.
4424func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall {
4425	c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4426	c.bucket = bucket
4427	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4428	return c
4429}
4430
4431// ProvisionalUserProject sets the optional parameter
4432// "provisionalUserProject": The project to be billed for this request
4433// if the target bucket is requester-pays bucket.
4434func (c *BucketsLockRetentionPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsLockRetentionPolicyCall {
4435	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4436	return c
4437}
4438
4439// UserProject sets the optional parameter "userProject": The project to
4440// be billed for this request. Required for Requester Pays buckets.
4441func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall {
4442	c.urlParams_.Set("userProject", userProject)
4443	return c
4444}
4445
4446// Fields allows partial responses to be retrieved. See
4447// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4448// for more information.
4449func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall {
4450	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4451	return c
4452}
4453
4454// Context sets the context to be used in this call's Do method. Any
4455// pending HTTP request will be aborted if the provided context is
4456// canceled.
4457func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall {
4458	c.ctx_ = ctx
4459	return c
4460}
4461
4462// Header returns an http.Header that can be modified by the caller to
4463// add HTTP headers to the request.
4464func (c *BucketsLockRetentionPolicyCall) Header() http.Header {
4465	if c.header_ == nil {
4466		c.header_ = make(http.Header)
4467	}
4468	return c.header_
4469}
4470
4471func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
4472	reqHeaders := make(http.Header)
4473	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4474	for k, v := range c.header_ {
4475		reqHeaders[k] = v
4476	}
4477	reqHeaders.Set("User-Agent", c.s.userAgent())
4478	var body io.Reader = nil
4479	c.urlParams_.Set("alt", alt)
4480	c.urlParams_.Set("prettyPrint", "false")
4481	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy")
4482	urls += "?" + c.urlParams_.Encode()
4483	req, err := http.NewRequest("POST", urls, body)
4484	if err != nil {
4485		return nil, err
4486	}
4487	req.Header = reqHeaders
4488	googleapi.Expand(req.URL, map[string]string{
4489		"bucket": c.bucket,
4490	})
4491	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4492}
4493
4494// Do executes the "storage.buckets.lockRetentionPolicy" call.
4495// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4496// code is an error. Response headers are in either
4497// *Bucket.ServerResponse.Header or (if a response was returned at all)
4498// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4499// check whether the returned error was because http.StatusNotModified
4500// was returned.
4501func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4502	gensupport.SetOptions(c.urlParams_, opts...)
4503	res, err := c.doRequest("json")
4504	if res != nil && res.StatusCode == http.StatusNotModified {
4505		if res.Body != nil {
4506			res.Body.Close()
4507		}
4508		return nil, &googleapi.Error{
4509			Code:   res.StatusCode,
4510			Header: res.Header,
4511		}
4512	}
4513	if err != nil {
4514		return nil, err
4515	}
4516	defer googleapi.CloseBody(res)
4517	if err := googleapi.CheckResponse(res); err != nil {
4518		return nil, err
4519	}
4520	ret := &Bucket{
4521		ServerResponse: googleapi.ServerResponse{
4522			Header:         res.Header,
4523			HTTPStatusCode: res.StatusCode,
4524		},
4525	}
4526	target := &ret
4527	if err := gensupport.DecodeResponse(target, res); err != nil {
4528		return nil, err
4529	}
4530	return ret, nil
4531	// {
4532	//   "description": "Locks retention policy on a bucket.",
4533	//   "httpMethod": "POST",
4534	//   "id": "storage.buckets.lockRetentionPolicy",
4535	//   "parameterOrder": [
4536	//     "bucket",
4537	//     "ifMetagenerationMatch"
4538	//   ],
4539	//   "parameters": {
4540	//     "bucket": {
4541	//       "description": "Name of a bucket.",
4542	//       "location": "path",
4543	//       "required": true,
4544	//       "type": "string"
4545	//     },
4546	//     "ifMetagenerationMatch": {
4547	//       "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
4548	//       "format": "int64",
4549	//       "location": "query",
4550	//       "required": true,
4551	//       "type": "string"
4552	//     },
4553	//     "provisionalUserProject": {
4554	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4555	//       "location": "query",
4556	//       "type": "string"
4557	//     },
4558	//     "userProject": {
4559	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4560	//       "location": "query",
4561	//       "type": "string"
4562	//     }
4563	//   },
4564	//   "path": "b/{bucket}/lockRetentionPolicy",
4565	//   "response": {
4566	//     "$ref": "Bucket"
4567	//   },
4568	//   "scopes": [
4569	//     "https://www.googleapis.com/auth/cloud-platform",
4570	//     "https://www.googleapis.com/auth/devstorage.full_control",
4571	//     "https://www.googleapis.com/auth/devstorage.read_write"
4572	//   ]
4573	// }
4574
4575}
4576
4577// method id "storage.buckets.patch":
4578
4579type BucketsPatchCall struct {
4580	s          *Service
4581	bucket     string
4582	bucket2    *Bucket
4583	urlParams_ gensupport.URLParams
4584	ctx_       context.Context
4585	header_    http.Header
4586}
4587
4588// Patch: Patches a bucket. Changes to the bucket will be readable
4589// immediately after writing, but configuration changes may take time to
4590// propagate.
4591func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
4592	c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4593	c.bucket = bucket
4594	c.bucket2 = bucket2
4595	return c
4596}
4597
4598// IfMetagenerationMatch sets the optional parameter
4599// "ifMetagenerationMatch": Makes the return of the bucket metadata
4600// conditional on whether the bucket's current metageneration matches
4601// the given value.
4602func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
4603	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4604	return c
4605}
4606
4607// IfMetagenerationNotMatch sets the optional parameter
4608// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
4609// conditional on whether the bucket's current metageneration does not
4610// match the given value.
4611func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall {
4612	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
4613	return c
4614}
4615
4616// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4617// predefined set of access controls to this bucket.
4618//
4619// Possible values:
4620//   "authenticatedRead" - Project team owners get OWNER access, and
4621// allAuthenticatedUsers get READER access.
4622//   "private" - Project team owners get OWNER access.
4623//   "projectPrivate" - Project team members get access according to
4624// their roles.
4625//   "publicRead" - Project team owners get OWNER access, and allUsers
4626// get READER access.
4627//   "publicReadWrite" - Project team owners get OWNER access, and
4628// allUsers get WRITER access.
4629func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall {
4630	c.urlParams_.Set("predefinedAcl", predefinedAcl)
4631	return c
4632}
4633
4634// PredefinedDefaultObjectAcl sets the optional parameter
4635// "predefinedDefaultObjectAcl": Apply a predefined set of default
4636// object access controls to this bucket.
4637//
4638// Possible values:
4639//   "authenticatedRead" - Object owner gets OWNER access, and
4640// allAuthenticatedUsers get READER access.
4641//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
4642// project team owners get OWNER access.
4643//   "bucketOwnerRead" - Object owner gets OWNER access, and project
4644// team owners get READER access.
4645//   "private" - Object owner gets OWNER access.
4646//   "projectPrivate" - Object owner gets OWNER access, and project team
4647// members get access according to their roles.
4648//   "publicRead" - Object owner gets OWNER access, and allUsers get
4649// READER access.
4650func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
4651	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4652	return c
4653}
4654
4655// Projection sets the optional parameter "projection": Set of
4656// properties to return. Defaults to full.
4657//
4658// Possible values:
4659//   "full" - Include all properties.
4660//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4661func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
4662	c.urlParams_.Set("projection", projection)
4663	return c
4664}
4665
4666// ProvisionalUserProject sets the optional parameter
4667// "provisionalUserProject": The project to be billed for this request
4668// if the target bucket is requester-pays bucket.
4669func (c *BucketsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketsPatchCall {
4670	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4671	return c
4672}
4673
4674// UserProject sets the optional parameter "userProject": The project to
4675// be billed for this request. Required for Requester Pays buckets.
4676func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
4677	c.urlParams_.Set("userProject", userProject)
4678	return c
4679}
4680
4681// Fields allows partial responses to be retrieved. See
4682// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4683// for more information.
4684func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
4685	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4686	return c
4687}
4688
4689// Context sets the context to be used in this call's Do method. Any
4690// pending HTTP request will be aborted if the provided context is
4691// canceled.
4692func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
4693	c.ctx_ = ctx
4694	return c
4695}
4696
4697// Header returns an http.Header that can be modified by the caller to
4698// add HTTP headers to the request.
4699func (c *BucketsPatchCall) Header() http.Header {
4700	if c.header_ == nil {
4701		c.header_ = make(http.Header)
4702	}
4703	return c.header_
4704}
4705
4706func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
4707	reqHeaders := make(http.Header)
4708	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4709	for k, v := range c.header_ {
4710		reqHeaders[k] = v
4711	}
4712	reqHeaders.Set("User-Agent", c.s.userAgent())
4713	var body io.Reader = nil
4714	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
4715	if err != nil {
4716		return nil, err
4717	}
4718	reqHeaders.Set("Content-Type", "application/json")
4719	c.urlParams_.Set("alt", alt)
4720	c.urlParams_.Set("prettyPrint", "false")
4721	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
4722	urls += "?" + c.urlParams_.Encode()
4723	req, err := http.NewRequest("PATCH", urls, body)
4724	if err != nil {
4725		return nil, err
4726	}
4727	req.Header = reqHeaders
4728	googleapi.Expand(req.URL, map[string]string{
4729		"bucket": c.bucket,
4730	})
4731	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4732}
4733
4734// Do executes the "storage.buckets.patch" call.
4735// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4736// code is an error. Response headers are in either
4737// *Bucket.ServerResponse.Header or (if a response was returned at all)
4738// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4739// check whether the returned error was because http.StatusNotModified
4740// was returned.
4741func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4742	gensupport.SetOptions(c.urlParams_, opts...)
4743	res, err := c.doRequest("json")
4744	if res != nil && res.StatusCode == http.StatusNotModified {
4745		if res.Body != nil {
4746			res.Body.Close()
4747		}
4748		return nil, &googleapi.Error{
4749			Code:   res.StatusCode,
4750			Header: res.Header,
4751		}
4752	}
4753	if err != nil {
4754		return nil, err
4755	}
4756	defer googleapi.CloseBody(res)
4757	if err := googleapi.CheckResponse(res); err != nil {
4758		return nil, err
4759	}
4760	ret := &Bucket{
4761		ServerResponse: googleapi.ServerResponse{
4762			Header:         res.Header,
4763			HTTPStatusCode: res.StatusCode,
4764		},
4765	}
4766	target := &ret
4767	if err := gensupport.DecodeResponse(target, res); err != nil {
4768		return nil, err
4769	}
4770	return ret, nil
4771	// {
4772	//   "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
4773	//   "httpMethod": "PATCH",
4774	//   "id": "storage.buckets.patch",
4775	//   "parameterOrder": [
4776	//     "bucket"
4777	//   ],
4778	//   "parameters": {
4779	//     "bucket": {
4780	//       "description": "Name of a bucket.",
4781	//       "location": "path",
4782	//       "required": true,
4783	//       "type": "string"
4784	//     },
4785	//     "ifMetagenerationMatch": {
4786	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
4787	//       "format": "int64",
4788	//       "location": "query",
4789	//       "type": "string"
4790	//     },
4791	//     "ifMetagenerationNotMatch": {
4792	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
4793	//       "format": "int64",
4794	//       "location": "query",
4795	//       "type": "string"
4796	//     },
4797	//     "predefinedAcl": {
4798	//       "description": "Apply a predefined set of access controls to this bucket.",
4799	//       "enum": [
4800	//         "authenticatedRead",
4801	//         "private",
4802	//         "projectPrivate",
4803	//         "publicRead",
4804	//         "publicReadWrite"
4805	//       ],
4806	//       "enumDescriptions": [
4807	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4808	//         "Project team owners get OWNER access.",
4809	//         "Project team members get access according to their roles.",
4810	//         "Project team owners get OWNER access, and allUsers get READER access.",
4811	//         "Project team owners get OWNER access, and allUsers get WRITER access."
4812	//       ],
4813	//       "location": "query",
4814	//       "type": "string"
4815	//     },
4816	//     "predefinedDefaultObjectAcl": {
4817	//       "description": "Apply a predefined set of default object access controls to this bucket.",
4818	//       "enum": [
4819	//         "authenticatedRead",
4820	//         "bucketOwnerFullControl",
4821	//         "bucketOwnerRead",
4822	//         "private",
4823	//         "projectPrivate",
4824	//         "publicRead"
4825	//       ],
4826	//       "enumDescriptions": [
4827	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4828	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
4829	//         "Object owner gets OWNER access, and project team owners get READER access.",
4830	//         "Object owner gets OWNER access.",
4831	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
4832	//         "Object owner gets OWNER access, and allUsers get READER access."
4833	//       ],
4834	//       "location": "query",
4835	//       "type": "string"
4836	//     },
4837	//     "projection": {
4838	//       "description": "Set of properties to return. Defaults to full.",
4839	//       "enum": [
4840	//         "full",
4841	//         "noAcl"
4842	//       ],
4843	//       "enumDescriptions": [
4844	//         "Include all properties.",
4845	//         "Omit owner, acl and defaultObjectAcl properties."
4846	//       ],
4847	//       "location": "query",
4848	//       "type": "string"
4849	//     },
4850	//     "provisionalUserProject": {
4851	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4852	//       "location": "query",
4853	//       "type": "string"
4854	//     },
4855	//     "userProject": {
4856	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4857	//       "location": "query",
4858	//       "type": "string"
4859	//     }
4860	//   },
4861	//   "path": "b/{bucket}",
4862	//   "request": {
4863	//     "$ref": "Bucket"
4864	//   },
4865	//   "response": {
4866	//     "$ref": "Bucket"
4867	//   },
4868	//   "scopes": [
4869	//     "https://www.googleapis.com/auth/cloud-platform",
4870	//     "https://www.googleapis.com/auth/devstorage.full_control"
4871	//   ]
4872	// }
4873
4874}
4875
4876// method id "storage.buckets.setIamPolicy":
4877
4878type BucketsSetIamPolicyCall struct {
4879	s          *Service
4880	bucket     string
4881	policy     *Policy
4882	urlParams_ gensupport.URLParams
4883	ctx_       context.Context
4884	header_    http.Header
4885}
4886
4887// SetIamPolicy: Updates an IAM policy for the specified bucket.
4888func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall {
4889	c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4890	c.bucket = bucket
4891	c.policy = policy
4892	return c
4893}
4894
4895// ProvisionalUserProject sets the optional parameter
4896// "provisionalUserProject": The project to be billed for this request
4897// if the target bucket is requester-pays bucket.
4898func (c *BucketsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsSetIamPolicyCall {
4899	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4900	return c
4901}
4902
4903// UserProject sets the optional parameter "userProject": The project to
4904// be billed for this request. Required for Requester Pays buckets.
4905func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
4906	c.urlParams_.Set("userProject", userProject)
4907	return c
4908}
4909
4910// Fields allows partial responses to be retrieved. See
4911// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4912// for more information.
4913func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall {
4914	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4915	return c
4916}
4917
4918// Context sets the context to be used in this call's Do method. Any
4919// pending HTTP request will be aborted if the provided context is
4920// canceled.
4921func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
4922	c.ctx_ = ctx
4923	return c
4924}
4925
4926// Header returns an http.Header that can be modified by the caller to
4927// add HTTP headers to the request.
4928func (c *BucketsSetIamPolicyCall) Header() http.Header {
4929	if c.header_ == nil {
4930		c.header_ = make(http.Header)
4931	}
4932	return c.header_
4933}
4934
4935func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4936	reqHeaders := make(http.Header)
4937	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
4938	for k, v := range c.header_ {
4939		reqHeaders[k] = v
4940	}
4941	reqHeaders.Set("User-Agent", c.s.userAgent())
4942	var body io.Reader = nil
4943	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
4944	if err != nil {
4945		return nil, err
4946	}
4947	reqHeaders.Set("Content-Type", "application/json")
4948	c.urlParams_.Set("alt", alt)
4949	c.urlParams_.Set("prettyPrint", "false")
4950	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
4951	urls += "?" + c.urlParams_.Encode()
4952	req, err := http.NewRequest("PUT", urls, body)
4953	if err != nil {
4954		return nil, err
4955	}
4956	req.Header = reqHeaders
4957	googleapi.Expand(req.URL, map[string]string{
4958		"bucket": c.bucket,
4959	})
4960	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4961}
4962
4963// Do executes the "storage.buckets.setIamPolicy" call.
4964// Exactly one of *Policy or error will be non-nil. Any non-2xx status
4965// code is an error. Response headers are in either
4966// *Policy.ServerResponse.Header or (if a response was returned at all)
4967// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4968// check whether the returned error was because http.StatusNotModified
4969// was returned.
4970func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4971	gensupport.SetOptions(c.urlParams_, opts...)
4972	res, err := c.doRequest("json")
4973	if res != nil && res.StatusCode == http.StatusNotModified {
4974		if res.Body != nil {
4975			res.Body.Close()
4976		}
4977		return nil, &googleapi.Error{
4978			Code:   res.StatusCode,
4979			Header: res.Header,
4980		}
4981	}
4982	if err != nil {
4983		return nil, err
4984	}
4985	defer googleapi.CloseBody(res)
4986	if err := googleapi.CheckResponse(res); err != nil {
4987		return nil, err
4988	}
4989	ret := &Policy{
4990		ServerResponse: googleapi.ServerResponse{
4991			Header:         res.Header,
4992			HTTPStatusCode: res.StatusCode,
4993		},
4994	}
4995	target := &ret
4996	if err := gensupport.DecodeResponse(target, res); err != nil {
4997		return nil, err
4998	}
4999	return ret, nil
5000	// {
5001	//   "description": "Updates an IAM policy for the specified bucket.",
5002	//   "httpMethod": "PUT",
5003	//   "id": "storage.buckets.setIamPolicy",
5004	//   "parameterOrder": [
5005	//     "bucket"
5006	//   ],
5007	//   "parameters": {
5008	//     "bucket": {
5009	//       "description": "Name of a bucket.",
5010	//       "location": "path",
5011	//       "required": true,
5012	//       "type": "string"
5013	//     },
5014	//     "provisionalUserProject": {
5015	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5016	//       "location": "query",
5017	//       "type": "string"
5018	//     },
5019	//     "userProject": {
5020	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5021	//       "location": "query",
5022	//       "type": "string"
5023	//     }
5024	//   },
5025	//   "path": "b/{bucket}/iam",
5026	//   "request": {
5027	//     "$ref": "Policy"
5028	//   },
5029	//   "response": {
5030	//     "$ref": "Policy"
5031	//   },
5032	//   "scopes": [
5033	//     "https://www.googleapis.com/auth/cloud-platform",
5034	//     "https://www.googleapis.com/auth/devstorage.full_control"
5035	//   ]
5036	// }
5037
5038}
5039
5040// method id "storage.buckets.testIamPermissions":
5041
5042type BucketsTestIamPermissionsCall struct {
5043	s            *Service
5044	bucket       string
5045	urlParams_   gensupport.URLParams
5046	ifNoneMatch_ string
5047	ctx_         context.Context
5048	header_      http.Header
5049}
5050
5051// TestIamPermissions: Tests a set of permissions on the given bucket to
5052// see which, if any, are held by the caller.
5053func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall {
5054	c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5055	c.bucket = bucket
5056	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
5057	return c
5058}
5059
5060// ProvisionalUserProject sets the optional parameter
5061// "provisionalUserProject": The project to be billed for this request
5062// if the target bucket is requester-pays bucket.
5063func (c *BucketsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *BucketsTestIamPermissionsCall {
5064	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5065	return c
5066}
5067
5068// UserProject sets the optional parameter "userProject": The project to
5069// be billed for this request. Required for Requester Pays buckets.
5070func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
5071	c.urlParams_.Set("userProject", userProject)
5072	return c
5073}
5074
5075// Fields allows partial responses to be retrieved. See
5076// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5077// for more information.
5078func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall {
5079	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5080	return c
5081}
5082
5083// IfNoneMatch sets the optional parameter which makes the operation
5084// fail if the object's ETag matches the given value. This is useful for
5085// getting updates only after the object has changed since the last
5086// request. Use googleapi.IsNotModified to check whether the response
5087// error from Do is the result of In-None-Match.
5088func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall {
5089	c.ifNoneMatch_ = entityTag
5090	return c
5091}
5092
5093// Context sets the context to be used in this call's Do method. Any
5094// pending HTTP request will be aborted if the provided context is
5095// canceled.
5096func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
5097	c.ctx_ = ctx
5098	return c
5099}
5100
5101// Header returns an http.Header that can be modified by the caller to
5102// add HTTP headers to the request.
5103func (c *BucketsTestIamPermissionsCall) Header() http.Header {
5104	if c.header_ == nil {
5105		c.header_ = make(http.Header)
5106	}
5107	return c.header_
5108}
5109
5110func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5111	reqHeaders := make(http.Header)
5112	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5113	for k, v := range c.header_ {
5114		reqHeaders[k] = v
5115	}
5116	reqHeaders.Set("User-Agent", c.s.userAgent())
5117	if c.ifNoneMatch_ != "" {
5118		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5119	}
5120	var body io.Reader = nil
5121	c.urlParams_.Set("alt", alt)
5122	c.urlParams_.Set("prettyPrint", "false")
5123	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions")
5124	urls += "?" + c.urlParams_.Encode()
5125	req, err := http.NewRequest("GET", urls, body)
5126	if err != nil {
5127		return nil, err
5128	}
5129	req.Header = reqHeaders
5130	googleapi.Expand(req.URL, map[string]string{
5131		"bucket": c.bucket,
5132	})
5133	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5134}
5135
5136// Do executes the "storage.buckets.testIamPermissions" call.
5137// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
5138// Any non-2xx status code is an error. Response headers are in either
5139// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
5140// was returned at all) in error.(*googleapi.Error).Header. Use
5141// googleapi.IsNotModified to check whether the returned error was
5142// because http.StatusNotModified was returned.
5143func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
5144	gensupport.SetOptions(c.urlParams_, opts...)
5145	res, err := c.doRequest("json")
5146	if res != nil && res.StatusCode == http.StatusNotModified {
5147		if res.Body != nil {
5148			res.Body.Close()
5149		}
5150		return nil, &googleapi.Error{
5151			Code:   res.StatusCode,
5152			Header: res.Header,
5153		}
5154	}
5155	if err != nil {
5156		return nil, err
5157	}
5158	defer googleapi.CloseBody(res)
5159	if err := googleapi.CheckResponse(res); err != nil {
5160		return nil, err
5161	}
5162	ret := &TestIamPermissionsResponse{
5163		ServerResponse: googleapi.ServerResponse{
5164			Header:         res.Header,
5165			HTTPStatusCode: res.StatusCode,
5166		},
5167	}
5168	target := &ret
5169	if err := gensupport.DecodeResponse(target, res); err != nil {
5170		return nil, err
5171	}
5172	return ret, nil
5173	// {
5174	//   "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
5175	//   "httpMethod": "GET",
5176	//   "id": "storage.buckets.testIamPermissions",
5177	//   "parameterOrder": [
5178	//     "bucket",
5179	//     "permissions"
5180	//   ],
5181	//   "parameters": {
5182	//     "bucket": {
5183	//       "description": "Name of a bucket.",
5184	//       "location": "path",
5185	//       "required": true,
5186	//       "type": "string"
5187	//     },
5188	//     "permissions": {
5189	//       "description": "Permissions to test.",
5190	//       "location": "query",
5191	//       "repeated": true,
5192	//       "required": true,
5193	//       "type": "string"
5194	//     },
5195	//     "provisionalUserProject": {
5196	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5197	//       "location": "query",
5198	//       "type": "string"
5199	//     },
5200	//     "userProject": {
5201	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5202	//       "location": "query",
5203	//       "type": "string"
5204	//     }
5205	//   },
5206	//   "path": "b/{bucket}/iam/testPermissions",
5207	//   "response": {
5208	//     "$ref": "TestIamPermissionsResponse"
5209	//   },
5210	//   "scopes": [
5211	//     "https://www.googleapis.com/auth/cloud-platform",
5212	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5213	//     "https://www.googleapis.com/auth/devstorage.full_control",
5214	//     "https://www.googleapis.com/auth/devstorage.read_only",
5215	//     "https://www.googleapis.com/auth/devstorage.read_write"
5216	//   ]
5217	// }
5218
5219}
5220
5221// method id "storage.buckets.update":
5222
5223type BucketsUpdateCall struct {
5224	s          *Service
5225	bucket     string
5226	bucket2    *Bucket
5227	urlParams_ gensupport.URLParams
5228	ctx_       context.Context
5229	header_    http.Header
5230}
5231
5232// Update: Updates a bucket. Changes to the bucket will be readable
5233// immediately after writing, but configuration changes may take time to
5234// propagate.
5235func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
5236	c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5237	c.bucket = bucket
5238	c.bucket2 = bucket2
5239	return c
5240}
5241
5242// IfMetagenerationMatch sets the optional parameter
5243// "ifMetagenerationMatch": Makes the return of the bucket metadata
5244// conditional on whether the bucket's current metageneration matches
5245// the given value.
5246func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
5247	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5248	return c
5249}
5250
5251// IfMetagenerationNotMatch sets the optional parameter
5252// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
5253// conditional on whether the bucket's current metageneration does not
5254// match the given value.
5255func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall {
5256	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5257	return c
5258}
5259
5260// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
5261// predefined set of access controls to this bucket.
5262//
5263// Possible values:
5264//   "authenticatedRead" - Project team owners get OWNER access, and
5265// allAuthenticatedUsers get READER access.
5266//   "private" - Project team owners get OWNER access.
5267//   "projectPrivate" - Project team members get access according to
5268// their roles.
5269//   "publicRead" - Project team owners get OWNER access, and allUsers
5270// get READER access.
5271//   "publicReadWrite" - Project team owners get OWNER access, and
5272// allUsers get WRITER access.
5273func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall {
5274	c.urlParams_.Set("predefinedAcl", predefinedAcl)
5275	return c
5276}
5277
5278// PredefinedDefaultObjectAcl sets the optional parameter
5279// "predefinedDefaultObjectAcl": Apply a predefined set of default
5280// object access controls to this bucket.
5281//
5282// Possible values:
5283//   "authenticatedRead" - Object owner gets OWNER access, and
5284// allAuthenticatedUsers get READER access.
5285//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
5286// project team owners get OWNER access.
5287//   "bucketOwnerRead" - Object owner gets OWNER access, and project
5288// team owners get READER access.
5289//   "private" - Object owner gets OWNER access.
5290//   "projectPrivate" - Object owner gets OWNER access, and project team
5291// members get access according to their roles.
5292//   "publicRead" - Object owner gets OWNER access, and allUsers get
5293// READER access.
5294func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
5295	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
5296	return c
5297}
5298
5299// Projection sets the optional parameter "projection": Set of
5300// properties to return. Defaults to full.
5301//
5302// Possible values:
5303//   "full" - Include all properties.
5304//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
5305func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
5306	c.urlParams_.Set("projection", projection)
5307	return c
5308}
5309
5310// ProvisionalUserProject sets the optional parameter
5311// "provisionalUserProject": The project to be billed for this request
5312// if the target bucket is requester-pays bucket.
5313func (c *BucketsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketsUpdateCall {
5314	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5315	return c
5316}
5317
5318// UserProject sets the optional parameter "userProject": The project to
5319// be billed for this request. Required for Requester Pays buckets.
5320func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
5321	c.urlParams_.Set("userProject", userProject)
5322	return c
5323}
5324
5325// Fields allows partial responses to be retrieved. See
5326// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5327// for more information.
5328func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
5329	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5330	return c
5331}
5332
5333// Context sets the context to be used in this call's Do method. Any
5334// pending HTTP request will be aborted if the provided context is
5335// canceled.
5336func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
5337	c.ctx_ = ctx
5338	return c
5339}
5340
5341// Header returns an http.Header that can be modified by the caller to
5342// add HTTP headers to the request.
5343func (c *BucketsUpdateCall) Header() http.Header {
5344	if c.header_ == nil {
5345		c.header_ = make(http.Header)
5346	}
5347	return c.header_
5348}
5349
5350func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
5351	reqHeaders := make(http.Header)
5352	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5353	for k, v := range c.header_ {
5354		reqHeaders[k] = v
5355	}
5356	reqHeaders.Set("User-Agent", c.s.userAgent())
5357	var body io.Reader = nil
5358	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
5359	if err != nil {
5360		return nil, err
5361	}
5362	reqHeaders.Set("Content-Type", "application/json")
5363	c.urlParams_.Set("alt", alt)
5364	c.urlParams_.Set("prettyPrint", "false")
5365	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
5366	urls += "?" + c.urlParams_.Encode()
5367	req, err := http.NewRequest("PUT", urls, body)
5368	if err != nil {
5369		return nil, err
5370	}
5371	req.Header = reqHeaders
5372	googleapi.Expand(req.URL, map[string]string{
5373		"bucket": c.bucket,
5374	})
5375	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5376}
5377
5378// Do executes the "storage.buckets.update" call.
5379// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
5380// code is an error. Response headers are in either
5381// *Bucket.ServerResponse.Header or (if a response was returned at all)
5382// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5383// check whether the returned error was because http.StatusNotModified
5384// was returned.
5385func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
5386	gensupport.SetOptions(c.urlParams_, opts...)
5387	res, err := c.doRequest("json")
5388	if res != nil && res.StatusCode == http.StatusNotModified {
5389		if res.Body != nil {
5390			res.Body.Close()
5391		}
5392		return nil, &googleapi.Error{
5393			Code:   res.StatusCode,
5394			Header: res.Header,
5395		}
5396	}
5397	if err != nil {
5398		return nil, err
5399	}
5400	defer googleapi.CloseBody(res)
5401	if err := googleapi.CheckResponse(res); err != nil {
5402		return nil, err
5403	}
5404	ret := &Bucket{
5405		ServerResponse: googleapi.ServerResponse{
5406			Header:         res.Header,
5407			HTTPStatusCode: res.StatusCode,
5408		},
5409	}
5410	target := &ret
5411	if err := gensupport.DecodeResponse(target, res); err != nil {
5412		return nil, err
5413	}
5414	return ret, nil
5415	// {
5416	//   "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
5417	//   "httpMethod": "PUT",
5418	//   "id": "storage.buckets.update",
5419	//   "parameterOrder": [
5420	//     "bucket"
5421	//   ],
5422	//   "parameters": {
5423	//     "bucket": {
5424	//       "description": "Name of a bucket.",
5425	//       "location": "path",
5426	//       "required": true,
5427	//       "type": "string"
5428	//     },
5429	//     "ifMetagenerationMatch": {
5430	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
5431	//       "format": "int64",
5432	//       "location": "query",
5433	//       "type": "string"
5434	//     },
5435	//     "ifMetagenerationNotMatch": {
5436	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
5437	//       "format": "int64",
5438	//       "location": "query",
5439	//       "type": "string"
5440	//     },
5441	//     "predefinedAcl": {
5442	//       "description": "Apply a predefined set of access controls to this bucket.",
5443	//       "enum": [
5444	//         "authenticatedRead",
5445	//         "private",
5446	//         "projectPrivate",
5447	//         "publicRead",
5448	//         "publicReadWrite"
5449	//       ],
5450	//       "enumDescriptions": [
5451	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
5452	//         "Project team owners get OWNER access.",
5453	//         "Project team members get access according to their roles.",
5454	//         "Project team owners get OWNER access, and allUsers get READER access.",
5455	//         "Project team owners get OWNER access, and allUsers get WRITER access."
5456	//       ],
5457	//       "location": "query",
5458	//       "type": "string"
5459	//     },
5460	//     "predefinedDefaultObjectAcl": {
5461	//       "description": "Apply a predefined set of default object access controls to this bucket.",
5462	//       "enum": [
5463	//         "authenticatedRead",
5464	//         "bucketOwnerFullControl",
5465	//         "bucketOwnerRead",
5466	//         "private",
5467	//         "projectPrivate",
5468	//         "publicRead"
5469	//       ],
5470	//       "enumDescriptions": [
5471	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
5472	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
5473	//         "Object owner gets OWNER access, and project team owners get READER access.",
5474	//         "Object owner gets OWNER access.",
5475	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
5476	//         "Object owner gets OWNER access, and allUsers get READER access."
5477	//       ],
5478	//       "location": "query",
5479	//       "type": "string"
5480	//     },
5481	//     "projection": {
5482	//       "description": "Set of properties to return. Defaults to full.",
5483	//       "enum": [
5484	//         "full",
5485	//         "noAcl"
5486	//       ],
5487	//       "enumDescriptions": [
5488	//         "Include all properties.",
5489	//         "Omit owner, acl and defaultObjectAcl properties."
5490	//       ],
5491	//       "location": "query",
5492	//       "type": "string"
5493	//     },
5494	//     "provisionalUserProject": {
5495	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5496	//       "location": "query",
5497	//       "type": "string"
5498	//     },
5499	//     "userProject": {
5500	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5501	//       "location": "query",
5502	//       "type": "string"
5503	//     }
5504	//   },
5505	//   "path": "b/{bucket}",
5506	//   "request": {
5507	//     "$ref": "Bucket"
5508	//   },
5509	//   "response": {
5510	//     "$ref": "Bucket"
5511	//   },
5512	//   "scopes": [
5513	//     "https://www.googleapis.com/auth/cloud-platform",
5514	//     "https://www.googleapis.com/auth/devstorage.full_control"
5515	//   ]
5516	// }
5517
5518}
5519
5520// method id "storage.channels.stop":
5521
5522type ChannelsStopCall struct {
5523	s          *Service
5524	channel    *Channel
5525	urlParams_ gensupport.URLParams
5526	ctx_       context.Context
5527	header_    http.Header
5528}
5529
5530// Stop: Stop watching resources through this channel
5531func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
5532	c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5533	c.channel = channel
5534	return c
5535}
5536
5537// Fields allows partial responses to be retrieved. See
5538// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5539// for more information.
5540func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
5541	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5542	return c
5543}
5544
5545// Context sets the context to be used in this call's Do method. Any
5546// pending HTTP request will be aborted if the provided context is
5547// canceled.
5548func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
5549	c.ctx_ = ctx
5550	return c
5551}
5552
5553// Header returns an http.Header that can be modified by the caller to
5554// add HTTP headers to the request.
5555func (c *ChannelsStopCall) Header() http.Header {
5556	if c.header_ == nil {
5557		c.header_ = make(http.Header)
5558	}
5559	return c.header_
5560}
5561
5562func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
5563	reqHeaders := make(http.Header)
5564	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5565	for k, v := range c.header_ {
5566		reqHeaders[k] = v
5567	}
5568	reqHeaders.Set("User-Agent", c.s.userAgent())
5569	var body io.Reader = nil
5570	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
5571	if err != nil {
5572		return nil, err
5573	}
5574	reqHeaders.Set("Content-Type", "application/json")
5575	c.urlParams_.Set("alt", alt)
5576	c.urlParams_.Set("prettyPrint", "false")
5577	urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
5578	urls += "?" + c.urlParams_.Encode()
5579	req, err := http.NewRequest("POST", urls, body)
5580	if err != nil {
5581		return nil, err
5582	}
5583	req.Header = reqHeaders
5584	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5585}
5586
5587// Do executes the "storage.channels.stop" call.
5588func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
5589	gensupport.SetOptions(c.urlParams_, opts...)
5590	res, err := c.doRequest("json")
5591	if err != nil {
5592		return err
5593	}
5594	defer googleapi.CloseBody(res)
5595	if err := googleapi.CheckResponse(res); err != nil {
5596		return err
5597	}
5598	return nil
5599	// {
5600	//   "description": "Stop watching resources through this channel",
5601	//   "httpMethod": "POST",
5602	//   "id": "storage.channels.stop",
5603	//   "path": "channels/stop",
5604	//   "request": {
5605	//     "$ref": "Channel",
5606	//     "parameterName": "resource"
5607	//   },
5608	//   "scopes": [
5609	//     "https://www.googleapis.com/auth/cloud-platform",
5610	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5611	//     "https://www.googleapis.com/auth/devstorage.full_control",
5612	//     "https://www.googleapis.com/auth/devstorage.read_only",
5613	//     "https://www.googleapis.com/auth/devstorage.read_write"
5614	//   ]
5615	// }
5616
5617}
5618
5619// method id "storage.defaultObjectAccessControls.delete":
5620
5621type DefaultObjectAccessControlsDeleteCall struct {
5622	s          *Service
5623	bucket     string
5624	entity     string
5625	urlParams_ gensupport.URLParams
5626	ctx_       context.Context
5627	header_    http.Header
5628}
5629
5630// Delete: Permanently deletes the default object ACL entry for the
5631// specified entity on the specified bucket.
5632func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
5633	c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5634	c.bucket = bucket
5635	c.entity = entity
5636	return c
5637}
5638
5639// ProvisionalUserProject sets the optional parameter
5640// "provisionalUserProject": The project to be billed for this request
5641// if the target bucket is requester-pays bucket.
5642func (c *DefaultObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsDeleteCall {
5643	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5644	return c
5645}
5646
5647// UserProject sets the optional parameter "userProject": The project to
5648// be billed for this request. Required for Requester Pays buckets.
5649func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
5650	c.urlParams_.Set("userProject", userProject)
5651	return c
5652}
5653
5654// Fields allows partial responses to be retrieved. See
5655// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5656// for more information.
5657func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
5658	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5659	return c
5660}
5661
5662// Context sets the context to be used in this call's Do method. Any
5663// pending HTTP request will be aborted if the provided context is
5664// canceled.
5665func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
5666	c.ctx_ = ctx
5667	return c
5668}
5669
5670// Header returns an http.Header that can be modified by the caller to
5671// add HTTP headers to the request.
5672func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
5673	if c.header_ == nil {
5674		c.header_ = make(http.Header)
5675	}
5676	return c.header_
5677}
5678
5679func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
5680	reqHeaders := make(http.Header)
5681	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5682	for k, v := range c.header_ {
5683		reqHeaders[k] = v
5684	}
5685	reqHeaders.Set("User-Agent", c.s.userAgent())
5686	var body io.Reader = nil
5687	c.urlParams_.Set("alt", alt)
5688	c.urlParams_.Set("prettyPrint", "false")
5689	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5690	urls += "?" + c.urlParams_.Encode()
5691	req, err := http.NewRequest("DELETE", urls, body)
5692	if err != nil {
5693		return nil, err
5694	}
5695	req.Header = reqHeaders
5696	googleapi.Expand(req.URL, map[string]string{
5697		"bucket": c.bucket,
5698		"entity": c.entity,
5699	})
5700	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5701}
5702
5703// Do executes the "storage.defaultObjectAccessControls.delete" call.
5704func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
5705	gensupport.SetOptions(c.urlParams_, opts...)
5706	res, err := c.doRequest("json")
5707	if err != nil {
5708		return err
5709	}
5710	defer googleapi.CloseBody(res)
5711	if err := googleapi.CheckResponse(res); err != nil {
5712		return err
5713	}
5714	return nil
5715	// {
5716	//   "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
5717	//   "httpMethod": "DELETE",
5718	//   "id": "storage.defaultObjectAccessControls.delete",
5719	//   "parameterOrder": [
5720	//     "bucket",
5721	//     "entity"
5722	//   ],
5723	//   "parameters": {
5724	//     "bucket": {
5725	//       "description": "Name of a bucket.",
5726	//       "location": "path",
5727	//       "required": true,
5728	//       "type": "string"
5729	//     },
5730	//     "entity": {
5731	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5732	//       "location": "path",
5733	//       "required": true,
5734	//       "type": "string"
5735	//     },
5736	//     "provisionalUserProject": {
5737	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5738	//       "location": "query",
5739	//       "type": "string"
5740	//     },
5741	//     "userProject": {
5742	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5743	//       "location": "query",
5744	//       "type": "string"
5745	//     }
5746	//   },
5747	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5748	//   "scopes": [
5749	//     "https://www.googleapis.com/auth/cloud-platform",
5750	//     "https://www.googleapis.com/auth/devstorage.full_control"
5751	//   ]
5752	// }
5753
5754}
5755
5756// method id "storage.defaultObjectAccessControls.get":
5757
5758type DefaultObjectAccessControlsGetCall struct {
5759	s            *Service
5760	bucket       string
5761	entity       string
5762	urlParams_   gensupport.URLParams
5763	ifNoneMatch_ string
5764	ctx_         context.Context
5765	header_      http.Header
5766}
5767
5768// Get: Returns the default object ACL entry for the specified entity on
5769// the specified bucket.
5770func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
5771	c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5772	c.bucket = bucket
5773	c.entity = entity
5774	return c
5775}
5776
5777// ProvisionalUserProject sets the optional parameter
5778// "provisionalUserProject": The project to be billed for this request
5779// if the target bucket is requester-pays bucket.
5780func (c *DefaultObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsGetCall {
5781	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5782	return c
5783}
5784
5785// UserProject sets the optional parameter "userProject": The project to
5786// be billed for this request. Required for Requester Pays buckets.
5787func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
5788	c.urlParams_.Set("userProject", userProject)
5789	return c
5790}
5791
5792// Fields allows partial responses to be retrieved. See
5793// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5794// for more information.
5795func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
5796	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5797	return c
5798}
5799
5800// IfNoneMatch sets the optional parameter which makes the operation
5801// fail if the object's ETag matches the given value. This is useful for
5802// getting updates only after the object has changed since the last
5803// request. Use googleapi.IsNotModified to check whether the response
5804// error from Do is the result of In-None-Match.
5805func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
5806	c.ifNoneMatch_ = entityTag
5807	return c
5808}
5809
5810// Context sets the context to be used in this call's Do method. Any
5811// pending HTTP request will be aborted if the provided context is
5812// canceled.
5813func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
5814	c.ctx_ = ctx
5815	return c
5816}
5817
5818// Header returns an http.Header that can be modified by the caller to
5819// add HTTP headers to the request.
5820func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
5821	if c.header_ == nil {
5822		c.header_ = make(http.Header)
5823	}
5824	return c.header_
5825}
5826
5827func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
5828	reqHeaders := make(http.Header)
5829	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5830	for k, v := range c.header_ {
5831		reqHeaders[k] = v
5832	}
5833	reqHeaders.Set("User-Agent", c.s.userAgent())
5834	if c.ifNoneMatch_ != "" {
5835		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5836	}
5837	var body io.Reader = nil
5838	c.urlParams_.Set("alt", alt)
5839	c.urlParams_.Set("prettyPrint", "false")
5840	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5841	urls += "?" + c.urlParams_.Encode()
5842	req, err := http.NewRequest("GET", urls, body)
5843	if err != nil {
5844		return nil, err
5845	}
5846	req.Header = reqHeaders
5847	googleapi.Expand(req.URL, map[string]string{
5848		"bucket": c.bucket,
5849		"entity": c.entity,
5850	})
5851	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5852}
5853
5854// Do executes the "storage.defaultObjectAccessControls.get" call.
5855// Exactly one of *ObjectAccessControl or error will be non-nil. Any
5856// non-2xx status code is an error. Response headers are in either
5857// *ObjectAccessControl.ServerResponse.Header or (if a response was
5858// returned at all) in error.(*googleapi.Error).Header. Use
5859// googleapi.IsNotModified to check whether the returned error was
5860// because http.StatusNotModified was returned.
5861func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5862	gensupport.SetOptions(c.urlParams_, opts...)
5863	res, err := c.doRequest("json")
5864	if res != nil && res.StatusCode == http.StatusNotModified {
5865		if res.Body != nil {
5866			res.Body.Close()
5867		}
5868		return nil, &googleapi.Error{
5869			Code:   res.StatusCode,
5870			Header: res.Header,
5871		}
5872	}
5873	if err != nil {
5874		return nil, err
5875	}
5876	defer googleapi.CloseBody(res)
5877	if err := googleapi.CheckResponse(res); err != nil {
5878		return nil, err
5879	}
5880	ret := &ObjectAccessControl{
5881		ServerResponse: googleapi.ServerResponse{
5882			Header:         res.Header,
5883			HTTPStatusCode: res.StatusCode,
5884		},
5885	}
5886	target := &ret
5887	if err := gensupport.DecodeResponse(target, res); err != nil {
5888		return nil, err
5889	}
5890	return ret, nil
5891	// {
5892	//   "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
5893	//   "httpMethod": "GET",
5894	//   "id": "storage.defaultObjectAccessControls.get",
5895	//   "parameterOrder": [
5896	//     "bucket",
5897	//     "entity"
5898	//   ],
5899	//   "parameters": {
5900	//     "bucket": {
5901	//       "description": "Name of a bucket.",
5902	//       "location": "path",
5903	//       "required": true,
5904	//       "type": "string"
5905	//     },
5906	//     "entity": {
5907	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5908	//       "location": "path",
5909	//       "required": true,
5910	//       "type": "string"
5911	//     },
5912	//     "provisionalUserProject": {
5913	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5914	//       "location": "query",
5915	//       "type": "string"
5916	//     },
5917	//     "userProject": {
5918	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5919	//       "location": "query",
5920	//       "type": "string"
5921	//     }
5922	//   },
5923	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5924	//   "response": {
5925	//     "$ref": "ObjectAccessControl"
5926	//   },
5927	//   "scopes": [
5928	//     "https://www.googleapis.com/auth/cloud-platform",
5929	//     "https://www.googleapis.com/auth/devstorage.full_control"
5930	//   ]
5931	// }
5932
5933}
5934
5935// method id "storage.defaultObjectAccessControls.insert":
5936
5937type DefaultObjectAccessControlsInsertCall struct {
5938	s                   *Service
5939	bucket              string
5940	objectaccesscontrol *ObjectAccessControl
5941	urlParams_          gensupport.URLParams
5942	ctx_                context.Context
5943	header_             http.Header
5944}
5945
5946// Insert: Creates a new default object ACL entry on the specified
5947// bucket.
5948func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
5949	c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5950	c.bucket = bucket
5951	c.objectaccesscontrol = objectaccesscontrol
5952	return c
5953}
5954
5955// ProvisionalUserProject sets the optional parameter
5956// "provisionalUserProject": The project to be billed for this request
5957// if the target bucket is requester-pays bucket.
5958func (c *DefaultObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsInsertCall {
5959	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5960	return c
5961}
5962
5963// UserProject sets the optional parameter "userProject": The project to
5964// be billed for this request. Required for Requester Pays buckets.
5965func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
5966	c.urlParams_.Set("userProject", userProject)
5967	return c
5968}
5969
5970// Fields allows partial responses to be retrieved. See
5971// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5972// for more information.
5973func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
5974	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5975	return c
5976}
5977
5978// Context sets the context to be used in this call's Do method. Any
5979// pending HTTP request will be aborted if the provided context is
5980// canceled.
5981func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
5982	c.ctx_ = ctx
5983	return c
5984}
5985
5986// Header returns an http.Header that can be modified by the caller to
5987// add HTTP headers to the request.
5988func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
5989	if c.header_ == nil {
5990		c.header_ = make(http.Header)
5991	}
5992	return c.header_
5993}
5994
5995func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
5996	reqHeaders := make(http.Header)
5997	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
5998	for k, v := range c.header_ {
5999		reqHeaders[k] = v
6000	}
6001	reqHeaders.Set("User-Agent", c.s.userAgent())
6002	var body io.Reader = nil
6003	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6004	if err != nil {
6005		return nil, err
6006	}
6007	reqHeaders.Set("Content-Type", "application/json")
6008	c.urlParams_.Set("alt", alt)
6009	c.urlParams_.Set("prettyPrint", "false")
6010	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
6011	urls += "?" + c.urlParams_.Encode()
6012	req, err := http.NewRequest("POST", urls, body)
6013	if err != nil {
6014		return nil, err
6015	}
6016	req.Header = reqHeaders
6017	googleapi.Expand(req.URL, map[string]string{
6018		"bucket": c.bucket,
6019	})
6020	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6021}
6022
6023// Do executes the "storage.defaultObjectAccessControls.insert" call.
6024// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6025// non-2xx status code is an error. Response headers are in either
6026// *ObjectAccessControl.ServerResponse.Header or (if a response was
6027// returned at all) in error.(*googleapi.Error).Header. Use
6028// googleapi.IsNotModified to check whether the returned error was
6029// because http.StatusNotModified was returned.
6030func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6031	gensupport.SetOptions(c.urlParams_, opts...)
6032	res, err := c.doRequest("json")
6033	if res != nil && res.StatusCode == http.StatusNotModified {
6034		if res.Body != nil {
6035			res.Body.Close()
6036		}
6037		return nil, &googleapi.Error{
6038			Code:   res.StatusCode,
6039			Header: res.Header,
6040		}
6041	}
6042	if err != nil {
6043		return nil, err
6044	}
6045	defer googleapi.CloseBody(res)
6046	if err := googleapi.CheckResponse(res); err != nil {
6047		return nil, err
6048	}
6049	ret := &ObjectAccessControl{
6050		ServerResponse: googleapi.ServerResponse{
6051			Header:         res.Header,
6052			HTTPStatusCode: res.StatusCode,
6053		},
6054	}
6055	target := &ret
6056	if err := gensupport.DecodeResponse(target, res); err != nil {
6057		return nil, err
6058	}
6059	return ret, nil
6060	// {
6061	//   "description": "Creates a new default object ACL entry on the specified bucket.",
6062	//   "httpMethod": "POST",
6063	//   "id": "storage.defaultObjectAccessControls.insert",
6064	//   "parameterOrder": [
6065	//     "bucket"
6066	//   ],
6067	//   "parameters": {
6068	//     "bucket": {
6069	//       "description": "Name of a bucket.",
6070	//       "location": "path",
6071	//       "required": true,
6072	//       "type": "string"
6073	//     },
6074	//     "provisionalUserProject": {
6075	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6076	//       "location": "query",
6077	//       "type": "string"
6078	//     },
6079	//     "userProject": {
6080	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6081	//       "location": "query",
6082	//       "type": "string"
6083	//     }
6084	//   },
6085	//   "path": "b/{bucket}/defaultObjectAcl",
6086	//   "request": {
6087	//     "$ref": "ObjectAccessControl"
6088	//   },
6089	//   "response": {
6090	//     "$ref": "ObjectAccessControl"
6091	//   },
6092	//   "scopes": [
6093	//     "https://www.googleapis.com/auth/cloud-platform",
6094	//     "https://www.googleapis.com/auth/devstorage.full_control"
6095	//   ]
6096	// }
6097
6098}
6099
6100// method id "storage.defaultObjectAccessControls.list":
6101
6102type DefaultObjectAccessControlsListCall struct {
6103	s            *Service
6104	bucket       string
6105	urlParams_   gensupport.URLParams
6106	ifNoneMatch_ string
6107	ctx_         context.Context
6108	header_      http.Header
6109}
6110
6111// List: Retrieves default object ACL entries on the specified bucket.
6112func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
6113	c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6114	c.bucket = bucket
6115	return c
6116}
6117
6118// IfMetagenerationMatch sets the optional parameter
6119// "ifMetagenerationMatch": If present, only return default ACL listing
6120// if the bucket's current metageneration matches this value.
6121func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
6122	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
6123	return c
6124}
6125
6126// IfMetagenerationNotMatch sets the optional parameter
6127// "ifMetagenerationNotMatch": If present, only return default ACL
6128// listing if the bucket's current metageneration does not match the
6129// given value.
6130func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
6131	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
6132	return c
6133}
6134
6135// ProvisionalUserProject sets the optional parameter
6136// "provisionalUserProject": The project to be billed for this request
6137// if the target bucket is requester-pays bucket.
6138func (c *DefaultObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsListCall {
6139	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6140	return c
6141}
6142
6143// UserProject sets the optional parameter "userProject": The project to
6144// be billed for this request. Required for Requester Pays buckets.
6145func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
6146	c.urlParams_.Set("userProject", userProject)
6147	return c
6148}
6149
6150// Fields allows partial responses to be retrieved. See
6151// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6152// for more information.
6153func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
6154	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6155	return c
6156}
6157
6158// IfNoneMatch sets the optional parameter which makes the operation
6159// fail if the object's ETag matches the given value. This is useful for
6160// getting updates only after the object has changed since the last
6161// request. Use googleapi.IsNotModified to check whether the response
6162// error from Do is the result of In-None-Match.
6163func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
6164	c.ifNoneMatch_ = entityTag
6165	return c
6166}
6167
6168// Context sets the context to be used in this call's Do method. Any
6169// pending HTTP request will be aborted if the provided context is
6170// canceled.
6171func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
6172	c.ctx_ = ctx
6173	return c
6174}
6175
6176// Header returns an http.Header that can be modified by the caller to
6177// add HTTP headers to the request.
6178func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
6179	if c.header_ == nil {
6180		c.header_ = make(http.Header)
6181	}
6182	return c.header_
6183}
6184
6185func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
6186	reqHeaders := make(http.Header)
6187	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6188	for k, v := range c.header_ {
6189		reqHeaders[k] = v
6190	}
6191	reqHeaders.Set("User-Agent", c.s.userAgent())
6192	if c.ifNoneMatch_ != "" {
6193		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6194	}
6195	var body io.Reader = nil
6196	c.urlParams_.Set("alt", alt)
6197	c.urlParams_.Set("prettyPrint", "false")
6198	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
6199	urls += "?" + c.urlParams_.Encode()
6200	req, err := http.NewRequest("GET", urls, body)
6201	if err != nil {
6202		return nil, err
6203	}
6204	req.Header = reqHeaders
6205	googleapi.Expand(req.URL, map[string]string{
6206		"bucket": c.bucket,
6207	})
6208	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6209}
6210
6211// Do executes the "storage.defaultObjectAccessControls.list" call.
6212// Exactly one of *ObjectAccessControls or error will be non-nil. Any
6213// non-2xx status code is an error. Response headers are in either
6214// *ObjectAccessControls.ServerResponse.Header or (if a response was
6215// returned at all) in error.(*googleapi.Error).Header. Use
6216// googleapi.IsNotModified to check whether the returned error was
6217// because http.StatusNotModified was returned.
6218func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
6219	gensupport.SetOptions(c.urlParams_, opts...)
6220	res, err := c.doRequest("json")
6221	if res != nil && res.StatusCode == http.StatusNotModified {
6222		if res.Body != nil {
6223			res.Body.Close()
6224		}
6225		return nil, &googleapi.Error{
6226			Code:   res.StatusCode,
6227			Header: res.Header,
6228		}
6229	}
6230	if err != nil {
6231		return nil, err
6232	}
6233	defer googleapi.CloseBody(res)
6234	if err := googleapi.CheckResponse(res); err != nil {
6235		return nil, err
6236	}
6237	ret := &ObjectAccessControls{
6238		ServerResponse: googleapi.ServerResponse{
6239			Header:         res.Header,
6240			HTTPStatusCode: res.StatusCode,
6241		},
6242	}
6243	target := &ret
6244	if err := gensupport.DecodeResponse(target, res); err != nil {
6245		return nil, err
6246	}
6247	return ret, nil
6248	// {
6249	//   "description": "Retrieves default object ACL entries on the specified bucket.",
6250	//   "httpMethod": "GET",
6251	//   "id": "storage.defaultObjectAccessControls.list",
6252	//   "parameterOrder": [
6253	//     "bucket"
6254	//   ],
6255	//   "parameters": {
6256	//     "bucket": {
6257	//       "description": "Name of a bucket.",
6258	//       "location": "path",
6259	//       "required": true,
6260	//       "type": "string"
6261	//     },
6262	//     "ifMetagenerationMatch": {
6263	//       "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
6264	//       "format": "int64",
6265	//       "location": "query",
6266	//       "type": "string"
6267	//     },
6268	//     "ifMetagenerationNotMatch": {
6269	//       "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
6270	//       "format": "int64",
6271	//       "location": "query",
6272	//       "type": "string"
6273	//     },
6274	//     "provisionalUserProject": {
6275	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6276	//       "location": "query",
6277	//       "type": "string"
6278	//     },
6279	//     "userProject": {
6280	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6281	//       "location": "query",
6282	//       "type": "string"
6283	//     }
6284	//   },
6285	//   "path": "b/{bucket}/defaultObjectAcl",
6286	//   "response": {
6287	//     "$ref": "ObjectAccessControls"
6288	//   },
6289	//   "scopes": [
6290	//     "https://www.googleapis.com/auth/cloud-platform",
6291	//     "https://www.googleapis.com/auth/devstorage.full_control"
6292	//   ]
6293	// }
6294
6295}
6296
6297// method id "storage.defaultObjectAccessControls.patch":
6298
6299type DefaultObjectAccessControlsPatchCall struct {
6300	s                   *Service
6301	bucket              string
6302	entity              string
6303	objectaccesscontrol *ObjectAccessControl
6304	urlParams_          gensupport.URLParams
6305	ctx_                context.Context
6306	header_             http.Header
6307}
6308
6309// Patch: Patches a default object ACL entry on the specified bucket.
6310func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
6311	c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6312	c.bucket = bucket
6313	c.entity = entity
6314	c.objectaccesscontrol = objectaccesscontrol
6315	return c
6316}
6317
6318// ProvisionalUserProject sets the optional parameter
6319// "provisionalUserProject": The project to be billed for this request
6320// if the target bucket is requester-pays bucket.
6321func (c *DefaultObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsPatchCall {
6322	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6323	return c
6324}
6325
6326// UserProject sets the optional parameter "userProject": The project to
6327// be billed for this request. Required for Requester Pays buckets.
6328func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
6329	c.urlParams_.Set("userProject", userProject)
6330	return c
6331}
6332
6333// Fields allows partial responses to be retrieved. See
6334// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6335// for more information.
6336func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
6337	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6338	return c
6339}
6340
6341// Context sets the context to be used in this call's Do method. Any
6342// pending HTTP request will be aborted if the provided context is
6343// canceled.
6344func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
6345	c.ctx_ = ctx
6346	return c
6347}
6348
6349// Header returns an http.Header that can be modified by the caller to
6350// add HTTP headers to the request.
6351func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
6352	if c.header_ == nil {
6353		c.header_ = make(http.Header)
6354	}
6355	return c.header_
6356}
6357
6358func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
6359	reqHeaders := make(http.Header)
6360	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6361	for k, v := range c.header_ {
6362		reqHeaders[k] = v
6363	}
6364	reqHeaders.Set("User-Agent", c.s.userAgent())
6365	var body io.Reader = nil
6366	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6367	if err != nil {
6368		return nil, err
6369	}
6370	reqHeaders.Set("Content-Type", "application/json")
6371	c.urlParams_.Set("alt", alt)
6372	c.urlParams_.Set("prettyPrint", "false")
6373	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
6374	urls += "?" + c.urlParams_.Encode()
6375	req, err := http.NewRequest("PATCH", urls, body)
6376	if err != nil {
6377		return nil, err
6378	}
6379	req.Header = reqHeaders
6380	googleapi.Expand(req.URL, map[string]string{
6381		"bucket": c.bucket,
6382		"entity": c.entity,
6383	})
6384	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6385}
6386
6387// Do executes the "storage.defaultObjectAccessControls.patch" call.
6388// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6389// non-2xx status code is an error. Response headers are in either
6390// *ObjectAccessControl.ServerResponse.Header or (if a response was
6391// returned at all) in error.(*googleapi.Error).Header. Use
6392// googleapi.IsNotModified to check whether the returned error was
6393// because http.StatusNotModified was returned.
6394func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6395	gensupport.SetOptions(c.urlParams_, opts...)
6396	res, err := c.doRequest("json")
6397	if res != nil && res.StatusCode == http.StatusNotModified {
6398		if res.Body != nil {
6399			res.Body.Close()
6400		}
6401		return nil, &googleapi.Error{
6402			Code:   res.StatusCode,
6403			Header: res.Header,
6404		}
6405	}
6406	if err != nil {
6407		return nil, err
6408	}
6409	defer googleapi.CloseBody(res)
6410	if err := googleapi.CheckResponse(res); err != nil {
6411		return nil, err
6412	}
6413	ret := &ObjectAccessControl{
6414		ServerResponse: googleapi.ServerResponse{
6415			Header:         res.Header,
6416			HTTPStatusCode: res.StatusCode,
6417		},
6418	}
6419	target := &ret
6420	if err := gensupport.DecodeResponse(target, res); err != nil {
6421		return nil, err
6422	}
6423	return ret, nil
6424	// {
6425	//   "description": "Patches a default object ACL entry on the specified bucket.",
6426	//   "httpMethod": "PATCH",
6427	//   "id": "storage.defaultObjectAccessControls.patch",
6428	//   "parameterOrder": [
6429	//     "bucket",
6430	//     "entity"
6431	//   ],
6432	//   "parameters": {
6433	//     "bucket": {
6434	//       "description": "Name of a bucket.",
6435	//       "location": "path",
6436	//       "required": true,
6437	//       "type": "string"
6438	//     },
6439	//     "entity": {
6440	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6441	//       "location": "path",
6442	//       "required": true,
6443	//       "type": "string"
6444	//     },
6445	//     "provisionalUserProject": {
6446	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6447	//       "location": "query",
6448	//       "type": "string"
6449	//     },
6450	//     "userProject": {
6451	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6452	//       "location": "query",
6453	//       "type": "string"
6454	//     }
6455	//   },
6456	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
6457	//   "request": {
6458	//     "$ref": "ObjectAccessControl"
6459	//   },
6460	//   "response": {
6461	//     "$ref": "ObjectAccessControl"
6462	//   },
6463	//   "scopes": [
6464	//     "https://www.googleapis.com/auth/cloud-platform",
6465	//     "https://www.googleapis.com/auth/devstorage.full_control"
6466	//   ]
6467	// }
6468
6469}
6470
6471// method id "storage.defaultObjectAccessControls.update":
6472
6473type DefaultObjectAccessControlsUpdateCall struct {
6474	s                   *Service
6475	bucket              string
6476	entity              string
6477	objectaccesscontrol *ObjectAccessControl
6478	urlParams_          gensupport.URLParams
6479	ctx_                context.Context
6480	header_             http.Header
6481}
6482
6483// Update: Updates a default object ACL entry on the specified bucket.
6484func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
6485	c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6486	c.bucket = bucket
6487	c.entity = entity
6488	c.objectaccesscontrol = objectaccesscontrol
6489	return c
6490}
6491
6492// ProvisionalUserProject sets the optional parameter
6493// "provisionalUserProject": The project to be billed for this request
6494// if the target bucket is requester-pays bucket.
6495func (c *DefaultObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsUpdateCall {
6496	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6497	return c
6498}
6499
6500// UserProject sets the optional parameter "userProject": The project to
6501// be billed for this request. Required for Requester Pays buckets.
6502func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
6503	c.urlParams_.Set("userProject", userProject)
6504	return c
6505}
6506
6507// Fields allows partial responses to be retrieved. See
6508// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6509// for more information.
6510func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
6511	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6512	return c
6513}
6514
6515// Context sets the context to be used in this call's Do method. Any
6516// pending HTTP request will be aborted if the provided context is
6517// canceled.
6518func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
6519	c.ctx_ = ctx
6520	return c
6521}
6522
6523// Header returns an http.Header that can be modified by the caller to
6524// add HTTP headers to the request.
6525func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
6526	if c.header_ == nil {
6527		c.header_ = make(http.Header)
6528	}
6529	return c.header_
6530}
6531
6532func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
6533	reqHeaders := make(http.Header)
6534	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6535	for k, v := range c.header_ {
6536		reqHeaders[k] = v
6537	}
6538	reqHeaders.Set("User-Agent", c.s.userAgent())
6539	var body io.Reader = nil
6540	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6541	if err != nil {
6542		return nil, err
6543	}
6544	reqHeaders.Set("Content-Type", "application/json")
6545	c.urlParams_.Set("alt", alt)
6546	c.urlParams_.Set("prettyPrint", "false")
6547	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
6548	urls += "?" + c.urlParams_.Encode()
6549	req, err := http.NewRequest("PUT", urls, body)
6550	if err != nil {
6551		return nil, err
6552	}
6553	req.Header = reqHeaders
6554	googleapi.Expand(req.URL, map[string]string{
6555		"bucket": c.bucket,
6556		"entity": c.entity,
6557	})
6558	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6559}
6560
6561// Do executes the "storage.defaultObjectAccessControls.update" call.
6562// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6563// non-2xx status code is an error. Response headers are in either
6564// *ObjectAccessControl.ServerResponse.Header or (if a response was
6565// returned at all) in error.(*googleapi.Error).Header. Use
6566// googleapi.IsNotModified to check whether the returned error was
6567// because http.StatusNotModified was returned.
6568func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6569	gensupport.SetOptions(c.urlParams_, opts...)
6570	res, err := c.doRequest("json")
6571	if res != nil && res.StatusCode == http.StatusNotModified {
6572		if res.Body != nil {
6573			res.Body.Close()
6574		}
6575		return nil, &googleapi.Error{
6576			Code:   res.StatusCode,
6577			Header: res.Header,
6578		}
6579	}
6580	if err != nil {
6581		return nil, err
6582	}
6583	defer googleapi.CloseBody(res)
6584	if err := googleapi.CheckResponse(res); err != nil {
6585		return nil, err
6586	}
6587	ret := &ObjectAccessControl{
6588		ServerResponse: googleapi.ServerResponse{
6589			Header:         res.Header,
6590			HTTPStatusCode: res.StatusCode,
6591		},
6592	}
6593	target := &ret
6594	if err := gensupport.DecodeResponse(target, res); err != nil {
6595		return nil, err
6596	}
6597	return ret, nil
6598	// {
6599	//   "description": "Updates a default object ACL entry on the specified bucket.",
6600	//   "httpMethod": "PUT",
6601	//   "id": "storage.defaultObjectAccessControls.update",
6602	//   "parameterOrder": [
6603	//     "bucket",
6604	//     "entity"
6605	//   ],
6606	//   "parameters": {
6607	//     "bucket": {
6608	//       "description": "Name of a bucket.",
6609	//       "location": "path",
6610	//       "required": true,
6611	//       "type": "string"
6612	//     },
6613	//     "entity": {
6614	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6615	//       "location": "path",
6616	//       "required": true,
6617	//       "type": "string"
6618	//     },
6619	//     "provisionalUserProject": {
6620	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6621	//       "location": "query",
6622	//       "type": "string"
6623	//     },
6624	//     "userProject": {
6625	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6626	//       "location": "query",
6627	//       "type": "string"
6628	//     }
6629	//   },
6630	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
6631	//   "request": {
6632	//     "$ref": "ObjectAccessControl"
6633	//   },
6634	//   "response": {
6635	//     "$ref": "ObjectAccessControl"
6636	//   },
6637	//   "scopes": [
6638	//     "https://www.googleapis.com/auth/cloud-platform",
6639	//     "https://www.googleapis.com/auth/devstorage.full_control"
6640	//   ]
6641	// }
6642
6643}
6644
6645// method id "storage.notifications.delete":
6646
6647type NotificationsDeleteCall struct {
6648	s            *Service
6649	bucket       string
6650	notification string
6651	urlParams_   gensupport.URLParams
6652	ctx_         context.Context
6653	header_      http.Header
6654}
6655
6656// Delete: Permanently deletes a notification subscription.
6657func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
6658	c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6659	c.bucket = bucket
6660	c.notification = notification
6661	return c
6662}
6663
6664// ProvisionalUserProject sets the optional parameter
6665// "provisionalUserProject": The project to be billed for this request
6666// if the target bucket is requester-pays bucket.
6667func (c *NotificationsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsDeleteCall {
6668	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6669	return c
6670}
6671
6672// UserProject sets the optional parameter "userProject": The project to
6673// be billed for this request. Required for Requester Pays buckets.
6674func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
6675	c.urlParams_.Set("userProject", userProject)
6676	return c
6677}
6678
6679// Fields allows partial responses to be retrieved. See
6680// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6681// for more information.
6682func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
6683	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6684	return c
6685}
6686
6687// Context sets the context to be used in this call's Do method. Any
6688// pending HTTP request will be aborted if the provided context is
6689// canceled.
6690func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
6691	c.ctx_ = ctx
6692	return c
6693}
6694
6695// Header returns an http.Header that can be modified by the caller to
6696// add HTTP headers to the request.
6697func (c *NotificationsDeleteCall) Header() http.Header {
6698	if c.header_ == nil {
6699		c.header_ = make(http.Header)
6700	}
6701	return c.header_
6702}
6703
6704func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
6705	reqHeaders := make(http.Header)
6706	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6707	for k, v := range c.header_ {
6708		reqHeaders[k] = v
6709	}
6710	reqHeaders.Set("User-Agent", c.s.userAgent())
6711	var body io.Reader = nil
6712	c.urlParams_.Set("alt", alt)
6713	c.urlParams_.Set("prettyPrint", "false")
6714	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6715	urls += "?" + c.urlParams_.Encode()
6716	req, err := http.NewRequest("DELETE", urls, body)
6717	if err != nil {
6718		return nil, err
6719	}
6720	req.Header = reqHeaders
6721	googleapi.Expand(req.URL, map[string]string{
6722		"bucket":       c.bucket,
6723		"notification": c.notification,
6724	})
6725	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6726}
6727
6728// Do executes the "storage.notifications.delete" call.
6729func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
6730	gensupport.SetOptions(c.urlParams_, opts...)
6731	res, err := c.doRequest("json")
6732	if err != nil {
6733		return err
6734	}
6735	defer googleapi.CloseBody(res)
6736	if err := googleapi.CheckResponse(res); err != nil {
6737		return err
6738	}
6739	return nil
6740	// {
6741	//   "description": "Permanently deletes a notification subscription.",
6742	//   "httpMethod": "DELETE",
6743	//   "id": "storage.notifications.delete",
6744	//   "parameterOrder": [
6745	//     "bucket",
6746	//     "notification"
6747	//   ],
6748	//   "parameters": {
6749	//     "bucket": {
6750	//       "description": "The parent bucket of the notification.",
6751	//       "location": "path",
6752	//       "required": true,
6753	//       "type": "string"
6754	//     },
6755	//     "notification": {
6756	//       "description": "ID of the notification to delete.",
6757	//       "location": "path",
6758	//       "required": true,
6759	//       "type": "string"
6760	//     },
6761	//     "provisionalUserProject": {
6762	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6763	//       "location": "query",
6764	//       "type": "string"
6765	//     },
6766	//     "userProject": {
6767	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6768	//       "location": "query",
6769	//       "type": "string"
6770	//     }
6771	//   },
6772	//   "path": "b/{bucket}/notificationConfigs/{notification}",
6773	//   "scopes": [
6774	//     "https://www.googleapis.com/auth/cloud-platform",
6775	//     "https://www.googleapis.com/auth/devstorage.full_control",
6776	//     "https://www.googleapis.com/auth/devstorage.read_write"
6777	//   ]
6778	// }
6779
6780}
6781
6782// method id "storage.notifications.get":
6783
6784type NotificationsGetCall struct {
6785	s            *Service
6786	bucket       string
6787	notification string
6788	urlParams_   gensupport.URLParams
6789	ifNoneMatch_ string
6790	ctx_         context.Context
6791	header_      http.Header
6792}
6793
6794// Get: View a notification configuration.
6795func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
6796	c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6797	c.bucket = bucket
6798	c.notification = notification
6799	return c
6800}
6801
6802// ProvisionalUserProject sets the optional parameter
6803// "provisionalUserProject": The project to be billed for this request
6804// if the target bucket is requester-pays bucket.
6805func (c *NotificationsGetCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsGetCall {
6806	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6807	return c
6808}
6809
6810// UserProject sets the optional parameter "userProject": The project to
6811// be billed for this request. Required for Requester Pays buckets.
6812func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
6813	c.urlParams_.Set("userProject", userProject)
6814	return c
6815}
6816
6817// Fields allows partial responses to be retrieved. See
6818// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6819// for more information.
6820func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
6821	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6822	return c
6823}
6824
6825// IfNoneMatch sets the optional parameter which makes the operation
6826// fail if the object's ETag matches the given value. This is useful for
6827// getting updates only after the object has changed since the last
6828// request. Use googleapi.IsNotModified to check whether the response
6829// error from Do is the result of In-None-Match.
6830func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
6831	c.ifNoneMatch_ = entityTag
6832	return c
6833}
6834
6835// Context sets the context to be used in this call's Do method. Any
6836// pending HTTP request will be aborted if the provided context is
6837// canceled.
6838func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
6839	c.ctx_ = ctx
6840	return c
6841}
6842
6843// Header returns an http.Header that can be modified by the caller to
6844// add HTTP headers to the request.
6845func (c *NotificationsGetCall) Header() http.Header {
6846	if c.header_ == nil {
6847		c.header_ = make(http.Header)
6848	}
6849	return c.header_
6850}
6851
6852func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
6853	reqHeaders := make(http.Header)
6854	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
6855	for k, v := range c.header_ {
6856		reqHeaders[k] = v
6857	}
6858	reqHeaders.Set("User-Agent", c.s.userAgent())
6859	if c.ifNoneMatch_ != "" {
6860		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6861	}
6862	var body io.Reader = nil
6863	c.urlParams_.Set("alt", alt)
6864	c.urlParams_.Set("prettyPrint", "false")
6865	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6866	urls += "?" + c.urlParams_.Encode()
6867	req, err := http.NewRequest("GET", urls, body)
6868	if err != nil {
6869		return nil, err
6870	}
6871	req.Header = reqHeaders
6872	googleapi.Expand(req.URL, map[string]string{
6873		"bucket":       c.bucket,
6874		"notification": c.notification,
6875	})
6876	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6877}
6878
6879// Do executes the "storage.notifications.get" call.
6880// Exactly one of *Notification or error will be non-nil. Any non-2xx
6881// status code is an error. Response headers are in either
6882// *Notification.ServerResponse.Header or (if a response was returned at
6883// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6884// to check whether the returned error was because
6885// http.StatusNotModified was returned.
6886func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
6887	gensupport.SetOptions(c.urlParams_, opts...)
6888	res, err := c.doRequest("json")
6889	if res != nil && res.StatusCode == http.StatusNotModified {
6890		if res.Body != nil {
6891			res.Body.Close()
6892		}
6893		return nil, &googleapi.Error{
6894			Code:   res.StatusCode,
6895			Header: res.Header,
6896		}
6897	}
6898	if err != nil {
6899		return nil, err
6900	}
6901	defer googleapi.CloseBody(res)
6902	if err := googleapi.CheckResponse(res); err != nil {
6903		return nil, err
6904	}
6905	ret := &Notification{
6906		ServerResponse: googleapi.ServerResponse{
6907			Header:         res.Header,
6908			HTTPStatusCode: res.StatusCode,
6909		},
6910	}
6911	target := &ret
6912	if err := gensupport.DecodeResponse(target, res); err != nil {
6913		return nil, err
6914	}
6915	return ret, nil
6916	// {
6917	//   "description": "View a notification configuration.",
6918	//   "httpMethod": "GET",
6919	//   "id": "storage.notifications.get",
6920	//   "parameterOrder": [
6921	//     "bucket",
6922	//     "notification"
6923	//   ],
6924	//   "parameters": {
6925	//     "bucket": {
6926	//       "description": "The parent bucket of the notification.",
6927	//       "location": "path",
6928	//       "required": true,
6929	//       "type": "string"
6930	//     },
6931	//     "notification": {
6932	//       "description": "Notification ID",
6933	//       "location": "path",
6934	//       "required": true,
6935	//       "type": "string"
6936	//     },
6937	//     "provisionalUserProject": {
6938	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6939	//       "location": "query",
6940	//       "type": "string"
6941	//     },
6942	//     "userProject": {
6943	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6944	//       "location": "query",
6945	//       "type": "string"
6946	//     }
6947	//   },
6948	//   "path": "b/{bucket}/notificationConfigs/{notification}",
6949	//   "response": {
6950	//     "$ref": "Notification"
6951	//   },
6952	//   "scopes": [
6953	//     "https://www.googleapis.com/auth/cloud-platform",
6954	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6955	//     "https://www.googleapis.com/auth/devstorage.full_control",
6956	//     "https://www.googleapis.com/auth/devstorage.read_only",
6957	//     "https://www.googleapis.com/auth/devstorage.read_write"
6958	//   ]
6959	// }
6960
6961}
6962
6963// method id "storage.notifications.insert":
6964
6965type NotificationsInsertCall struct {
6966	s            *Service
6967	bucket       string
6968	notification *Notification
6969	urlParams_   gensupport.URLParams
6970	ctx_         context.Context
6971	header_      http.Header
6972}
6973
6974// Insert: Creates a notification subscription for a given bucket.
6975func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
6976	c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6977	c.bucket = bucket
6978	c.notification = notification
6979	return c
6980}
6981
6982// ProvisionalUserProject sets the optional parameter
6983// "provisionalUserProject": The project to be billed for this request
6984// if the target bucket is requester-pays bucket.
6985func (c *NotificationsInsertCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsInsertCall {
6986	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6987	return c
6988}
6989
6990// UserProject sets the optional parameter "userProject": The project to
6991// be billed for this request. Required for Requester Pays buckets.
6992func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
6993	c.urlParams_.Set("userProject", userProject)
6994	return c
6995}
6996
6997// Fields allows partial responses to be retrieved. See
6998// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6999// for more information.
7000func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
7001	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7002	return c
7003}
7004
7005// Context sets the context to be used in this call's Do method. Any
7006// pending HTTP request will be aborted if the provided context is
7007// canceled.
7008func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
7009	c.ctx_ = ctx
7010	return c
7011}
7012
7013// Header returns an http.Header that can be modified by the caller to
7014// add HTTP headers to the request.
7015func (c *NotificationsInsertCall) Header() http.Header {
7016	if c.header_ == nil {
7017		c.header_ = make(http.Header)
7018	}
7019	return c.header_
7020}
7021
7022func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
7023	reqHeaders := make(http.Header)
7024	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7025	for k, v := range c.header_ {
7026		reqHeaders[k] = v
7027	}
7028	reqHeaders.Set("User-Agent", c.s.userAgent())
7029	var body io.Reader = nil
7030	body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
7031	if err != nil {
7032		return nil, err
7033	}
7034	reqHeaders.Set("Content-Type", "application/json")
7035	c.urlParams_.Set("alt", alt)
7036	c.urlParams_.Set("prettyPrint", "false")
7037	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
7038	urls += "?" + c.urlParams_.Encode()
7039	req, err := http.NewRequest("POST", urls, body)
7040	if err != nil {
7041		return nil, err
7042	}
7043	req.Header = reqHeaders
7044	googleapi.Expand(req.URL, map[string]string{
7045		"bucket": c.bucket,
7046	})
7047	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7048}
7049
7050// Do executes the "storage.notifications.insert" call.
7051// Exactly one of *Notification or error will be non-nil. Any non-2xx
7052// status code is an error. Response headers are in either
7053// *Notification.ServerResponse.Header or (if a response was returned at
7054// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7055// to check whether the returned error was because
7056// http.StatusNotModified was returned.
7057func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
7058	gensupport.SetOptions(c.urlParams_, opts...)
7059	res, err := c.doRequest("json")
7060	if res != nil && res.StatusCode == http.StatusNotModified {
7061		if res.Body != nil {
7062			res.Body.Close()
7063		}
7064		return nil, &googleapi.Error{
7065			Code:   res.StatusCode,
7066			Header: res.Header,
7067		}
7068	}
7069	if err != nil {
7070		return nil, err
7071	}
7072	defer googleapi.CloseBody(res)
7073	if err := googleapi.CheckResponse(res); err != nil {
7074		return nil, err
7075	}
7076	ret := &Notification{
7077		ServerResponse: googleapi.ServerResponse{
7078			Header:         res.Header,
7079			HTTPStatusCode: res.StatusCode,
7080		},
7081	}
7082	target := &ret
7083	if err := gensupport.DecodeResponse(target, res); err != nil {
7084		return nil, err
7085	}
7086	return ret, nil
7087	// {
7088	//   "description": "Creates a notification subscription for a given bucket.",
7089	//   "httpMethod": "POST",
7090	//   "id": "storage.notifications.insert",
7091	//   "parameterOrder": [
7092	//     "bucket"
7093	//   ],
7094	//   "parameters": {
7095	//     "bucket": {
7096	//       "description": "The parent bucket of the notification.",
7097	//       "location": "path",
7098	//       "required": true,
7099	//       "type": "string"
7100	//     },
7101	//     "provisionalUserProject": {
7102	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7103	//       "location": "query",
7104	//       "type": "string"
7105	//     },
7106	//     "userProject": {
7107	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7108	//       "location": "query",
7109	//       "type": "string"
7110	//     }
7111	//   },
7112	//   "path": "b/{bucket}/notificationConfigs",
7113	//   "request": {
7114	//     "$ref": "Notification"
7115	//   },
7116	//   "response": {
7117	//     "$ref": "Notification"
7118	//   },
7119	//   "scopes": [
7120	//     "https://www.googleapis.com/auth/cloud-platform",
7121	//     "https://www.googleapis.com/auth/devstorage.full_control",
7122	//     "https://www.googleapis.com/auth/devstorage.read_write"
7123	//   ]
7124	// }
7125
7126}
7127
7128// method id "storage.notifications.list":
7129
7130type NotificationsListCall struct {
7131	s            *Service
7132	bucket       string
7133	urlParams_   gensupport.URLParams
7134	ifNoneMatch_ string
7135	ctx_         context.Context
7136	header_      http.Header
7137}
7138
7139// List: Retrieves a list of notification subscriptions for a given
7140// bucket.
7141func (r *NotificationsService) List(bucket string) *NotificationsListCall {
7142	c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7143	c.bucket = bucket
7144	return c
7145}
7146
7147// ProvisionalUserProject sets the optional parameter
7148// "provisionalUserProject": The project to be billed for this request
7149// if the target bucket is requester-pays bucket.
7150func (c *NotificationsListCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsListCall {
7151	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7152	return c
7153}
7154
7155// UserProject sets the optional parameter "userProject": The project to
7156// be billed for this request. Required for Requester Pays buckets.
7157func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
7158	c.urlParams_.Set("userProject", userProject)
7159	return c
7160}
7161
7162// Fields allows partial responses to be retrieved. See
7163// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7164// for more information.
7165func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
7166	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7167	return c
7168}
7169
7170// IfNoneMatch sets the optional parameter which makes the operation
7171// fail if the object's ETag matches the given value. This is useful for
7172// getting updates only after the object has changed since the last
7173// request. Use googleapi.IsNotModified to check whether the response
7174// error from Do is the result of In-None-Match.
7175func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
7176	c.ifNoneMatch_ = entityTag
7177	return c
7178}
7179
7180// Context sets the context to be used in this call's Do method. Any
7181// pending HTTP request will be aborted if the provided context is
7182// canceled.
7183func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
7184	c.ctx_ = ctx
7185	return c
7186}
7187
7188// Header returns an http.Header that can be modified by the caller to
7189// add HTTP headers to the request.
7190func (c *NotificationsListCall) Header() http.Header {
7191	if c.header_ == nil {
7192		c.header_ = make(http.Header)
7193	}
7194	return c.header_
7195}
7196
7197func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
7198	reqHeaders := make(http.Header)
7199	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7200	for k, v := range c.header_ {
7201		reqHeaders[k] = v
7202	}
7203	reqHeaders.Set("User-Agent", c.s.userAgent())
7204	if c.ifNoneMatch_ != "" {
7205		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7206	}
7207	var body io.Reader = nil
7208	c.urlParams_.Set("alt", alt)
7209	c.urlParams_.Set("prettyPrint", "false")
7210	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
7211	urls += "?" + c.urlParams_.Encode()
7212	req, err := http.NewRequest("GET", urls, body)
7213	if err != nil {
7214		return nil, err
7215	}
7216	req.Header = reqHeaders
7217	googleapi.Expand(req.URL, map[string]string{
7218		"bucket": c.bucket,
7219	})
7220	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7221}
7222
7223// Do executes the "storage.notifications.list" call.
7224// Exactly one of *Notifications or error will be non-nil. Any non-2xx
7225// status code is an error. Response headers are in either
7226// *Notifications.ServerResponse.Header or (if a response was returned
7227// at all) in error.(*googleapi.Error).Header. Use
7228// googleapi.IsNotModified to check whether the returned error was
7229// because http.StatusNotModified was returned.
7230func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
7231	gensupport.SetOptions(c.urlParams_, opts...)
7232	res, err := c.doRequest("json")
7233	if res != nil && res.StatusCode == http.StatusNotModified {
7234		if res.Body != nil {
7235			res.Body.Close()
7236		}
7237		return nil, &googleapi.Error{
7238			Code:   res.StatusCode,
7239			Header: res.Header,
7240		}
7241	}
7242	if err != nil {
7243		return nil, err
7244	}
7245	defer googleapi.CloseBody(res)
7246	if err := googleapi.CheckResponse(res); err != nil {
7247		return nil, err
7248	}
7249	ret := &Notifications{
7250		ServerResponse: googleapi.ServerResponse{
7251			Header:         res.Header,
7252			HTTPStatusCode: res.StatusCode,
7253		},
7254	}
7255	target := &ret
7256	if err := gensupport.DecodeResponse(target, res); err != nil {
7257		return nil, err
7258	}
7259	return ret, nil
7260	// {
7261	//   "description": "Retrieves a list of notification subscriptions for a given bucket.",
7262	//   "httpMethod": "GET",
7263	//   "id": "storage.notifications.list",
7264	//   "parameterOrder": [
7265	//     "bucket"
7266	//   ],
7267	//   "parameters": {
7268	//     "bucket": {
7269	//       "description": "Name of a Google Cloud Storage bucket.",
7270	//       "location": "path",
7271	//       "required": true,
7272	//       "type": "string"
7273	//     },
7274	//     "provisionalUserProject": {
7275	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7276	//       "location": "query",
7277	//       "type": "string"
7278	//     },
7279	//     "userProject": {
7280	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7281	//       "location": "query",
7282	//       "type": "string"
7283	//     }
7284	//   },
7285	//   "path": "b/{bucket}/notificationConfigs",
7286	//   "response": {
7287	//     "$ref": "Notifications"
7288	//   },
7289	//   "scopes": [
7290	//     "https://www.googleapis.com/auth/cloud-platform",
7291	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7292	//     "https://www.googleapis.com/auth/devstorage.full_control",
7293	//     "https://www.googleapis.com/auth/devstorage.read_only",
7294	//     "https://www.googleapis.com/auth/devstorage.read_write"
7295	//   ]
7296	// }
7297
7298}
7299
7300// method id "storage.objectAccessControls.delete":
7301
7302type ObjectAccessControlsDeleteCall struct {
7303	s          *Service
7304	bucket     string
7305	object     string
7306	entity     string
7307	urlParams_ gensupport.URLParams
7308	ctx_       context.Context
7309	header_    http.Header
7310}
7311
7312// Delete: Permanently deletes the ACL entry for the specified entity on
7313// the specified object.
7314func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
7315	c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7316	c.bucket = bucket
7317	c.object = object
7318	c.entity = entity
7319	return c
7320}
7321
7322// Generation sets the optional parameter "generation": If present,
7323// selects a specific revision of this object (as opposed to the latest
7324// version, the default).
7325func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall {
7326	c.urlParams_.Set("generation", fmt.Sprint(generation))
7327	return c
7328}
7329
7330// ProvisionalUserProject sets the optional parameter
7331// "provisionalUserProject": The project to be billed for this request
7332// if the target bucket is requester-pays bucket.
7333func (c *ObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsDeleteCall {
7334	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7335	return c
7336}
7337
7338// UserProject sets the optional parameter "userProject": The project to
7339// be billed for this request. Required for Requester Pays buckets.
7340func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
7341	c.urlParams_.Set("userProject", userProject)
7342	return c
7343}
7344
7345// Fields allows partial responses to be retrieved. See
7346// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7347// for more information.
7348func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
7349	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7350	return c
7351}
7352
7353// Context sets the context to be used in this call's Do method. Any
7354// pending HTTP request will be aborted if the provided context is
7355// canceled.
7356func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
7357	c.ctx_ = ctx
7358	return c
7359}
7360
7361// Header returns an http.Header that can be modified by the caller to
7362// add HTTP headers to the request.
7363func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
7364	if c.header_ == nil {
7365		c.header_ = make(http.Header)
7366	}
7367	return c.header_
7368}
7369
7370func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
7371	reqHeaders := make(http.Header)
7372	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7373	for k, v := range c.header_ {
7374		reqHeaders[k] = v
7375	}
7376	reqHeaders.Set("User-Agent", c.s.userAgent())
7377	var body io.Reader = nil
7378	c.urlParams_.Set("alt", alt)
7379	c.urlParams_.Set("prettyPrint", "false")
7380	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7381	urls += "?" + c.urlParams_.Encode()
7382	req, err := http.NewRequest("DELETE", urls, body)
7383	if err != nil {
7384		return nil, err
7385	}
7386	req.Header = reqHeaders
7387	googleapi.Expand(req.URL, map[string]string{
7388		"bucket": c.bucket,
7389		"object": c.object,
7390		"entity": c.entity,
7391	})
7392	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7393}
7394
7395// Do executes the "storage.objectAccessControls.delete" call.
7396func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
7397	gensupport.SetOptions(c.urlParams_, opts...)
7398	res, err := c.doRequest("json")
7399	if err != nil {
7400		return err
7401	}
7402	defer googleapi.CloseBody(res)
7403	if err := googleapi.CheckResponse(res); err != nil {
7404		return err
7405	}
7406	return nil
7407	// {
7408	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
7409	//   "httpMethod": "DELETE",
7410	//   "id": "storage.objectAccessControls.delete",
7411	//   "parameterOrder": [
7412	//     "bucket",
7413	//     "object",
7414	//     "entity"
7415	//   ],
7416	//   "parameters": {
7417	//     "bucket": {
7418	//       "description": "Name of a bucket.",
7419	//       "location": "path",
7420	//       "required": true,
7421	//       "type": "string"
7422	//     },
7423	//     "entity": {
7424	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7425	//       "location": "path",
7426	//       "required": true,
7427	//       "type": "string"
7428	//     },
7429	//     "generation": {
7430	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7431	//       "format": "int64",
7432	//       "location": "query",
7433	//       "type": "string"
7434	//     },
7435	//     "object": {
7436	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7437	//       "location": "path",
7438	//       "required": true,
7439	//       "type": "string"
7440	//     },
7441	//     "provisionalUserProject": {
7442	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7443	//       "location": "query",
7444	//       "type": "string"
7445	//     },
7446	//     "userProject": {
7447	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7448	//       "location": "query",
7449	//       "type": "string"
7450	//     }
7451	//   },
7452	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
7453	//   "scopes": [
7454	//     "https://www.googleapis.com/auth/cloud-platform",
7455	//     "https://www.googleapis.com/auth/devstorage.full_control"
7456	//   ]
7457	// }
7458
7459}
7460
7461// method id "storage.objectAccessControls.get":
7462
7463type ObjectAccessControlsGetCall struct {
7464	s            *Service
7465	bucket       string
7466	object       string
7467	entity       string
7468	urlParams_   gensupport.URLParams
7469	ifNoneMatch_ string
7470	ctx_         context.Context
7471	header_      http.Header
7472}
7473
7474// Get: Returns the ACL entry for the specified entity on the specified
7475// object.
7476func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
7477	c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7478	c.bucket = bucket
7479	c.object = object
7480	c.entity = entity
7481	return c
7482}
7483
7484// Generation sets the optional parameter "generation": If present,
7485// selects a specific revision of this object (as opposed to the latest
7486// version, the default).
7487func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall {
7488	c.urlParams_.Set("generation", fmt.Sprint(generation))
7489	return c
7490}
7491
7492// ProvisionalUserProject sets the optional parameter
7493// "provisionalUserProject": The project to be billed for this request
7494// if the target bucket is requester-pays bucket.
7495func (c *ObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsGetCall {
7496	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7497	return c
7498}
7499
7500// UserProject sets the optional parameter "userProject": The project to
7501// be billed for this request. Required for Requester Pays buckets.
7502func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
7503	c.urlParams_.Set("userProject", userProject)
7504	return c
7505}
7506
7507// Fields allows partial responses to be retrieved. See
7508// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7509// for more information.
7510func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
7511	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7512	return c
7513}
7514
7515// IfNoneMatch sets the optional parameter which makes the operation
7516// fail if the object's ETag matches the given value. This is useful for
7517// getting updates only after the object has changed since the last
7518// request. Use googleapi.IsNotModified to check whether the response
7519// error from Do is the result of In-None-Match.
7520func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
7521	c.ifNoneMatch_ = entityTag
7522	return c
7523}
7524
7525// Context sets the context to be used in this call's Do method. Any
7526// pending HTTP request will be aborted if the provided context is
7527// canceled.
7528func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
7529	c.ctx_ = ctx
7530	return c
7531}
7532
7533// Header returns an http.Header that can be modified by the caller to
7534// add HTTP headers to the request.
7535func (c *ObjectAccessControlsGetCall) Header() http.Header {
7536	if c.header_ == nil {
7537		c.header_ = make(http.Header)
7538	}
7539	return c.header_
7540}
7541
7542func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
7543	reqHeaders := make(http.Header)
7544	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7545	for k, v := range c.header_ {
7546		reqHeaders[k] = v
7547	}
7548	reqHeaders.Set("User-Agent", c.s.userAgent())
7549	if c.ifNoneMatch_ != "" {
7550		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7551	}
7552	var body io.Reader = nil
7553	c.urlParams_.Set("alt", alt)
7554	c.urlParams_.Set("prettyPrint", "false")
7555	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7556	urls += "?" + c.urlParams_.Encode()
7557	req, err := http.NewRequest("GET", urls, body)
7558	if err != nil {
7559		return nil, err
7560	}
7561	req.Header = reqHeaders
7562	googleapi.Expand(req.URL, map[string]string{
7563		"bucket": c.bucket,
7564		"object": c.object,
7565		"entity": c.entity,
7566	})
7567	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7568}
7569
7570// Do executes the "storage.objectAccessControls.get" call.
7571// Exactly one of *ObjectAccessControl or error will be non-nil. Any
7572// non-2xx status code is an error. Response headers are in either
7573// *ObjectAccessControl.ServerResponse.Header or (if a response was
7574// returned at all) in error.(*googleapi.Error).Header. Use
7575// googleapi.IsNotModified to check whether the returned error was
7576// because http.StatusNotModified was returned.
7577func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7578	gensupport.SetOptions(c.urlParams_, opts...)
7579	res, err := c.doRequest("json")
7580	if res != nil && res.StatusCode == http.StatusNotModified {
7581		if res.Body != nil {
7582			res.Body.Close()
7583		}
7584		return nil, &googleapi.Error{
7585			Code:   res.StatusCode,
7586			Header: res.Header,
7587		}
7588	}
7589	if err != nil {
7590		return nil, err
7591	}
7592	defer googleapi.CloseBody(res)
7593	if err := googleapi.CheckResponse(res); err != nil {
7594		return nil, err
7595	}
7596	ret := &ObjectAccessControl{
7597		ServerResponse: googleapi.ServerResponse{
7598			Header:         res.Header,
7599			HTTPStatusCode: res.StatusCode,
7600		},
7601	}
7602	target := &ret
7603	if err := gensupport.DecodeResponse(target, res); err != nil {
7604		return nil, err
7605	}
7606	return ret, nil
7607	// {
7608	//   "description": "Returns the ACL entry for the specified entity on the specified object.",
7609	//   "httpMethod": "GET",
7610	//   "id": "storage.objectAccessControls.get",
7611	//   "parameterOrder": [
7612	//     "bucket",
7613	//     "object",
7614	//     "entity"
7615	//   ],
7616	//   "parameters": {
7617	//     "bucket": {
7618	//       "description": "Name of a bucket.",
7619	//       "location": "path",
7620	//       "required": true,
7621	//       "type": "string"
7622	//     },
7623	//     "entity": {
7624	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7625	//       "location": "path",
7626	//       "required": true,
7627	//       "type": "string"
7628	//     },
7629	//     "generation": {
7630	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7631	//       "format": "int64",
7632	//       "location": "query",
7633	//       "type": "string"
7634	//     },
7635	//     "object": {
7636	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7637	//       "location": "path",
7638	//       "required": true,
7639	//       "type": "string"
7640	//     },
7641	//     "provisionalUserProject": {
7642	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7643	//       "location": "query",
7644	//       "type": "string"
7645	//     },
7646	//     "userProject": {
7647	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7648	//       "location": "query",
7649	//       "type": "string"
7650	//     }
7651	//   },
7652	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
7653	//   "response": {
7654	//     "$ref": "ObjectAccessControl"
7655	//   },
7656	//   "scopes": [
7657	//     "https://www.googleapis.com/auth/cloud-platform",
7658	//     "https://www.googleapis.com/auth/devstorage.full_control"
7659	//   ]
7660	// }
7661
7662}
7663
7664// method id "storage.objectAccessControls.insert":
7665
7666type ObjectAccessControlsInsertCall struct {
7667	s                   *Service
7668	bucket              string
7669	object              string
7670	objectaccesscontrol *ObjectAccessControl
7671	urlParams_          gensupport.URLParams
7672	ctx_                context.Context
7673	header_             http.Header
7674}
7675
7676// Insert: Creates a new ACL entry on the specified object.
7677func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
7678	c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7679	c.bucket = bucket
7680	c.object = object
7681	c.objectaccesscontrol = objectaccesscontrol
7682	return c
7683}
7684
7685// Generation sets the optional parameter "generation": If present,
7686// selects a specific revision of this object (as opposed to the latest
7687// version, the default).
7688func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall {
7689	c.urlParams_.Set("generation", fmt.Sprint(generation))
7690	return c
7691}
7692
7693// ProvisionalUserProject sets the optional parameter
7694// "provisionalUserProject": The project to be billed for this request
7695// if the target bucket is requester-pays bucket.
7696func (c *ObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsInsertCall {
7697	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7698	return c
7699}
7700
7701// UserProject sets the optional parameter "userProject": The project to
7702// be billed for this request. Required for Requester Pays buckets.
7703func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
7704	c.urlParams_.Set("userProject", userProject)
7705	return c
7706}
7707
7708// Fields allows partial responses to be retrieved. See
7709// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7710// for more information.
7711func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
7712	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7713	return c
7714}
7715
7716// Context sets the context to be used in this call's Do method. Any
7717// pending HTTP request will be aborted if the provided context is
7718// canceled.
7719func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
7720	c.ctx_ = ctx
7721	return c
7722}
7723
7724// Header returns an http.Header that can be modified by the caller to
7725// add HTTP headers to the request.
7726func (c *ObjectAccessControlsInsertCall) Header() http.Header {
7727	if c.header_ == nil {
7728		c.header_ = make(http.Header)
7729	}
7730	return c.header_
7731}
7732
7733func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
7734	reqHeaders := make(http.Header)
7735	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7736	for k, v := range c.header_ {
7737		reqHeaders[k] = v
7738	}
7739	reqHeaders.Set("User-Agent", c.s.userAgent())
7740	var body io.Reader = nil
7741	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
7742	if err != nil {
7743		return nil, err
7744	}
7745	reqHeaders.Set("Content-Type", "application/json")
7746	c.urlParams_.Set("alt", alt)
7747	c.urlParams_.Set("prettyPrint", "false")
7748	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7749	urls += "?" + c.urlParams_.Encode()
7750	req, err := http.NewRequest("POST", urls, body)
7751	if err != nil {
7752		return nil, err
7753	}
7754	req.Header = reqHeaders
7755	googleapi.Expand(req.URL, map[string]string{
7756		"bucket": c.bucket,
7757		"object": c.object,
7758	})
7759	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7760}
7761
7762// Do executes the "storage.objectAccessControls.insert" call.
7763// Exactly one of *ObjectAccessControl or error will be non-nil. Any
7764// non-2xx status code is an error. Response headers are in either
7765// *ObjectAccessControl.ServerResponse.Header or (if a response was
7766// returned at all) in error.(*googleapi.Error).Header. Use
7767// googleapi.IsNotModified to check whether the returned error was
7768// because http.StatusNotModified was returned.
7769func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7770	gensupport.SetOptions(c.urlParams_, opts...)
7771	res, err := c.doRequest("json")
7772	if res != nil && res.StatusCode == http.StatusNotModified {
7773		if res.Body != nil {
7774			res.Body.Close()
7775		}
7776		return nil, &googleapi.Error{
7777			Code:   res.StatusCode,
7778			Header: res.Header,
7779		}
7780	}
7781	if err != nil {
7782		return nil, err
7783	}
7784	defer googleapi.CloseBody(res)
7785	if err := googleapi.CheckResponse(res); err != nil {
7786		return nil, err
7787	}
7788	ret := &ObjectAccessControl{
7789		ServerResponse: googleapi.ServerResponse{
7790			Header:         res.Header,
7791			HTTPStatusCode: res.StatusCode,
7792		},
7793	}
7794	target := &ret
7795	if err := gensupport.DecodeResponse(target, res); err != nil {
7796		return nil, err
7797	}
7798	return ret, nil
7799	// {
7800	//   "description": "Creates a new ACL entry on the specified object.",
7801	//   "httpMethod": "POST",
7802	//   "id": "storage.objectAccessControls.insert",
7803	//   "parameterOrder": [
7804	//     "bucket",
7805	//     "object"
7806	//   ],
7807	//   "parameters": {
7808	//     "bucket": {
7809	//       "description": "Name of a bucket.",
7810	//       "location": "path",
7811	//       "required": true,
7812	//       "type": "string"
7813	//     },
7814	//     "generation": {
7815	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7816	//       "format": "int64",
7817	//       "location": "query",
7818	//       "type": "string"
7819	//     },
7820	//     "object": {
7821	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7822	//       "location": "path",
7823	//       "required": true,
7824	//       "type": "string"
7825	//     },
7826	//     "provisionalUserProject": {
7827	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7828	//       "location": "query",
7829	//       "type": "string"
7830	//     },
7831	//     "userProject": {
7832	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7833	//       "location": "query",
7834	//       "type": "string"
7835	//     }
7836	//   },
7837	//   "path": "b/{bucket}/o/{object}/acl",
7838	//   "request": {
7839	//     "$ref": "ObjectAccessControl"
7840	//   },
7841	//   "response": {
7842	//     "$ref": "ObjectAccessControl"
7843	//   },
7844	//   "scopes": [
7845	//     "https://www.googleapis.com/auth/cloud-platform",
7846	//     "https://www.googleapis.com/auth/devstorage.full_control"
7847	//   ]
7848	// }
7849
7850}
7851
7852// method id "storage.objectAccessControls.list":
7853
7854type ObjectAccessControlsListCall struct {
7855	s            *Service
7856	bucket       string
7857	object       string
7858	urlParams_   gensupport.URLParams
7859	ifNoneMatch_ string
7860	ctx_         context.Context
7861	header_      http.Header
7862}
7863
7864// List: Retrieves ACL entries on the specified object.
7865func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
7866	c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7867	c.bucket = bucket
7868	c.object = object
7869	return c
7870}
7871
7872// Generation sets the optional parameter "generation": If present,
7873// selects a specific revision of this object (as opposed to the latest
7874// version, the default).
7875func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall {
7876	c.urlParams_.Set("generation", fmt.Sprint(generation))
7877	return c
7878}
7879
7880// ProvisionalUserProject sets the optional parameter
7881// "provisionalUserProject": The project to be billed for this request
7882// if the target bucket is requester-pays bucket.
7883func (c *ObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsListCall {
7884	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7885	return c
7886}
7887
7888// UserProject sets the optional parameter "userProject": The project to
7889// be billed for this request. Required for Requester Pays buckets.
7890func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
7891	c.urlParams_.Set("userProject", userProject)
7892	return c
7893}
7894
7895// Fields allows partial responses to be retrieved. See
7896// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7897// for more information.
7898func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
7899	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7900	return c
7901}
7902
7903// IfNoneMatch sets the optional parameter which makes the operation
7904// fail if the object's ETag matches the given value. This is useful for
7905// getting updates only after the object has changed since the last
7906// request. Use googleapi.IsNotModified to check whether the response
7907// error from Do is the result of In-None-Match.
7908func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
7909	c.ifNoneMatch_ = entityTag
7910	return c
7911}
7912
7913// Context sets the context to be used in this call's Do method. Any
7914// pending HTTP request will be aborted if the provided context is
7915// canceled.
7916func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
7917	c.ctx_ = ctx
7918	return c
7919}
7920
7921// Header returns an http.Header that can be modified by the caller to
7922// add HTTP headers to the request.
7923func (c *ObjectAccessControlsListCall) Header() http.Header {
7924	if c.header_ == nil {
7925		c.header_ = make(http.Header)
7926	}
7927	return c.header_
7928}
7929
7930func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
7931	reqHeaders := make(http.Header)
7932	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
7933	for k, v := range c.header_ {
7934		reqHeaders[k] = v
7935	}
7936	reqHeaders.Set("User-Agent", c.s.userAgent())
7937	if c.ifNoneMatch_ != "" {
7938		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7939	}
7940	var body io.Reader = nil
7941	c.urlParams_.Set("alt", alt)
7942	c.urlParams_.Set("prettyPrint", "false")
7943	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7944	urls += "?" + c.urlParams_.Encode()
7945	req, err := http.NewRequest("GET", urls, body)
7946	if err != nil {
7947		return nil, err
7948	}
7949	req.Header = reqHeaders
7950	googleapi.Expand(req.URL, map[string]string{
7951		"bucket": c.bucket,
7952		"object": c.object,
7953	})
7954	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7955}
7956
7957// Do executes the "storage.objectAccessControls.list" call.
7958// Exactly one of *ObjectAccessControls or error will be non-nil. Any
7959// non-2xx status code is an error. Response headers are in either
7960// *ObjectAccessControls.ServerResponse.Header or (if a response was
7961// returned at all) in error.(*googleapi.Error).Header. Use
7962// googleapi.IsNotModified to check whether the returned error was
7963// because http.StatusNotModified was returned.
7964func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
7965	gensupport.SetOptions(c.urlParams_, opts...)
7966	res, err := c.doRequest("json")
7967	if res != nil && res.StatusCode == http.StatusNotModified {
7968		if res.Body != nil {
7969			res.Body.Close()
7970		}
7971		return nil, &googleapi.Error{
7972			Code:   res.StatusCode,
7973			Header: res.Header,
7974		}
7975	}
7976	if err != nil {
7977		return nil, err
7978	}
7979	defer googleapi.CloseBody(res)
7980	if err := googleapi.CheckResponse(res); err != nil {
7981		return nil, err
7982	}
7983	ret := &ObjectAccessControls{
7984		ServerResponse: googleapi.ServerResponse{
7985			Header:         res.Header,
7986			HTTPStatusCode: res.StatusCode,
7987		},
7988	}
7989	target := &ret
7990	if err := gensupport.DecodeResponse(target, res); err != nil {
7991		return nil, err
7992	}
7993	return ret, nil
7994	// {
7995	//   "description": "Retrieves ACL entries on the specified object.",
7996	//   "httpMethod": "GET",
7997	//   "id": "storage.objectAccessControls.list",
7998	//   "parameterOrder": [
7999	//     "bucket",
8000	//     "object"
8001	//   ],
8002	//   "parameters": {
8003	//     "bucket": {
8004	//       "description": "Name of a bucket.",
8005	//       "location": "path",
8006	//       "required": true,
8007	//       "type": "string"
8008	//     },
8009	//     "generation": {
8010	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8011	//       "format": "int64",
8012	//       "location": "query",
8013	//       "type": "string"
8014	//     },
8015	//     "object": {
8016	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8017	//       "location": "path",
8018	//       "required": true,
8019	//       "type": "string"
8020	//     },
8021	//     "provisionalUserProject": {
8022	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8023	//       "location": "query",
8024	//       "type": "string"
8025	//     },
8026	//     "userProject": {
8027	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8028	//       "location": "query",
8029	//       "type": "string"
8030	//     }
8031	//   },
8032	//   "path": "b/{bucket}/o/{object}/acl",
8033	//   "response": {
8034	//     "$ref": "ObjectAccessControls"
8035	//   },
8036	//   "scopes": [
8037	//     "https://www.googleapis.com/auth/cloud-platform",
8038	//     "https://www.googleapis.com/auth/devstorage.full_control"
8039	//   ]
8040	// }
8041
8042}
8043
8044// method id "storage.objectAccessControls.patch":
8045
8046type ObjectAccessControlsPatchCall struct {
8047	s                   *Service
8048	bucket              string
8049	object              string
8050	entity              string
8051	objectaccesscontrol *ObjectAccessControl
8052	urlParams_          gensupport.URLParams
8053	ctx_                context.Context
8054	header_             http.Header
8055}
8056
8057// Patch: Patches an ACL entry on the specified object.
8058func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
8059	c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8060	c.bucket = bucket
8061	c.object = object
8062	c.entity = entity
8063	c.objectaccesscontrol = objectaccesscontrol
8064	return c
8065}
8066
8067// Generation sets the optional parameter "generation": If present,
8068// selects a specific revision of this object (as opposed to the latest
8069// version, the default).
8070func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall {
8071	c.urlParams_.Set("generation", fmt.Sprint(generation))
8072	return c
8073}
8074
8075// ProvisionalUserProject sets the optional parameter
8076// "provisionalUserProject": The project to be billed for this request
8077// if the target bucket is requester-pays bucket.
8078func (c *ObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsPatchCall {
8079	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8080	return c
8081}
8082
8083// UserProject sets the optional parameter "userProject": The project to
8084// be billed for this request. Required for Requester Pays buckets.
8085func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
8086	c.urlParams_.Set("userProject", userProject)
8087	return c
8088}
8089
8090// Fields allows partial responses to be retrieved. See
8091// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8092// for more information.
8093func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
8094	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8095	return c
8096}
8097
8098// Context sets the context to be used in this call's Do method. Any
8099// pending HTTP request will be aborted if the provided context is
8100// canceled.
8101func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
8102	c.ctx_ = ctx
8103	return c
8104}
8105
8106// Header returns an http.Header that can be modified by the caller to
8107// add HTTP headers to the request.
8108func (c *ObjectAccessControlsPatchCall) Header() http.Header {
8109	if c.header_ == nil {
8110		c.header_ = make(http.Header)
8111	}
8112	return c.header_
8113}
8114
8115func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
8116	reqHeaders := make(http.Header)
8117	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8118	for k, v := range c.header_ {
8119		reqHeaders[k] = v
8120	}
8121	reqHeaders.Set("User-Agent", c.s.userAgent())
8122	var body io.Reader = nil
8123	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
8124	if err != nil {
8125		return nil, err
8126	}
8127	reqHeaders.Set("Content-Type", "application/json")
8128	c.urlParams_.Set("alt", alt)
8129	c.urlParams_.Set("prettyPrint", "false")
8130	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
8131	urls += "?" + c.urlParams_.Encode()
8132	req, err := http.NewRequest("PATCH", urls, body)
8133	if err != nil {
8134		return nil, err
8135	}
8136	req.Header = reqHeaders
8137	googleapi.Expand(req.URL, map[string]string{
8138		"bucket": c.bucket,
8139		"object": c.object,
8140		"entity": c.entity,
8141	})
8142	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8143}
8144
8145// Do executes the "storage.objectAccessControls.patch" call.
8146// Exactly one of *ObjectAccessControl or error will be non-nil. Any
8147// non-2xx status code is an error. Response headers are in either
8148// *ObjectAccessControl.ServerResponse.Header or (if a response was
8149// returned at all) in error.(*googleapi.Error).Header. Use
8150// googleapi.IsNotModified to check whether the returned error was
8151// because http.StatusNotModified was returned.
8152func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
8153	gensupport.SetOptions(c.urlParams_, opts...)
8154	res, err := c.doRequest("json")
8155	if res != nil && res.StatusCode == http.StatusNotModified {
8156		if res.Body != nil {
8157			res.Body.Close()
8158		}
8159		return nil, &googleapi.Error{
8160			Code:   res.StatusCode,
8161			Header: res.Header,
8162		}
8163	}
8164	if err != nil {
8165		return nil, err
8166	}
8167	defer googleapi.CloseBody(res)
8168	if err := googleapi.CheckResponse(res); err != nil {
8169		return nil, err
8170	}
8171	ret := &ObjectAccessControl{
8172		ServerResponse: googleapi.ServerResponse{
8173			Header:         res.Header,
8174			HTTPStatusCode: res.StatusCode,
8175		},
8176	}
8177	target := &ret
8178	if err := gensupport.DecodeResponse(target, res); err != nil {
8179		return nil, err
8180	}
8181	return ret, nil
8182	// {
8183	//   "description": "Patches an ACL entry on the specified object.",
8184	//   "httpMethod": "PATCH",
8185	//   "id": "storage.objectAccessControls.patch",
8186	//   "parameterOrder": [
8187	//     "bucket",
8188	//     "object",
8189	//     "entity"
8190	//   ],
8191	//   "parameters": {
8192	//     "bucket": {
8193	//       "description": "Name of a bucket.",
8194	//       "location": "path",
8195	//       "required": true,
8196	//       "type": "string"
8197	//     },
8198	//     "entity": {
8199	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
8200	//       "location": "path",
8201	//       "required": true,
8202	//       "type": "string"
8203	//     },
8204	//     "generation": {
8205	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8206	//       "format": "int64",
8207	//       "location": "query",
8208	//       "type": "string"
8209	//     },
8210	//     "object": {
8211	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8212	//       "location": "path",
8213	//       "required": true,
8214	//       "type": "string"
8215	//     },
8216	//     "provisionalUserProject": {
8217	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8218	//       "location": "query",
8219	//       "type": "string"
8220	//     },
8221	//     "userProject": {
8222	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8223	//       "location": "query",
8224	//       "type": "string"
8225	//     }
8226	//   },
8227	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
8228	//   "request": {
8229	//     "$ref": "ObjectAccessControl"
8230	//   },
8231	//   "response": {
8232	//     "$ref": "ObjectAccessControl"
8233	//   },
8234	//   "scopes": [
8235	//     "https://www.googleapis.com/auth/cloud-platform",
8236	//     "https://www.googleapis.com/auth/devstorage.full_control"
8237	//   ]
8238	// }
8239
8240}
8241
8242// method id "storage.objectAccessControls.update":
8243
8244type ObjectAccessControlsUpdateCall struct {
8245	s                   *Service
8246	bucket              string
8247	object              string
8248	entity              string
8249	objectaccesscontrol *ObjectAccessControl
8250	urlParams_          gensupport.URLParams
8251	ctx_                context.Context
8252	header_             http.Header
8253}
8254
8255// Update: Updates an ACL entry on the specified object.
8256func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
8257	c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8258	c.bucket = bucket
8259	c.object = object
8260	c.entity = entity
8261	c.objectaccesscontrol = objectaccesscontrol
8262	return c
8263}
8264
8265// Generation sets the optional parameter "generation": If present,
8266// selects a specific revision of this object (as opposed to the latest
8267// version, the default).
8268func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall {
8269	c.urlParams_.Set("generation", fmt.Sprint(generation))
8270	return c
8271}
8272
8273// ProvisionalUserProject sets the optional parameter
8274// "provisionalUserProject": The project to be billed for this request
8275// if the target bucket is requester-pays bucket.
8276func (c *ObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsUpdateCall {
8277	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8278	return c
8279}
8280
8281// UserProject sets the optional parameter "userProject": The project to
8282// be billed for this request. Required for Requester Pays buckets.
8283func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
8284	c.urlParams_.Set("userProject", userProject)
8285	return c
8286}
8287
8288// Fields allows partial responses to be retrieved. See
8289// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8290// for more information.
8291func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
8292	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8293	return c
8294}
8295
8296// Context sets the context to be used in this call's Do method. Any
8297// pending HTTP request will be aborted if the provided context is
8298// canceled.
8299func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
8300	c.ctx_ = ctx
8301	return c
8302}
8303
8304// Header returns an http.Header that can be modified by the caller to
8305// add HTTP headers to the request.
8306func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
8307	if c.header_ == nil {
8308		c.header_ = make(http.Header)
8309	}
8310	return c.header_
8311}
8312
8313func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
8314	reqHeaders := make(http.Header)
8315	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8316	for k, v := range c.header_ {
8317		reqHeaders[k] = v
8318	}
8319	reqHeaders.Set("User-Agent", c.s.userAgent())
8320	var body io.Reader = nil
8321	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
8322	if err != nil {
8323		return nil, err
8324	}
8325	reqHeaders.Set("Content-Type", "application/json")
8326	c.urlParams_.Set("alt", alt)
8327	c.urlParams_.Set("prettyPrint", "false")
8328	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
8329	urls += "?" + c.urlParams_.Encode()
8330	req, err := http.NewRequest("PUT", urls, body)
8331	if err != nil {
8332		return nil, err
8333	}
8334	req.Header = reqHeaders
8335	googleapi.Expand(req.URL, map[string]string{
8336		"bucket": c.bucket,
8337		"object": c.object,
8338		"entity": c.entity,
8339	})
8340	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8341}
8342
8343// Do executes the "storage.objectAccessControls.update" call.
8344// Exactly one of *ObjectAccessControl or error will be non-nil. Any
8345// non-2xx status code is an error. Response headers are in either
8346// *ObjectAccessControl.ServerResponse.Header or (if a response was
8347// returned at all) in error.(*googleapi.Error).Header. Use
8348// googleapi.IsNotModified to check whether the returned error was
8349// because http.StatusNotModified was returned.
8350func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
8351	gensupport.SetOptions(c.urlParams_, opts...)
8352	res, err := c.doRequest("json")
8353	if res != nil && res.StatusCode == http.StatusNotModified {
8354		if res.Body != nil {
8355			res.Body.Close()
8356		}
8357		return nil, &googleapi.Error{
8358			Code:   res.StatusCode,
8359			Header: res.Header,
8360		}
8361	}
8362	if err != nil {
8363		return nil, err
8364	}
8365	defer googleapi.CloseBody(res)
8366	if err := googleapi.CheckResponse(res); err != nil {
8367		return nil, err
8368	}
8369	ret := &ObjectAccessControl{
8370		ServerResponse: googleapi.ServerResponse{
8371			Header:         res.Header,
8372			HTTPStatusCode: res.StatusCode,
8373		},
8374	}
8375	target := &ret
8376	if err := gensupport.DecodeResponse(target, res); err != nil {
8377		return nil, err
8378	}
8379	return ret, nil
8380	// {
8381	//   "description": "Updates an ACL entry on the specified object.",
8382	//   "httpMethod": "PUT",
8383	//   "id": "storage.objectAccessControls.update",
8384	//   "parameterOrder": [
8385	//     "bucket",
8386	//     "object",
8387	//     "entity"
8388	//   ],
8389	//   "parameters": {
8390	//     "bucket": {
8391	//       "description": "Name of a bucket.",
8392	//       "location": "path",
8393	//       "required": true,
8394	//       "type": "string"
8395	//     },
8396	//     "entity": {
8397	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
8398	//       "location": "path",
8399	//       "required": true,
8400	//       "type": "string"
8401	//     },
8402	//     "generation": {
8403	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8404	//       "format": "int64",
8405	//       "location": "query",
8406	//       "type": "string"
8407	//     },
8408	//     "object": {
8409	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8410	//       "location": "path",
8411	//       "required": true,
8412	//       "type": "string"
8413	//     },
8414	//     "provisionalUserProject": {
8415	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8416	//       "location": "query",
8417	//       "type": "string"
8418	//     },
8419	//     "userProject": {
8420	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8421	//       "location": "query",
8422	//       "type": "string"
8423	//     }
8424	//   },
8425	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
8426	//   "request": {
8427	//     "$ref": "ObjectAccessControl"
8428	//   },
8429	//   "response": {
8430	//     "$ref": "ObjectAccessControl"
8431	//   },
8432	//   "scopes": [
8433	//     "https://www.googleapis.com/auth/cloud-platform",
8434	//     "https://www.googleapis.com/auth/devstorage.full_control"
8435	//   ]
8436	// }
8437
8438}
8439
8440// method id "storage.objects.compose":
8441
8442type ObjectsComposeCall struct {
8443	s                 *Service
8444	destinationBucket string
8445	destinationObject string
8446	composerequest    *ComposeRequest
8447	urlParams_        gensupport.URLParams
8448	ctx_              context.Context
8449	header_           http.Header
8450}
8451
8452// Compose: Concatenates a list of existing objects into a new object in
8453// the same bucket.
8454func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
8455	c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8456	c.destinationBucket = destinationBucket
8457	c.destinationObject = destinationObject
8458	c.composerequest = composerequest
8459	return c
8460}
8461
8462// DestinationPredefinedAcl sets the optional parameter
8463// "destinationPredefinedAcl": Apply a predefined set of access controls
8464// to the destination object.
8465//
8466// Possible values:
8467//   "authenticatedRead" - Object owner gets OWNER access, and
8468// allAuthenticatedUsers get READER access.
8469//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
8470// project team owners get OWNER access.
8471//   "bucketOwnerRead" - Object owner gets OWNER access, and project
8472// team owners get READER access.
8473//   "private" - Object owner gets OWNER access.
8474//   "projectPrivate" - Object owner gets OWNER access, and project team
8475// members get access according to their roles.
8476//   "publicRead" - Object owner gets OWNER access, and allUsers get
8477// READER access.
8478func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
8479	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
8480	return c
8481}
8482
8483// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8484// Makes the operation conditional on whether the object's current
8485// generation matches the given value. Setting to 0 makes the operation
8486// succeed only if there are no live versions of the object.
8487func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
8488	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8489	return c
8490}
8491
8492// IfMetagenerationMatch sets the optional parameter
8493// "ifMetagenerationMatch": Makes the operation conditional on whether
8494// the object's current metageneration matches the given value.
8495func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall {
8496	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8497	return c
8498}
8499
8500// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
8501// the Cloud KMS key, of the form
8502// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
8503//  that will be used to encrypt the object. Overrides the object
8504// metadata's kms_key_name value, if any.
8505func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall {
8506	c.urlParams_.Set("kmsKeyName", kmsKeyName)
8507	return c
8508}
8509
8510// ProvisionalUserProject sets the optional parameter
8511// "provisionalUserProject": The project to be billed for this request
8512// if the target bucket is requester-pays bucket.
8513func (c *ObjectsComposeCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsComposeCall {
8514	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8515	return c
8516}
8517
8518// UserProject sets the optional parameter "userProject": The project to
8519// be billed for this request. Required for Requester Pays buckets.
8520func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
8521	c.urlParams_.Set("userProject", userProject)
8522	return c
8523}
8524
8525// Fields allows partial responses to be retrieved. See
8526// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8527// for more information.
8528func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
8529	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8530	return c
8531}
8532
8533// Context sets the context to be used in this call's Do method. Any
8534// pending HTTP request will be aborted if the provided context is
8535// canceled.
8536func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
8537	c.ctx_ = ctx
8538	return c
8539}
8540
8541// Header returns an http.Header that can be modified by the caller to
8542// add HTTP headers to the request.
8543func (c *ObjectsComposeCall) Header() http.Header {
8544	if c.header_ == nil {
8545		c.header_ = make(http.Header)
8546	}
8547	return c.header_
8548}
8549
8550func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
8551	reqHeaders := make(http.Header)
8552	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8553	for k, v := range c.header_ {
8554		reqHeaders[k] = v
8555	}
8556	reqHeaders.Set("User-Agent", c.s.userAgent())
8557	var body io.Reader = nil
8558	body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
8559	if err != nil {
8560		return nil, err
8561	}
8562	reqHeaders.Set("Content-Type", "application/json")
8563	c.urlParams_.Set("alt", alt)
8564	c.urlParams_.Set("prettyPrint", "false")
8565	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
8566	urls += "?" + c.urlParams_.Encode()
8567	req, err := http.NewRequest("POST", urls, body)
8568	if err != nil {
8569		return nil, err
8570	}
8571	req.Header = reqHeaders
8572	googleapi.Expand(req.URL, map[string]string{
8573		"destinationBucket": c.destinationBucket,
8574		"destinationObject": c.destinationObject,
8575	})
8576	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8577}
8578
8579// Do executes the "storage.objects.compose" call.
8580// Exactly one of *Object or error will be non-nil. Any non-2xx status
8581// code is an error. Response headers are in either
8582// *Object.ServerResponse.Header or (if a response was returned at all)
8583// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8584// check whether the returned error was because http.StatusNotModified
8585// was returned.
8586func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8587	gensupport.SetOptions(c.urlParams_, opts...)
8588	res, err := c.doRequest("json")
8589	if res != nil && res.StatusCode == http.StatusNotModified {
8590		if res.Body != nil {
8591			res.Body.Close()
8592		}
8593		return nil, &googleapi.Error{
8594			Code:   res.StatusCode,
8595			Header: res.Header,
8596		}
8597	}
8598	if err != nil {
8599		return nil, err
8600	}
8601	defer googleapi.CloseBody(res)
8602	if err := googleapi.CheckResponse(res); err != nil {
8603		return nil, err
8604	}
8605	ret := &Object{
8606		ServerResponse: googleapi.ServerResponse{
8607			Header:         res.Header,
8608			HTTPStatusCode: res.StatusCode,
8609		},
8610	}
8611	target := &ret
8612	if err := gensupport.DecodeResponse(target, res); err != nil {
8613		return nil, err
8614	}
8615	return ret, nil
8616	// {
8617	//   "description": "Concatenates a list of existing objects into a new object in the same bucket.",
8618	//   "httpMethod": "POST",
8619	//   "id": "storage.objects.compose",
8620	//   "parameterOrder": [
8621	//     "destinationBucket",
8622	//     "destinationObject"
8623	//   ],
8624	//   "parameters": {
8625	//     "destinationBucket": {
8626	//       "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
8627	//       "location": "path",
8628	//       "required": true,
8629	//       "type": "string"
8630	//     },
8631	//     "destinationObject": {
8632	//       "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8633	//       "location": "path",
8634	//       "required": true,
8635	//       "type": "string"
8636	//     },
8637	//     "destinationPredefinedAcl": {
8638	//       "description": "Apply a predefined set of access controls to the destination object.",
8639	//       "enum": [
8640	//         "authenticatedRead",
8641	//         "bucketOwnerFullControl",
8642	//         "bucketOwnerRead",
8643	//         "private",
8644	//         "projectPrivate",
8645	//         "publicRead"
8646	//       ],
8647	//       "enumDescriptions": [
8648	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8649	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
8650	//         "Object owner gets OWNER access, and project team owners get READER access.",
8651	//         "Object owner gets OWNER access.",
8652	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
8653	//         "Object owner gets OWNER access, and allUsers get READER access."
8654	//       ],
8655	//       "location": "query",
8656	//       "type": "string"
8657	//     },
8658	//     "ifGenerationMatch": {
8659	//       "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.",
8660	//       "format": "int64",
8661	//       "location": "query",
8662	//       "type": "string"
8663	//     },
8664	//     "ifMetagenerationMatch": {
8665	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
8666	//       "format": "int64",
8667	//       "location": "query",
8668	//       "type": "string"
8669	//     },
8670	//     "kmsKeyName": {
8671	//       "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.",
8672	//       "location": "query",
8673	//       "type": "string"
8674	//     },
8675	//     "provisionalUserProject": {
8676	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8677	//       "location": "query",
8678	//       "type": "string"
8679	//     },
8680	//     "userProject": {
8681	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8682	//       "location": "query",
8683	//       "type": "string"
8684	//     }
8685	//   },
8686	//   "path": "b/{destinationBucket}/o/{destinationObject}/compose",
8687	//   "request": {
8688	//     "$ref": "ComposeRequest"
8689	//   },
8690	//   "response": {
8691	//     "$ref": "Object"
8692	//   },
8693	//   "scopes": [
8694	//     "https://www.googleapis.com/auth/cloud-platform",
8695	//     "https://www.googleapis.com/auth/devstorage.full_control",
8696	//     "https://www.googleapis.com/auth/devstorage.read_write"
8697	//   ]
8698	// }
8699
8700}
8701
8702// method id "storage.objects.copy":
8703
8704type ObjectsCopyCall struct {
8705	s                 *Service
8706	sourceBucket      string
8707	sourceObject      string
8708	destinationBucket string
8709	destinationObject string
8710	object            *Object
8711	urlParams_        gensupport.URLParams
8712	ctx_              context.Context
8713	header_           http.Header
8714}
8715
8716// Copy: Copies a source object to a destination object. Optionally
8717// overrides metadata.
8718func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
8719	c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8720	c.sourceBucket = sourceBucket
8721	c.sourceObject = sourceObject
8722	c.destinationBucket = destinationBucket
8723	c.destinationObject = destinationObject
8724	c.object = object
8725	return c
8726}
8727
8728// DestinationPredefinedAcl sets the optional parameter
8729// "destinationPredefinedAcl": Apply a predefined set of access controls
8730// to the destination object.
8731//
8732// Possible values:
8733//   "authenticatedRead" - Object owner gets OWNER access, and
8734// allAuthenticatedUsers get READER access.
8735//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
8736// project team owners get OWNER access.
8737//   "bucketOwnerRead" - Object owner gets OWNER access, and project
8738// team owners get READER access.
8739//   "private" - Object owner gets OWNER access.
8740//   "projectPrivate" - Object owner gets OWNER access, and project team
8741// members get access according to their roles.
8742//   "publicRead" - Object owner gets OWNER access, and allUsers get
8743// READER access.
8744func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
8745	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
8746	return c
8747}
8748
8749// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8750// Makes the operation conditional on whether the destination object's
8751// current generation matches the given value. Setting to 0 makes the
8752// operation succeed only if there are no live versions of the object.
8753func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
8754	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8755	return c
8756}
8757
8758// IfGenerationNotMatch sets the optional parameter
8759// "ifGenerationNotMatch": Makes the operation conditional on whether
8760// the destination object's current generation does not match the given
8761// value. If no live object exists, the precondition fails. Setting to 0
8762// makes the operation succeed only if there is a live version of the
8763// object.
8764func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
8765	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
8766	return c
8767}
8768
8769// IfMetagenerationMatch sets the optional parameter
8770// "ifMetagenerationMatch": Makes the operation conditional on whether
8771// the destination object's current metageneration matches the given
8772// value.
8773func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
8774	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8775	return c
8776}
8777
8778// IfMetagenerationNotMatch sets the optional parameter
8779// "ifMetagenerationNotMatch": Makes the operation conditional on
8780// whether the destination object's current metageneration does not
8781// match the given value.
8782func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall {
8783	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8784	return c
8785}
8786
8787// IfSourceGenerationMatch sets the optional parameter
8788// "ifSourceGenerationMatch": Makes the operation conditional on whether
8789// the source object's current generation matches the given value.
8790func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
8791	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
8792	return c
8793}
8794
8795// IfSourceGenerationNotMatch sets the optional parameter
8796// "ifSourceGenerationNotMatch": Makes the operation conditional on
8797// whether the source object's current generation does not match the
8798// given value.
8799func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
8800	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
8801	return c
8802}
8803
8804// IfSourceMetagenerationMatch sets the optional parameter
8805// "ifSourceMetagenerationMatch": Makes the operation conditional on
8806// whether the source object's current metageneration matches the given
8807// value.
8808func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
8809	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
8810	return c
8811}
8812
8813// IfSourceMetagenerationNotMatch sets the optional parameter
8814// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
8815// whether the source object's current metageneration does not match the
8816// given value.
8817func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
8818	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
8819	return c
8820}
8821
8822// Projection sets the optional parameter "projection": Set of
8823// properties to return. Defaults to noAcl, unless the object resource
8824// specifies the acl property, when it defaults to full.
8825//
8826// Possible values:
8827//   "full" - Include all properties.
8828//   "noAcl" - Omit the owner, acl property.
8829func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
8830	c.urlParams_.Set("projection", projection)
8831	return c
8832}
8833
8834// ProvisionalUserProject sets the optional parameter
8835// "provisionalUserProject": The project to be billed for this request
8836// if the target bucket is requester-pays bucket.
8837func (c *ObjectsCopyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsCopyCall {
8838	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8839	return c
8840}
8841
8842// SourceGeneration sets the optional parameter "sourceGeneration": If
8843// present, selects a specific revision of the source object (as opposed
8844// to the latest version, the default).
8845func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall {
8846	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
8847	return c
8848}
8849
8850// UserProject sets the optional parameter "userProject": The project to
8851// be billed for this request. Required for Requester Pays buckets.
8852func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
8853	c.urlParams_.Set("userProject", userProject)
8854	return c
8855}
8856
8857// Fields allows partial responses to be retrieved. See
8858// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8859// for more information.
8860func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
8861	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8862	return c
8863}
8864
8865// Context sets the context to be used in this call's Do method. Any
8866// pending HTTP request will be aborted if the provided context is
8867// canceled.
8868func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
8869	c.ctx_ = ctx
8870	return c
8871}
8872
8873// Header returns an http.Header that can be modified by the caller to
8874// add HTTP headers to the request.
8875func (c *ObjectsCopyCall) Header() http.Header {
8876	if c.header_ == nil {
8877		c.header_ = make(http.Header)
8878	}
8879	return c.header_
8880}
8881
8882func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
8883	reqHeaders := make(http.Header)
8884	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
8885	for k, v := range c.header_ {
8886		reqHeaders[k] = v
8887	}
8888	reqHeaders.Set("User-Agent", c.s.userAgent())
8889	var body io.Reader = nil
8890	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
8891	if err != nil {
8892		return nil, err
8893	}
8894	reqHeaders.Set("Content-Type", "application/json")
8895	c.urlParams_.Set("alt", alt)
8896	c.urlParams_.Set("prettyPrint", "false")
8897	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
8898	urls += "?" + c.urlParams_.Encode()
8899	req, err := http.NewRequest("POST", urls, body)
8900	if err != nil {
8901		return nil, err
8902	}
8903	req.Header = reqHeaders
8904	googleapi.Expand(req.URL, map[string]string{
8905		"sourceBucket":      c.sourceBucket,
8906		"sourceObject":      c.sourceObject,
8907		"destinationBucket": c.destinationBucket,
8908		"destinationObject": c.destinationObject,
8909	})
8910	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8911}
8912
8913// Do executes the "storage.objects.copy" call.
8914// Exactly one of *Object or error will be non-nil. Any non-2xx status
8915// code is an error. Response headers are in either
8916// *Object.ServerResponse.Header or (if a response was returned at all)
8917// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8918// check whether the returned error was because http.StatusNotModified
8919// was returned.
8920func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8921	gensupport.SetOptions(c.urlParams_, opts...)
8922	res, err := c.doRequest("json")
8923	if res != nil && res.StatusCode == http.StatusNotModified {
8924		if res.Body != nil {
8925			res.Body.Close()
8926		}
8927		return nil, &googleapi.Error{
8928			Code:   res.StatusCode,
8929			Header: res.Header,
8930		}
8931	}
8932	if err != nil {
8933		return nil, err
8934	}
8935	defer googleapi.CloseBody(res)
8936	if err := googleapi.CheckResponse(res); err != nil {
8937		return nil, err
8938	}
8939	ret := &Object{
8940		ServerResponse: googleapi.ServerResponse{
8941			Header:         res.Header,
8942			HTTPStatusCode: res.StatusCode,
8943		},
8944	}
8945	target := &ret
8946	if err := gensupport.DecodeResponse(target, res); err != nil {
8947		return nil, err
8948	}
8949	return ret, nil
8950	// {
8951	//   "description": "Copies a source object to a destination object. Optionally overrides metadata.",
8952	//   "httpMethod": "POST",
8953	//   "id": "storage.objects.copy",
8954	//   "parameterOrder": [
8955	//     "sourceBucket",
8956	//     "sourceObject",
8957	//     "destinationBucket",
8958	//     "destinationObject"
8959	//   ],
8960	//   "parameters": {
8961	//     "destinationBucket": {
8962	//       "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.",
8963	//       "location": "path",
8964	//       "required": true,
8965	//       "type": "string"
8966	//     },
8967	//     "destinationObject": {
8968	//       "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
8969	//       "location": "path",
8970	//       "required": true,
8971	//       "type": "string"
8972	//     },
8973	//     "destinationPredefinedAcl": {
8974	//       "description": "Apply a predefined set of access controls to the destination object.",
8975	//       "enum": [
8976	//         "authenticatedRead",
8977	//         "bucketOwnerFullControl",
8978	//         "bucketOwnerRead",
8979	//         "private",
8980	//         "projectPrivate",
8981	//         "publicRead"
8982	//       ],
8983	//       "enumDescriptions": [
8984	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8985	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
8986	//         "Object owner gets OWNER access, and project team owners get READER access.",
8987	//         "Object owner gets OWNER access.",
8988	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
8989	//         "Object owner gets OWNER access, and allUsers get READER access."
8990	//       ],
8991	//       "location": "query",
8992	//       "type": "string"
8993	//     },
8994	//     "ifGenerationMatch": {
8995	//       "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.",
8996	//       "format": "int64",
8997	//       "location": "query",
8998	//       "type": "string"
8999	//     },
9000	//     "ifGenerationNotMatch": {
9001	//       "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.",
9002	//       "format": "int64",
9003	//       "location": "query",
9004	//       "type": "string"
9005	//     },
9006	//     "ifMetagenerationMatch": {
9007	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
9008	//       "format": "int64",
9009	//       "location": "query",
9010	//       "type": "string"
9011	//     },
9012	//     "ifMetagenerationNotMatch": {
9013	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
9014	//       "format": "int64",
9015	//       "location": "query",
9016	//       "type": "string"
9017	//     },
9018	//     "ifSourceGenerationMatch": {
9019	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
9020	//       "format": "int64",
9021	//       "location": "query",
9022	//       "type": "string"
9023	//     },
9024	//     "ifSourceGenerationNotMatch": {
9025	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
9026	//       "format": "int64",
9027	//       "location": "query",
9028	//       "type": "string"
9029	//     },
9030	//     "ifSourceMetagenerationMatch": {
9031	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
9032	//       "format": "int64",
9033	//       "location": "query",
9034	//       "type": "string"
9035	//     },
9036	//     "ifSourceMetagenerationNotMatch": {
9037	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
9038	//       "format": "int64",
9039	//       "location": "query",
9040	//       "type": "string"
9041	//     },
9042	//     "projection": {
9043	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
9044	//       "enum": [
9045	//         "full",
9046	//         "noAcl"
9047	//       ],
9048	//       "enumDescriptions": [
9049	//         "Include all properties.",
9050	//         "Omit the owner, acl property."
9051	//       ],
9052	//       "location": "query",
9053	//       "type": "string"
9054	//     },
9055	//     "provisionalUserProject": {
9056	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9057	//       "location": "query",
9058	//       "type": "string"
9059	//     },
9060	//     "sourceBucket": {
9061	//       "description": "Name of the bucket in which to find the source object.",
9062	//       "location": "path",
9063	//       "required": true,
9064	//       "type": "string"
9065	//     },
9066	//     "sourceGeneration": {
9067	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
9068	//       "format": "int64",
9069	//       "location": "query",
9070	//       "type": "string"
9071	//     },
9072	//     "sourceObject": {
9073	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9074	//       "location": "path",
9075	//       "required": true,
9076	//       "type": "string"
9077	//     },
9078	//     "userProject": {
9079	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9080	//       "location": "query",
9081	//       "type": "string"
9082	//     }
9083	//   },
9084	//   "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
9085	//   "request": {
9086	//     "$ref": "Object"
9087	//   },
9088	//   "response": {
9089	//     "$ref": "Object"
9090	//   },
9091	//   "scopes": [
9092	//     "https://www.googleapis.com/auth/cloud-platform",
9093	//     "https://www.googleapis.com/auth/devstorage.full_control",
9094	//     "https://www.googleapis.com/auth/devstorage.read_write"
9095	//   ]
9096	// }
9097
9098}
9099
9100// method id "storage.objects.delete":
9101
9102type ObjectsDeleteCall struct {
9103	s          *Service
9104	bucket     string
9105	object     string
9106	urlParams_ gensupport.URLParams
9107	ctx_       context.Context
9108	header_    http.Header
9109}
9110
9111// Delete: Deletes an object and its metadata. Deletions are permanent
9112// if versioning is not enabled for the bucket, or if the generation
9113// parameter is used.
9114func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
9115	c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9116	c.bucket = bucket
9117	c.object = object
9118	return c
9119}
9120
9121// Generation sets the optional parameter "generation": If present,
9122// permanently deletes a specific revision of this object (as opposed to
9123// the latest version, the default).
9124func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
9125	c.urlParams_.Set("generation", fmt.Sprint(generation))
9126	return c
9127}
9128
9129// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9130// Makes the operation conditional on whether the object's current
9131// generation matches the given value. Setting to 0 makes the operation
9132// succeed only if there are no live versions of the object.
9133func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
9134	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9135	return c
9136}
9137
9138// IfGenerationNotMatch sets the optional parameter
9139// "ifGenerationNotMatch": Makes the operation conditional on whether
9140// the object's current generation does not match the given value. If no
9141// live object exists, the precondition fails. Setting to 0 makes the
9142// operation succeed only if there is a live version of the object.
9143func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
9144	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9145	return c
9146}
9147
9148// IfMetagenerationMatch sets the optional parameter
9149// "ifMetagenerationMatch": Makes the operation conditional on whether
9150// the object's current metageneration matches the given value.
9151func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall {
9152	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9153	return c
9154}
9155
9156// IfMetagenerationNotMatch sets the optional parameter
9157// "ifMetagenerationNotMatch": Makes the operation conditional on
9158// whether the object's current metageneration does not match the given
9159// value.
9160func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
9161	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9162	return c
9163}
9164
9165// ProvisionalUserProject sets the optional parameter
9166// "provisionalUserProject": The project to be billed for this request
9167// if the target bucket is requester-pays bucket.
9168func (c *ObjectsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsDeleteCall {
9169	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9170	return c
9171}
9172
9173// UserProject sets the optional parameter "userProject": The project to
9174// be billed for this request. Required for Requester Pays buckets.
9175func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
9176	c.urlParams_.Set("userProject", userProject)
9177	return c
9178}
9179
9180// Fields allows partial responses to be retrieved. See
9181// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9182// for more information.
9183func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
9184	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9185	return c
9186}
9187
9188// Context sets the context to be used in this call's Do method. Any
9189// pending HTTP request will be aborted if the provided context is
9190// canceled.
9191func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
9192	c.ctx_ = ctx
9193	return c
9194}
9195
9196// Header returns an http.Header that can be modified by the caller to
9197// add HTTP headers to the request.
9198func (c *ObjectsDeleteCall) Header() http.Header {
9199	if c.header_ == nil {
9200		c.header_ = make(http.Header)
9201	}
9202	return c.header_
9203}
9204
9205func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
9206	reqHeaders := make(http.Header)
9207	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9208	for k, v := range c.header_ {
9209		reqHeaders[k] = v
9210	}
9211	reqHeaders.Set("User-Agent", c.s.userAgent())
9212	var body io.Reader = nil
9213	c.urlParams_.Set("alt", alt)
9214	c.urlParams_.Set("prettyPrint", "false")
9215	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9216	urls += "?" + c.urlParams_.Encode()
9217	req, err := http.NewRequest("DELETE", urls, body)
9218	if err != nil {
9219		return nil, err
9220	}
9221	req.Header = reqHeaders
9222	googleapi.Expand(req.URL, map[string]string{
9223		"bucket": c.bucket,
9224		"object": c.object,
9225	})
9226	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9227}
9228
9229// Do executes the "storage.objects.delete" call.
9230func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
9231	gensupport.SetOptions(c.urlParams_, opts...)
9232	res, err := c.doRequest("json")
9233	if err != nil {
9234		return err
9235	}
9236	defer googleapi.CloseBody(res)
9237	if err := googleapi.CheckResponse(res); err != nil {
9238		return err
9239	}
9240	return nil
9241	// {
9242	//   "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.",
9243	//   "httpMethod": "DELETE",
9244	//   "id": "storage.objects.delete",
9245	//   "parameterOrder": [
9246	//     "bucket",
9247	//     "object"
9248	//   ],
9249	//   "parameters": {
9250	//     "bucket": {
9251	//       "description": "Name of the bucket in which the object resides.",
9252	//       "location": "path",
9253	//       "required": true,
9254	//       "type": "string"
9255	//     },
9256	//     "generation": {
9257	//       "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
9258	//       "format": "int64",
9259	//       "location": "query",
9260	//       "type": "string"
9261	//     },
9262	//     "ifGenerationMatch": {
9263	//       "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.",
9264	//       "format": "int64",
9265	//       "location": "query",
9266	//       "type": "string"
9267	//     },
9268	//     "ifGenerationNotMatch": {
9269	//       "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.",
9270	//       "format": "int64",
9271	//       "location": "query",
9272	//       "type": "string"
9273	//     },
9274	//     "ifMetagenerationMatch": {
9275	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9276	//       "format": "int64",
9277	//       "location": "query",
9278	//       "type": "string"
9279	//     },
9280	//     "ifMetagenerationNotMatch": {
9281	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9282	//       "format": "int64",
9283	//       "location": "query",
9284	//       "type": "string"
9285	//     },
9286	//     "object": {
9287	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9288	//       "location": "path",
9289	//       "required": true,
9290	//       "type": "string"
9291	//     },
9292	//     "provisionalUserProject": {
9293	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9294	//       "location": "query",
9295	//       "type": "string"
9296	//     },
9297	//     "userProject": {
9298	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9299	//       "location": "query",
9300	//       "type": "string"
9301	//     }
9302	//   },
9303	//   "path": "b/{bucket}/o/{object}",
9304	//   "scopes": [
9305	//     "https://www.googleapis.com/auth/cloud-platform",
9306	//     "https://www.googleapis.com/auth/devstorage.full_control",
9307	//     "https://www.googleapis.com/auth/devstorage.read_write"
9308	//   ]
9309	// }
9310
9311}
9312
9313// method id "storage.objects.get":
9314
9315type ObjectsGetCall struct {
9316	s            *Service
9317	bucket       string
9318	object       string
9319	urlParams_   gensupport.URLParams
9320	ifNoneMatch_ string
9321	ctx_         context.Context
9322	header_      http.Header
9323}
9324
9325// Get: Retrieves an object or its metadata.
9326func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
9327	c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9328	c.bucket = bucket
9329	c.object = object
9330	return c
9331}
9332
9333// Generation sets the optional parameter "generation": If present,
9334// selects a specific revision of this object (as opposed to the latest
9335// version, the default).
9336func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
9337	c.urlParams_.Set("generation", fmt.Sprint(generation))
9338	return c
9339}
9340
9341// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9342// Makes the operation conditional on whether the object's current
9343// generation matches the given value. Setting to 0 makes the operation
9344// succeed only if there are no live versions of the object.
9345func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
9346	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9347	return c
9348}
9349
9350// IfGenerationNotMatch sets the optional parameter
9351// "ifGenerationNotMatch": Makes the operation conditional on whether
9352// the object's current generation does not match the given value. If no
9353// live object exists, the precondition fails. Setting to 0 makes the
9354// operation succeed only if there is a live version of the object.
9355func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
9356	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9357	return c
9358}
9359
9360// IfMetagenerationMatch sets the optional parameter
9361// "ifMetagenerationMatch": Makes the operation conditional on whether
9362// the object's current metageneration matches the given value.
9363func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall {
9364	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9365	return c
9366}
9367
9368// IfMetagenerationNotMatch sets the optional parameter
9369// "ifMetagenerationNotMatch": Makes the operation conditional on
9370// whether the object's current metageneration does not match the given
9371// value.
9372func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
9373	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9374	return c
9375}
9376
9377// Projection sets the optional parameter "projection": Set of
9378// properties to return. Defaults to noAcl.
9379//
9380// Possible values:
9381//   "full" - Include all properties.
9382//   "noAcl" - Omit the owner, acl property.
9383func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
9384	c.urlParams_.Set("projection", projection)
9385	return c
9386}
9387
9388// ProvisionalUserProject sets the optional parameter
9389// "provisionalUserProject": The project to be billed for this request
9390// if the target bucket is requester-pays bucket.
9391func (c *ObjectsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetCall {
9392	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9393	return c
9394}
9395
9396// UserProject sets the optional parameter "userProject": The project to
9397// be billed for this request. Required for Requester Pays buckets.
9398func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
9399	c.urlParams_.Set("userProject", userProject)
9400	return c
9401}
9402
9403// Fields allows partial responses to be retrieved. See
9404// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9405// for more information.
9406func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
9407	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9408	return c
9409}
9410
9411// IfNoneMatch sets the optional parameter which makes the operation
9412// fail if the object's ETag matches the given value. This is useful for
9413// getting updates only after the object has changed since the last
9414// request. Use googleapi.IsNotModified to check whether the response
9415// error from Do is the result of In-None-Match.
9416func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
9417	c.ifNoneMatch_ = entityTag
9418	return c
9419}
9420
9421// Context sets the context to be used in this call's Do and Download
9422// methods. Any pending HTTP request will be aborted if the provided
9423// context is canceled.
9424func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
9425	c.ctx_ = ctx
9426	return c
9427}
9428
9429// Header returns an http.Header that can be modified by the caller to
9430// add HTTP headers to the request.
9431func (c *ObjectsGetCall) Header() http.Header {
9432	if c.header_ == nil {
9433		c.header_ = make(http.Header)
9434	}
9435	return c.header_
9436}
9437
9438func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
9439	reqHeaders := make(http.Header)
9440	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9441	for k, v := range c.header_ {
9442		reqHeaders[k] = v
9443	}
9444	reqHeaders.Set("User-Agent", c.s.userAgent())
9445	if c.ifNoneMatch_ != "" {
9446		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9447	}
9448	var body io.Reader = nil
9449	c.urlParams_.Set("alt", alt)
9450	c.urlParams_.Set("prettyPrint", "false")
9451	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9452	urls += "?" + c.urlParams_.Encode()
9453	req, err := http.NewRequest("GET", urls, body)
9454	if err != nil {
9455		return nil, err
9456	}
9457	req.Header = reqHeaders
9458	googleapi.Expand(req.URL, map[string]string{
9459		"bucket": c.bucket,
9460		"object": c.object,
9461	})
9462	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9463}
9464
9465// Download fetches the API endpoint's "media" value, instead of the normal
9466// API response value. If the returned error is nil, the Response is guaranteed to
9467// have a 2xx status code. Callers must close the Response.Body as usual.
9468func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
9469	gensupport.SetOptions(c.urlParams_, opts...)
9470	res, err := c.doRequest("media")
9471	if err != nil {
9472		return nil, err
9473	}
9474	if err := googleapi.CheckMediaResponse(res); err != nil {
9475		res.Body.Close()
9476		return nil, err
9477	}
9478	return res, nil
9479}
9480
9481// Do executes the "storage.objects.get" call.
9482// Exactly one of *Object or error will be non-nil. Any non-2xx status
9483// code is an error. Response headers are in either
9484// *Object.ServerResponse.Header or (if a response was returned at all)
9485// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9486// check whether the returned error was because http.StatusNotModified
9487// was returned.
9488func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
9489	gensupport.SetOptions(c.urlParams_, opts...)
9490	res, err := c.doRequest("json")
9491	if res != nil && res.StatusCode == http.StatusNotModified {
9492		if res.Body != nil {
9493			res.Body.Close()
9494		}
9495		return nil, &googleapi.Error{
9496			Code:   res.StatusCode,
9497			Header: res.Header,
9498		}
9499	}
9500	if err != nil {
9501		return nil, err
9502	}
9503	defer googleapi.CloseBody(res)
9504	if err := googleapi.CheckResponse(res); err != nil {
9505		return nil, err
9506	}
9507	ret := &Object{
9508		ServerResponse: googleapi.ServerResponse{
9509			Header:         res.Header,
9510			HTTPStatusCode: res.StatusCode,
9511		},
9512	}
9513	target := &ret
9514	if err := gensupport.DecodeResponse(target, res); err != nil {
9515		return nil, err
9516	}
9517	return ret, nil
9518	// {
9519	//   "description": "Retrieves an object or its metadata.",
9520	//   "httpMethod": "GET",
9521	//   "id": "storage.objects.get",
9522	//   "parameterOrder": [
9523	//     "bucket",
9524	//     "object"
9525	//   ],
9526	//   "parameters": {
9527	//     "bucket": {
9528	//       "description": "Name of the bucket in which the object resides.",
9529	//       "location": "path",
9530	//       "required": true,
9531	//       "type": "string"
9532	//     },
9533	//     "generation": {
9534	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9535	//       "format": "int64",
9536	//       "location": "query",
9537	//       "type": "string"
9538	//     },
9539	//     "ifGenerationMatch": {
9540	//       "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.",
9541	//       "format": "int64",
9542	//       "location": "query",
9543	//       "type": "string"
9544	//     },
9545	//     "ifGenerationNotMatch": {
9546	//       "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.",
9547	//       "format": "int64",
9548	//       "location": "query",
9549	//       "type": "string"
9550	//     },
9551	//     "ifMetagenerationMatch": {
9552	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9553	//       "format": "int64",
9554	//       "location": "query",
9555	//       "type": "string"
9556	//     },
9557	//     "ifMetagenerationNotMatch": {
9558	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9559	//       "format": "int64",
9560	//       "location": "query",
9561	//       "type": "string"
9562	//     },
9563	//     "object": {
9564	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9565	//       "location": "path",
9566	//       "required": true,
9567	//       "type": "string"
9568	//     },
9569	//     "projection": {
9570	//       "description": "Set of properties to return. Defaults to noAcl.",
9571	//       "enum": [
9572	//         "full",
9573	//         "noAcl"
9574	//       ],
9575	//       "enumDescriptions": [
9576	//         "Include all properties.",
9577	//         "Omit the owner, acl property."
9578	//       ],
9579	//       "location": "query",
9580	//       "type": "string"
9581	//     },
9582	//     "provisionalUserProject": {
9583	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9584	//       "location": "query",
9585	//       "type": "string"
9586	//     },
9587	//     "userProject": {
9588	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9589	//       "location": "query",
9590	//       "type": "string"
9591	//     }
9592	//   },
9593	//   "path": "b/{bucket}/o/{object}",
9594	//   "response": {
9595	//     "$ref": "Object"
9596	//   },
9597	//   "scopes": [
9598	//     "https://www.googleapis.com/auth/cloud-platform",
9599	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9600	//     "https://www.googleapis.com/auth/devstorage.full_control",
9601	//     "https://www.googleapis.com/auth/devstorage.read_only",
9602	//     "https://www.googleapis.com/auth/devstorage.read_write"
9603	//   ],
9604	//   "supportsMediaDownload": true,
9605	//   "useMediaDownloadService": true
9606	// }
9607
9608}
9609
9610// method id "storage.objects.getIamPolicy":
9611
9612type ObjectsGetIamPolicyCall struct {
9613	s            *Service
9614	bucket       string
9615	object       string
9616	urlParams_   gensupport.URLParams
9617	ifNoneMatch_ string
9618	ctx_         context.Context
9619	header_      http.Header
9620}
9621
9622// GetIamPolicy: Returns an IAM policy for the specified object.
9623func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall {
9624	c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9625	c.bucket = bucket
9626	c.object = object
9627	return c
9628}
9629
9630// Generation sets the optional parameter "generation": If present,
9631// selects a specific revision of this object (as opposed to the latest
9632// version, the default).
9633func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall {
9634	c.urlParams_.Set("generation", fmt.Sprint(generation))
9635	return c
9636}
9637
9638// ProvisionalUserProject sets the optional parameter
9639// "provisionalUserProject": The project to be billed for this request
9640// if the target bucket is requester-pays bucket.
9641func (c *ObjectsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetIamPolicyCall {
9642	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9643	return c
9644}
9645
9646// UserProject sets the optional parameter "userProject": The project to
9647// be billed for this request. Required for Requester Pays buckets.
9648func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
9649	c.urlParams_.Set("userProject", userProject)
9650	return c
9651}
9652
9653// Fields allows partial responses to be retrieved. See
9654// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9655// for more information.
9656func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall {
9657	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9658	return c
9659}
9660
9661// IfNoneMatch sets the optional parameter which makes the operation
9662// fail if the object's ETag matches the given value. This is useful for
9663// getting updates only after the object has changed since the last
9664// request. Use googleapi.IsNotModified to check whether the response
9665// error from Do is the result of In-None-Match.
9666func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall {
9667	c.ifNoneMatch_ = entityTag
9668	return c
9669}
9670
9671// Context sets the context to be used in this call's Do method. Any
9672// pending HTTP request will be aborted if the provided context is
9673// canceled.
9674func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
9675	c.ctx_ = ctx
9676	return c
9677}
9678
9679// Header returns an http.Header that can be modified by the caller to
9680// add HTTP headers to the request.
9681func (c *ObjectsGetIamPolicyCall) Header() http.Header {
9682	if c.header_ == nil {
9683		c.header_ = make(http.Header)
9684	}
9685	return c.header_
9686}
9687
9688func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9689	reqHeaders := make(http.Header)
9690	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
9691	for k, v := range c.header_ {
9692		reqHeaders[k] = v
9693	}
9694	reqHeaders.Set("User-Agent", c.s.userAgent())
9695	if c.ifNoneMatch_ != "" {
9696		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9697	}
9698	var body io.Reader = nil
9699	c.urlParams_.Set("alt", alt)
9700	c.urlParams_.Set("prettyPrint", "false")
9701	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
9702	urls += "?" + c.urlParams_.Encode()
9703	req, err := http.NewRequest("GET", urls, body)
9704	if err != nil {
9705		return nil, err
9706	}
9707	req.Header = reqHeaders
9708	googleapi.Expand(req.URL, map[string]string{
9709		"bucket": c.bucket,
9710		"object": c.object,
9711	})
9712	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9713}
9714
9715// Do executes the "storage.objects.getIamPolicy" call.
9716// Exactly one of *Policy or error will be non-nil. Any non-2xx status
9717// code is an error. Response headers are in either
9718// *Policy.ServerResponse.Header or (if a response was returned at all)
9719// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9720// check whether the returned error was because http.StatusNotModified
9721// was returned.
9722func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9723	gensupport.SetOptions(c.urlParams_, opts...)
9724	res, err := c.doRequest("json")
9725	if res != nil && res.StatusCode == http.StatusNotModified {
9726		if res.Body != nil {
9727			res.Body.Close()
9728		}
9729		return nil, &googleapi.Error{
9730			Code:   res.StatusCode,
9731			Header: res.Header,
9732		}
9733	}
9734	if err != nil {
9735		return nil, err
9736	}
9737	defer googleapi.CloseBody(res)
9738	if err := googleapi.CheckResponse(res); err != nil {
9739		return nil, err
9740	}
9741	ret := &Policy{
9742		ServerResponse: googleapi.ServerResponse{
9743			Header:         res.Header,
9744			HTTPStatusCode: res.StatusCode,
9745		},
9746	}
9747	target := &ret
9748	if err := gensupport.DecodeResponse(target, res); err != nil {
9749		return nil, err
9750	}
9751	return ret, nil
9752	// {
9753	//   "description": "Returns an IAM policy for the specified object.",
9754	//   "httpMethod": "GET",
9755	//   "id": "storage.objects.getIamPolicy",
9756	//   "parameterOrder": [
9757	//     "bucket",
9758	//     "object"
9759	//   ],
9760	//   "parameters": {
9761	//     "bucket": {
9762	//       "description": "Name of the bucket in which the object resides.",
9763	//       "location": "path",
9764	//       "required": true,
9765	//       "type": "string"
9766	//     },
9767	//     "generation": {
9768	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9769	//       "format": "int64",
9770	//       "location": "query",
9771	//       "type": "string"
9772	//     },
9773	//     "object": {
9774	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9775	//       "location": "path",
9776	//       "required": true,
9777	//       "type": "string"
9778	//     },
9779	//     "provisionalUserProject": {
9780	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9781	//       "location": "query",
9782	//       "type": "string"
9783	//     },
9784	//     "userProject": {
9785	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9786	//       "location": "query",
9787	//       "type": "string"
9788	//     }
9789	//   },
9790	//   "path": "b/{bucket}/o/{object}/iam",
9791	//   "response": {
9792	//     "$ref": "Policy"
9793	//   },
9794	//   "scopes": [
9795	//     "https://www.googleapis.com/auth/cloud-platform",
9796	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9797	//     "https://www.googleapis.com/auth/devstorage.full_control",
9798	//     "https://www.googleapis.com/auth/devstorage.read_only",
9799	//     "https://www.googleapis.com/auth/devstorage.read_write"
9800	//   ]
9801	// }
9802
9803}
9804
9805// method id "storage.objects.insert":
9806
9807type ObjectsInsertCall struct {
9808	s          *Service
9809	bucket     string
9810	object     *Object
9811	urlParams_ gensupport.URLParams
9812	mediaInfo_ *gensupport.MediaInfo
9813	ctx_       context.Context
9814	header_    http.Header
9815}
9816
9817// Insert: Stores a new object and metadata.
9818func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
9819	c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9820	c.bucket = bucket
9821	c.object = object
9822	return c
9823}
9824
9825// ContentEncoding sets the optional parameter "contentEncoding": If
9826// set, sets the contentEncoding property of the final object to this
9827// value. Setting this parameter is equivalent to setting the
9828// contentEncoding metadata property. This can be useful when uploading
9829// an object with uploadType=media to indicate the encoding of the
9830// content being uploaded.
9831func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall {
9832	c.urlParams_.Set("contentEncoding", contentEncoding)
9833	return c
9834}
9835
9836// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9837// Makes the operation conditional on whether the object's current
9838// generation matches the given value. Setting to 0 makes the operation
9839// succeed only if there are no live versions of the object.
9840func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
9841	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9842	return c
9843}
9844
9845// IfGenerationNotMatch sets the optional parameter
9846// "ifGenerationNotMatch": Makes the operation conditional on whether
9847// the object's current generation does not match the given value. If no
9848// live object exists, the precondition fails. Setting to 0 makes the
9849// operation succeed only if there is a live version of the object.
9850func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
9851	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9852	return c
9853}
9854
9855// IfMetagenerationMatch sets the optional parameter
9856// "ifMetagenerationMatch": Makes the operation conditional on whether
9857// the object's current metageneration matches the given value.
9858func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall {
9859	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9860	return c
9861}
9862
9863// IfMetagenerationNotMatch sets the optional parameter
9864// "ifMetagenerationNotMatch": Makes the operation conditional on
9865// whether the object's current metageneration does not match the given
9866// value.
9867func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
9868	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9869	return c
9870}
9871
9872// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
9873// the Cloud KMS key, of the form
9874// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
9875//  that will be used to encrypt the object. Overrides the object
9876// metadata's kms_key_name value, if any.
9877func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall {
9878	c.urlParams_.Set("kmsKeyName", kmsKeyName)
9879	return c
9880}
9881
9882// Name sets the optional parameter "name": Name of the object. Required
9883// when the object metadata is not otherwise provided. Overrides the
9884// object metadata's name value, if any. For information about how to
9885// URL encode object names to be path safe, see Encoding URI Path Parts.
9886func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
9887	c.urlParams_.Set("name", name)
9888	return c
9889}
9890
9891// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9892// predefined set of access controls to this object.
9893//
9894// Possible values:
9895//   "authenticatedRead" - Object owner gets OWNER access, and
9896// allAuthenticatedUsers get READER access.
9897//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
9898// project team owners get OWNER access.
9899//   "bucketOwnerRead" - Object owner gets OWNER access, and project
9900// team owners get READER access.
9901//   "private" - Object owner gets OWNER access.
9902//   "projectPrivate" - Object owner gets OWNER access, and project team
9903// members get access according to their roles.
9904//   "publicRead" - Object owner gets OWNER access, and allUsers get
9905// READER access.
9906func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
9907	c.urlParams_.Set("predefinedAcl", predefinedAcl)
9908	return c
9909}
9910
9911// Projection sets the optional parameter "projection": Set of
9912// properties to return. Defaults to noAcl, unless the object resource
9913// specifies the acl property, when it defaults to full.
9914//
9915// Possible values:
9916//   "full" - Include all properties.
9917//   "noAcl" - Omit the owner, acl property.
9918func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
9919	c.urlParams_.Set("projection", projection)
9920	return c
9921}
9922
9923// ProvisionalUserProject sets the optional parameter
9924// "provisionalUserProject": The project to be billed for this request
9925// if the target bucket is requester-pays bucket.
9926func (c *ObjectsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsInsertCall {
9927	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9928	return c
9929}
9930
9931// UserProject sets the optional parameter "userProject": The project to
9932// be billed for this request. Required for Requester Pays buckets.
9933func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
9934	c.urlParams_.Set("userProject", userProject)
9935	return c
9936}
9937
9938// Media specifies the media to upload in one or more chunks. The chunk
9939// size may be controlled by supplying a MediaOption generated by
9940// googleapi.ChunkSize. The chunk size defaults to
9941// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
9942// upload request will be determined by sniffing the contents of r,
9943// unless a MediaOption generated by googleapi.ContentType is
9944// supplied.
9945// At most one of Media and ResumableMedia may be set.
9946func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
9947	if ct := c.object.ContentType; ct != "" {
9948		options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
9949	}
9950	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9951	return c
9952}
9953
9954// ResumableMedia specifies the media to upload in chunks and can be
9955// canceled with ctx.
9956//
9957// Deprecated: use Media instead.
9958//
9959// At most one of Media and ResumableMedia may be set. mediaType
9960// identifies the MIME media type of the upload, such as "image/png". If
9961// mediaType is "", it will be auto-detected. The provided ctx will
9962// supersede any context previously provided to the Context method.
9963func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
9964	c.ctx_ = ctx
9965	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
9966	return c
9967}
9968
9969// ProgressUpdater provides a callback function that will be called
9970// after every chunk. It should be a low-latency function in order to
9971// not slow down the upload operation. This should only be called when
9972// using ResumableMedia (as opposed to Media).
9973func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
9974	c.mediaInfo_.SetProgressUpdater(pu)
9975	return c
9976}
9977
9978// Fields allows partial responses to be retrieved. See
9979// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9980// for more information.
9981func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
9982	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9983	return c
9984}
9985
9986// Context sets the context to be used in this call's Do method. Any
9987// pending HTTP request will be aborted if the provided context is
9988// canceled.
9989// This context will supersede any context previously provided to the
9990// ResumableMedia method.
9991func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
9992	c.ctx_ = ctx
9993	return c
9994}
9995
9996// Header returns an http.Header that can be modified by the caller to
9997// add HTTP headers to the request.
9998func (c *ObjectsInsertCall) Header() http.Header {
9999	if c.header_ == nil {
10000		c.header_ = make(http.Header)
10001	}
10002	return c.header_
10003}
10004
10005func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
10006	reqHeaders := make(http.Header)
10007	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
10008	for k, v := range c.header_ {
10009		reqHeaders[k] = v
10010	}
10011	reqHeaders.Set("User-Agent", c.s.userAgent())
10012	var body io.Reader = nil
10013	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
10014	if err != nil {
10015		return nil, err
10016	}
10017	reqHeaders.Set("Content-Type", "application/json")
10018	c.urlParams_.Set("alt", alt)
10019	c.urlParams_.Set("prettyPrint", "false")
10020	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
10021	if c.mediaInfo_ != nil {
10022		urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
10023		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
10024	}
10025	if body == nil {
10026		body = new(bytes.Buffer)
10027		reqHeaders.Set("Content-Type", "application/json")
10028	}
10029	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
10030	defer cleanup()
10031	urls += "?" + c.urlParams_.Encode()
10032	req, err := http.NewRequest("POST", urls, body)
10033	if err != nil {
10034		return nil, err
10035	}
10036	req.Header = reqHeaders
10037	req.GetBody = getBody
10038	googleapi.Expand(req.URL, map[string]string{
10039		"bucket": c.bucket,
10040	})
10041	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10042}
10043
10044// Do executes the "storage.objects.insert" call.
10045// Exactly one of *Object or error will be non-nil. Any non-2xx status
10046// code is an error. Response headers are in either
10047// *Object.ServerResponse.Header or (if a response was returned at all)
10048// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10049// check whether the returned error was because http.StatusNotModified
10050// was returned.
10051func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
10052	gensupport.SetOptions(c.urlParams_, opts...)
10053	res, err := c.doRequest("json")
10054	if res != nil && res.StatusCode == http.StatusNotModified {
10055		if res.Body != nil {
10056			res.Body.Close()
10057		}
10058		return nil, &googleapi.Error{
10059			Code:   res.StatusCode,
10060			Header: res.Header,
10061		}
10062	}
10063	if err != nil {
10064		return nil, err
10065	}
10066	defer googleapi.CloseBody(res)
10067	if err := googleapi.CheckResponse(res); err != nil {
10068		return nil, err
10069	}
10070	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
10071	if rx != nil {
10072		rx.Client = c.s.client
10073		rx.UserAgent = c.s.userAgent()
10074		ctx := c.ctx_
10075		if ctx == nil {
10076			ctx = context.TODO()
10077		}
10078		res, err = rx.Upload(ctx)
10079		if err != nil {
10080			return nil, err
10081		}
10082		defer res.Body.Close()
10083		if err := googleapi.CheckResponse(res); err != nil {
10084			return nil, err
10085		}
10086	}
10087	ret := &Object{
10088		ServerResponse: googleapi.ServerResponse{
10089			Header:         res.Header,
10090			HTTPStatusCode: res.StatusCode,
10091		},
10092	}
10093	target := &ret
10094	if err := gensupport.DecodeResponse(target, res); err != nil {
10095		return nil, err
10096	}
10097	return ret, nil
10098	// {
10099	//   "description": "Stores a new object and metadata.",
10100	//   "httpMethod": "POST",
10101	//   "id": "storage.objects.insert",
10102	//   "mediaUpload": {
10103	//     "accept": [
10104	//       "*/*"
10105	//     ],
10106	//     "protocols": {
10107	//       "resumable": {
10108	//         "multipart": true,
10109	//         "path": "/resumable/upload/storage/v1/b/{bucket}/o"
10110	//       },
10111	//       "simple": {
10112	//         "multipart": true,
10113	//         "path": "/upload/storage/v1/b/{bucket}/o"
10114	//       }
10115	//     }
10116	//   },
10117	//   "parameterOrder": [
10118	//     "bucket"
10119	//   ],
10120	//   "parameters": {
10121	//     "bucket": {
10122	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
10123	//       "location": "path",
10124	//       "required": true,
10125	//       "type": "string"
10126	//     },
10127	//     "contentEncoding": {
10128	//       "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.",
10129	//       "location": "query",
10130	//       "type": "string"
10131	//     },
10132	//     "ifGenerationMatch": {
10133	//       "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.",
10134	//       "format": "int64",
10135	//       "location": "query",
10136	//       "type": "string"
10137	//     },
10138	//     "ifGenerationNotMatch": {
10139	//       "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.",
10140	//       "format": "int64",
10141	//       "location": "query",
10142	//       "type": "string"
10143	//     },
10144	//     "ifMetagenerationMatch": {
10145	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10146	//       "format": "int64",
10147	//       "location": "query",
10148	//       "type": "string"
10149	//     },
10150	//     "ifMetagenerationNotMatch": {
10151	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10152	//       "format": "int64",
10153	//       "location": "query",
10154	//       "type": "string"
10155	//     },
10156	//     "kmsKeyName": {
10157	//       "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.",
10158	//       "location": "query",
10159	//       "type": "string"
10160	//     },
10161	//     "name": {
10162	//       "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.",
10163	//       "location": "query",
10164	//       "type": "string"
10165	//     },
10166	//     "predefinedAcl": {
10167	//       "description": "Apply a predefined set of access controls to this object.",
10168	//       "enum": [
10169	//         "authenticatedRead",
10170	//         "bucketOwnerFullControl",
10171	//         "bucketOwnerRead",
10172	//         "private",
10173	//         "projectPrivate",
10174	//         "publicRead"
10175	//       ],
10176	//       "enumDescriptions": [
10177	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10178	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
10179	//         "Object owner gets OWNER access, and project team owners get READER access.",
10180	//         "Object owner gets OWNER access.",
10181	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
10182	//         "Object owner gets OWNER access, and allUsers get READER access."
10183	//       ],
10184	//       "location": "query",
10185	//       "type": "string"
10186	//     },
10187	//     "projection": {
10188	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
10189	//       "enum": [
10190	//         "full",
10191	//         "noAcl"
10192	//       ],
10193	//       "enumDescriptions": [
10194	//         "Include all properties.",
10195	//         "Omit the owner, acl property."
10196	//       ],
10197	//       "location": "query",
10198	//       "type": "string"
10199	//     },
10200	//     "provisionalUserProject": {
10201	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10202	//       "location": "query",
10203	//       "type": "string"
10204	//     },
10205	//     "userProject": {
10206	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10207	//       "location": "query",
10208	//       "type": "string"
10209	//     }
10210	//   },
10211	//   "path": "b/{bucket}/o",
10212	//   "request": {
10213	//     "$ref": "Object"
10214	//   },
10215	//   "response": {
10216	//     "$ref": "Object"
10217	//   },
10218	//   "scopes": [
10219	//     "https://www.googleapis.com/auth/cloud-platform",
10220	//     "https://www.googleapis.com/auth/devstorage.full_control",
10221	//     "https://www.googleapis.com/auth/devstorage.read_write"
10222	//   ],
10223	//   "supportsMediaUpload": true
10224	// }
10225
10226}
10227
10228// method id "storage.objects.list":
10229
10230type ObjectsListCall struct {
10231	s            *Service
10232	bucket       string
10233	urlParams_   gensupport.URLParams
10234	ifNoneMatch_ string
10235	ctx_         context.Context
10236	header_      http.Header
10237}
10238
10239// List: Retrieves a list of objects matching the criteria.
10240func (r *ObjectsService) List(bucket string) *ObjectsListCall {
10241	c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10242	c.bucket = bucket
10243	return c
10244}
10245
10246// Delimiter sets the optional parameter "delimiter": Returns results in
10247// a directory-like mode. items will contain only objects whose names,
10248// aside from the prefix, do not contain delimiter. Objects whose names,
10249// aside from the prefix, contain delimiter will have their name,
10250// truncated after the delimiter, returned in prefixes. Duplicate
10251// prefixes are omitted.
10252func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
10253	c.urlParams_.Set("delimiter", delimiter)
10254	return c
10255}
10256
10257// IncludeTrailingDelimiter sets the optional parameter
10258// "includeTrailingDelimiter": If true, objects that end in exactly one
10259// instance of delimiter will have their metadata included in items in
10260// addition to prefixes.
10261func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall {
10262	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
10263	return c
10264}
10265
10266// MaxResults sets the optional parameter "maxResults": Maximum number
10267// of items plus prefixes to return in a single page of responses. As
10268// duplicate prefixes are omitted, fewer total results may be returned
10269// than requested. The service will use this parameter or 1,000 items,
10270// whichever is smaller.
10271func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
10272	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
10273	return c
10274}
10275
10276// PageToken sets the optional parameter "pageToken": A
10277// previously-returned page token representing part of the larger set of
10278// results to view.
10279func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
10280	c.urlParams_.Set("pageToken", pageToken)
10281	return c
10282}
10283
10284// Prefix sets the optional parameter "prefix": Filter results to
10285// objects whose names begin with this prefix.
10286func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
10287	c.urlParams_.Set("prefix", prefix)
10288	return c
10289}
10290
10291// Projection sets the optional parameter "projection": Set of
10292// properties to return. Defaults to noAcl.
10293//
10294// Possible values:
10295//   "full" - Include all properties.
10296//   "noAcl" - Omit the owner, acl property.
10297func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
10298	c.urlParams_.Set("projection", projection)
10299	return c
10300}
10301
10302// ProvisionalUserProject sets the optional parameter
10303// "provisionalUserProject": The project to be billed for this request
10304// if the target bucket is requester-pays bucket.
10305func (c *ObjectsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsListCall {
10306	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
10307	return c
10308}
10309
10310// UserProject sets the optional parameter "userProject": The project to
10311// be billed for this request. Required for Requester Pays buckets.
10312func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
10313	c.urlParams_.Set("userProject", userProject)
10314	return c
10315}
10316
10317// Versions sets the optional parameter "versions": If true, lists all
10318// versions of an object as distinct results. The default is false. For
10319// more information, see Object Versioning.
10320func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
10321	c.urlParams_.Set("versions", fmt.Sprint(versions))
10322	return c
10323}
10324
10325// Fields allows partial responses to be retrieved. See
10326// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10327// for more information.
10328func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
10329	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10330	return c
10331}
10332
10333// IfNoneMatch sets the optional parameter which makes the operation
10334// fail if the object's ETag matches the given value. This is useful for
10335// getting updates only after the object has changed since the last
10336// request. Use googleapi.IsNotModified to check whether the response
10337// error from Do is the result of In-None-Match.
10338func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
10339	c.ifNoneMatch_ = entityTag
10340	return c
10341}
10342
10343// Context sets the context to be used in this call's Do method. Any
10344// pending HTTP request will be aborted if the provided context is
10345// canceled.
10346func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
10347	c.ctx_ = ctx
10348	return c
10349}
10350
10351// Header returns an http.Header that can be modified by the caller to
10352// add HTTP headers to the request.
10353func (c *ObjectsListCall) Header() http.Header {
10354	if c.header_ == nil {
10355		c.header_ = make(http.Header)
10356	}
10357	return c.header_
10358}
10359
10360func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
10361	reqHeaders := make(http.Header)
10362	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
10363	for k, v := range c.header_ {
10364		reqHeaders[k] = v
10365	}
10366	reqHeaders.Set("User-Agent", c.s.userAgent())
10367	if c.ifNoneMatch_ != "" {
10368		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10369	}
10370	var body io.Reader = nil
10371	c.urlParams_.Set("alt", alt)
10372	c.urlParams_.Set("prettyPrint", "false")
10373	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
10374	urls += "?" + c.urlParams_.Encode()
10375	req, err := http.NewRequest("GET", urls, body)
10376	if err != nil {
10377		return nil, err
10378	}
10379	req.Header = reqHeaders
10380	googleapi.Expand(req.URL, map[string]string{
10381		"bucket": c.bucket,
10382	})
10383	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10384}
10385
10386// Do executes the "storage.objects.list" call.
10387// Exactly one of *Objects or error will be non-nil. Any non-2xx status
10388// code is an error. Response headers are in either
10389// *Objects.ServerResponse.Header or (if a response was returned at all)
10390// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10391// check whether the returned error was because http.StatusNotModified
10392// was returned.
10393func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
10394	gensupport.SetOptions(c.urlParams_, opts...)
10395	res, err := c.doRequest("json")
10396	if res != nil && res.StatusCode == http.StatusNotModified {
10397		if res.Body != nil {
10398			res.Body.Close()
10399		}
10400		return nil, &googleapi.Error{
10401			Code:   res.StatusCode,
10402			Header: res.Header,
10403		}
10404	}
10405	if err != nil {
10406		return nil, err
10407	}
10408	defer googleapi.CloseBody(res)
10409	if err := googleapi.CheckResponse(res); err != nil {
10410		return nil, err
10411	}
10412	ret := &Objects{
10413		ServerResponse: googleapi.ServerResponse{
10414			Header:         res.Header,
10415			HTTPStatusCode: res.StatusCode,
10416		},
10417	}
10418	target := &ret
10419	if err := gensupport.DecodeResponse(target, res); err != nil {
10420		return nil, err
10421	}
10422	return ret, nil
10423	// {
10424	//   "description": "Retrieves a list of objects matching the criteria.",
10425	//   "httpMethod": "GET",
10426	//   "id": "storage.objects.list",
10427	//   "parameterOrder": [
10428	//     "bucket"
10429	//   ],
10430	//   "parameters": {
10431	//     "bucket": {
10432	//       "description": "Name of the bucket in which to look for objects.",
10433	//       "location": "path",
10434	//       "required": true,
10435	//       "type": "string"
10436	//     },
10437	//     "delimiter": {
10438	//       "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.",
10439	//       "location": "query",
10440	//       "type": "string"
10441	//     },
10442	//     "includeTrailingDelimiter": {
10443	//       "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
10444	//       "location": "query",
10445	//       "type": "boolean"
10446	//     },
10447	//     "maxResults": {
10448	//       "default": "1000",
10449	//       "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.",
10450	//       "format": "uint32",
10451	//       "location": "query",
10452	//       "minimum": "0",
10453	//       "type": "integer"
10454	//     },
10455	//     "pageToken": {
10456	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
10457	//       "location": "query",
10458	//       "type": "string"
10459	//     },
10460	//     "prefix": {
10461	//       "description": "Filter results to objects whose names begin with this prefix.",
10462	//       "location": "query",
10463	//       "type": "string"
10464	//     },
10465	//     "projection": {
10466	//       "description": "Set of properties to return. Defaults to noAcl.",
10467	//       "enum": [
10468	//         "full",
10469	//         "noAcl"
10470	//       ],
10471	//       "enumDescriptions": [
10472	//         "Include all properties.",
10473	//         "Omit the owner, acl property."
10474	//       ],
10475	//       "location": "query",
10476	//       "type": "string"
10477	//     },
10478	//     "provisionalUserProject": {
10479	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10480	//       "location": "query",
10481	//       "type": "string"
10482	//     },
10483	//     "userProject": {
10484	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10485	//       "location": "query",
10486	//       "type": "string"
10487	//     },
10488	//     "versions": {
10489	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
10490	//       "location": "query",
10491	//       "type": "boolean"
10492	//     }
10493	//   },
10494	//   "path": "b/{bucket}/o",
10495	//   "response": {
10496	//     "$ref": "Objects"
10497	//   },
10498	//   "scopes": [
10499	//     "https://www.googleapis.com/auth/cloud-platform",
10500	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10501	//     "https://www.googleapis.com/auth/devstorage.full_control",
10502	//     "https://www.googleapis.com/auth/devstorage.read_only",
10503	//     "https://www.googleapis.com/auth/devstorage.read_write"
10504	//   ],
10505	//   "supportsSubscription": true
10506	// }
10507
10508}
10509
10510// Pages invokes f for each page of results.
10511// A non-nil error returned from f will halt the iteration.
10512// The provided context supersedes any context provided to the Context method.
10513func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
10514	c.ctx_ = ctx
10515	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
10516	for {
10517		x, err := c.Do()
10518		if err != nil {
10519			return err
10520		}
10521		if err := f(x); err != nil {
10522			return err
10523		}
10524		if x.NextPageToken == "" {
10525			return nil
10526		}
10527		c.PageToken(x.NextPageToken)
10528	}
10529}
10530
10531// method id "storage.objects.patch":
10532
10533type ObjectsPatchCall struct {
10534	s          *Service
10535	bucket     string
10536	object     string
10537	object2    *Object
10538	urlParams_ gensupport.URLParams
10539	ctx_       context.Context
10540	header_    http.Header
10541}
10542
10543// Patch: Patches an object's metadata.
10544func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
10545	c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10546	c.bucket = bucket
10547	c.object = object
10548	c.object2 = object2
10549	return c
10550}
10551
10552// Generation sets the optional parameter "generation": If present,
10553// selects a specific revision of this object (as opposed to the latest
10554// version, the default).
10555func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
10556	c.urlParams_.Set("generation", fmt.Sprint(generation))
10557	return c
10558}
10559
10560// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10561// Makes the operation conditional on whether the object's current
10562// generation matches the given value. Setting to 0 makes the operation
10563// succeed only if there are no live versions of the object.
10564func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
10565	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10566	return c
10567}
10568
10569// IfGenerationNotMatch sets the optional parameter
10570// "ifGenerationNotMatch": Makes the operation conditional on whether
10571// the object's current generation does not match the given value. If no
10572// live object exists, the precondition fails. Setting to 0 makes the
10573// operation succeed only if there is a live version of the object.
10574func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
10575	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10576	return c
10577}
10578
10579// IfMetagenerationMatch sets the optional parameter
10580// "ifMetagenerationMatch": Makes the operation conditional on whether
10581// the object's current metageneration matches the given value.
10582func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall {
10583	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10584	return c
10585}
10586
10587// IfMetagenerationNotMatch sets the optional parameter
10588// "ifMetagenerationNotMatch": Makes the operation conditional on
10589// whether the object's current metageneration does not match the given
10590// value.
10591func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
10592	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10593	return c
10594}
10595
10596// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
10597// predefined set of access controls to this object.
10598//
10599// Possible values:
10600//   "authenticatedRead" - Object owner gets OWNER access, and
10601// allAuthenticatedUsers get READER access.
10602//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
10603// project team owners get OWNER access.
10604//   "bucketOwnerRead" - Object owner gets OWNER access, and project
10605// team owners get READER access.
10606//   "private" - Object owner gets OWNER access.
10607//   "projectPrivate" - Object owner gets OWNER access, and project team
10608// members get access according to their roles.
10609//   "publicRead" - Object owner gets OWNER access, and allUsers get
10610// READER access.
10611func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
10612	c.urlParams_.Set("predefinedAcl", predefinedAcl)
10613	return c
10614}
10615
10616// Projection sets the optional parameter "projection": Set of
10617// properties to return. Defaults to full.
10618//
10619// Possible values:
10620//   "full" - Include all properties.
10621//   "noAcl" - Omit the owner, acl property.
10622func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
10623	c.urlParams_.Set("projection", projection)
10624	return c
10625}
10626
10627// ProvisionalUserProject sets the optional parameter
10628// "provisionalUserProject": The project to be billed for this request
10629// if the target bucket is requester-pays bucket.
10630func (c *ObjectsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsPatchCall {
10631	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
10632	return c
10633}
10634
10635// UserProject sets the optional parameter "userProject": The project to
10636// be billed for this request, for Requester Pays buckets.
10637func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
10638	c.urlParams_.Set("userProject", userProject)
10639	return c
10640}
10641
10642// Fields allows partial responses to be retrieved. See
10643// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10644// for more information.
10645func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
10646	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10647	return c
10648}
10649
10650// Context sets the context to be used in this call's Do method. Any
10651// pending HTTP request will be aborted if the provided context is
10652// canceled.
10653func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
10654	c.ctx_ = ctx
10655	return c
10656}
10657
10658// Header returns an http.Header that can be modified by the caller to
10659// add HTTP headers to the request.
10660func (c *ObjectsPatchCall) Header() http.Header {
10661	if c.header_ == nil {
10662		c.header_ = make(http.Header)
10663	}
10664	return c.header_
10665}
10666
10667func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
10668	reqHeaders := make(http.Header)
10669	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
10670	for k, v := range c.header_ {
10671		reqHeaders[k] = v
10672	}
10673	reqHeaders.Set("User-Agent", c.s.userAgent())
10674	var body io.Reader = nil
10675	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
10676	if err != nil {
10677		return nil, err
10678	}
10679	reqHeaders.Set("Content-Type", "application/json")
10680	c.urlParams_.Set("alt", alt)
10681	c.urlParams_.Set("prettyPrint", "false")
10682	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
10683	urls += "?" + c.urlParams_.Encode()
10684	req, err := http.NewRequest("PATCH", urls, body)
10685	if err != nil {
10686		return nil, err
10687	}
10688	req.Header = reqHeaders
10689	googleapi.Expand(req.URL, map[string]string{
10690		"bucket": c.bucket,
10691		"object": c.object,
10692	})
10693	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10694}
10695
10696// Do executes the "storage.objects.patch" call.
10697// Exactly one of *Object or error will be non-nil. Any non-2xx status
10698// code is an error. Response headers are in either
10699// *Object.ServerResponse.Header or (if a response was returned at all)
10700// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10701// check whether the returned error was because http.StatusNotModified
10702// was returned.
10703func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
10704	gensupport.SetOptions(c.urlParams_, opts...)
10705	res, err := c.doRequest("json")
10706	if res != nil && res.StatusCode == http.StatusNotModified {
10707		if res.Body != nil {
10708			res.Body.Close()
10709		}
10710		return nil, &googleapi.Error{
10711			Code:   res.StatusCode,
10712			Header: res.Header,
10713		}
10714	}
10715	if err != nil {
10716		return nil, err
10717	}
10718	defer googleapi.CloseBody(res)
10719	if err := googleapi.CheckResponse(res); err != nil {
10720		return nil, err
10721	}
10722	ret := &Object{
10723		ServerResponse: googleapi.ServerResponse{
10724			Header:         res.Header,
10725			HTTPStatusCode: res.StatusCode,
10726		},
10727	}
10728	target := &ret
10729	if err := gensupport.DecodeResponse(target, res); err != nil {
10730		return nil, err
10731	}
10732	return ret, nil
10733	// {
10734	//   "description": "Patches an object's metadata.",
10735	//   "httpMethod": "PATCH",
10736	//   "id": "storage.objects.patch",
10737	//   "parameterOrder": [
10738	//     "bucket",
10739	//     "object"
10740	//   ],
10741	//   "parameters": {
10742	//     "bucket": {
10743	//       "description": "Name of the bucket in which the object resides.",
10744	//       "location": "path",
10745	//       "required": true,
10746	//       "type": "string"
10747	//     },
10748	//     "generation": {
10749	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10750	//       "format": "int64",
10751	//       "location": "query",
10752	//       "type": "string"
10753	//     },
10754	//     "ifGenerationMatch": {
10755	//       "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.",
10756	//       "format": "int64",
10757	//       "location": "query",
10758	//       "type": "string"
10759	//     },
10760	//     "ifGenerationNotMatch": {
10761	//       "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.",
10762	//       "format": "int64",
10763	//       "location": "query",
10764	//       "type": "string"
10765	//     },
10766	//     "ifMetagenerationMatch": {
10767	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10768	//       "format": "int64",
10769	//       "location": "query",
10770	//       "type": "string"
10771	//     },
10772	//     "ifMetagenerationNotMatch": {
10773	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10774	//       "format": "int64",
10775	//       "location": "query",
10776	//       "type": "string"
10777	//     },
10778	//     "object": {
10779	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10780	//       "location": "path",
10781	//       "required": true,
10782	//       "type": "string"
10783	//     },
10784	//     "predefinedAcl": {
10785	//       "description": "Apply a predefined set of access controls to this object.",
10786	//       "enum": [
10787	//         "authenticatedRead",
10788	//         "bucketOwnerFullControl",
10789	//         "bucketOwnerRead",
10790	//         "private",
10791	//         "projectPrivate",
10792	//         "publicRead"
10793	//       ],
10794	//       "enumDescriptions": [
10795	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10796	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
10797	//         "Object owner gets OWNER access, and project team owners get READER access.",
10798	//         "Object owner gets OWNER access.",
10799	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
10800	//         "Object owner gets OWNER access, and allUsers get READER access."
10801	//       ],
10802	//       "location": "query",
10803	//       "type": "string"
10804	//     },
10805	//     "projection": {
10806	//       "description": "Set of properties to return. Defaults to full.",
10807	//       "enum": [
10808	//         "full",
10809	//         "noAcl"
10810	//       ],
10811	//       "enumDescriptions": [
10812	//         "Include all properties.",
10813	//         "Omit the owner, acl property."
10814	//       ],
10815	//       "location": "query",
10816	//       "type": "string"
10817	//     },
10818	//     "provisionalUserProject": {
10819	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10820	//       "location": "query",
10821	//       "type": "string"
10822	//     },
10823	//     "userProject": {
10824	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
10825	//       "location": "query",
10826	//       "type": "string"
10827	//     }
10828	//   },
10829	//   "path": "b/{bucket}/o/{object}",
10830	//   "request": {
10831	//     "$ref": "Object"
10832	//   },
10833	//   "response": {
10834	//     "$ref": "Object"
10835	//   },
10836	//   "scopes": [
10837	//     "https://www.googleapis.com/auth/cloud-platform",
10838	//     "https://www.googleapis.com/auth/devstorage.full_control"
10839	//   ]
10840	// }
10841
10842}
10843
10844// method id "storage.objects.rewrite":
10845
10846type ObjectsRewriteCall struct {
10847	s                 *Service
10848	sourceBucket      string
10849	sourceObject      string
10850	destinationBucket string
10851	destinationObject string
10852	object            *Object
10853	urlParams_        gensupport.URLParams
10854	ctx_              context.Context
10855	header_           http.Header
10856}
10857
10858// Rewrite: Rewrites a source object to a destination object. Optionally
10859// overrides metadata.
10860func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall {
10861	c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10862	c.sourceBucket = sourceBucket
10863	c.sourceObject = sourceObject
10864	c.destinationBucket = destinationBucket
10865	c.destinationObject = destinationObject
10866	c.object = object
10867	return c
10868}
10869
10870// DestinationKmsKeyName sets the optional parameter
10871// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the
10872// form
10873// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
10874//  that will be used to encrypt the object. Overrides the object
10875// metadata's kms_key_name value, if any.
10876func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall {
10877	c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
10878	return c
10879}
10880
10881// DestinationPredefinedAcl sets the optional parameter
10882// "destinationPredefinedAcl": Apply a predefined set of access controls
10883// to the destination object.
10884//
10885// Possible values:
10886//   "authenticatedRead" - Object owner gets OWNER access, and
10887// allAuthenticatedUsers get READER access.
10888//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
10889// project team owners get OWNER access.
10890//   "bucketOwnerRead" - Object owner gets OWNER access, and project
10891// team owners get READER access.
10892//   "private" - Object owner gets OWNER access.
10893//   "projectPrivate" - Object owner gets OWNER access, and project team
10894// members get access according to their roles.
10895//   "publicRead" - Object owner gets OWNER access, and allUsers get
10896// READER access.
10897func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
10898	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
10899	return c
10900}
10901
10902// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10903// Makes the operation conditional on whether the object's current
10904// generation matches the given value. Setting to 0 makes the operation
10905// succeed only if there are no live versions of the object.
10906func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
10907	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10908	return c
10909}
10910
10911// IfGenerationNotMatch sets the optional parameter
10912// "ifGenerationNotMatch": Makes the operation conditional on whether
10913// the object's current generation does not match the given value. If no
10914// live object exists, the precondition fails. Setting to 0 makes the
10915// operation succeed only if there is a live version of the object.
10916func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
10917	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10918	return c
10919}
10920
10921// IfMetagenerationMatch sets the optional parameter
10922// "ifMetagenerationMatch": Makes the operation conditional on whether
10923// the destination object's current metageneration matches the given
10924// value.
10925func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
10926	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10927	return c
10928}
10929
10930// IfMetagenerationNotMatch sets the optional parameter
10931// "ifMetagenerationNotMatch": Makes the operation conditional on
10932// whether the destination object's current metageneration does not
10933// match the given value.
10934func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall {
10935	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10936	return c
10937}
10938
10939// IfSourceGenerationMatch sets the optional parameter
10940// "ifSourceGenerationMatch": Makes the operation conditional on whether
10941// the source object's current generation matches the given value.
10942func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
10943	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
10944	return c
10945}
10946
10947// IfSourceGenerationNotMatch sets the optional parameter
10948// "ifSourceGenerationNotMatch": Makes the operation conditional on
10949// whether the source object's current generation does not match the
10950// given value.
10951func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
10952	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
10953	return c
10954}
10955
10956// IfSourceMetagenerationMatch sets the optional parameter
10957// "ifSourceMetagenerationMatch": Makes the operation conditional on
10958// whether the source object's current metageneration matches the given
10959// value.
10960func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
10961	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
10962	return c
10963}
10964
10965// IfSourceMetagenerationNotMatch sets the optional parameter
10966// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
10967// whether the source object's current metageneration does not match the
10968// given value.
10969func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
10970	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
10971	return c
10972}
10973
10974// MaxBytesRewrittenPerCall sets the optional parameter
10975// "maxBytesRewrittenPerCall": The maximum number of bytes that will be
10976// rewritten per rewrite request. Most callers shouldn't need to specify
10977// this parameter - it is primarily in place to support testing. If
10978// specified the value must be an integral multiple of 1 MiB (1048576).
10979// Also, this only applies to requests where the source and destination
10980// span locations and/or storage classes. Finally, this value must not
10981// change across rewrite calls else you'll get an error that the
10982// rewriteToken is invalid.
10983func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall {
10984	c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall))
10985	return c
10986}
10987
10988// Projection sets the optional parameter "projection": Set of
10989// properties to return. Defaults to noAcl, unless the object resource
10990// specifies the acl property, when it defaults to full.
10991//
10992// Possible values:
10993//   "full" - Include all properties.
10994//   "noAcl" - Omit the owner, acl property.
10995func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall {
10996	c.urlParams_.Set("projection", projection)
10997	return c
10998}
10999
11000// ProvisionalUserProject sets the optional parameter
11001// "provisionalUserProject": The project to be billed for this request
11002// if the target bucket is requester-pays bucket.
11003func (c *ObjectsRewriteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsRewriteCall {
11004	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11005	return c
11006}
11007
11008// RewriteToken sets the optional parameter "rewriteToken": Include this
11009// field (from the previous rewrite response) on each rewrite request
11010// after the first one, until the rewrite response 'done' flag is true.
11011// Calls that provide a rewriteToken can omit all other request fields,
11012// but if included those fields must match the values provided in the
11013// first rewrite request.
11014func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall {
11015	c.urlParams_.Set("rewriteToken", rewriteToken)
11016	return c
11017}
11018
11019// SourceGeneration sets the optional parameter "sourceGeneration": If
11020// present, selects a specific revision of the source object (as opposed
11021// to the latest version, the default).
11022func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall {
11023	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
11024	return c
11025}
11026
11027// UserProject sets the optional parameter "userProject": The project to
11028// be billed for this request. Required for Requester Pays buckets.
11029func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
11030	c.urlParams_.Set("userProject", userProject)
11031	return c
11032}
11033
11034// Fields allows partial responses to be retrieved. See
11035// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11036// for more information.
11037func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall {
11038	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11039	return c
11040}
11041
11042// Context sets the context to be used in this call's Do method. Any
11043// pending HTTP request will be aborted if the provided context is
11044// canceled.
11045func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
11046	c.ctx_ = ctx
11047	return c
11048}
11049
11050// Header returns an http.Header that can be modified by the caller to
11051// add HTTP headers to the request.
11052func (c *ObjectsRewriteCall) Header() http.Header {
11053	if c.header_ == nil {
11054		c.header_ = make(http.Header)
11055	}
11056	return c.header_
11057}
11058
11059func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
11060	reqHeaders := make(http.Header)
11061	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
11062	for k, v := range c.header_ {
11063		reqHeaders[k] = v
11064	}
11065	reqHeaders.Set("User-Agent", c.s.userAgent())
11066	var body io.Reader = nil
11067	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
11068	if err != nil {
11069		return nil, err
11070	}
11071	reqHeaders.Set("Content-Type", "application/json")
11072	c.urlParams_.Set("alt", alt)
11073	c.urlParams_.Set("prettyPrint", "false")
11074	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}")
11075	urls += "?" + c.urlParams_.Encode()
11076	req, err := http.NewRequest("POST", urls, body)
11077	if err != nil {
11078		return nil, err
11079	}
11080	req.Header = reqHeaders
11081	googleapi.Expand(req.URL, map[string]string{
11082		"sourceBucket":      c.sourceBucket,
11083		"sourceObject":      c.sourceObject,
11084		"destinationBucket": c.destinationBucket,
11085		"destinationObject": c.destinationObject,
11086	})
11087	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11088}
11089
11090// Do executes the "storage.objects.rewrite" call.
11091// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx
11092// status code is an error. Response headers are in either
11093// *RewriteResponse.ServerResponse.Header or (if a response was returned
11094// at all) in error.(*googleapi.Error).Header. Use
11095// googleapi.IsNotModified to check whether the returned error was
11096// because http.StatusNotModified was returned.
11097func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) {
11098	gensupport.SetOptions(c.urlParams_, opts...)
11099	res, err := c.doRequest("json")
11100	if res != nil && res.StatusCode == http.StatusNotModified {
11101		if res.Body != nil {
11102			res.Body.Close()
11103		}
11104		return nil, &googleapi.Error{
11105			Code:   res.StatusCode,
11106			Header: res.Header,
11107		}
11108	}
11109	if err != nil {
11110		return nil, err
11111	}
11112	defer googleapi.CloseBody(res)
11113	if err := googleapi.CheckResponse(res); err != nil {
11114		return nil, err
11115	}
11116	ret := &RewriteResponse{
11117		ServerResponse: googleapi.ServerResponse{
11118			Header:         res.Header,
11119			HTTPStatusCode: res.StatusCode,
11120		},
11121	}
11122	target := &ret
11123	if err := gensupport.DecodeResponse(target, res); err != nil {
11124		return nil, err
11125	}
11126	return ret, nil
11127	// {
11128	//   "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
11129	//   "httpMethod": "POST",
11130	//   "id": "storage.objects.rewrite",
11131	//   "parameterOrder": [
11132	//     "sourceBucket",
11133	//     "sourceObject",
11134	//     "destinationBucket",
11135	//     "destinationObject"
11136	//   ],
11137	//   "parameters": {
11138	//     "destinationBucket": {
11139	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
11140	//       "location": "path",
11141	//       "required": true,
11142	//       "type": "string"
11143	//     },
11144	//     "destinationKmsKeyName": {
11145	//       "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.",
11146	//       "location": "query",
11147	//       "type": "string"
11148	//     },
11149	//     "destinationObject": {
11150	//       "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.",
11151	//       "location": "path",
11152	//       "required": true,
11153	//       "type": "string"
11154	//     },
11155	//     "destinationPredefinedAcl": {
11156	//       "description": "Apply a predefined set of access controls to the destination object.",
11157	//       "enum": [
11158	//         "authenticatedRead",
11159	//         "bucketOwnerFullControl",
11160	//         "bucketOwnerRead",
11161	//         "private",
11162	//         "projectPrivate",
11163	//         "publicRead"
11164	//       ],
11165	//       "enumDescriptions": [
11166	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
11167	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
11168	//         "Object owner gets OWNER access, and project team owners get READER access.",
11169	//         "Object owner gets OWNER access.",
11170	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
11171	//         "Object owner gets OWNER access, and allUsers get READER access."
11172	//       ],
11173	//       "location": "query",
11174	//       "type": "string"
11175	//     },
11176	//     "ifGenerationMatch": {
11177	//       "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.",
11178	//       "format": "int64",
11179	//       "location": "query",
11180	//       "type": "string"
11181	//     },
11182	//     "ifGenerationNotMatch": {
11183	//       "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.",
11184	//       "format": "int64",
11185	//       "location": "query",
11186	//       "type": "string"
11187	//     },
11188	//     "ifMetagenerationMatch": {
11189	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
11190	//       "format": "int64",
11191	//       "location": "query",
11192	//       "type": "string"
11193	//     },
11194	//     "ifMetagenerationNotMatch": {
11195	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
11196	//       "format": "int64",
11197	//       "location": "query",
11198	//       "type": "string"
11199	//     },
11200	//     "ifSourceGenerationMatch": {
11201	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
11202	//       "format": "int64",
11203	//       "location": "query",
11204	//       "type": "string"
11205	//     },
11206	//     "ifSourceGenerationNotMatch": {
11207	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
11208	//       "format": "int64",
11209	//       "location": "query",
11210	//       "type": "string"
11211	//     },
11212	//     "ifSourceMetagenerationMatch": {
11213	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
11214	//       "format": "int64",
11215	//       "location": "query",
11216	//       "type": "string"
11217	//     },
11218	//     "ifSourceMetagenerationNotMatch": {
11219	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
11220	//       "format": "int64",
11221	//       "location": "query",
11222	//       "type": "string"
11223	//     },
11224	//     "maxBytesRewrittenPerCall": {
11225	//       "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.",
11226	//       "format": "int64",
11227	//       "location": "query",
11228	//       "type": "string"
11229	//     },
11230	//     "projection": {
11231	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
11232	//       "enum": [
11233	//         "full",
11234	//         "noAcl"
11235	//       ],
11236	//       "enumDescriptions": [
11237	//         "Include all properties.",
11238	//         "Omit the owner, acl property."
11239	//       ],
11240	//       "location": "query",
11241	//       "type": "string"
11242	//     },
11243	//     "provisionalUserProject": {
11244	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11245	//       "location": "query",
11246	//       "type": "string"
11247	//     },
11248	//     "rewriteToken": {
11249	//       "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.",
11250	//       "location": "query",
11251	//       "type": "string"
11252	//     },
11253	//     "sourceBucket": {
11254	//       "description": "Name of the bucket in which to find the source object.",
11255	//       "location": "path",
11256	//       "required": true,
11257	//       "type": "string"
11258	//     },
11259	//     "sourceGeneration": {
11260	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
11261	//       "format": "int64",
11262	//       "location": "query",
11263	//       "type": "string"
11264	//     },
11265	//     "sourceObject": {
11266	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11267	//       "location": "path",
11268	//       "required": true,
11269	//       "type": "string"
11270	//     },
11271	//     "userProject": {
11272	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11273	//       "location": "query",
11274	//       "type": "string"
11275	//     }
11276	//   },
11277	//   "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
11278	//   "request": {
11279	//     "$ref": "Object"
11280	//   },
11281	//   "response": {
11282	//     "$ref": "RewriteResponse"
11283	//   },
11284	//   "scopes": [
11285	//     "https://www.googleapis.com/auth/cloud-platform",
11286	//     "https://www.googleapis.com/auth/devstorage.full_control",
11287	//     "https://www.googleapis.com/auth/devstorage.read_write"
11288	//   ]
11289	// }
11290
11291}
11292
11293// method id "storage.objects.setIamPolicy":
11294
11295type ObjectsSetIamPolicyCall struct {
11296	s          *Service
11297	bucket     string
11298	object     string
11299	policy     *Policy
11300	urlParams_ gensupport.URLParams
11301	ctx_       context.Context
11302	header_    http.Header
11303}
11304
11305// SetIamPolicy: Updates an IAM policy for the specified object.
11306func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall {
11307	c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11308	c.bucket = bucket
11309	c.object = object
11310	c.policy = policy
11311	return c
11312}
11313
11314// Generation sets the optional parameter "generation": If present,
11315// selects a specific revision of this object (as opposed to the latest
11316// version, the default).
11317func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall {
11318	c.urlParams_.Set("generation", fmt.Sprint(generation))
11319	return c
11320}
11321
11322// ProvisionalUserProject sets the optional parameter
11323// "provisionalUserProject": The project to be billed for this request
11324// if the target bucket is requester-pays bucket.
11325func (c *ObjectsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsSetIamPolicyCall {
11326	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11327	return c
11328}
11329
11330// UserProject sets the optional parameter "userProject": The project to
11331// be billed for this request. Required for Requester Pays buckets.
11332func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
11333	c.urlParams_.Set("userProject", userProject)
11334	return c
11335}
11336
11337// Fields allows partial responses to be retrieved. See
11338// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11339// for more information.
11340func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall {
11341	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11342	return c
11343}
11344
11345// Context sets the context to be used in this call's Do method. Any
11346// pending HTTP request will be aborted if the provided context is
11347// canceled.
11348func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
11349	c.ctx_ = ctx
11350	return c
11351}
11352
11353// Header returns an http.Header that can be modified by the caller to
11354// add HTTP headers to the request.
11355func (c *ObjectsSetIamPolicyCall) Header() http.Header {
11356	if c.header_ == nil {
11357		c.header_ = make(http.Header)
11358	}
11359	return c.header_
11360}
11361
11362func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11363	reqHeaders := make(http.Header)
11364	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
11365	for k, v := range c.header_ {
11366		reqHeaders[k] = v
11367	}
11368	reqHeaders.Set("User-Agent", c.s.userAgent())
11369	var body io.Reader = nil
11370	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
11371	if err != nil {
11372		return nil, err
11373	}
11374	reqHeaders.Set("Content-Type", "application/json")
11375	c.urlParams_.Set("alt", alt)
11376	c.urlParams_.Set("prettyPrint", "false")
11377	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
11378	urls += "?" + c.urlParams_.Encode()
11379	req, err := http.NewRequest("PUT", urls, body)
11380	if err != nil {
11381		return nil, err
11382	}
11383	req.Header = reqHeaders
11384	googleapi.Expand(req.URL, map[string]string{
11385		"bucket": c.bucket,
11386		"object": c.object,
11387	})
11388	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11389}
11390
11391// Do executes the "storage.objects.setIamPolicy" call.
11392// Exactly one of *Policy or error will be non-nil. Any non-2xx status
11393// code is an error. Response headers are in either
11394// *Policy.ServerResponse.Header or (if a response was returned at all)
11395// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11396// check whether the returned error was because http.StatusNotModified
11397// was returned.
11398func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11399	gensupport.SetOptions(c.urlParams_, opts...)
11400	res, err := c.doRequest("json")
11401	if res != nil && res.StatusCode == http.StatusNotModified {
11402		if res.Body != nil {
11403			res.Body.Close()
11404		}
11405		return nil, &googleapi.Error{
11406			Code:   res.StatusCode,
11407			Header: res.Header,
11408		}
11409	}
11410	if err != nil {
11411		return nil, err
11412	}
11413	defer googleapi.CloseBody(res)
11414	if err := googleapi.CheckResponse(res); err != nil {
11415		return nil, err
11416	}
11417	ret := &Policy{
11418		ServerResponse: googleapi.ServerResponse{
11419			Header:         res.Header,
11420			HTTPStatusCode: res.StatusCode,
11421		},
11422	}
11423	target := &ret
11424	if err := gensupport.DecodeResponse(target, res); err != nil {
11425		return nil, err
11426	}
11427	return ret, nil
11428	// {
11429	//   "description": "Updates an IAM policy for the specified object.",
11430	//   "httpMethod": "PUT",
11431	//   "id": "storage.objects.setIamPolicy",
11432	//   "parameterOrder": [
11433	//     "bucket",
11434	//     "object"
11435	//   ],
11436	//   "parameters": {
11437	//     "bucket": {
11438	//       "description": "Name of the bucket in which the object resides.",
11439	//       "location": "path",
11440	//       "required": true,
11441	//       "type": "string"
11442	//     },
11443	//     "generation": {
11444	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11445	//       "format": "int64",
11446	//       "location": "query",
11447	//       "type": "string"
11448	//     },
11449	//     "object": {
11450	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11451	//       "location": "path",
11452	//       "required": true,
11453	//       "type": "string"
11454	//     },
11455	//     "provisionalUserProject": {
11456	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11457	//       "location": "query",
11458	//       "type": "string"
11459	//     },
11460	//     "userProject": {
11461	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11462	//       "location": "query",
11463	//       "type": "string"
11464	//     }
11465	//   },
11466	//   "path": "b/{bucket}/o/{object}/iam",
11467	//   "request": {
11468	//     "$ref": "Policy"
11469	//   },
11470	//   "response": {
11471	//     "$ref": "Policy"
11472	//   },
11473	//   "scopes": [
11474	//     "https://www.googleapis.com/auth/cloud-platform",
11475	//     "https://www.googleapis.com/auth/devstorage.full_control",
11476	//     "https://www.googleapis.com/auth/devstorage.read_write"
11477	//   ]
11478	// }
11479
11480}
11481
11482// method id "storage.objects.testIamPermissions":
11483
11484type ObjectsTestIamPermissionsCall struct {
11485	s            *Service
11486	bucket       string
11487	object       string
11488	urlParams_   gensupport.URLParams
11489	ifNoneMatch_ string
11490	ctx_         context.Context
11491	header_      http.Header
11492}
11493
11494// TestIamPermissions: Tests a set of permissions on the given object to
11495// see which, if any, are held by the caller.
11496func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall {
11497	c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11498	c.bucket = bucket
11499	c.object = object
11500	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
11501	return c
11502}
11503
11504// Generation sets the optional parameter "generation": If present,
11505// selects a specific revision of this object (as opposed to the latest
11506// version, the default).
11507func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall {
11508	c.urlParams_.Set("generation", fmt.Sprint(generation))
11509	return c
11510}
11511
11512// ProvisionalUserProject sets the optional parameter
11513// "provisionalUserProject": The project to be billed for this request
11514// if the target bucket is requester-pays bucket.
11515func (c *ObjectsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsTestIamPermissionsCall {
11516	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11517	return c
11518}
11519
11520// UserProject sets the optional parameter "userProject": The project to
11521// be billed for this request. Required for Requester Pays buckets.
11522func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
11523	c.urlParams_.Set("userProject", userProject)
11524	return c
11525}
11526
11527// Fields allows partial responses to be retrieved. See
11528// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11529// for more information.
11530func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall {
11531	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11532	return c
11533}
11534
11535// IfNoneMatch sets the optional parameter which makes the operation
11536// fail if the object's ETag matches the given value. This is useful for
11537// getting updates only after the object has changed since the last
11538// request. Use googleapi.IsNotModified to check whether the response
11539// error from Do is the result of In-None-Match.
11540func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall {
11541	c.ifNoneMatch_ = entityTag
11542	return c
11543}
11544
11545// Context sets the context to be used in this call's Do method. Any
11546// pending HTTP request will be aborted if the provided context is
11547// canceled.
11548func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
11549	c.ctx_ = ctx
11550	return c
11551}
11552
11553// Header returns an http.Header that can be modified by the caller to
11554// add HTTP headers to the request.
11555func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
11556	if c.header_ == nil {
11557		c.header_ = make(http.Header)
11558	}
11559	return c.header_
11560}
11561
11562func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
11563	reqHeaders := make(http.Header)
11564	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
11565	for k, v := range c.header_ {
11566		reqHeaders[k] = v
11567	}
11568	reqHeaders.Set("User-Agent", c.s.userAgent())
11569	if c.ifNoneMatch_ != "" {
11570		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11571	}
11572	var body io.Reader = nil
11573	c.urlParams_.Set("alt", alt)
11574	c.urlParams_.Set("prettyPrint", "false")
11575	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions")
11576	urls += "?" + c.urlParams_.Encode()
11577	req, err := http.NewRequest("GET", urls, body)
11578	if err != nil {
11579		return nil, err
11580	}
11581	req.Header = reqHeaders
11582	googleapi.Expand(req.URL, map[string]string{
11583		"bucket": c.bucket,
11584		"object": c.object,
11585	})
11586	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11587}
11588
11589// Do executes the "storage.objects.testIamPermissions" call.
11590// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
11591// Any non-2xx status code is an error. Response headers are in either
11592// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
11593// was returned at all) in error.(*googleapi.Error).Header. Use
11594// googleapi.IsNotModified to check whether the returned error was
11595// because http.StatusNotModified was returned.
11596func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
11597	gensupport.SetOptions(c.urlParams_, opts...)
11598	res, err := c.doRequest("json")
11599	if res != nil && res.StatusCode == http.StatusNotModified {
11600		if res.Body != nil {
11601			res.Body.Close()
11602		}
11603		return nil, &googleapi.Error{
11604			Code:   res.StatusCode,
11605			Header: res.Header,
11606		}
11607	}
11608	if err != nil {
11609		return nil, err
11610	}
11611	defer googleapi.CloseBody(res)
11612	if err := googleapi.CheckResponse(res); err != nil {
11613		return nil, err
11614	}
11615	ret := &TestIamPermissionsResponse{
11616		ServerResponse: googleapi.ServerResponse{
11617			Header:         res.Header,
11618			HTTPStatusCode: res.StatusCode,
11619		},
11620	}
11621	target := &ret
11622	if err := gensupport.DecodeResponse(target, res); err != nil {
11623		return nil, err
11624	}
11625	return ret, nil
11626	// {
11627	//   "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
11628	//   "httpMethod": "GET",
11629	//   "id": "storage.objects.testIamPermissions",
11630	//   "parameterOrder": [
11631	//     "bucket",
11632	//     "object",
11633	//     "permissions"
11634	//   ],
11635	//   "parameters": {
11636	//     "bucket": {
11637	//       "description": "Name of the bucket in which the object resides.",
11638	//       "location": "path",
11639	//       "required": true,
11640	//       "type": "string"
11641	//     },
11642	//     "generation": {
11643	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11644	//       "format": "int64",
11645	//       "location": "query",
11646	//       "type": "string"
11647	//     },
11648	//     "object": {
11649	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11650	//       "location": "path",
11651	//       "required": true,
11652	//       "type": "string"
11653	//     },
11654	//     "permissions": {
11655	//       "description": "Permissions to test.",
11656	//       "location": "query",
11657	//       "repeated": true,
11658	//       "required": true,
11659	//       "type": "string"
11660	//     },
11661	//     "provisionalUserProject": {
11662	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11663	//       "location": "query",
11664	//       "type": "string"
11665	//     },
11666	//     "userProject": {
11667	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11668	//       "location": "query",
11669	//       "type": "string"
11670	//     }
11671	//   },
11672	//   "path": "b/{bucket}/o/{object}/iam/testPermissions",
11673	//   "response": {
11674	//     "$ref": "TestIamPermissionsResponse"
11675	//   },
11676	//   "scopes": [
11677	//     "https://www.googleapis.com/auth/cloud-platform",
11678	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11679	//     "https://www.googleapis.com/auth/devstorage.full_control",
11680	//     "https://www.googleapis.com/auth/devstorage.read_only",
11681	//     "https://www.googleapis.com/auth/devstorage.read_write"
11682	//   ]
11683	// }
11684
11685}
11686
11687// method id "storage.objects.update":
11688
11689type ObjectsUpdateCall struct {
11690	s          *Service
11691	bucket     string
11692	object     string
11693	object2    *Object
11694	urlParams_ gensupport.URLParams
11695	ctx_       context.Context
11696	header_    http.Header
11697}
11698
11699// Update: Updates an object's metadata.
11700func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
11701	c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11702	c.bucket = bucket
11703	c.object = object
11704	c.object2 = object2
11705	return c
11706}
11707
11708// Generation sets the optional parameter "generation": If present,
11709// selects a specific revision of this object (as opposed to the latest
11710// version, the default).
11711func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
11712	c.urlParams_.Set("generation", fmt.Sprint(generation))
11713	return c
11714}
11715
11716// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
11717// Makes the operation conditional on whether the object's current
11718// generation matches the given value. Setting to 0 makes the operation
11719// succeed only if there are no live versions of the object.
11720func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
11721	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
11722	return c
11723}
11724
11725// IfGenerationNotMatch sets the optional parameter
11726// "ifGenerationNotMatch": Makes the operation conditional on whether
11727// the object's current generation does not match the given value. If no
11728// live object exists, the precondition fails. Setting to 0 makes the
11729// operation succeed only if there is a live version of the object.
11730func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
11731	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
11732	return c
11733}
11734
11735// IfMetagenerationMatch sets the optional parameter
11736// "ifMetagenerationMatch": Makes the operation conditional on whether
11737// the object's current metageneration matches the given value.
11738func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall {
11739	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
11740	return c
11741}
11742
11743// IfMetagenerationNotMatch sets the optional parameter
11744// "ifMetagenerationNotMatch": Makes the operation conditional on
11745// whether the object's current metageneration does not match the given
11746// value.
11747func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
11748	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
11749	return c
11750}
11751
11752// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
11753// predefined set of access controls to this object.
11754//
11755// Possible values:
11756//   "authenticatedRead" - Object owner gets OWNER access, and
11757// allAuthenticatedUsers get READER access.
11758//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
11759// project team owners get OWNER access.
11760//   "bucketOwnerRead" - Object owner gets OWNER access, and project
11761// team owners get READER access.
11762//   "private" - Object owner gets OWNER access.
11763//   "projectPrivate" - Object owner gets OWNER access, and project team
11764// members get access according to their roles.
11765//   "publicRead" - Object owner gets OWNER access, and allUsers get
11766// READER access.
11767func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
11768	c.urlParams_.Set("predefinedAcl", predefinedAcl)
11769	return c
11770}
11771
11772// Projection sets the optional parameter "projection": Set of
11773// properties to return. Defaults to full.
11774//
11775// Possible values:
11776//   "full" - Include all properties.
11777//   "noAcl" - Omit the owner, acl property.
11778func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
11779	c.urlParams_.Set("projection", projection)
11780	return c
11781}
11782
11783// ProvisionalUserProject sets the optional parameter
11784// "provisionalUserProject": The project to be billed for this request
11785// if the target bucket is requester-pays bucket.
11786func (c *ObjectsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsUpdateCall {
11787	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11788	return c
11789}
11790
11791// UserProject sets the optional parameter "userProject": The project to
11792// be billed for this request. Required for Requester Pays buckets.
11793func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
11794	c.urlParams_.Set("userProject", userProject)
11795	return c
11796}
11797
11798// Fields allows partial responses to be retrieved. See
11799// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11800// for more information.
11801func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
11802	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11803	return c
11804}
11805
11806// Context sets the context to be used in this call's Do method. Any
11807// pending HTTP request will be aborted if the provided context is
11808// canceled.
11809func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
11810	c.ctx_ = ctx
11811	return c
11812}
11813
11814// Header returns an http.Header that can be modified by the caller to
11815// add HTTP headers to the request.
11816func (c *ObjectsUpdateCall) Header() http.Header {
11817	if c.header_ == nil {
11818		c.header_ = make(http.Header)
11819	}
11820	return c.header_
11821}
11822
11823func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
11824	reqHeaders := make(http.Header)
11825	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
11826	for k, v := range c.header_ {
11827		reqHeaders[k] = v
11828	}
11829	reqHeaders.Set("User-Agent", c.s.userAgent())
11830	var body io.Reader = nil
11831	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
11832	if err != nil {
11833		return nil, err
11834	}
11835	reqHeaders.Set("Content-Type", "application/json")
11836	c.urlParams_.Set("alt", alt)
11837	c.urlParams_.Set("prettyPrint", "false")
11838	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
11839	urls += "?" + c.urlParams_.Encode()
11840	req, err := http.NewRequest("PUT", urls, body)
11841	if err != nil {
11842		return nil, err
11843	}
11844	req.Header = reqHeaders
11845	googleapi.Expand(req.URL, map[string]string{
11846		"bucket": c.bucket,
11847		"object": c.object,
11848	})
11849	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11850}
11851
11852// Do executes the "storage.objects.update" call.
11853// Exactly one of *Object or error will be non-nil. Any non-2xx status
11854// code is an error. Response headers are in either
11855// *Object.ServerResponse.Header or (if a response was returned at all)
11856// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11857// check whether the returned error was because http.StatusNotModified
11858// was returned.
11859func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
11860	gensupport.SetOptions(c.urlParams_, opts...)
11861	res, err := c.doRequest("json")
11862	if res != nil && res.StatusCode == http.StatusNotModified {
11863		if res.Body != nil {
11864			res.Body.Close()
11865		}
11866		return nil, &googleapi.Error{
11867			Code:   res.StatusCode,
11868			Header: res.Header,
11869		}
11870	}
11871	if err != nil {
11872		return nil, err
11873	}
11874	defer googleapi.CloseBody(res)
11875	if err := googleapi.CheckResponse(res); err != nil {
11876		return nil, err
11877	}
11878	ret := &Object{
11879		ServerResponse: googleapi.ServerResponse{
11880			Header:         res.Header,
11881			HTTPStatusCode: res.StatusCode,
11882		},
11883	}
11884	target := &ret
11885	if err := gensupport.DecodeResponse(target, res); err != nil {
11886		return nil, err
11887	}
11888	return ret, nil
11889	// {
11890	//   "description": "Updates an object's metadata.",
11891	//   "httpMethod": "PUT",
11892	//   "id": "storage.objects.update",
11893	//   "parameterOrder": [
11894	//     "bucket",
11895	//     "object"
11896	//   ],
11897	//   "parameters": {
11898	//     "bucket": {
11899	//       "description": "Name of the bucket in which the object resides.",
11900	//       "location": "path",
11901	//       "required": true,
11902	//       "type": "string"
11903	//     },
11904	//     "generation": {
11905	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11906	//       "format": "int64",
11907	//       "location": "query",
11908	//       "type": "string"
11909	//     },
11910	//     "ifGenerationMatch": {
11911	//       "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.",
11912	//       "format": "int64",
11913	//       "location": "query",
11914	//       "type": "string"
11915	//     },
11916	//     "ifGenerationNotMatch": {
11917	//       "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.",
11918	//       "format": "int64",
11919	//       "location": "query",
11920	//       "type": "string"
11921	//     },
11922	//     "ifMetagenerationMatch": {
11923	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
11924	//       "format": "int64",
11925	//       "location": "query",
11926	//       "type": "string"
11927	//     },
11928	//     "ifMetagenerationNotMatch": {
11929	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
11930	//       "format": "int64",
11931	//       "location": "query",
11932	//       "type": "string"
11933	//     },
11934	//     "object": {
11935	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11936	//       "location": "path",
11937	//       "required": true,
11938	//       "type": "string"
11939	//     },
11940	//     "predefinedAcl": {
11941	//       "description": "Apply a predefined set of access controls to this object.",
11942	//       "enum": [
11943	//         "authenticatedRead",
11944	//         "bucketOwnerFullControl",
11945	//         "bucketOwnerRead",
11946	//         "private",
11947	//         "projectPrivate",
11948	//         "publicRead"
11949	//       ],
11950	//       "enumDescriptions": [
11951	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
11952	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
11953	//         "Object owner gets OWNER access, and project team owners get READER access.",
11954	//         "Object owner gets OWNER access.",
11955	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
11956	//         "Object owner gets OWNER access, and allUsers get READER access."
11957	//       ],
11958	//       "location": "query",
11959	//       "type": "string"
11960	//     },
11961	//     "projection": {
11962	//       "description": "Set of properties to return. Defaults to full.",
11963	//       "enum": [
11964	//         "full",
11965	//         "noAcl"
11966	//       ],
11967	//       "enumDescriptions": [
11968	//         "Include all properties.",
11969	//         "Omit the owner, acl property."
11970	//       ],
11971	//       "location": "query",
11972	//       "type": "string"
11973	//     },
11974	//     "provisionalUserProject": {
11975	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11976	//       "location": "query",
11977	//       "type": "string"
11978	//     },
11979	//     "userProject": {
11980	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11981	//       "location": "query",
11982	//       "type": "string"
11983	//     }
11984	//   },
11985	//   "path": "b/{bucket}/o/{object}",
11986	//   "request": {
11987	//     "$ref": "Object"
11988	//   },
11989	//   "response": {
11990	//     "$ref": "Object"
11991	//   },
11992	//   "scopes": [
11993	//     "https://www.googleapis.com/auth/cloud-platform",
11994	//     "https://www.googleapis.com/auth/devstorage.full_control"
11995	//   ]
11996	// }
11997
11998}
11999
12000// method id "storage.objects.watchAll":
12001
12002type ObjectsWatchAllCall struct {
12003	s          *Service
12004	bucket     string
12005	channel    *Channel
12006	urlParams_ gensupport.URLParams
12007	ctx_       context.Context
12008	header_    http.Header
12009}
12010
12011// WatchAll: Watch for changes on all objects in a bucket.
12012func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
12013	c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12014	c.bucket = bucket
12015	c.channel = channel
12016	return c
12017}
12018
12019// Delimiter sets the optional parameter "delimiter": Returns results in
12020// a directory-like mode. items will contain only objects whose names,
12021// aside from the prefix, do not contain delimiter. Objects whose names,
12022// aside from the prefix, contain delimiter will have their name,
12023// truncated after the delimiter, returned in prefixes. Duplicate
12024// prefixes are omitted.
12025func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
12026	c.urlParams_.Set("delimiter", delimiter)
12027	return c
12028}
12029
12030// IncludeTrailingDelimiter sets the optional parameter
12031// "includeTrailingDelimiter": If true, objects that end in exactly one
12032// instance of delimiter will have their metadata included in items in
12033// addition to prefixes.
12034func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall {
12035	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
12036	return c
12037}
12038
12039// MaxResults sets the optional parameter "maxResults": Maximum number
12040// of items plus prefixes to return in a single page of responses. As
12041// duplicate prefixes are omitted, fewer total results may be returned
12042// than requested. The service will use this parameter or 1,000 items,
12043// whichever is smaller.
12044func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
12045	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12046	return c
12047}
12048
12049// PageToken sets the optional parameter "pageToken": A
12050// previously-returned page token representing part of the larger set of
12051// results to view.
12052func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
12053	c.urlParams_.Set("pageToken", pageToken)
12054	return c
12055}
12056
12057// Prefix sets the optional parameter "prefix": Filter results to
12058// objects whose names begin with this prefix.
12059func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
12060	c.urlParams_.Set("prefix", prefix)
12061	return c
12062}
12063
12064// Projection sets the optional parameter "projection": Set of
12065// properties to return. Defaults to noAcl.
12066//
12067// Possible values:
12068//   "full" - Include all properties.
12069//   "noAcl" - Omit the owner, acl property.
12070func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
12071	c.urlParams_.Set("projection", projection)
12072	return c
12073}
12074
12075// ProvisionalUserProject sets the optional parameter
12076// "provisionalUserProject": The project to be billed for this request
12077// if the target bucket is requester-pays bucket.
12078func (c *ObjectsWatchAllCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsWatchAllCall {
12079	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
12080	return c
12081}
12082
12083// UserProject sets the optional parameter "userProject": The project to
12084// be billed for this request. Required for Requester Pays buckets.
12085func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
12086	c.urlParams_.Set("userProject", userProject)
12087	return c
12088}
12089
12090// Versions sets the optional parameter "versions": If true, lists all
12091// versions of an object as distinct results. The default is false. For
12092// more information, see Object Versioning.
12093func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
12094	c.urlParams_.Set("versions", fmt.Sprint(versions))
12095	return c
12096}
12097
12098// Fields allows partial responses to be retrieved. See
12099// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12100// for more information.
12101func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
12102	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12103	return c
12104}
12105
12106// Context sets the context to be used in this call's Do method. Any
12107// pending HTTP request will be aborted if the provided context is
12108// canceled.
12109func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
12110	c.ctx_ = ctx
12111	return c
12112}
12113
12114// Header returns an http.Header that can be modified by the caller to
12115// add HTTP headers to the request.
12116func (c *ObjectsWatchAllCall) Header() http.Header {
12117	if c.header_ == nil {
12118		c.header_ = make(http.Header)
12119	}
12120	return c.header_
12121}
12122
12123func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
12124	reqHeaders := make(http.Header)
12125	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
12126	for k, v := range c.header_ {
12127		reqHeaders[k] = v
12128	}
12129	reqHeaders.Set("User-Agent", c.s.userAgent())
12130	var body io.Reader = nil
12131	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
12132	if err != nil {
12133		return nil, err
12134	}
12135	reqHeaders.Set("Content-Type", "application/json")
12136	c.urlParams_.Set("alt", alt)
12137	c.urlParams_.Set("prettyPrint", "false")
12138	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
12139	urls += "?" + c.urlParams_.Encode()
12140	req, err := http.NewRequest("POST", urls, body)
12141	if err != nil {
12142		return nil, err
12143	}
12144	req.Header = reqHeaders
12145	googleapi.Expand(req.URL, map[string]string{
12146		"bucket": c.bucket,
12147	})
12148	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12149}
12150
12151// Do executes the "storage.objects.watchAll" call.
12152// Exactly one of *Channel or error will be non-nil. Any non-2xx status
12153// code is an error. Response headers are in either
12154// *Channel.ServerResponse.Header or (if a response was returned at all)
12155// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12156// check whether the returned error was because http.StatusNotModified
12157// was returned.
12158func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
12159	gensupport.SetOptions(c.urlParams_, opts...)
12160	res, err := c.doRequest("json")
12161	if res != nil && res.StatusCode == http.StatusNotModified {
12162		if res.Body != nil {
12163			res.Body.Close()
12164		}
12165		return nil, &googleapi.Error{
12166			Code:   res.StatusCode,
12167			Header: res.Header,
12168		}
12169	}
12170	if err != nil {
12171		return nil, err
12172	}
12173	defer googleapi.CloseBody(res)
12174	if err := googleapi.CheckResponse(res); err != nil {
12175		return nil, err
12176	}
12177	ret := &Channel{
12178		ServerResponse: googleapi.ServerResponse{
12179			Header:         res.Header,
12180			HTTPStatusCode: res.StatusCode,
12181		},
12182	}
12183	target := &ret
12184	if err := gensupport.DecodeResponse(target, res); err != nil {
12185		return nil, err
12186	}
12187	return ret, nil
12188	// {
12189	//   "description": "Watch for changes on all objects in a bucket.",
12190	//   "httpMethod": "POST",
12191	//   "id": "storage.objects.watchAll",
12192	//   "parameterOrder": [
12193	//     "bucket"
12194	//   ],
12195	//   "parameters": {
12196	//     "bucket": {
12197	//       "description": "Name of the bucket in which to look for objects.",
12198	//       "location": "path",
12199	//       "required": true,
12200	//       "type": "string"
12201	//     },
12202	//     "delimiter": {
12203	//       "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.",
12204	//       "location": "query",
12205	//       "type": "string"
12206	//     },
12207	//     "includeTrailingDelimiter": {
12208	//       "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
12209	//       "location": "query",
12210	//       "type": "boolean"
12211	//     },
12212	//     "maxResults": {
12213	//       "default": "1000",
12214	//       "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.",
12215	//       "format": "uint32",
12216	//       "location": "query",
12217	//       "minimum": "0",
12218	//       "type": "integer"
12219	//     },
12220	//     "pageToken": {
12221	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
12222	//       "location": "query",
12223	//       "type": "string"
12224	//     },
12225	//     "prefix": {
12226	//       "description": "Filter results to objects whose names begin with this prefix.",
12227	//       "location": "query",
12228	//       "type": "string"
12229	//     },
12230	//     "projection": {
12231	//       "description": "Set of properties to return. Defaults to noAcl.",
12232	//       "enum": [
12233	//         "full",
12234	//         "noAcl"
12235	//       ],
12236	//       "enumDescriptions": [
12237	//         "Include all properties.",
12238	//         "Omit the owner, acl property."
12239	//       ],
12240	//       "location": "query",
12241	//       "type": "string"
12242	//     },
12243	//     "provisionalUserProject": {
12244	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
12245	//       "location": "query",
12246	//       "type": "string"
12247	//     },
12248	//     "userProject": {
12249	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
12250	//       "location": "query",
12251	//       "type": "string"
12252	//     },
12253	//     "versions": {
12254	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
12255	//       "location": "query",
12256	//       "type": "boolean"
12257	//     }
12258	//   },
12259	//   "path": "b/{bucket}/o/watch",
12260	//   "request": {
12261	//     "$ref": "Channel",
12262	//     "parameterName": "resource"
12263	//   },
12264	//   "response": {
12265	//     "$ref": "Channel"
12266	//   },
12267	//   "scopes": [
12268	//     "https://www.googleapis.com/auth/cloud-platform",
12269	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12270	//     "https://www.googleapis.com/auth/devstorage.full_control",
12271	//     "https://www.googleapis.com/auth/devstorage.read_only",
12272	//     "https://www.googleapis.com/auth/devstorage.read_write"
12273	//   ],
12274	//   "supportsSubscription": true
12275	// }
12276
12277}
12278
12279// method id "storage.projects.hmacKeys.create":
12280
12281type ProjectsHmacKeysCreateCall struct {
12282	s          *Service
12283	projectId  string
12284	urlParams_ gensupport.URLParams
12285	ctx_       context.Context
12286	header_    http.Header
12287}
12288
12289// Create: Creates a new HMAC key for the specified service account.
12290func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall {
12291	c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12292	c.projectId = projectId
12293	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
12294	return c
12295}
12296
12297// UserProject sets the optional parameter "userProject": The project to
12298// be billed for this request.
12299func (c *ProjectsHmacKeysCreateCall) UserProject(userProject string) *ProjectsHmacKeysCreateCall {
12300	c.urlParams_.Set("userProject", userProject)
12301	return c
12302}
12303
12304// Fields allows partial responses to be retrieved. See
12305// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12306// for more information.
12307func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall {
12308	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12309	return c
12310}
12311
12312// Context sets the context to be used in this call's Do method. Any
12313// pending HTTP request will be aborted if the provided context is
12314// canceled.
12315func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall {
12316	c.ctx_ = ctx
12317	return c
12318}
12319
12320// Header returns an http.Header that can be modified by the caller to
12321// add HTTP headers to the request.
12322func (c *ProjectsHmacKeysCreateCall) Header() http.Header {
12323	if c.header_ == nil {
12324		c.header_ = make(http.Header)
12325	}
12326	return c.header_
12327}
12328
12329func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) {
12330	reqHeaders := make(http.Header)
12331	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
12332	for k, v := range c.header_ {
12333		reqHeaders[k] = v
12334	}
12335	reqHeaders.Set("User-Agent", c.s.userAgent())
12336	var body io.Reader = nil
12337	c.urlParams_.Set("alt", alt)
12338	c.urlParams_.Set("prettyPrint", "false")
12339	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
12340	urls += "?" + c.urlParams_.Encode()
12341	req, err := http.NewRequest("POST", urls, body)
12342	if err != nil {
12343		return nil, err
12344	}
12345	req.Header = reqHeaders
12346	googleapi.Expand(req.URL, map[string]string{
12347		"projectId": c.projectId,
12348	})
12349	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12350}
12351
12352// Do executes the "storage.projects.hmacKeys.create" call.
12353// Exactly one of *HmacKey or error will be non-nil. Any non-2xx status
12354// code is an error. Response headers are in either
12355// *HmacKey.ServerResponse.Header or (if a response was returned at all)
12356// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12357// check whether the returned error was because http.StatusNotModified
12358// was returned.
12359func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) {
12360	gensupport.SetOptions(c.urlParams_, opts...)
12361	res, err := c.doRequest("json")
12362	if res != nil && res.StatusCode == http.StatusNotModified {
12363		if res.Body != nil {
12364			res.Body.Close()
12365		}
12366		return nil, &googleapi.Error{
12367			Code:   res.StatusCode,
12368			Header: res.Header,
12369		}
12370	}
12371	if err != nil {
12372		return nil, err
12373	}
12374	defer googleapi.CloseBody(res)
12375	if err := googleapi.CheckResponse(res); err != nil {
12376		return nil, err
12377	}
12378	ret := &HmacKey{
12379		ServerResponse: googleapi.ServerResponse{
12380			Header:         res.Header,
12381			HTTPStatusCode: res.StatusCode,
12382		},
12383	}
12384	target := &ret
12385	if err := gensupport.DecodeResponse(target, res); err != nil {
12386		return nil, err
12387	}
12388	return ret, nil
12389	// {
12390	//   "description": "Creates a new HMAC key for the specified service account.",
12391	//   "httpMethod": "POST",
12392	//   "id": "storage.projects.hmacKeys.create",
12393	//   "parameterOrder": [
12394	//     "projectId",
12395	//     "serviceAccountEmail"
12396	//   ],
12397	//   "parameters": {
12398	//     "projectId": {
12399	//       "description": "Project ID owning the service account.",
12400	//       "location": "path",
12401	//       "required": true,
12402	//       "type": "string"
12403	//     },
12404	//     "serviceAccountEmail": {
12405	//       "description": "Email address of the service account.",
12406	//       "location": "query",
12407	//       "required": true,
12408	//       "type": "string"
12409	//     },
12410	//     "userProject": {
12411	//       "description": "The project to be billed for this request.",
12412	//       "location": "query",
12413	//       "type": "string"
12414	//     }
12415	//   },
12416	//   "path": "projects/{projectId}/hmacKeys",
12417	//   "response": {
12418	//     "$ref": "HmacKey"
12419	//   },
12420	//   "scopes": [
12421	//     "https://www.googleapis.com/auth/cloud-platform",
12422	//     "https://www.googleapis.com/auth/devstorage.full_control"
12423	//   ]
12424	// }
12425
12426}
12427
12428// method id "storage.projects.hmacKeys.delete":
12429
12430type ProjectsHmacKeysDeleteCall struct {
12431	s          *Service
12432	projectId  string
12433	accessId   string
12434	urlParams_ gensupport.URLParams
12435	ctx_       context.Context
12436	header_    http.Header
12437}
12438
12439// Delete: Deletes an HMAC key.
12440func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall {
12441	c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12442	c.projectId = projectId
12443	c.accessId = accessId
12444	return c
12445}
12446
12447// UserProject sets the optional parameter "userProject": The project to
12448// be billed for this request.
12449func (c *ProjectsHmacKeysDeleteCall) UserProject(userProject string) *ProjectsHmacKeysDeleteCall {
12450	c.urlParams_.Set("userProject", userProject)
12451	return c
12452}
12453
12454// Fields allows partial responses to be retrieved. See
12455// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12456// for more information.
12457func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall {
12458	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12459	return c
12460}
12461
12462// Context sets the context to be used in this call's Do method. Any
12463// pending HTTP request will be aborted if the provided context is
12464// canceled.
12465func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall {
12466	c.ctx_ = ctx
12467	return c
12468}
12469
12470// Header returns an http.Header that can be modified by the caller to
12471// add HTTP headers to the request.
12472func (c *ProjectsHmacKeysDeleteCall) Header() http.Header {
12473	if c.header_ == nil {
12474		c.header_ = make(http.Header)
12475	}
12476	return c.header_
12477}
12478
12479func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
12480	reqHeaders := make(http.Header)
12481	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
12482	for k, v := range c.header_ {
12483		reqHeaders[k] = v
12484	}
12485	reqHeaders.Set("User-Agent", c.s.userAgent())
12486	var body io.Reader = nil
12487	c.urlParams_.Set("alt", alt)
12488	c.urlParams_.Set("prettyPrint", "false")
12489	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
12490	urls += "?" + c.urlParams_.Encode()
12491	req, err := http.NewRequest("DELETE", urls, body)
12492	if err != nil {
12493		return nil, err
12494	}
12495	req.Header = reqHeaders
12496	googleapi.Expand(req.URL, map[string]string{
12497		"projectId": c.projectId,
12498		"accessId":  c.accessId,
12499	})
12500	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12501}
12502
12503// Do executes the "storage.projects.hmacKeys.delete" call.
12504func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
12505	gensupport.SetOptions(c.urlParams_, opts...)
12506	res, err := c.doRequest("json")
12507	if err != nil {
12508		return err
12509	}
12510	defer googleapi.CloseBody(res)
12511	if err := googleapi.CheckResponse(res); err != nil {
12512		return err
12513	}
12514	return nil
12515	// {
12516	//   "description": "Deletes an HMAC key.",
12517	//   "httpMethod": "DELETE",
12518	//   "id": "storage.projects.hmacKeys.delete",
12519	//   "parameterOrder": [
12520	//     "projectId",
12521	//     "accessId"
12522	//   ],
12523	//   "parameters": {
12524	//     "accessId": {
12525	//       "description": "Name of the HMAC key to be deleted.",
12526	//       "location": "path",
12527	//       "required": true,
12528	//       "type": "string"
12529	//     },
12530	//     "projectId": {
12531	//       "description": "Project ID owning the requested key",
12532	//       "location": "path",
12533	//       "required": true,
12534	//       "type": "string"
12535	//     },
12536	//     "userProject": {
12537	//       "description": "The project to be billed for this request.",
12538	//       "location": "query",
12539	//       "type": "string"
12540	//     }
12541	//   },
12542	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
12543	//   "scopes": [
12544	//     "https://www.googleapis.com/auth/cloud-platform",
12545	//     "https://www.googleapis.com/auth/devstorage.full_control",
12546	//     "https://www.googleapis.com/auth/devstorage.read_write"
12547	//   ]
12548	// }
12549
12550}
12551
12552// method id "storage.projects.hmacKeys.get":
12553
12554type ProjectsHmacKeysGetCall struct {
12555	s            *Service
12556	projectId    string
12557	accessId     string
12558	urlParams_   gensupport.URLParams
12559	ifNoneMatch_ string
12560	ctx_         context.Context
12561	header_      http.Header
12562}
12563
12564// Get: Retrieves an HMAC key's metadata
12565func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall {
12566	c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12567	c.projectId = projectId
12568	c.accessId = accessId
12569	return c
12570}
12571
12572// UserProject sets the optional parameter "userProject": The project to
12573// be billed for this request.
12574func (c *ProjectsHmacKeysGetCall) UserProject(userProject string) *ProjectsHmacKeysGetCall {
12575	c.urlParams_.Set("userProject", userProject)
12576	return c
12577}
12578
12579// Fields allows partial responses to be retrieved. See
12580// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12581// for more information.
12582func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall {
12583	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12584	return c
12585}
12586
12587// IfNoneMatch sets the optional parameter which makes the operation
12588// fail if the object's ETag matches the given value. This is useful for
12589// getting updates only after the object has changed since the last
12590// request. Use googleapi.IsNotModified to check whether the response
12591// error from Do is the result of In-None-Match.
12592func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall {
12593	c.ifNoneMatch_ = entityTag
12594	return c
12595}
12596
12597// Context sets the context to be used in this call's Do method. Any
12598// pending HTTP request will be aborted if the provided context is
12599// canceled.
12600func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall {
12601	c.ctx_ = ctx
12602	return c
12603}
12604
12605// Header returns an http.Header that can be modified by the caller to
12606// add HTTP headers to the request.
12607func (c *ProjectsHmacKeysGetCall) Header() http.Header {
12608	if c.header_ == nil {
12609		c.header_ = make(http.Header)
12610	}
12611	return c.header_
12612}
12613
12614func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) {
12615	reqHeaders := make(http.Header)
12616	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
12617	for k, v := range c.header_ {
12618		reqHeaders[k] = v
12619	}
12620	reqHeaders.Set("User-Agent", c.s.userAgent())
12621	if c.ifNoneMatch_ != "" {
12622		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12623	}
12624	var body io.Reader = nil
12625	c.urlParams_.Set("alt", alt)
12626	c.urlParams_.Set("prettyPrint", "false")
12627	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
12628	urls += "?" + c.urlParams_.Encode()
12629	req, err := http.NewRequest("GET", urls, body)
12630	if err != nil {
12631		return nil, err
12632	}
12633	req.Header = reqHeaders
12634	googleapi.Expand(req.URL, map[string]string{
12635		"projectId": c.projectId,
12636		"accessId":  c.accessId,
12637	})
12638	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12639}
12640
12641// Do executes the "storage.projects.hmacKeys.get" call.
12642// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
12643// status code is an error. Response headers are in either
12644// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
12645// at all) in error.(*googleapi.Error).Header. Use
12646// googleapi.IsNotModified to check whether the returned error was
12647// because http.StatusNotModified was returned.
12648func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
12649	gensupport.SetOptions(c.urlParams_, opts...)
12650	res, err := c.doRequest("json")
12651	if res != nil && res.StatusCode == http.StatusNotModified {
12652		if res.Body != nil {
12653			res.Body.Close()
12654		}
12655		return nil, &googleapi.Error{
12656			Code:   res.StatusCode,
12657			Header: res.Header,
12658		}
12659	}
12660	if err != nil {
12661		return nil, err
12662	}
12663	defer googleapi.CloseBody(res)
12664	if err := googleapi.CheckResponse(res); err != nil {
12665		return nil, err
12666	}
12667	ret := &HmacKeyMetadata{
12668		ServerResponse: googleapi.ServerResponse{
12669			Header:         res.Header,
12670			HTTPStatusCode: res.StatusCode,
12671		},
12672	}
12673	target := &ret
12674	if err := gensupport.DecodeResponse(target, res); err != nil {
12675		return nil, err
12676	}
12677	return ret, nil
12678	// {
12679	//   "description": "Retrieves an HMAC key's metadata",
12680	//   "httpMethod": "GET",
12681	//   "id": "storage.projects.hmacKeys.get",
12682	//   "parameterOrder": [
12683	//     "projectId",
12684	//     "accessId"
12685	//   ],
12686	//   "parameters": {
12687	//     "accessId": {
12688	//       "description": "Name of the HMAC key.",
12689	//       "location": "path",
12690	//       "required": true,
12691	//       "type": "string"
12692	//     },
12693	//     "projectId": {
12694	//       "description": "Project ID owning the service account of the requested key.",
12695	//       "location": "path",
12696	//       "required": true,
12697	//       "type": "string"
12698	//     },
12699	//     "userProject": {
12700	//       "description": "The project to be billed for this request.",
12701	//       "location": "query",
12702	//       "type": "string"
12703	//     }
12704	//   },
12705	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
12706	//   "response": {
12707	//     "$ref": "HmacKeyMetadata"
12708	//   },
12709	//   "scopes": [
12710	//     "https://www.googleapis.com/auth/cloud-platform",
12711	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12712	//     "https://www.googleapis.com/auth/devstorage.read_only"
12713	//   ]
12714	// }
12715
12716}
12717
12718// method id "storage.projects.hmacKeys.list":
12719
12720type ProjectsHmacKeysListCall struct {
12721	s            *Service
12722	projectId    string
12723	urlParams_   gensupport.URLParams
12724	ifNoneMatch_ string
12725	ctx_         context.Context
12726	header_      http.Header
12727}
12728
12729// List: Retrieves a list of HMAC keys matching the criteria.
12730func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall {
12731	c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12732	c.projectId = projectId
12733	return c
12734}
12735
12736// MaxResults sets the optional parameter "maxResults": Maximum number
12737// of items to return in a single page of responses. The service uses
12738// this parameter or 250 items, whichever is smaller. The max number of
12739// items per page will also be limited by the number of distinct service
12740// accounts in the response. If the number of service accounts in a
12741// single response is too high, the page will truncated and a next page
12742// token will be returned.
12743func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall {
12744	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12745	return c
12746}
12747
12748// PageToken sets the optional parameter "pageToken": A
12749// previously-returned page token representing part of the larger set of
12750// results to view.
12751func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall {
12752	c.urlParams_.Set("pageToken", pageToken)
12753	return c
12754}
12755
12756// ServiceAccountEmail sets the optional parameter
12757// "serviceAccountEmail": If present, only keys for the given service
12758// account are returned.
12759func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall {
12760	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
12761	return c
12762}
12763
12764// ShowDeletedKeys sets the optional parameter "showDeletedKeys":
12765// Whether or not to show keys in the DELETED state.
12766func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall {
12767	c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys))
12768	return c
12769}
12770
12771// UserProject sets the optional parameter "userProject": The project to
12772// be billed for this request.
12773func (c *ProjectsHmacKeysListCall) UserProject(userProject string) *ProjectsHmacKeysListCall {
12774	c.urlParams_.Set("userProject", userProject)
12775	return c
12776}
12777
12778// Fields allows partial responses to be retrieved. See
12779// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12780// for more information.
12781func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall {
12782	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12783	return c
12784}
12785
12786// IfNoneMatch sets the optional parameter which makes the operation
12787// fail if the object's ETag matches the given value. This is useful for
12788// getting updates only after the object has changed since the last
12789// request. Use googleapi.IsNotModified to check whether the response
12790// error from Do is the result of In-None-Match.
12791func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall {
12792	c.ifNoneMatch_ = entityTag
12793	return c
12794}
12795
12796// Context sets the context to be used in this call's Do method. Any
12797// pending HTTP request will be aborted if the provided context is
12798// canceled.
12799func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall {
12800	c.ctx_ = ctx
12801	return c
12802}
12803
12804// Header returns an http.Header that can be modified by the caller to
12805// add HTTP headers to the request.
12806func (c *ProjectsHmacKeysListCall) Header() http.Header {
12807	if c.header_ == nil {
12808		c.header_ = make(http.Header)
12809	}
12810	return c.header_
12811}
12812
12813func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) {
12814	reqHeaders := make(http.Header)
12815	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
12816	for k, v := range c.header_ {
12817		reqHeaders[k] = v
12818	}
12819	reqHeaders.Set("User-Agent", c.s.userAgent())
12820	if c.ifNoneMatch_ != "" {
12821		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12822	}
12823	var body io.Reader = nil
12824	c.urlParams_.Set("alt", alt)
12825	c.urlParams_.Set("prettyPrint", "false")
12826	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
12827	urls += "?" + c.urlParams_.Encode()
12828	req, err := http.NewRequest("GET", urls, body)
12829	if err != nil {
12830		return nil, err
12831	}
12832	req.Header = reqHeaders
12833	googleapi.Expand(req.URL, map[string]string{
12834		"projectId": c.projectId,
12835	})
12836	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12837}
12838
12839// Do executes the "storage.projects.hmacKeys.list" call.
12840// Exactly one of *HmacKeysMetadata or error will be non-nil. Any
12841// non-2xx status code is an error. Response headers are in either
12842// *HmacKeysMetadata.ServerResponse.Header or (if a response was
12843// returned at all) in error.(*googleapi.Error).Header. Use
12844// googleapi.IsNotModified to check whether the returned error was
12845// because http.StatusNotModified was returned.
12846func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) {
12847	gensupport.SetOptions(c.urlParams_, opts...)
12848	res, err := c.doRequest("json")
12849	if res != nil && res.StatusCode == http.StatusNotModified {
12850		if res.Body != nil {
12851			res.Body.Close()
12852		}
12853		return nil, &googleapi.Error{
12854			Code:   res.StatusCode,
12855			Header: res.Header,
12856		}
12857	}
12858	if err != nil {
12859		return nil, err
12860	}
12861	defer googleapi.CloseBody(res)
12862	if err := googleapi.CheckResponse(res); err != nil {
12863		return nil, err
12864	}
12865	ret := &HmacKeysMetadata{
12866		ServerResponse: googleapi.ServerResponse{
12867			Header:         res.Header,
12868			HTTPStatusCode: res.StatusCode,
12869		},
12870	}
12871	target := &ret
12872	if err := gensupport.DecodeResponse(target, res); err != nil {
12873		return nil, err
12874	}
12875	return ret, nil
12876	// {
12877	//   "description": "Retrieves a list of HMAC keys matching the criteria.",
12878	//   "httpMethod": "GET",
12879	//   "id": "storage.projects.hmacKeys.list",
12880	//   "parameterOrder": [
12881	//     "projectId"
12882	//   ],
12883	//   "parameters": {
12884	//     "maxResults": {
12885	//       "default": "250",
12886	//       "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.",
12887	//       "format": "uint32",
12888	//       "location": "query",
12889	//       "minimum": "0",
12890	//       "type": "integer"
12891	//     },
12892	//     "pageToken": {
12893	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
12894	//       "location": "query",
12895	//       "type": "string"
12896	//     },
12897	//     "projectId": {
12898	//       "description": "Name of the project in which to look for HMAC keys.",
12899	//       "location": "path",
12900	//       "required": true,
12901	//       "type": "string"
12902	//     },
12903	//     "serviceAccountEmail": {
12904	//       "description": "If present, only keys for the given service account are returned.",
12905	//       "location": "query",
12906	//       "type": "string"
12907	//     },
12908	//     "showDeletedKeys": {
12909	//       "description": "Whether or not to show keys in the DELETED state.",
12910	//       "location": "query",
12911	//       "type": "boolean"
12912	//     },
12913	//     "userProject": {
12914	//       "description": "The project to be billed for this request.",
12915	//       "location": "query",
12916	//       "type": "string"
12917	//     }
12918	//   },
12919	//   "path": "projects/{projectId}/hmacKeys",
12920	//   "response": {
12921	//     "$ref": "HmacKeysMetadata"
12922	//   },
12923	//   "scopes": [
12924	//     "https://www.googleapis.com/auth/cloud-platform",
12925	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12926	//     "https://www.googleapis.com/auth/devstorage.full_control",
12927	//     "https://www.googleapis.com/auth/devstorage.read_only"
12928	//   ]
12929	// }
12930
12931}
12932
12933// Pages invokes f for each page of results.
12934// A non-nil error returned from f will halt the iteration.
12935// The provided context supersedes any context provided to the Context method.
12936func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error {
12937	c.ctx_ = ctx
12938	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12939	for {
12940		x, err := c.Do()
12941		if err != nil {
12942			return err
12943		}
12944		if err := f(x); err != nil {
12945			return err
12946		}
12947		if x.NextPageToken == "" {
12948			return nil
12949		}
12950		c.PageToken(x.NextPageToken)
12951	}
12952}
12953
12954// method id "storage.projects.hmacKeys.update":
12955
12956type ProjectsHmacKeysUpdateCall struct {
12957	s               *Service
12958	projectId       string
12959	accessId        string
12960	hmackeymetadata *HmacKeyMetadata
12961	urlParams_      gensupport.URLParams
12962	ctx_            context.Context
12963	header_         http.Header
12964}
12965
12966// Update: Updates the state of an HMAC key. See the HMAC Key resource
12967// descriptor for valid states.
12968func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall {
12969	c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12970	c.projectId = projectId
12971	c.accessId = accessId
12972	c.hmackeymetadata = hmackeymetadata
12973	return c
12974}
12975
12976// UserProject sets the optional parameter "userProject": The project to
12977// be billed for this request.
12978func (c *ProjectsHmacKeysUpdateCall) UserProject(userProject string) *ProjectsHmacKeysUpdateCall {
12979	c.urlParams_.Set("userProject", userProject)
12980	return c
12981}
12982
12983// Fields allows partial responses to be retrieved. See
12984// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12985// for more information.
12986func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall {
12987	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12988	return c
12989}
12990
12991// Context sets the context to be used in this call's Do method. Any
12992// pending HTTP request will be aborted if the provided context is
12993// canceled.
12994func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall {
12995	c.ctx_ = ctx
12996	return c
12997}
12998
12999// Header returns an http.Header that can be modified by the caller to
13000// add HTTP headers to the request.
13001func (c *ProjectsHmacKeysUpdateCall) Header() http.Header {
13002	if c.header_ == nil {
13003		c.header_ = make(http.Header)
13004	}
13005	return c.header_
13006}
13007
13008func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) {
13009	reqHeaders := make(http.Header)
13010	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
13011	for k, v := range c.header_ {
13012		reqHeaders[k] = v
13013	}
13014	reqHeaders.Set("User-Agent", c.s.userAgent())
13015	var body io.Reader = nil
13016	body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata)
13017	if err != nil {
13018		return nil, err
13019	}
13020	reqHeaders.Set("Content-Type", "application/json")
13021	c.urlParams_.Set("alt", alt)
13022	c.urlParams_.Set("prettyPrint", "false")
13023	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
13024	urls += "?" + c.urlParams_.Encode()
13025	req, err := http.NewRequest("PUT", urls, body)
13026	if err != nil {
13027		return nil, err
13028	}
13029	req.Header = reqHeaders
13030	googleapi.Expand(req.URL, map[string]string{
13031		"projectId": c.projectId,
13032		"accessId":  c.accessId,
13033	})
13034	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13035}
13036
13037// Do executes the "storage.projects.hmacKeys.update" call.
13038// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
13039// status code is an error. Response headers are in either
13040// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
13041// at all) in error.(*googleapi.Error).Header. Use
13042// googleapi.IsNotModified to check whether the returned error was
13043// because http.StatusNotModified was returned.
13044func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
13045	gensupport.SetOptions(c.urlParams_, opts...)
13046	res, err := c.doRequest("json")
13047	if res != nil && res.StatusCode == http.StatusNotModified {
13048		if res.Body != nil {
13049			res.Body.Close()
13050		}
13051		return nil, &googleapi.Error{
13052			Code:   res.StatusCode,
13053			Header: res.Header,
13054		}
13055	}
13056	if err != nil {
13057		return nil, err
13058	}
13059	defer googleapi.CloseBody(res)
13060	if err := googleapi.CheckResponse(res); err != nil {
13061		return nil, err
13062	}
13063	ret := &HmacKeyMetadata{
13064		ServerResponse: googleapi.ServerResponse{
13065			Header:         res.Header,
13066			HTTPStatusCode: res.StatusCode,
13067		},
13068	}
13069	target := &ret
13070	if err := gensupport.DecodeResponse(target, res); err != nil {
13071		return nil, err
13072	}
13073	return ret, nil
13074	// {
13075	//   "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
13076	//   "httpMethod": "PUT",
13077	//   "id": "storage.projects.hmacKeys.update",
13078	//   "parameterOrder": [
13079	//     "projectId",
13080	//     "accessId"
13081	//   ],
13082	//   "parameters": {
13083	//     "accessId": {
13084	//       "description": "Name of the HMAC key being updated.",
13085	//       "location": "path",
13086	//       "required": true,
13087	//       "type": "string"
13088	//     },
13089	//     "projectId": {
13090	//       "description": "Project ID owning the service account of the updated key.",
13091	//       "location": "path",
13092	//       "required": true,
13093	//       "type": "string"
13094	//     },
13095	//     "userProject": {
13096	//       "description": "The project to be billed for this request.",
13097	//       "location": "query",
13098	//       "type": "string"
13099	//     }
13100	//   },
13101	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
13102	//   "request": {
13103	//     "$ref": "HmacKeyMetadata"
13104	//   },
13105	//   "response": {
13106	//     "$ref": "HmacKeyMetadata"
13107	//   },
13108	//   "scopes": [
13109	//     "https://www.googleapis.com/auth/cloud-platform",
13110	//     "https://www.googleapis.com/auth/devstorage.full_control"
13111	//   ]
13112	// }
13113
13114}
13115
13116// method id "storage.projects.serviceAccount.get":
13117
13118type ProjectsServiceAccountGetCall struct {
13119	s            *Service
13120	projectId    string
13121	urlParams_   gensupport.URLParams
13122	ifNoneMatch_ string
13123	ctx_         context.Context
13124	header_      http.Header
13125}
13126
13127// Get: Get the email address of this project's Google Cloud Storage
13128// service account.
13129func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
13130	c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13131	c.projectId = projectId
13132	return c
13133}
13134
13135// ProvisionalUserProject sets the optional parameter
13136// "provisionalUserProject": The project to be billed for this request
13137// if the target bucket is requester-pays bucket.
13138func (c *ProjectsServiceAccountGetCall) ProvisionalUserProject(provisionalUserProject string) *ProjectsServiceAccountGetCall {
13139	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
13140	return c
13141}
13142
13143// UserProject sets the optional parameter "userProject": The project to
13144// be billed for this request.
13145func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall {
13146	c.urlParams_.Set("userProject", userProject)
13147	return c
13148}
13149
13150// Fields allows partial responses to be retrieved. See
13151// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13152// for more information.
13153func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
13154	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13155	return c
13156}
13157
13158// IfNoneMatch sets the optional parameter which makes the operation
13159// fail if the object's ETag matches the given value. This is useful for
13160// getting updates only after the object has changed since the last
13161// request. Use googleapi.IsNotModified to check whether the response
13162// error from Do is the result of In-None-Match.
13163func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
13164	c.ifNoneMatch_ = entityTag
13165	return c
13166}
13167
13168// Context sets the context to be used in this call's Do method. Any
13169// pending HTTP request will be aborted if the provided context is
13170// canceled.
13171func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
13172	c.ctx_ = ctx
13173	return c
13174}
13175
13176// Header returns an http.Header that can be modified by the caller to
13177// add HTTP headers to the request.
13178func (c *ProjectsServiceAccountGetCall) Header() http.Header {
13179	if c.header_ == nil {
13180		c.header_ = make(http.Header)
13181	}
13182	return c.header_
13183}
13184
13185func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
13186	reqHeaders := make(http.Header)
13187	reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20190926")
13188	for k, v := range c.header_ {
13189		reqHeaders[k] = v
13190	}
13191	reqHeaders.Set("User-Agent", c.s.userAgent())
13192	if c.ifNoneMatch_ != "" {
13193		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13194	}
13195	var body io.Reader = nil
13196	c.urlParams_.Set("alt", alt)
13197	c.urlParams_.Set("prettyPrint", "false")
13198	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
13199	urls += "?" + c.urlParams_.Encode()
13200	req, err := http.NewRequest("GET", urls, body)
13201	if err != nil {
13202		return nil, err
13203	}
13204	req.Header = reqHeaders
13205	googleapi.Expand(req.URL, map[string]string{
13206		"projectId": c.projectId,
13207	})
13208	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13209}
13210
13211// Do executes the "storage.projects.serviceAccount.get" call.
13212// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
13213// status code is an error. Response headers are in either
13214// *ServiceAccount.ServerResponse.Header or (if a response was returned
13215// at all) in error.(*googleapi.Error).Header. Use
13216// googleapi.IsNotModified to check whether the returned error was
13217// because http.StatusNotModified was returned.
13218func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
13219	gensupport.SetOptions(c.urlParams_, opts...)
13220	res, err := c.doRequest("json")
13221	if res != nil && res.StatusCode == http.StatusNotModified {
13222		if res.Body != nil {
13223			res.Body.Close()
13224		}
13225		return nil, &googleapi.Error{
13226			Code:   res.StatusCode,
13227			Header: res.Header,
13228		}
13229	}
13230	if err != nil {
13231		return nil, err
13232	}
13233	defer googleapi.CloseBody(res)
13234	if err := googleapi.CheckResponse(res); err != nil {
13235		return nil, err
13236	}
13237	ret := &ServiceAccount{
13238		ServerResponse: googleapi.ServerResponse{
13239			Header:         res.Header,
13240			HTTPStatusCode: res.StatusCode,
13241		},
13242	}
13243	target := &ret
13244	if err := gensupport.DecodeResponse(target, res); err != nil {
13245		return nil, err
13246	}
13247	return ret, nil
13248	// {
13249	//   "description": "Get the email address of this project's Google Cloud Storage service account.",
13250	//   "httpMethod": "GET",
13251	//   "id": "storage.projects.serviceAccount.get",
13252	//   "parameterOrder": [
13253	//     "projectId"
13254	//   ],
13255	//   "parameters": {
13256	//     "projectId": {
13257	//       "description": "Project ID",
13258	//       "location": "path",
13259	//       "required": true,
13260	//       "type": "string"
13261	//     },
13262	//     "provisionalUserProject": {
13263	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
13264	//       "location": "query",
13265	//       "type": "string"
13266	//     },
13267	//     "userProject": {
13268	//       "description": "The project to be billed for this request.",
13269	//       "location": "query",
13270	//       "type": "string"
13271	//     }
13272	//   },
13273	//   "path": "projects/{projectId}/serviceAccount",
13274	//   "response": {
13275	//     "$ref": "ServiceAccount"
13276	//   },
13277	//   "scopes": [
13278	//     "https://www.googleapis.com/auth/cloud-platform",
13279	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13280	//     "https://www.googleapis.com/auth/devstorage.full_control",
13281	//     "https://www.googleapis.com/auth/devstorage.read_only",
13282	//     "https://www.googleapis.com/auth/devstorage.read_write"
13283	//   ]
13284	// }
13285
13286}
13287