• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Package storage provides access to the Cloud Storage JSON API.
2//
3// See https://developers.google.com/storage/docs/json_api/
4//
5// Usage example:
6//
7//   import "google.golang.org/api/storage/v1"
8//   ...
9//   storageService, err := storage.New(oauthHttpClient)
10package storage
11
12import (
13	"bytes"
14	"encoding/json"
15	"errors"
16	"fmt"
17	context "golang.org/x/net/context"
18	ctxhttp "golang.org/x/net/context/ctxhttp"
19	gensupport "google.golang.org/api/gensupport"
20	googleapi "google.golang.org/api/googleapi"
21	"io"
22	"net/http"
23	"net/url"
24	"strconv"
25	"strings"
26)
27
28// Always reference these packages, just in case the auto-generated code
29// below doesn't.
30var _ = bytes.NewBuffer
31var _ = strconv.Itoa
32var _ = fmt.Sprintf
33var _ = json.NewDecoder
34var _ = io.Copy
35var _ = url.Parse
36var _ = gensupport.MarshalJSON
37var _ = googleapi.Version
38var _ = errors.New
39var _ = strings.Replace
40var _ = context.Canceled
41var _ = ctxhttp.Do
42
43const apiId = "storage:v1"
44const apiName = "storage"
45const apiVersion = "v1"
46const basePath = "https://www.googleapis.com/storage/v1/"
47
48// OAuth2 scopes used by this API.
49const (
50	// View and manage your data across Google Cloud Platform services
51	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
52
53	// View your data across Google Cloud Platform services
54	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
55
56	// Manage your data and permissions in Google Cloud Storage
57	DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
58
59	// View your data in Google Cloud Storage
60	DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
61
62	// Manage your data in Google Cloud Storage
63	DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
64)
65
66func New(client *http.Client) (*Service, error) {
67	if client == nil {
68		return nil, errors.New("client is nil")
69	}
70	s := &Service{client: client, BasePath: basePath}
71	s.BucketAccessControls = NewBucketAccessControlsService(s)
72	s.Buckets = NewBucketsService(s)
73	s.Channels = NewChannelsService(s)
74	s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
75	s.Notifications = NewNotificationsService(s)
76	s.ObjectAccessControls = NewObjectAccessControlsService(s)
77	s.Objects = NewObjectsService(s)
78	s.Projects = NewProjectsService(s)
79	return s, nil
80}
81
82type Service struct {
83	client    *http.Client
84	BasePath  string // API endpoint base URL
85	UserAgent string // optional additional User-Agent fragment
86
87	BucketAccessControls *BucketAccessControlsService
88
89	Buckets *BucketsService
90
91	Channels *ChannelsService
92
93	DefaultObjectAccessControls *DefaultObjectAccessControlsService
94
95	Notifications *NotificationsService
96
97	ObjectAccessControls *ObjectAccessControlsService
98
99	Objects *ObjectsService
100
101	Projects *ProjectsService
102}
103
104func (s *Service) userAgent() string {
105	if s.UserAgent == "" {
106		return googleapi.UserAgent
107	}
108	return googleapi.UserAgent + " " + s.UserAgent
109}
110
111func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
112	rs := &BucketAccessControlsService{s: s}
113	return rs
114}
115
116type BucketAccessControlsService struct {
117	s *Service
118}
119
120func NewBucketsService(s *Service) *BucketsService {
121	rs := &BucketsService{s: s}
122	return rs
123}
124
125type BucketsService struct {
126	s *Service
127}
128
129func NewChannelsService(s *Service) *ChannelsService {
130	rs := &ChannelsService{s: s}
131	return rs
132}
133
134type ChannelsService struct {
135	s *Service
136}
137
138func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
139	rs := &DefaultObjectAccessControlsService{s: s}
140	return rs
141}
142
143type DefaultObjectAccessControlsService struct {
144	s *Service
145}
146
147func NewNotificationsService(s *Service) *NotificationsService {
148	rs := &NotificationsService{s: s}
149	return rs
150}
151
152type NotificationsService struct {
153	s *Service
154}
155
156func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
157	rs := &ObjectAccessControlsService{s: s}
158	return rs
159}
160
161type ObjectAccessControlsService struct {
162	s *Service
163}
164
165func NewObjectsService(s *Service) *ObjectsService {
166	rs := &ObjectsService{s: s}
167	return rs
168}
169
170type ObjectsService struct {
171	s *Service
172}
173
174func NewProjectsService(s *Service) *ProjectsService {
175	rs := &ProjectsService{s: s}
176	rs.ServiceAccount = NewProjectsServiceAccountService(s)
177	return rs
178}
179
180type ProjectsService struct {
181	s *Service
182
183	ServiceAccount *ProjectsServiceAccountService
184}
185
186func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
187	rs := &ProjectsServiceAccountService{s: s}
188	return rs
189}
190
191type ProjectsServiceAccountService struct {
192	s *Service
193}
194
195// Bucket: A bucket.
196type Bucket struct {
197	// Acl: Access controls on the bucket.
198	Acl []*BucketAccessControl `json:"acl,omitempty"`
199
200	// Billing: The bucket's billing configuration.
201	Billing *BucketBilling `json:"billing,omitempty"`
202
203	// Cors: The bucket's Cross-Origin Resource Sharing (CORS)
204	// configuration.
205	Cors []*BucketCors `json:"cors,omitempty"`
206
207	// DefaultObjectAcl: Default access controls to apply to new objects
208	// when no ACL is provided.
209	DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
210
211	// Encryption: Encryption configuration used by default for newly
212	// inserted objects, when no encryption config is specified.
213	Encryption *BucketEncryption `json:"encryption,omitempty"`
214
215	// Etag: HTTP 1.1 Entity tag for the bucket.
216	Etag string `json:"etag,omitempty"`
217
218	// Id: The ID of the bucket. For buckets, the id and name properities
219	// are the same.
220	Id string `json:"id,omitempty"`
221
222	// Kind: The kind of item this is. For buckets, this is always
223	// storage#bucket.
224	Kind string `json:"kind,omitempty"`
225
226	// Labels: User-provided labels, in key/value pairs.
227	Labels map[string]string `json:"labels,omitempty"`
228
229	// Lifecycle: The bucket's lifecycle configuration. See lifecycle
230	// management for more information.
231	Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
232
233	// Location: The location of the bucket. Object data for objects in the
234	// bucket resides in physical storage within this region. Defaults to
235	// US. See the developer's guide for the authoritative list.
236	Location string `json:"location,omitempty"`
237
238	// Logging: The bucket's logging configuration, which defines the
239	// destination bucket and optional name prefix for the current bucket's
240	// logs.
241	Logging *BucketLogging `json:"logging,omitempty"`
242
243	// Metageneration: The metadata generation of this bucket.
244	Metageneration int64 `json:"metageneration,omitempty,string"`
245
246	// Name: The name of the bucket.
247	Name string `json:"name,omitempty"`
248
249	// Owner: The owner of the bucket. This is always the project team's
250	// owner group.
251	Owner *BucketOwner `json:"owner,omitempty"`
252
253	// ProjectNumber: The project number of the project the bucket belongs
254	// to.
255	ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
256
257	// SelfLink: The URI of this bucket.
258	SelfLink string `json:"selfLink,omitempty"`
259
260	// StorageClass: The bucket's default storage class, used whenever no
261	// storageClass is specified for a newly-created object. This defines
262	// how objects in the bucket are stored and determines the SLA and the
263	// cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD,
264	// NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value
265	// is not specified when the bucket is created, it will default to
266	// STANDARD. For more information, see storage classes.
267	StorageClass string `json:"storageClass,omitempty"`
268
269	// TimeCreated: The creation time of the bucket in RFC 3339 format.
270	TimeCreated string `json:"timeCreated,omitempty"`
271
272	// Updated: The modification time of the bucket in RFC 3339 format.
273	Updated string `json:"updated,omitempty"`
274
275	// Versioning: The bucket's versioning configuration.
276	Versioning *BucketVersioning `json:"versioning,omitempty"`
277
278	// Website: The bucket's website configuration, controlling how the
279	// service behaves when accessing bucket contents as a web site. See the
280	// Static Website Examples for more information.
281	Website *BucketWebsite `json:"website,omitempty"`
282
283	// ServerResponse contains the HTTP response code and headers from the
284	// server.
285	googleapi.ServerResponse `json:"-"`
286
287	// ForceSendFields is a list of field names (e.g. "Acl") to
288	// unconditionally include in API requests. By default, fields with
289	// empty values are omitted from API requests. However, any non-pointer,
290	// non-interface field appearing in ForceSendFields will be sent to the
291	// server regardless of whether the field is empty or not. This may be
292	// used to include empty fields in Patch requests.
293	ForceSendFields []string `json:"-"`
294
295	// NullFields is a list of field names (e.g. "Acl") to include in API
296	// requests with the JSON null value. By default, fields with empty
297	// values are omitted from API requests. However, any field with an
298	// empty value appearing in NullFields will be sent to the server as
299	// null. It is an error if a field in this list has a non-empty value.
300	// This may be used to include null fields in Patch requests.
301	NullFields []string `json:"-"`
302}
303
304func (s *Bucket) MarshalJSON() ([]byte, error) {
305	type noMethod Bucket
306	raw := noMethod(*s)
307	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
308}
309
310// BucketBilling: The bucket's billing configuration.
311type BucketBilling struct {
312	// RequesterPays: When set to true, bucket is requester pays.
313	RequesterPays bool `json:"requesterPays,omitempty"`
314
315	// ForceSendFields is a list of field names (e.g. "RequesterPays") to
316	// unconditionally include in API requests. By default, fields with
317	// empty values are omitted from API requests. However, any non-pointer,
318	// non-interface field appearing in ForceSendFields will be sent to the
319	// server regardless of whether the field is empty or not. This may be
320	// used to include empty fields in Patch requests.
321	ForceSendFields []string `json:"-"`
322
323	// NullFields is a list of field names (e.g. "RequesterPays") to include
324	// in API requests with the JSON null value. By default, fields with
325	// empty values are omitted from API requests. However, any field with
326	// an empty value appearing in NullFields will be sent to the server as
327	// null. It is an error if a field in this list has a non-empty value.
328	// This may be used to include null fields in Patch requests.
329	NullFields []string `json:"-"`
330}
331
332func (s *BucketBilling) MarshalJSON() ([]byte, error) {
333	type noMethod BucketBilling
334	raw := noMethod(*s)
335	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
336}
337
338type BucketCors struct {
339	// MaxAgeSeconds: The value, in seconds, to return in the
340	// Access-Control-Max-Age header used in preflight responses.
341	MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
342
343	// Method: The list of HTTP methods on which to include CORS response
344	// headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list
345	// of methods, and means "any method".
346	Method []string `json:"method,omitempty"`
347
348	// Origin: The list of Origins eligible to receive CORS response
349	// headers. Note: "*" is permitted in the list of origins, and means
350	// "any Origin".
351	Origin []string `json:"origin,omitempty"`
352
353	// ResponseHeader: The list of HTTP headers other than the simple
354	// response headers to give permission for the user-agent to share
355	// across domains.
356	ResponseHeader []string `json:"responseHeader,omitempty"`
357
358	// ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
359	// unconditionally include in API requests. By default, fields with
360	// empty values are omitted from API requests. However, any non-pointer,
361	// non-interface field appearing in ForceSendFields will be sent to the
362	// server regardless of whether the field is empty or not. This may be
363	// used to include empty fields in Patch requests.
364	ForceSendFields []string `json:"-"`
365
366	// NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
367	// in API requests with the JSON null value. By default, fields with
368	// empty values are omitted from API requests. However, any field with
369	// an empty value appearing in NullFields will be sent to the server as
370	// null. It is an error if a field in this list has a non-empty value.
371	// This may be used to include null fields in Patch requests.
372	NullFields []string `json:"-"`
373}
374
375func (s *BucketCors) MarshalJSON() ([]byte, error) {
376	type noMethod BucketCors
377	raw := noMethod(*s)
378	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
379}
380
381// BucketEncryption: Encryption configuration used by default for newly
382// inserted objects, when no encryption config is specified.
383type BucketEncryption struct {
384	DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
385
386	// ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName")
387	// to unconditionally include in API requests. By default, fields with
388	// empty values are omitted from API requests. However, any non-pointer,
389	// non-interface field appearing in ForceSendFields will be sent to the
390	// server regardless of whether the field is empty or not. This may be
391	// used to include empty fields in Patch requests.
392	ForceSendFields []string `json:"-"`
393
394	// NullFields is a list of field names (e.g. "DefaultKmsKeyName") to
395	// include in API requests with the JSON null value. By default, fields
396	// with empty values are omitted from API requests. However, any field
397	// with an empty value appearing in NullFields will be sent to the
398	// server as null. It is an error if a field in this list has a
399	// non-empty value. This may be used to include null fields in Patch
400	// requests.
401	NullFields []string `json:"-"`
402}
403
404func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
405	type noMethod BucketEncryption
406	raw := noMethod(*s)
407	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
408}
409
410// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
411// management for more information.
412type BucketLifecycle struct {
413	// Rule: A lifecycle management rule, which is made of an action to take
414	// and the condition(s) under which the action will be taken.
415	Rule []*BucketLifecycleRule `json:"rule,omitempty"`
416
417	// ForceSendFields is a list of field names (e.g. "Rule") to
418	// unconditionally include in API requests. By default, fields with
419	// empty values are omitted from API requests. However, any non-pointer,
420	// non-interface field appearing in ForceSendFields will be sent to the
421	// server regardless of whether the field is empty or not. This may be
422	// used to include empty fields in Patch requests.
423	ForceSendFields []string `json:"-"`
424
425	// NullFields is a list of field names (e.g. "Rule") to include in API
426	// requests with the JSON null value. By default, fields with empty
427	// values are omitted from API requests. However, any field with an
428	// empty value appearing in NullFields will be sent to the server as
429	// null. It is an error if a field in this list has a non-empty value.
430	// This may be used to include null fields in Patch requests.
431	NullFields []string `json:"-"`
432}
433
434func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
435	type noMethod BucketLifecycle
436	raw := noMethod(*s)
437	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
438}
439
440type BucketLifecycleRule struct {
441	// Action: The action to take.
442	Action *BucketLifecycleRuleAction `json:"action,omitempty"`
443
444	// Condition: The condition(s) under which the action will be taken.
445	Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
446
447	// ForceSendFields is a list of field names (e.g. "Action") to
448	// unconditionally include in API requests. By default, fields with
449	// empty values are omitted from API requests. However, any non-pointer,
450	// non-interface field appearing in ForceSendFields will be sent to the
451	// server regardless of whether the field is empty or not. This may be
452	// used to include empty fields in Patch requests.
453	ForceSendFields []string `json:"-"`
454
455	// NullFields is a list of field names (e.g. "Action") to include in API
456	// requests with the JSON null value. By default, fields with empty
457	// values are omitted from API requests. However, any field with an
458	// empty value appearing in NullFields will be sent to the server as
459	// null. It is an error if a field in this list has a non-empty value.
460	// This may be used to include null fields in Patch requests.
461	NullFields []string `json:"-"`
462}
463
464func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
465	type noMethod BucketLifecycleRule
466	raw := noMethod(*s)
467	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
468}
469
470// BucketLifecycleRuleAction: The action to take.
471type BucketLifecycleRuleAction struct {
472	// StorageClass: Target storage class. Required iff the type of the
473	// action is SetStorageClass.
474	StorageClass string `json:"storageClass,omitempty"`
475
476	// Type: Type of the action. Currently, only Delete and SetStorageClass
477	// are supported.
478	Type string `json:"type,omitempty"`
479
480	// ForceSendFields is a list of field names (e.g. "StorageClass") to
481	// unconditionally include in API requests. By default, fields with
482	// empty values are omitted from API requests. However, any non-pointer,
483	// non-interface field appearing in ForceSendFields will be sent to the
484	// server regardless of whether the field is empty or not. This may be
485	// used to include empty fields in Patch requests.
486	ForceSendFields []string `json:"-"`
487
488	// NullFields is a list of field names (e.g. "StorageClass") to include
489	// in API requests with the JSON null value. By default, fields with
490	// empty values are omitted from API requests. However, any field with
491	// an empty value appearing in NullFields will be sent to the server as
492	// null. It is an error if a field in this list has a non-empty value.
493	// This may be used to include null fields in Patch requests.
494	NullFields []string `json:"-"`
495}
496
497func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
498	type noMethod BucketLifecycleRuleAction
499	raw := noMethod(*s)
500	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
501}
502
503// BucketLifecycleRuleCondition: The condition(s) under which the action
504// will be taken.
505type BucketLifecycleRuleCondition struct {
506	// Age: Age of an object (in days). This condition is satisfied when an
507	// object reaches the specified age.
508	Age int64 `json:"age,omitempty"`
509
510	// CreatedBefore: A date in RFC 3339 format with only the date part (for
511	// instance, "2013-01-15"). This condition is satisfied when an object
512	// is created before midnight of the specified date in UTC.
513	CreatedBefore string `json:"createdBefore,omitempty"`
514
515	// IsLive: Relevant only for versioned objects. If the value is true,
516	// this condition matches live objects; if the value is false, it
517	// matches archived objects.
518	IsLive *bool `json:"isLive,omitempty"`
519
520	// MatchesStorageClass: Objects having any of the storage classes
521	// specified by this condition will be matched. Values include
522	// MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and
523	// DURABLE_REDUCED_AVAILABILITY.
524	MatchesStorageClass []string `json:"matchesStorageClass,omitempty"`
525
526	// NumNewerVersions: Relevant only for versioned objects. If the value
527	// is N, this condition is satisfied when there are at least N versions
528	// (including the live version) newer than this version of the object.
529	NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
530
531	// ForceSendFields is a list of field names (e.g. "Age") to
532	// unconditionally include in API requests. By default, fields with
533	// empty values are omitted from API requests. However, any non-pointer,
534	// non-interface field appearing in ForceSendFields will be sent to the
535	// server regardless of whether the field is empty or not. This may be
536	// used to include empty fields in Patch requests.
537	ForceSendFields []string `json:"-"`
538
539	// NullFields is a list of field names (e.g. "Age") to include in API
540	// requests with the JSON null value. By default, fields with empty
541	// values are omitted from API requests. However, any field with an
542	// empty value appearing in NullFields will be sent to the server as
543	// null. It is an error if a field in this list has a non-empty value.
544	// This may be used to include null fields in Patch requests.
545	NullFields []string `json:"-"`
546}
547
548func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
549	type noMethod BucketLifecycleRuleCondition
550	raw := noMethod(*s)
551	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
552}
553
554// BucketLogging: The bucket's logging configuration, which defines the
555// destination bucket and optional name prefix for the current bucket's
556// logs.
557type BucketLogging struct {
558	// LogBucket: The destination bucket where the current bucket's logs
559	// should be placed.
560	LogBucket string `json:"logBucket,omitempty"`
561
562	// LogObjectPrefix: A prefix for log object names.
563	LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
564
565	// ForceSendFields is a list of field names (e.g. "LogBucket") to
566	// unconditionally include in API requests. By default, fields with
567	// empty values are omitted from API requests. However, any non-pointer,
568	// non-interface field appearing in ForceSendFields will be sent to the
569	// server regardless of whether the field is empty or not. This may be
570	// used to include empty fields in Patch requests.
571	ForceSendFields []string `json:"-"`
572
573	// NullFields is a list of field names (e.g. "LogBucket") to include in
574	// API requests with the JSON null value. By default, fields with empty
575	// values are omitted from API requests. However, any field with an
576	// empty value appearing in NullFields will be sent to the server as
577	// null. It is an error if a field in this list has a non-empty value.
578	// This may be used to include null fields in Patch requests.
579	NullFields []string `json:"-"`
580}
581
582func (s *BucketLogging) MarshalJSON() ([]byte, error) {
583	type noMethod BucketLogging
584	raw := noMethod(*s)
585	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
586}
587
588// BucketOwner: The owner of the bucket. This is always the project
589// team's owner group.
590type BucketOwner struct {
591	// Entity: The entity, in the form project-owner-projectId.
592	Entity string `json:"entity,omitempty"`
593
594	// EntityId: The ID for the entity.
595	EntityId string `json:"entityId,omitempty"`
596
597	// ForceSendFields is a list of field names (e.g. "Entity") to
598	// unconditionally include in API requests. By default, fields with
599	// empty values are omitted from API requests. However, any non-pointer,
600	// non-interface field appearing in ForceSendFields will be sent to the
601	// server regardless of whether the field is empty or not. This may be
602	// used to include empty fields in Patch requests.
603	ForceSendFields []string `json:"-"`
604
605	// NullFields is a list of field names (e.g. "Entity") to include in API
606	// requests with the JSON null value. By default, fields with empty
607	// values are omitted from API requests. However, any field with an
608	// empty value appearing in NullFields will be sent to the server as
609	// null. It is an error if a field in this list has a non-empty value.
610	// This may be used to include null fields in Patch requests.
611	NullFields []string `json:"-"`
612}
613
614func (s *BucketOwner) MarshalJSON() ([]byte, error) {
615	type noMethod BucketOwner
616	raw := noMethod(*s)
617	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
618}
619
620// BucketVersioning: The bucket's versioning configuration.
621type BucketVersioning struct {
622	// Enabled: While set to true, versioning is fully enabled for this
623	// bucket.
624	Enabled bool `json:"enabled,omitempty"`
625
626	// ForceSendFields is a list of field names (e.g. "Enabled") to
627	// unconditionally include in API requests. By default, fields with
628	// empty values are omitted from API requests. However, any non-pointer,
629	// non-interface field appearing in ForceSendFields will be sent to the
630	// server regardless of whether the field is empty or not. This may be
631	// used to include empty fields in Patch requests.
632	ForceSendFields []string `json:"-"`
633
634	// NullFields is a list of field names (e.g. "Enabled") to include in
635	// API requests with the JSON null value. By default, fields with empty
636	// values are omitted from API requests. However, any field with an
637	// empty value appearing in NullFields will be sent to the server as
638	// null. It is an error if a field in this list has a non-empty value.
639	// This may be used to include null fields in Patch requests.
640	NullFields []string `json:"-"`
641}
642
643func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
644	type noMethod BucketVersioning
645	raw := noMethod(*s)
646	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
647}
648
649// BucketWebsite: The bucket's website configuration, controlling how
650// the service behaves when accessing bucket contents as a web site. See
651// the Static Website Examples for more information.
652type BucketWebsite struct {
653	// MainPageSuffix: If the requested object path is missing, the service
654	// will ensure the path has a trailing '/', append this suffix, and
655	// attempt to retrieve the resulting object. This allows the creation of
656	// index.html objects to represent directory pages.
657	MainPageSuffix string `json:"mainPageSuffix,omitempty"`
658
659	// NotFoundPage: If the requested object path is missing, and any
660	// mainPageSuffix object is missing, if applicable, the service will
661	// return the named object from this bucket as the content for a 404 Not
662	// Found result.
663	NotFoundPage string `json:"notFoundPage,omitempty"`
664
665	// ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
666	// unconditionally include in API requests. By default, fields with
667	// empty values are omitted from API requests. However, any non-pointer,
668	// non-interface field appearing in ForceSendFields will be sent to the
669	// server regardless of whether the field is empty or not. This may be
670	// used to include empty fields in Patch requests.
671	ForceSendFields []string `json:"-"`
672
673	// NullFields is a list of field names (e.g. "MainPageSuffix") to
674	// include in API requests with the JSON null value. By default, fields
675	// with empty values are omitted from API requests. However, any field
676	// with an empty value appearing in NullFields will be sent to the
677	// server as null. It is an error if a field in this list has a
678	// non-empty value. This may be used to include null fields in Patch
679	// requests.
680	NullFields []string `json:"-"`
681}
682
683func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
684	type noMethod BucketWebsite
685	raw := noMethod(*s)
686	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
687}
688
689// BucketAccessControl: An access-control entry.
690type BucketAccessControl struct {
691	// Bucket: The name of the bucket.
692	Bucket string `json:"bucket,omitempty"`
693
694	// Domain: The domain associated with the entity, if any.
695	Domain string `json:"domain,omitempty"`
696
697	// Email: The email address associated with the entity, if any.
698	Email string `json:"email,omitempty"`
699
700	// Entity: The entity holding the permission, in one of the following
701	// forms:
702	// - user-userId
703	// - user-email
704	// - group-groupId
705	// - group-email
706	// - domain-domain
707	// - project-team-projectId
708	// - allUsers
709	// - allAuthenticatedUsers Examples:
710	// - The user liz@example.com would be user-liz@example.com.
711	// - The group example@googlegroups.com would be
712	// group-example@googlegroups.com.
713	// - To refer to all members of the Google Apps for Business domain
714	// example.com, the entity would be domain-example.com.
715	Entity string `json:"entity,omitempty"`
716
717	// EntityId: The ID for the entity, if any.
718	EntityId string `json:"entityId,omitempty"`
719
720	// Etag: HTTP 1.1 Entity tag for the access-control entry.
721	Etag string `json:"etag,omitempty"`
722
723	// Id: The ID of the access-control entry.
724	Id string `json:"id,omitempty"`
725
726	// Kind: The kind of item this is. For bucket access control entries,
727	// this is always storage#bucketAccessControl.
728	Kind string `json:"kind,omitempty"`
729
730	// ProjectTeam: The project team associated with the entity, if any.
731	ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
732
733	// Role: The access permission for the entity.
734	Role string `json:"role,omitempty"`
735
736	// SelfLink: The link to this access-control entry.
737	SelfLink string `json:"selfLink,omitempty"`
738
739	// ServerResponse contains the HTTP response code and headers from the
740	// server.
741	googleapi.ServerResponse `json:"-"`
742
743	// ForceSendFields is a list of field names (e.g. "Bucket") to
744	// unconditionally include in API requests. By default, fields with
745	// empty values are omitted from API requests. However, any non-pointer,
746	// non-interface field appearing in ForceSendFields will be sent to the
747	// server regardless of whether the field is empty or not. This may be
748	// used to include empty fields in Patch requests.
749	ForceSendFields []string `json:"-"`
750
751	// NullFields is a list of field names (e.g. "Bucket") to include in API
752	// requests with the JSON null value. By default, fields with empty
753	// values are omitted from API requests. However, any field with an
754	// empty value appearing in NullFields will be sent to the server as
755	// null. It is an error if a field in this list has a non-empty value.
756	// This may be used to include null fields in Patch requests.
757	NullFields []string `json:"-"`
758}
759
760func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
761	type noMethod BucketAccessControl
762	raw := noMethod(*s)
763	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
764}
765
766// BucketAccessControlProjectTeam: The project team associated with the
767// entity, if any.
768type BucketAccessControlProjectTeam struct {
769	// ProjectNumber: The project number.
770	ProjectNumber string `json:"projectNumber,omitempty"`
771
772	// Team: The team.
773	Team string `json:"team,omitempty"`
774
775	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
776	// unconditionally include in API requests. By default, fields with
777	// empty values are omitted from API requests. However, any non-pointer,
778	// non-interface field appearing in ForceSendFields will be sent to the
779	// server regardless of whether the field is empty or not. This may be
780	// used to include empty fields in Patch requests.
781	ForceSendFields []string `json:"-"`
782
783	// NullFields is a list of field names (e.g. "ProjectNumber") to include
784	// in API requests with the JSON null value. By default, fields with
785	// empty values are omitted from API requests. However, any field with
786	// an empty value appearing in NullFields will be sent to the server as
787	// null. It is an error if a field in this list has a non-empty value.
788	// This may be used to include null fields in Patch requests.
789	NullFields []string `json:"-"`
790}
791
792func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
793	type noMethod BucketAccessControlProjectTeam
794	raw := noMethod(*s)
795	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
796}
797
798// BucketAccessControls: An access-control list.
799type BucketAccessControls struct {
800	// Items: The list of items.
801	Items []*BucketAccessControl `json:"items,omitempty"`
802
803	// Kind: The kind of item this is. For lists of bucket access control
804	// entries, this is always storage#bucketAccessControls.
805	Kind string `json:"kind,omitempty"`
806
807	// ServerResponse contains the HTTP response code and headers from the
808	// server.
809	googleapi.ServerResponse `json:"-"`
810
811	// ForceSendFields is a list of field names (e.g. "Items") to
812	// unconditionally include in API requests. By default, fields with
813	// empty values are omitted from API requests. However, any non-pointer,
814	// non-interface field appearing in ForceSendFields will be sent to the
815	// server regardless of whether the field is empty or not. This may be
816	// used to include empty fields in Patch requests.
817	ForceSendFields []string `json:"-"`
818
819	// NullFields is a list of field names (e.g. "Items") to include in API
820	// requests with the JSON null value. By default, fields with empty
821	// values are omitted from API requests. However, any field with an
822	// empty value appearing in NullFields will be sent to the server as
823	// null. It is an error if a field in this list has a non-empty value.
824	// This may be used to include null fields in Patch requests.
825	NullFields []string `json:"-"`
826}
827
828func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
829	type noMethod BucketAccessControls
830	raw := noMethod(*s)
831	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
832}
833
834// Buckets: A list of buckets.
835type Buckets struct {
836	// Items: The list of items.
837	Items []*Bucket `json:"items,omitempty"`
838
839	// Kind: The kind of item this is. For lists of buckets, this is always
840	// storage#buckets.
841	Kind string `json:"kind,omitempty"`
842
843	// NextPageToken: The continuation token, used to page through large
844	// result sets. Provide this value in a subsequent request to return the
845	// next page of results.
846	NextPageToken string `json:"nextPageToken,omitempty"`
847
848	// ServerResponse contains the HTTP response code and headers from the
849	// server.
850	googleapi.ServerResponse `json:"-"`
851
852	// ForceSendFields is a list of field names (e.g. "Items") to
853	// unconditionally include in API requests. By default, fields with
854	// empty values are omitted from API requests. However, any non-pointer,
855	// non-interface field appearing in ForceSendFields will be sent to the
856	// server regardless of whether the field is empty or not. This may be
857	// used to include empty fields in Patch requests.
858	ForceSendFields []string `json:"-"`
859
860	// NullFields is a list of field names (e.g. "Items") to include in API
861	// requests with the JSON null value. By default, fields with empty
862	// values are omitted from API requests. However, any field with an
863	// empty value appearing in NullFields will be sent to the server as
864	// null. It is an error if a field in this list has a non-empty value.
865	// This may be used to include null fields in Patch requests.
866	NullFields []string `json:"-"`
867}
868
869func (s *Buckets) MarshalJSON() ([]byte, error) {
870	type noMethod Buckets
871	raw := noMethod(*s)
872	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
873}
874
875// Channel: An notification channel used to watch for resource changes.
876type Channel struct {
877	// Address: The address where notifications are delivered for this
878	// channel.
879	Address string `json:"address,omitempty"`
880
881	// Expiration: Date and time of notification channel expiration,
882	// expressed as a Unix timestamp, in milliseconds. Optional.
883	Expiration int64 `json:"expiration,omitempty,string"`
884
885	// Id: A UUID or similar unique string that identifies this channel.
886	Id string `json:"id,omitempty"`
887
888	// Kind: Identifies this as a notification channel used to watch for
889	// changes to a resource. Value: the fixed string "api#channel".
890	Kind string `json:"kind,omitempty"`
891
892	// Params: Additional parameters controlling delivery channel behavior.
893	// Optional.
894	Params map[string]string `json:"params,omitempty"`
895
896	// Payload: A Boolean value to indicate whether payload is wanted.
897	// Optional.
898	Payload bool `json:"payload,omitempty"`
899
900	// ResourceId: An opaque ID that identifies the resource being watched
901	// on this channel. Stable across different API versions.
902	ResourceId string `json:"resourceId,omitempty"`
903
904	// ResourceUri: A version-specific identifier for the watched resource.
905	ResourceUri string `json:"resourceUri,omitempty"`
906
907	// Token: An arbitrary string delivered to the target address with each
908	// notification delivered over this channel. Optional.
909	Token string `json:"token,omitempty"`
910
911	// Type: The type of delivery mechanism used for this channel.
912	Type string `json:"type,omitempty"`
913
914	// ServerResponse contains the HTTP response code and headers from the
915	// server.
916	googleapi.ServerResponse `json:"-"`
917
918	// ForceSendFields is a list of field names (e.g. "Address") to
919	// unconditionally include in API requests. By default, fields with
920	// empty values are omitted from API requests. However, any non-pointer,
921	// non-interface field appearing in ForceSendFields will be sent to the
922	// server regardless of whether the field is empty or not. This may be
923	// used to include empty fields in Patch requests.
924	ForceSendFields []string `json:"-"`
925
926	// NullFields is a list of field names (e.g. "Address") to include in
927	// API requests with the JSON null value. By default, fields with empty
928	// values are omitted from API requests. However, any field with an
929	// empty value appearing in NullFields will be sent to the server as
930	// null. It is an error if a field in this list has a non-empty value.
931	// This may be used to include null fields in Patch requests.
932	NullFields []string `json:"-"`
933}
934
935func (s *Channel) MarshalJSON() ([]byte, error) {
936	type noMethod Channel
937	raw := noMethod(*s)
938	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
939}
940
941// ComposeRequest: A Compose request.
942type ComposeRequest struct {
943	// Destination: Properties of the resulting object.
944	Destination *Object `json:"destination,omitempty"`
945
946	// Kind: The kind of item this is.
947	Kind string `json:"kind,omitempty"`
948
949	// SourceObjects: The list of source objects that will be concatenated
950	// into a single object.
951	SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
952
953	// ForceSendFields is a list of field names (e.g. "Destination") to
954	// unconditionally include in API requests. By default, fields with
955	// empty values are omitted from API requests. However, any non-pointer,
956	// non-interface field appearing in ForceSendFields will be sent to the
957	// server regardless of whether the field is empty or not. This may be
958	// used to include empty fields in Patch requests.
959	ForceSendFields []string `json:"-"`
960
961	// NullFields is a list of field names (e.g. "Destination") to include
962	// in API requests with the JSON null value. By default, fields with
963	// empty values are omitted from API requests. However, any field with
964	// an empty value appearing in NullFields will be sent to the server as
965	// null. It is an error if a field in this list has a non-empty value.
966	// This may be used to include null fields in Patch requests.
967	NullFields []string `json:"-"`
968}
969
970func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
971	type noMethod ComposeRequest
972	raw := noMethod(*s)
973	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
974}
975
976type ComposeRequestSourceObjects struct {
977	// Generation: The generation of this object to use as the source.
978	Generation int64 `json:"generation,omitempty,string"`
979
980	// Name: The source object's name. The source object's bucket is
981	// implicitly the destination bucket.
982	Name string `json:"name,omitempty"`
983
984	// ObjectPreconditions: Conditions that must be met for this operation
985	// to execute.
986	ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
987
988	// ForceSendFields is a list of field names (e.g. "Generation") to
989	// unconditionally include in API requests. By default, fields with
990	// empty values are omitted from API requests. However, any non-pointer,
991	// non-interface field appearing in ForceSendFields will be sent to the
992	// server regardless of whether the field is empty or not. This may be
993	// used to include empty fields in Patch requests.
994	ForceSendFields []string `json:"-"`
995
996	// NullFields is a list of field names (e.g. "Generation") to include in
997	// API requests with the JSON null value. By default, fields with empty
998	// values are omitted from API requests. However, any field with an
999	// empty value appearing in NullFields will be sent to the server as
1000	// null. It is an error if a field in this list has a non-empty value.
1001	// This may be used to include null fields in Patch requests.
1002	NullFields []string `json:"-"`
1003}
1004
1005func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
1006	type noMethod ComposeRequestSourceObjects
1007	raw := noMethod(*s)
1008	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1009}
1010
1011// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
1012// be met for this operation to execute.
1013type ComposeRequestSourceObjectsObjectPreconditions struct {
1014	// IfGenerationMatch: Only perform the composition if the generation of
1015	// the source object that would be used matches this value. If this
1016	// value and a generation are both specified, they must be the same
1017	// value or the call will fail.
1018	IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
1019
1020	// ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
1021	// to unconditionally include in API requests. By default, fields with
1022	// empty values are omitted from API requests. However, any non-pointer,
1023	// non-interface field appearing in ForceSendFields will be sent to the
1024	// server regardless of whether the field is empty or not. This may be
1025	// used to include empty fields in Patch requests.
1026	ForceSendFields []string `json:"-"`
1027
1028	// NullFields is a list of field names (e.g. "IfGenerationMatch") to
1029	// include in API requests with the JSON null value. By default, fields
1030	// with empty values are omitted from API requests. However, any field
1031	// with an empty value appearing in NullFields will be sent to the
1032	// server as null. It is an error if a field in this list has a
1033	// non-empty value. This may be used to include null fields in Patch
1034	// requests.
1035	NullFields []string `json:"-"`
1036}
1037
1038func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
1039	type noMethod ComposeRequestSourceObjectsObjectPreconditions
1040	raw := noMethod(*s)
1041	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1042}
1043
1044// Notification: A subscription to receive Google PubSub notifications.
1045type Notification struct {
1046	// CustomAttributes: An optional list of additional attributes to attach
1047	// to each Cloud PubSub message published for this notification
1048	// subscription.
1049	CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
1050
1051	// Etag: HTTP 1.1 Entity tag for this subscription notification.
1052	Etag string `json:"etag,omitempty"`
1053
1054	// EventTypes: If present, only send notifications about listed event
1055	// types. If empty, sent notifications for all event types.
1056	EventTypes []string `json:"event_types,omitempty"`
1057
1058	// Id: The ID of the notification.
1059	Id string `json:"id,omitempty"`
1060
1061	// Kind: The kind of item this is. For notifications, this is always
1062	// storage#notification.
1063	Kind string `json:"kind,omitempty"`
1064
1065	// ObjectNamePrefix: If present, only apply this notification
1066	// configuration to object names that begin with this prefix.
1067	ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
1068
1069	// PayloadFormat: The desired content of the Payload.
1070	PayloadFormat string `json:"payload_format,omitempty"`
1071
1072	// SelfLink: The canonical URL of this notification.
1073	SelfLink string `json:"selfLink,omitempty"`
1074
1075	// Topic: The Cloud PubSub topic to which this subscription publishes.
1076	// Formatted as:
1077	// '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
1078	// c}'
1079	Topic string `json:"topic,omitempty"`
1080
1081	// ServerResponse contains the HTTP response code and headers from the
1082	// server.
1083	googleapi.ServerResponse `json:"-"`
1084
1085	// ForceSendFields is a list of field names (e.g. "CustomAttributes") to
1086	// unconditionally include in API requests. By default, fields with
1087	// empty values are omitted from API requests. However, any non-pointer,
1088	// non-interface field appearing in ForceSendFields will be sent to the
1089	// server regardless of whether the field is empty or not. This may be
1090	// used to include empty fields in Patch requests.
1091	ForceSendFields []string `json:"-"`
1092
1093	// NullFields is a list of field names (e.g. "CustomAttributes") to
1094	// include in API requests with the JSON null value. By default, fields
1095	// with empty values are omitted from API requests. However, any field
1096	// with an empty value appearing in NullFields will be sent to the
1097	// server as null. It is an error if a field in this list has a
1098	// non-empty value. This may be used to include null fields in Patch
1099	// requests.
1100	NullFields []string `json:"-"`
1101}
1102
1103func (s *Notification) MarshalJSON() ([]byte, error) {
1104	type noMethod Notification
1105	raw := noMethod(*s)
1106	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1107}
1108
1109// Notifications: A list of notification subscriptions.
1110type Notifications struct {
1111	// Items: The list of items.
1112	Items []*Notification `json:"items,omitempty"`
1113
1114	// Kind: The kind of item this is. For lists of notifications, this is
1115	// always storage#notifications.
1116	Kind string `json:"kind,omitempty"`
1117
1118	// ServerResponse contains the HTTP response code and headers from the
1119	// server.
1120	googleapi.ServerResponse `json:"-"`
1121
1122	// ForceSendFields is a list of field names (e.g. "Items") to
1123	// unconditionally include in API requests. By default, fields with
1124	// empty values are omitted from API requests. However, any non-pointer,
1125	// non-interface field appearing in ForceSendFields will be sent to the
1126	// server regardless of whether the field is empty or not. This may be
1127	// used to include empty fields in Patch requests.
1128	ForceSendFields []string `json:"-"`
1129
1130	// NullFields is a list of field names (e.g. "Items") to include in API
1131	// requests with the JSON null value. By default, fields with empty
1132	// values are omitted from API requests. However, any field with an
1133	// empty value appearing in NullFields will be sent to the server as
1134	// null. It is an error if a field in this list has a non-empty value.
1135	// This may be used to include null fields in Patch requests.
1136	NullFields []string `json:"-"`
1137}
1138
1139func (s *Notifications) MarshalJSON() ([]byte, error) {
1140	type noMethod Notifications
1141	raw := noMethod(*s)
1142	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1143}
1144
1145// Object: An object.
1146type Object struct {
1147	// Acl: Access controls on the object.
1148	Acl []*ObjectAccessControl `json:"acl,omitempty"`
1149
1150	// Bucket: The name of the bucket containing this object.
1151	Bucket string `json:"bucket,omitempty"`
1152
1153	// CacheControl: Cache-Control directive for the object data. If
1154	// omitted, and the object is accessible to all anonymous users, the
1155	// default will be public, max-age=3600.
1156	CacheControl string `json:"cacheControl,omitempty"`
1157
1158	// ComponentCount: Number of underlying components that make up this
1159	// object. Components are accumulated by compose operations.
1160	ComponentCount int64 `json:"componentCount,omitempty"`
1161
1162	// ContentDisposition: Content-Disposition of the object data.
1163	ContentDisposition string `json:"contentDisposition,omitempty"`
1164
1165	// ContentEncoding: Content-Encoding of the object data.
1166	ContentEncoding string `json:"contentEncoding,omitempty"`
1167
1168	// ContentLanguage: Content-Language of the object data.
1169	ContentLanguage string `json:"contentLanguage,omitempty"`
1170
1171	// ContentType: Content-Type of the object data. If an object is stored
1172	// without a Content-Type, it is served as application/octet-stream.
1173	ContentType string `json:"contentType,omitempty"`
1174
1175	// Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
1176	// encoded using base64 in big-endian byte order. For more information
1177	// about using the CRC32c checksum, see Hashes and ETags: Best
1178	// Practices.
1179	Crc32c string `json:"crc32c,omitempty"`
1180
1181	// CustomerEncryption: Metadata of customer-supplied encryption key, if
1182	// the object is encrypted by such a key.
1183	CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
1184
1185	// Etag: HTTP 1.1 Entity tag for the object.
1186	Etag string `json:"etag,omitempty"`
1187
1188	// Generation: The content generation of this object. Used for object
1189	// versioning.
1190	Generation int64 `json:"generation,omitempty,string"`
1191
1192	// Id: The ID of the object, including the bucket name, object name, and
1193	// generation number.
1194	Id string `json:"id,omitempty"`
1195
1196	// Kind: The kind of item this is. For objects, this is always
1197	// storage#object.
1198	Kind string `json:"kind,omitempty"`
1199
1200	// KmsKeyName: Cloud KMS Key used to encrypt this object, if the object
1201	// is encrypted by such a key.
1202	KmsKeyName string `json:"kmsKeyName,omitempty"`
1203
1204	// Md5Hash: MD5 hash of the data; encoded using base64. For more
1205	// information about using the MD5 hash, see Hashes and ETags: Best
1206	// Practices.
1207	Md5Hash string `json:"md5Hash,omitempty"`
1208
1209	// MediaLink: Media download link.
1210	MediaLink string `json:"mediaLink,omitempty"`
1211
1212	// Metadata: User-provided metadata, in key/value pairs.
1213	Metadata map[string]string `json:"metadata,omitempty"`
1214
1215	// Metageneration: The version of the metadata for this object at this
1216	// generation. Used for preconditions and for detecting changes in
1217	// metadata. A metageneration number is only meaningful in the context
1218	// of a particular generation of a particular object.
1219	Metageneration int64 `json:"metageneration,omitempty,string"`
1220
1221	// Name: The name of the object. Required if not specified by URL
1222	// parameter.
1223	Name string `json:"name,omitempty"`
1224
1225	// Owner: The owner of the object. This will always be the uploader of
1226	// the object.
1227	Owner *ObjectOwner `json:"owner,omitempty"`
1228
1229	// SelfLink: The link to this object.
1230	SelfLink string `json:"selfLink,omitempty"`
1231
1232	// Size: Content-Length of the data in bytes.
1233	Size uint64 `json:"size,omitempty,string"`
1234
1235	// StorageClass: Storage class of the object.
1236	StorageClass string `json:"storageClass,omitempty"`
1237
1238	// TimeCreated: The creation time of the object in RFC 3339 format.
1239	TimeCreated string `json:"timeCreated,omitempty"`
1240
1241	// TimeDeleted: The deletion time of the object in RFC 3339 format. Will
1242	// be returned if and only if this version of the object has been
1243	// deleted.
1244	TimeDeleted string `json:"timeDeleted,omitempty"`
1245
1246	// TimeStorageClassUpdated: The time at which the object's storage class
1247	// was last changed. When the object is initially created, it will be
1248	// set to timeCreated.
1249	TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
1250
1251	// Updated: The modification time of the object metadata in RFC 3339
1252	// format.
1253	Updated string `json:"updated,omitempty"`
1254
1255	// ServerResponse contains the HTTP response code and headers from the
1256	// server.
1257	googleapi.ServerResponse `json:"-"`
1258
1259	// ForceSendFields is a list of field names (e.g. "Acl") to
1260	// unconditionally include in API requests. By default, fields with
1261	// empty values are omitted from API requests. However, any non-pointer,
1262	// non-interface field appearing in ForceSendFields will be sent to the
1263	// server regardless of whether the field is empty or not. This may be
1264	// used to include empty fields in Patch requests.
1265	ForceSendFields []string `json:"-"`
1266
1267	// NullFields is a list of field names (e.g. "Acl") to include in API
1268	// requests with the JSON null value. By default, fields with empty
1269	// values are omitted from API requests. However, any field with an
1270	// empty value appearing in NullFields will be sent to the server as
1271	// null. It is an error if a field in this list has a non-empty value.
1272	// This may be used to include null fields in Patch requests.
1273	NullFields []string `json:"-"`
1274}
1275
1276func (s *Object) MarshalJSON() ([]byte, error) {
1277	type noMethod Object
1278	raw := noMethod(*s)
1279	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1280}
1281
1282// ObjectCustomerEncryption: Metadata of customer-supplied encryption
1283// key, if the object is encrypted by such a key.
1284type ObjectCustomerEncryption struct {
1285	// EncryptionAlgorithm: The encryption algorithm.
1286	EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"`
1287
1288	// KeySha256: SHA256 hash value of the encryption key.
1289	KeySha256 string `json:"keySha256,omitempty"`
1290
1291	// ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm")
1292	// to unconditionally include in API requests. By default, fields with
1293	// empty values are omitted from API requests. However, any non-pointer,
1294	// non-interface field appearing in ForceSendFields will be sent to the
1295	// server regardless of whether the field is empty or not. This may be
1296	// used to include empty fields in Patch requests.
1297	ForceSendFields []string `json:"-"`
1298
1299	// NullFields is a list of field names (e.g. "EncryptionAlgorithm") to
1300	// include in API requests with the JSON null value. By default, fields
1301	// with empty values are omitted from API requests. However, any field
1302	// with an empty value appearing in NullFields will be sent to the
1303	// server as null. It is an error if a field in this list has a
1304	// non-empty value. This may be used to include null fields in Patch
1305	// requests.
1306	NullFields []string `json:"-"`
1307}
1308
1309func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
1310	type noMethod ObjectCustomerEncryption
1311	raw := noMethod(*s)
1312	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1313}
1314
1315// ObjectOwner: The owner of the object. This will always be the
1316// uploader of the object.
1317type ObjectOwner struct {
1318	// Entity: The entity, in the form user-userId.
1319	Entity string `json:"entity,omitempty"`
1320
1321	// EntityId: The ID for the entity.
1322	EntityId string `json:"entityId,omitempty"`
1323
1324	// ForceSendFields is a list of field names (e.g. "Entity") to
1325	// unconditionally include in API requests. By default, fields with
1326	// empty values are omitted from API requests. However, any non-pointer,
1327	// non-interface field appearing in ForceSendFields will be sent to the
1328	// server regardless of whether the field is empty or not. This may be
1329	// used to include empty fields in Patch requests.
1330	ForceSendFields []string `json:"-"`
1331
1332	// NullFields is a list of field names (e.g. "Entity") to include in API
1333	// requests with the JSON null value. By default, fields with empty
1334	// values are omitted from API requests. However, any field with an
1335	// empty value appearing in NullFields will be sent to the server as
1336	// null. It is an error if a field in this list has a non-empty value.
1337	// This may be used to include null fields in Patch requests.
1338	NullFields []string `json:"-"`
1339}
1340
1341func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
1342	type noMethod ObjectOwner
1343	raw := noMethod(*s)
1344	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1345}
1346
1347// ObjectAccessControl: An access-control entry.
1348type ObjectAccessControl struct {
1349	// Bucket: The name of the bucket.
1350	Bucket string `json:"bucket,omitempty"`
1351
1352	// Domain: The domain associated with the entity, if any.
1353	Domain string `json:"domain,omitempty"`
1354
1355	// Email: The email address associated with the entity, if any.
1356	Email string `json:"email,omitempty"`
1357
1358	// Entity: The entity holding the permission, in one of the following
1359	// forms:
1360	// - user-userId
1361	// - user-email
1362	// - group-groupId
1363	// - group-email
1364	// - domain-domain
1365	// - project-team-projectId
1366	// - allUsers
1367	// - allAuthenticatedUsers Examples:
1368	// - The user liz@example.com would be user-liz@example.com.
1369	// - The group example@googlegroups.com would be
1370	// group-example@googlegroups.com.
1371	// - To refer to all members of the Google Apps for Business domain
1372	// example.com, the entity would be domain-example.com.
1373	Entity string `json:"entity,omitempty"`
1374
1375	// EntityId: The ID for the entity, if any.
1376	EntityId string `json:"entityId,omitempty"`
1377
1378	// Etag: HTTP 1.1 Entity tag for the access-control entry.
1379	Etag string `json:"etag,omitempty"`
1380
1381	// Generation: The content generation of the object, if applied to an
1382	// object.
1383	Generation int64 `json:"generation,omitempty,string"`
1384
1385	// Id: The ID of the access-control entry.
1386	Id string `json:"id,omitempty"`
1387
1388	// Kind: The kind of item this is. For object access control entries,
1389	// this is always storage#objectAccessControl.
1390	Kind string `json:"kind,omitempty"`
1391
1392	// Object: The name of the object, if applied to an object.
1393	Object string `json:"object,omitempty"`
1394
1395	// ProjectTeam: The project team associated with the entity, if any.
1396	ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
1397
1398	// Role: The access permission for the entity.
1399	Role string `json:"role,omitempty"`
1400
1401	// SelfLink: The link to this access-control entry.
1402	SelfLink string `json:"selfLink,omitempty"`
1403
1404	// ServerResponse contains the HTTP response code and headers from the
1405	// server.
1406	googleapi.ServerResponse `json:"-"`
1407
1408	// ForceSendFields is a list of field names (e.g. "Bucket") to
1409	// unconditionally include in API requests. By default, fields with
1410	// empty values are omitted from API requests. However, any non-pointer,
1411	// non-interface field appearing in ForceSendFields will be sent to the
1412	// server regardless of whether the field is empty or not. This may be
1413	// used to include empty fields in Patch requests.
1414	ForceSendFields []string `json:"-"`
1415
1416	// NullFields is a list of field names (e.g. "Bucket") to include in API
1417	// requests with the JSON null value. By default, fields with empty
1418	// values are omitted from API requests. However, any field with an
1419	// empty value appearing in NullFields will be sent to the server as
1420	// null. It is an error if a field in this list has a non-empty value.
1421	// This may be used to include null fields in Patch requests.
1422	NullFields []string `json:"-"`
1423}
1424
1425func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
1426	type noMethod ObjectAccessControl
1427	raw := noMethod(*s)
1428	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1429}
1430
1431// ObjectAccessControlProjectTeam: The project team associated with the
1432// entity, if any.
1433type ObjectAccessControlProjectTeam struct {
1434	// ProjectNumber: The project number.
1435	ProjectNumber string `json:"projectNumber,omitempty"`
1436
1437	// Team: The team.
1438	Team string `json:"team,omitempty"`
1439
1440	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1441	// unconditionally include in API requests. By default, fields with
1442	// empty values are omitted from API requests. However, any non-pointer,
1443	// non-interface field appearing in ForceSendFields will be sent to the
1444	// server regardless of whether the field is empty or not. This may be
1445	// used to include empty fields in Patch requests.
1446	ForceSendFields []string `json:"-"`
1447
1448	// NullFields is a list of field names (e.g. "ProjectNumber") to include
1449	// in API requests with the JSON null value. By default, fields with
1450	// empty values are omitted from API requests. However, any field with
1451	// an empty value appearing in NullFields will be sent to the server as
1452	// null. It is an error if a field in this list has a non-empty value.
1453	// This may be used to include null fields in Patch requests.
1454	NullFields []string `json:"-"`
1455}
1456
1457func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1458	type noMethod ObjectAccessControlProjectTeam
1459	raw := noMethod(*s)
1460	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1461}
1462
1463// ObjectAccessControls: An access-control list.
1464type ObjectAccessControls struct {
1465	// Items: The list of items.
1466	Items []*ObjectAccessControl `json:"items,omitempty"`
1467
1468	// Kind: The kind of item this is. For lists of object access control
1469	// entries, this is always storage#objectAccessControls.
1470	Kind string `json:"kind,omitempty"`
1471
1472	// ServerResponse contains the HTTP response code and headers from the
1473	// server.
1474	googleapi.ServerResponse `json:"-"`
1475
1476	// ForceSendFields is a list of field names (e.g. "Items") to
1477	// unconditionally include in API requests. By default, fields with
1478	// empty values are omitted from API requests. However, any non-pointer,
1479	// non-interface field appearing in ForceSendFields will be sent to the
1480	// server regardless of whether the field is empty or not. This may be
1481	// used to include empty fields in Patch requests.
1482	ForceSendFields []string `json:"-"`
1483
1484	// NullFields is a list of field names (e.g. "Items") to include in API
1485	// requests with the JSON null value. By default, fields with empty
1486	// values are omitted from API requests. However, any field with an
1487	// empty value appearing in NullFields will be sent to the server as
1488	// null. It is an error if a field in this list has a non-empty value.
1489	// This may be used to include null fields in Patch requests.
1490	NullFields []string `json:"-"`
1491}
1492
1493func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
1494	type noMethod ObjectAccessControls
1495	raw := noMethod(*s)
1496	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1497}
1498
1499// Objects: A list of objects.
1500type Objects struct {
1501	// Items: The list of items.
1502	Items []*Object `json:"items,omitempty"`
1503
1504	// Kind: The kind of item this is. For lists of objects, this is always
1505	// storage#objects.
1506	Kind string `json:"kind,omitempty"`
1507
1508	// NextPageToken: The continuation token, used to page through large
1509	// result sets. Provide this value in a subsequent request to return the
1510	// next page of results.
1511	NextPageToken string `json:"nextPageToken,omitempty"`
1512
1513	// Prefixes: The list of prefixes of objects matching-but-not-listed up
1514	// to and including the requested delimiter.
1515	Prefixes []string `json:"prefixes,omitempty"`
1516
1517	// ServerResponse contains the HTTP response code and headers from the
1518	// server.
1519	googleapi.ServerResponse `json:"-"`
1520
1521	// ForceSendFields is a list of field names (e.g. "Items") to
1522	// unconditionally include in API requests. By default, fields with
1523	// empty values are omitted from API requests. However, any non-pointer,
1524	// non-interface field appearing in ForceSendFields will be sent to the
1525	// server regardless of whether the field is empty or not. This may be
1526	// used to include empty fields in Patch requests.
1527	ForceSendFields []string `json:"-"`
1528
1529	// NullFields is a list of field names (e.g. "Items") to include in API
1530	// requests with the JSON null value. By default, fields with empty
1531	// values are omitted from API requests. However, any field with an
1532	// empty value appearing in NullFields will be sent to the server as
1533	// null. It is an error if a field in this list has a non-empty value.
1534	// This may be used to include null fields in Patch requests.
1535	NullFields []string `json:"-"`
1536}
1537
1538func (s *Objects) MarshalJSON() ([]byte, error) {
1539	type noMethod Objects
1540	raw := noMethod(*s)
1541	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1542}
1543
1544// Policy: A bucket/object IAM policy.
1545type Policy struct {
1546	// Bindings: An association between a role, which comes with a set of
1547	// permissions, and members who may assume that role.
1548	Bindings []*PolicyBindings `json:"bindings,omitempty"`
1549
1550	// Etag: HTTP 1.1  Entity tag for the policy.
1551	Etag string `json:"etag,omitempty"`
1552
1553	// Kind: The kind of item this is. For policies, this is always
1554	// storage#policy. This field is ignored on input.
1555	Kind string `json:"kind,omitempty"`
1556
1557	// ResourceId: The ID of the resource to which this policy belongs. Will
1558	// be of the form projects/_/buckets/bucket for buckets, and
1559	// projects/_/buckets/bucket/objects/object for objects. A specific
1560	// generation may be specified by appending #generationNumber to the end
1561	// of the object name, e.g.
1562	// projects/_/buckets/my-bucket/objects/data.txt#17. The current
1563	// generation can be denoted with #0. This field is ignored on input.
1564	ResourceId string `json:"resourceId,omitempty"`
1565
1566	// ServerResponse contains the HTTP response code and headers from the
1567	// server.
1568	googleapi.ServerResponse `json:"-"`
1569
1570	// ForceSendFields is a list of field names (e.g. "Bindings") to
1571	// unconditionally include in API requests. By default, fields with
1572	// empty values are omitted from API requests. However, any non-pointer,
1573	// non-interface field appearing in ForceSendFields will be sent to the
1574	// server regardless of whether the field is empty or not. This may be
1575	// used to include empty fields in Patch requests.
1576	ForceSendFields []string `json:"-"`
1577
1578	// NullFields is a list of field names (e.g. "Bindings") to include in
1579	// API requests with the JSON null value. By default, fields with empty
1580	// values are omitted from API requests. However, any field with an
1581	// empty value appearing in NullFields will be sent to the server as
1582	// null. It is an error if a field in this list has a non-empty value.
1583	// This may be used to include null fields in Patch requests.
1584	NullFields []string `json:"-"`
1585}
1586
1587func (s *Policy) MarshalJSON() ([]byte, error) {
1588	type noMethod Policy
1589	raw := noMethod(*s)
1590	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1591}
1592
1593type PolicyBindings struct {
1594	// Members: A collection of identifiers for members who may assume the
1595	// provided role. Recognized identifiers are as follows:
1596	// - allUsers — A special identifier that represents anyone on the
1597	// internet; with or without a Google account.
1598	// - allAuthenticatedUsers — A special identifier that represents
1599	// anyone who is authenticated with a Google account or a service
1600	// account.
1601	// - user:emailid — An email address that represents a specific
1602	// account. For example, user:alice@gmail.com or user:joe@example.com.
1603	//
1604	// - serviceAccount:emailid — An email address that represents a
1605	// service account. For example,
1606	// serviceAccount:my-other-app@appspot.gserviceaccount.com .
1607	// - group:emailid — An email address that represents a Google group.
1608	// For example, group:admins@example.com.
1609	// - domain:domain — A Google Apps domain name that represents all the
1610	// users of that domain. For example, domain:google.com or
1611	// domain:example.com.
1612	// - projectOwner:projectid — Owners of the given project. For
1613	// example, projectOwner:my-example-project
1614	// - projectEditor:projectid — Editors of the given project. For
1615	// example, projectEditor:my-example-project
1616	// - projectViewer:projectid — Viewers of the given project. For
1617	// example, projectViewer:my-example-project
1618	Members []string `json:"members,omitempty"`
1619
1620	// Role: The role to which members belong. Two types of roles are
1621	// supported: new IAM roles, which grant permissions that do not map
1622	// directly to those provided by ACLs, and legacy IAM roles, which do
1623	// map directly to ACL permissions. All roles are of the format
1624	// roles/storage.specificRole.
1625	// The new IAM roles are:
1626	// - roles/storage.admin — Full control of Google Cloud Storage
1627	// resources.
1628	// - roles/storage.objectViewer — Read-Only access to Google Cloud
1629	// Storage objects.
1630	// - roles/storage.objectCreator — Access to create objects in Google
1631	// Cloud Storage.
1632	// - roles/storage.objectAdmin — Full control of Google Cloud Storage
1633	// objects.   The legacy IAM roles are:
1634	// - roles/storage.legacyObjectReader — Read-only access to objects
1635	// without listing. Equivalent to an ACL entry on an object with the
1636	// READER role.
1637	// - roles/storage.legacyObjectOwnerRead/write access to existing
1638	// objects without listing. Equivalent to an ACL entry on an object with
1639	// the OWNER role.
1640	// - roles/storage.legacyBucketReader — Read access to buckets with
1641	// object listing. Equivalent to an ACL entry on a bucket with the
1642	// READER role.
1643	// - roles/storage.legacyBucketWriter — Read access to buckets with
1644	// object listing/creation/deletion. Equivalent to an ACL entry on a
1645	// bucket with the WRITER role.
1646	// - roles/storage.legacyBucketOwner — Read and write access to
1647	// existing buckets with object listing/creation/deletion. Equivalent to
1648	// an ACL entry on a bucket with the OWNER role.
1649	Role string `json:"role,omitempty"`
1650
1651	// ForceSendFields is a list of field names (e.g. "Members") to
1652	// unconditionally include in API requests. By default, fields with
1653	// empty values are omitted from API requests. However, any non-pointer,
1654	// non-interface field appearing in ForceSendFields will be sent to the
1655	// server regardless of whether the field is empty or not. This may be
1656	// used to include empty fields in Patch requests.
1657	ForceSendFields []string `json:"-"`
1658
1659	// NullFields is a list of field names (e.g. "Members") to include in
1660	// API requests with the JSON null value. By default, fields with empty
1661	// values are omitted from API requests. However, any field with an
1662	// empty value appearing in NullFields will be sent to the server as
1663	// null. It is an error if a field in this list has a non-empty value.
1664	// This may be used to include null fields in Patch requests.
1665	NullFields []string `json:"-"`
1666}
1667
1668func (s *PolicyBindings) MarshalJSON() ([]byte, error) {
1669	type noMethod PolicyBindings
1670	raw := noMethod(*s)
1671	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1672}
1673
1674// RewriteResponse: A rewrite response.
1675type RewriteResponse struct {
1676	// Done: true if the copy is finished; otherwise, false if the copy is
1677	// in progress. This property is always present in the response.
1678	Done bool `json:"done,omitempty"`
1679
1680	// Kind: The kind of item this is.
1681	Kind string `json:"kind,omitempty"`
1682
1683	// ObjectSize: The total size of the object being copied in bytes. This
1684	// property is always present in the response.
1685	ObjectSize int64 `json:"objectSize,omitempty,string"`
1686
1687	// Resource: A resource containing the metadata for the copied-to
1688	// object. This property is present in the response only when copying
1689	// completes.
1690	Resource *Object `json:"resource,omitempty"`
1691
1692	// RewriteToken: A token to use in subsequent requests to continue
1693	// copying data. This token is present in the response only when there
1694	// is more data to copy.
1695	RewriteToken string `json:"rewriteToken,omitempty"`
1696
1697	// TotalBytesRewritten: The total bytes written so far, which can be
1698	// used to provide a waiting user with a progress indicator. This
1699	// property is always present in the response.
1700	TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
1701
1702	// ServerResponse contains the HTTP response code and headers from the
1703	// server.
1704	googleapi.ServerResponse `json:"-"`
1705
1706	// ForceSendFields is a list of field names (e.g. "Done") to
1707	// unconditionally include in API requests. By default, fields with
1708	// empty values are omitted from API requests. However, any non-pointer,
1709	// non-interface field appearing in ForceSendFields will be sent to the
1710	// server regardless of whether the field is empty or not. This may be
1711	// used to include empty fields in Patch requests.
1712	ForceSendFields []string `json:"-"`
1713
1714	// NullFields is a list of field names (e.g. "Done") to include in API
1715	// requests with the JSON null value. By default, fields with empty
1716	// values are omitted from API requests. However, any field with an
1717	// empty value appearing in NullFields will be sent to the server as
1718	// null. It is an error if a field in this list has a non-empty value.
1719	// This may be used to include null fields in Patch requests.
1720	NullFields []string `json:"-"`
1721}
1722
1723func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
1724	type noMethod RewriteResponse
1725	raw := noMethod(*s)
1726	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1727}
1728
1729// ServiceAccount: A subscription to receive Google PubSub
1730// notifications.
1731type ServiceAccount struct {
1732	// EmailAddress: The ID of the notification.
1733	EmailAddress string `json:"email_address,omitempty"`
1734
1735	// Kind: The kind of item this is. For notifications, this is always
1736	// storage#notification.
1737	Kind string `json:"kind,omitempty"`
1738
1739	// ServerResponse contains the HTTP response code and headers from the
1740	// server.
1741	googleapi.ServerResponse `json:"-"`
1742
1743	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
1744	// unconditionally include in API requests. By default, fields with
1745	// empty values are omitted from API requests. However, any non-pointer,
1746	// non-interface field appearing in ForceSendFields will be sent to the
1747	// server regardless of whether the field is empty or not. This may be
1748	// used to include empty fields in Patch requests.
1749	ForceSendFields []string `json:"-"`
1750
1751	// NullFields is a list of field names (e.g. "EmailAddress") to include
1752	// in API requests with the JSON null value. By default, fields with
1753	// empty values are omitted from API requests. However, any field with
1754	// an empty value appearing in NullFields will be sent to the server as
1755	// null. It is an error if a field in this list has a non-empty value.
1756	// This may be used to include null fields in Patch requests.
1757	NullFields []string `json:"-"`
1758}
1759
1760func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
1761	type noMethod ServiceAccount
1762	raw := noMethod(*s)
1763	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1764}
1765
1766// TestIamPermissionsResponse: A
1767// storage.(buckets|objects).testIamPermissions response.
1768type TestIamPermissionsResponse struct {
1769	// Kind: The kind of item this is.
1770	Kind string `json:"kind,omitempty"`
1771
1772	// Permissions: The permissions held by the caller. Permissions are
1773	// always of the format storage.resource.capability, where resource is
1774	// one of buckets or objects. The supported permissions are as follows:
1775	//
1776	// - storage.buckets.delete — Delete bucket.
1777	// - storage.buckets.get — Read bucket metadata.
1778	// - storage.buckets.getIamPolicy — Read bucket IAM policy.
1779	// - storage.buckets.create — Create bucket.
1780	// - storage.buckets.list — List buckets.
1781	// - storage.buckets.setIamPolicy — Update bucket IAM policy.
1782	// - storage.buckets.update — Update bucket metadata.
1783	// - storage.objects.delete — Delete object.
1784	// - storage.objects.get — Read object data and metadata.
1785	// - storage.objects.getIamPolicy — Read object IAM policy.
1786	// - storage.objects.create — Create object.
1787	// - storage.objects.list — List objects.
1788	// - storage.objects.setIamPolicy — Update object IAM policy.
1789	// - storage.objects.update — Update object metadata.
1790	Permissions []string `json:"permissions,omitempty"`
1791
1792	// ServerResponse contains the HTTP response code and headers from the
1793	// server.
1794	googleapi.ServerResponse `json:"-"`
1795
1796	// ForceSendFields is a list of field names (e.g. "Kind") to
1797	// 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. "Kind") to include in API
1805	// requests with the JSON null value. By default, fields with empty
1806	// values are omitted from API requests. However, any field with an
1807	// empty value appearing in NullFields will be sent to the server as
1808	// null. It is an error if a field in this list has a non-empty value.
1809	// This may be used to include null fields in Patch requests.
1810	NullFields []string `json:"-"`
1811}
1812
1813func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1814	type noMethod TestIamPermissionsResponse
1815	raw := noMethod(*s)
1816	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1817}
1818
1819// method id "storage.bucketAccessControls.delete":
1820
1821type BucketAccessControlsDeleteCall struct {
1822	s          *Service
1823	bucket     string
1824	entity     string
1825	urlParams_ gensupport.URLParams
1826	ctx_       context.Context
1827	header_    http.Header
1828}
1829
1830// Delete: Permanently deletes the ACL entry for the specified entity on
1831// the specified bucket.
1832func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
1833	c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1834	c.bucket = bucket
1835	c.entity = entity
1836	return c
1837}
1838
1839// UserProject sets the optional parameter "userProject": The project to
1840// be billed for this request, for Requester Pays buckets.
1841func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
1842	c.urlParams_.Set("userProject", userProject)
1843	return c
1844}
1845
1846// Fields allows partial responses to be retrieved. See
1847// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1848// for more information.
1849func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
1850	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1851	return c
1852}
1853
1854// Context sets the context to be used in this call's Do method. Any
1855// pending HTTP request will be aborted if the provided context is
1856// canceled.
1857func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
1858	c.ctx_ = ctx
1859	return c
1860}
1861
1862// Header returns an http.Header that can be modified by the caller to
1863// add HTTP headers to the request.
1864func (c *BucketAccessControlsDeleteCall) Header() http.Header {
1865	if c.header_ == nil {
1866		c.header_ = make(http.Header)
1867	}
1868	return c.header_
1869}
1870
1871func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
1872	reqHeaders := make(http.Header)
1873	for k, v := range c.header_ {
1874		reqHeaders[k] = v
1875	}
1876	reqHeaders.Set("User-Agent", c.s.userAgent())
1877	var body io.Reader = nil
1878	c.urlParams_.Set("alt", alt)
1879	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
1880	urls += "?" + c.urlParams_.Encode()
1881	req, _ := http.NewRequest("DELETE", urls, body)
1882	req.Header = reqHeaders
1883	googleapi.Expand(req.URL, map[string]string{
1884		"bucket": c.bucket,
1885		"entity": c.entity,
1886	})
1887	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1888}
1889
1890// Do executes the "storage.bucketAccessControls.delete" call.
1891func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
1892	gensupport.SetOptions(c.urlParams_, opts...)
1893	res, err := c.doRequest("json")
1894	if err != nil {
1895		return err
1896	}
1897	defer googleapi.CloseBody(res)
1898	if err := googleapi.CheckResponse(res); err != nil {
1899		return err
1900	}
1901	return nil
1902	// {
1903	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
1904	//   "httpMethod": "DELETE",
1905	//   "id": "storage.bucketAccessControls.delete",
1906	//   "parameterOrder": [
1907	//     "bucket",
1908	//     "entity"
1909	//   ],
1910	//   "parameters": {
1911	//     "bucket": {
1912	//       "description": "Name of a bucket.",
1913	//       "location": "path",
1914	//       "required": true,
1915	//       "type": "string"
1916	//     },
1917	//     "entity": {
1918	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
1919	//       "location": "path",
1920	//       "required": true,
1921	//       "type": "string"
1922	//     },
1923	//     "userProject": {
1924	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
1925	//       "location": "query",
1926	//       "type": "string"
1927	//     }
1928	//   },
1929	//   "path": "b/{bucket}/acl/{entity}",
1930	//   "scopes": [
1931	//     "https://www.googleapis.com/auth/cloud-platform",
1932	//     "https://www.googleapis.com/auth/devstorage.full_control"
1933	//   ]
1934	// }
1935
1936}
1937
1938// method id "storage.bucketAccessControls.get":
1939
1940type BucketAccessControlsGetCall struct {
1941	s            *Service
1942	bucket       string
1943	entity       string
1944	urlParams_   gensupport.URLParams
1945	ifNoneMatch_ string
1946	ctx_         context.Context
1947	header_      http.Header
1948}
1949
1950// Get: Returns the ACL entry for the specified entity on the specified
1951// bucket.
1952func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
1953	c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1954	c.bucket = bucket
1955	c.entity = entity
1956	return c
1957}
1958
1959// UserProject sets the optional parameter "userProject": The project to
1960// be billed for this request, for Requester Pays buckets.
1961func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
1962	c.urlParams_.Set("userProject", userProject)
1963	return c
1964}
1965
1966// Fields allows partial responses to be retrieved. See
1967// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1968// for more information.
1969func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
1970	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1971	return c
1972}
1973
1974// IfNoneMatch sets the optional parameter which makes the operation
1975// fail if the object's ETag matches the given value. This is useful for
1976// getting updates only after the object has changed since the last
1977// request. Use googleapi.IsNotModified to check whether the response
1978// error from Do is the result of In-None-Match.
1979func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
1980	c.ifNoneMatch_ = entityTag
1981	return c
1982}
1983
1984// Context sets the context to be used in this call's Do method. Any
1985// pending HTTP request will be aborted if the provided context is
1986// canceled.
1987func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
1988	c.ctx_ = ctx
1989	return c
1990}
1991
1992// Header returns an http.Header that can be modified by the caller to
1993// add HTTP headers to the request.
1994func (c *BucketAccessControlsGetCall) Header() http.Header {
1995	if c.header_ == nil {
1996		c.header_ = make(http.Header)
1997	}
1998	return c.header_
1999}
2000
2001func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
2002	reqHeaders := make(http.Header)
2003	for k, v := range c.header_ {
2004		reqHeaders[k] = v
2005	}
2006	reqHeaders.Set("User-Agent", c.s.userAgent())
2007	if c.ifNoneMatch_ != "" {
2008		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2009	}
2010	var body io.Reader = nil
2011	c.urlParams_.Set("alt", alt)
2012	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2013	urls += "?" + c.urlParams_.Encode()
2014	req, _ := http.NewRequest("GET", urls, body)
2015	req.Header = reqHeaders
2016	googleapi.Expand(req.URL, map[string]string{
2017		"bucket": c.bucket,
2018		"entity": c.entity,
2019	})
2020	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2021}
2022
2023// Do executes the "storage.bucketAccessControls.get" call.
2024// Exactly one of *BucketAccessControl or error will be non-nil. Any
2025// non-2xx status code is an error. Response headers are in either
2026// *BucketAccessControl.ServerResponse.Header or (if a response was
2027// returned at all) in error.(*googleapi.Error).Header. Use
2028// googleapi.IsNotModified to check whether the returned error was
2029// because http.StatusNotModified was returned.
2030func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2031	gensupport.SetOptions(c.urlParams_, opts...)
2032	res, err := c.doRequest("json")
2033	if res != nil && res.StatusCode == http.StatusNotModified {
2034		if res.Body != nil {
2035			res.Body.Close()
2036		}
2037		return nil, &googleapi.Error{
2038			Code:   res.StatusCode,
2039			Header: res.Header,
2040		}
2041	}
2042	if err != nil {
2043		return nil, err
2044	}
2045	defer googleapi.CloseBody(res)
2046	if err := googleapi.CheckResponse(res); err != nil {
2047		return nil, err
2048	}
2049	ret := &BucketAccessControl{
2050		ServerResponse: googleapi.ServerResponse{
2051			Header:         res.Header,
2052			HTTPStatusCode: res.StatusCode,
2053		},
2054	}
2055	target := &ret
2056	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
2057		return nil, err
2058	}
2059	return ret, nil
2060	// {
2061	//   "description": "Returns the ACL entry for the specified entity on the specified bucket.",
2062	//   "httpMethod": "GET",
2063	//   "id": "storage.bucketAccessControls.get",
2064	//   "parameterOrder": [
2065	//     "bucket",
2066	//     "entity"
2067	//   ],
2068	//   "parameters": {
2069	//     "bucket": {
2070	//       "description": "Name of a bucket.",
2071	//       "location": "path",
2072	//       "required": true,
2073	//       "type": "string"
2074	//     },
2075	//     "entity": {
2076	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2077	//       "location": "path",
2078	//       "required": true,
2079	//       "type": "string"
2080	//     },
2081	//     "userProject": {
2082	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
2083	//       "location": "query",
2084	//       "type": "string"
2085	//     }
2086	//   },
2087	//   "path": "b/{bucket}/acl/{entity}",
2088	//   "response": {
2089	//     "$ref": "BucketAccessControl"
2090	//   },
2091	//   "scopes": [
2092	//     "https://www.googleapis.com/auth/cloud-platform",
2093	//     "https://www.googleapis.com/auth/devstorage.full_control"
2094	//   ]
2095	// }
2096
2097}
2098
2099// method id "storage.bucketAccessControls.insert":
2100
2101type BucketAccessControlsInsertCall struct {
2102	s                   *Service
2103	bucket              string
2104	bucketaccesscontrol *BucketAccessControl
2105	urlParams_          gensupport.URLParams
2106	ctx_                context.Context
2107	header_             http.Header
2108}
2109
2110// Insert: Creates a new ACL entry on the specified bucket.
2111func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
2112	c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2113	c.bucket = bucket
2114	c.bucketaccesscontrol = bucketaccesscontrol
2115	return c
2116}
2117
2118// UserProject sets the optional parameter "userProject": The project to
2119// be billed for this request, for Requester Pays buckets.
2120func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
2121	c.urlParams_.Set("userProject", userProject)
2122	return c
2123}
2124
2125// Fields allows partial responses to be retrieved. See
2126// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2127// for more information.
2128func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
2129	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2130	return c
2131}
2132
2133// Context sets the context to be used in this call's Do method. Any
2134// pending HTTP request will be aborted if the provided context is
2135// canceled.
2136func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
2137	c.ctx_ = ctx
2138	return c
2139}
2140
2141// Header returns an http.Header that can be modified by the caller to
2142// add HTTP headers to the request.
2143func (c *BucketAccessControlsInsertCall) Header() http.Header {
2144	if c.header_ == nil {
2145		c.header_ = make(http.Header)
2146	}
2147	return c.header_
2148}
2149
2150func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
2151	reqHeaders := make(http.Header)
2152	for k, v := range c.header_ {
2153		reqHeaders[k] = v
2154	}
2155	reqHeaders.Set("User-Agent", c.s.userAgent())
2156	var body io.Reader = nil
2157	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2158	if err != nil {
2159		return nil, err
2160	}
2161	reqHeaders.Set("Content-Type", "application/json")
2162	c.urlParams_.Set("alt", alt)
2163	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2164	urls += "?" + c.urlParams_.Encode()
2165	req, _ := http.NewRequest("POST", urls, body)
2166	req.Header = reqHeaders
2167	googleapi.Expand(req.URL, map[string]string{
2168		"bucket": c.bucket,
2169	})
2170	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2171}
2172
2173// Do executes the "storage.bucketAccessControls.insert" call.
2174// Exactly one of *BucketAccessControl or error will be non-nil. Any
2175// non-2xx status code is an error. Response headers are in either
2176// *BucketAccessControl.ServerResponse.Header or (if a response was
2177// returned at all) in error.(*googleapi.Error).Header. Use
2178// googleapi.IsNotModified to check whether the returned error was
2179// because http.StatusNotModified was returned.
2180func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2181	gensupport.SetOptions(c.urlParams_, opts...)
2182	res, err := c.doRequest("json")
2183	if res != nil && res.StatusCode == http.StatusNotModified {
2184		if res.Body != nil {
2185			res.Body.Close()
2186		}
2187		return nil, &googleapi.Error{
2188			Code:   res.StatusCode,
2189			Header: res.Header,
2190		}
2191	}
2192	if err != nil {
2193		return nil, err
2194	}
2195	defer googleapi.CloseBody(res)
2196	if err := googleapi.CheckResponse(res); err != nil {
2197		return nil, err
2198	}
2199	ret := &BucketAccessControl{
2200		ServerResponse: googleapi.ServerResponse{
2201			Header:         res.Header,
2202			HTTPStatusCode: res.StatusCode,
2203		},
2204	}
2205	target := &ret
2206	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
2207		return nil, err
2208	}
2209	return ret, nil
2210	// {
2211	//   "description": "Creates a new ACL entry on the specified bucket.",
2212	//   "httpMethod": "POST",
2213	//   "id": "storage.bucketAccessControls.insert",
2214	//   "parameterOrder": [
2215	//     "bucket"
2216	//   ],
2217	//   "parameters": {
2218	//     "bucket": {
2219	//       "description": "Name of a bucket.",
2220	//       "location": "path",
2221	//       "required": true,
2222	//       "type": "string"
2223	//     },
2224	//     "userProject": {
2225	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
2226	//       "location": "query",
2227	//       "type": "string"
2228	//     }
2229	//   },
2230	//   "path": "b/{bucket}/acl",
2231	//   "request": {
2232	//     "$ref": "BucketAccessControl"
2233	//   },
2234	//   "response": {
2235	//     "$ref": "BucketAccessControl"
2236	//   },
2237	//   "scopes": [
2238	//     "https://www.googleapis.com/auth/cloud-platform",
2239	//     "https://www.googleapis.com/auth/devstorage.full_control"
2240	//   ]
2241	// }
2242
2243}
2244
2245// method id "storage.bucketAccessControls.list":
2246
2247type BucketAccessControlsListCall struct {
2248	s            *Service
2249	bucket       string
2250	urlParams_   gensupport.URLParams
2251	ifNoneMatch_ string
2252	ctx_         context.Context
2253	header_      http.Header
2254}
2255
2256// List: Retrieves ACL entries on the specified bucket.
2257func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
2258	c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2259	c.bucket = bucket
2260	return c
2261}
2262
2263// UserProject sets the optional parameter "userProject": The project to
2264// be billed for this request, for Requester Pays buckets.
2265func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
2266	c.urlParams_.Set("userProject", userProject)
2267	return c
2268}
2269
2270// Fields allows partial responses to be retrieved. See
2271// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2272// for more information.
2273func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
2274	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2275	return c
2276}
2277
2278// IfNoneMatch sets the optional parameter which makes the operation
2279// fail if the object's ETag matches the given value. This is useful for
2280// getting updates only after the object has changed since the last
2281// request. Use googleapi.IsNotModified to check whether the response
2282// error from Do is the result of In-None-Match.
2283func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
2284	c.ifNoneMatch_ = entityTag
2285	return c
2286}
2287
2288// Context sets the context to be used in this call's Do method. Any
2289// pending HTTP request will be aborted if the provided context is
2290// canceled.
2291func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
2292	c.ctx_ = ctx
2293	return c
2294}
2295
2296// Header returns an http.Header that can be modified by the caller to
2297// add HTTP headers to the request.
2298func (c *BucketAccessControlsListCall) Header() http.Header {
2299	if c.header_ == nil {
2300		c.header_ = make(http.Header)
2301	}
2302	return c.header_
2303}
2304
2305func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
2306	reqHeaders := make(http.Header)
2307	for k, v := range c.header_ {
2308		reqHeaders[k] = v
2309	}
2310	reqHeaders.Set("User-Agent", c.s.userAgent())
2311	if c.ifNoneMatch_ != "" {
2312		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2313	}
2314	var body io.Reader = nil
2315	c.urlParams_.Set("alt", alt)
2316	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2317	urls += "?" + c.urlParams_.Encode()
2318	req, _ := http.NewRequest("GET", urls, body)
2319	req.Header = reqHeaders
2320	googleapi.Expand(req.URL, map[string]string{
2321		"bucket": c.bucket,
2322	})
2323	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2324}
2325
2326// Do executes the "storage.bucketAccessControls.list" call.
2327// Exactly one of *BucketAccessControls or error will be non-nil. Any
2328// non-2xx status code is an error. Response headers are in either
2329// *BucketAccessControls.ServerResponse.Header or (if a response was
2330// returned at all) in error.(*googleapi.Error).Header. Use
2331// googleapi.IsNotModified to check whether the returned error was
2332// because http.StatusNotModified was returned.
2333func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
2334	gensupport.SetOptions(c.urlParams_, opts...)
2335	res, err := c.doRequest("json")
2336	if res != nil && res.StatusCode == http.StatusNotModified {
2337		if res.Body != nil {
2338			res.Body.Close()
2339		}
2340		return nil, &googleapi.Error{
2341			Code:   res.StatusCode,
2342			Header: res.Header,
2343		}
2344	}
2345	if err != nil {
2346		return nil, err
2347	}
2348	defer googleapi.CloseBody(res)
2349	if err := googleapi.CheckResponse(res); err != nil {
2350		return nil, err
2351	}
2352	ret := &BucketAccessControls{
2353		ServerResponse: googleapi.ServerResponse{
2354			Header:         res.Header,
2355			HTTPStatusCode: res.StatusCode,
2356		},
2357	}
2358	target := &ret
2359	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
2360		return nil, err
2361	}
2362	return ret, nil
2363	// {
2364	//   "description": "Retrieves ACL entries on the specified bucket.",
2365	//   "httpMethod": "GET",
2366	//   "id": "storage.bucketAccessControls.list",
2367	//   "parameterOrder": [
2368	//     "bucket"
2369	//   ],
2370	//   "parameters": {
2371	//     "bucket": {
2372	//       "description": "Name of a bucket.",
2373	//       "location": "path",
2374	//       "required": true,
2375	//       "type": "string"
2376	//     },
2377	//     "userProject": {
2378	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
2379	//       "location": "query",
2380	//       "type": "string"
2381	//     }
2382	//   },
2383	//   "path": "b/{bucket}/acl",
2384	//   "response": {
2385	//     "$ref": "BucketAccessControls"
2386	//   },
2387	//   "scopes": [
2388	//     "https://www.googleapis.com/auth/cloud-platform",
2389	//     "https://www.googleapis.com/auth/devstorage.full_control"
2390	//   ]
2391	// }
2392
2393}
2394
2395// method id "storage.bucketAccessControls.patch":
2396
2397type BucketAccessControlsPatchCall struct {
2398	s                   *Service
2399	bucket              string
2400	entity              string
2401	bucketaccesscontrol *BucketAccessControl
2402	urlParams_          gensupport.URLParams
2403	ctx_                context.Context
2404	header_             http.Header
2405}
2406
2407// Patch: Updates an ACL entry on the specified bucket. This method
2408// supports patch semantics.
2409func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
2410	c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2411	c.bucket = bucket
2412	c.entity = entity
2413	c.bucketaccesscontrol = bucketaccesscontrol
2414	return c
2415}
2416
2417// UserProject sets the optional parameter "userProject": The project to
2418// be billed for this request, for Requester Pays buckets.
2419func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
2420	c.urlParams_.Set("userProject", userProject)
2421	return c
2422}
2423
2424// Fields allows partial responses to be retrieved. See
2425// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2426// for more information.
2427func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
2428	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2429	return c
2430}
2431
2432// Context sets the context to be used in this call's Do method. Any
2433// pending HTTP request will be aborted if the provided context is
2434// canceled.
2435func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
2436	c.ctx_ = ctx
2437	return c
2438}
2439
2440// Header returns an http.Header that can be modified by the caller to
2441// add HTTP headers to the request.
2442func (c *BucketAccessControlsPatchCall) Header() http.Header {
2443	if c.header_ == nil {
2444		c.header_ = make(http.Header)
2445	}
2446	return c.header_
2447}
2448
2449func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
2450	reqHeaders := make(http.Header)
2451	for k, v := range c.header_ {
2452		reqHeaders[k] = v
2453	}
2454	reqHeaders.Set("User-Agent", c.s.userAgent())
2455	var body io.Reader = nil
2456	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2457	if err != nil {
2458		return nil, err
2459	}
2460	reqHeaders.Set("Content-Type", "application/json")
2461	c.urlParams_.Set("alt", alt)
2462	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2463	urls += "?" + c.urlParams_.Encode()
2464	req, _ := http.NewRequest("PATCH", urls, body)
2465	req.Header = reqHeaders
2466	googleapi.Expand(req.URL, map[string]string{
2467		"bucket": c.bucket,
2468		"entity": c.entity,
2469	})
2470	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2471}
2472
2473// Do executes the "storage.bucketAccessControls.patch" call.
2474// Exactly one of *BucketAccessControl or error will be non-nil. Any
2475// non-2xx status code is an error. Response headers are in either
2476// *BucketAccessControl.ServerResponse.Header or (if a response was
2477// returned at all) in error.(*googleapi.Error).Header. Use
2478// googleapi.IsNotModified to check whether the returned error was
2479// because http.StatusNotModified was returned.
2480func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2481	gensupport.SetOptions(c.urlParams_, opts...)
2482	res, err := c.doRequest("json")
2483	if res != nil && res.StatusCode == http.StatusNotModified {
2484		if res.Body != nil {
2485			res.Body.Close()
2486		}
2487		return nil, &googleapi.Error{
2488			Code:   res.StatusCode,
2489			Header: res.Header,
2490		}
2491	}
2492	if err != nil {
2493		return nil, err
2494	}
2495	defer googleapi.CloseBody(res)
2496	if err := googleapi.CheckResponse(res); err != nil {
2497		return nil, err
2498	}
2499	ret := &BucketAccessControl{
2500		ServerResponse: googleapi.ServerResponse{
2501			Header:         res.Header,
2502			HTTPStatusCode: res.StatusCode,
2503		},
2504	}
2505	target := &ret
2506	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
2507		return nil, err
2508	}
2509	return ret, nil
2510	// {
2511	//   "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.",
2512	//   "httpMethod": "PATCH",
2513	//   "id": "storage.bucketAccessControls.patch",
2514	//   "parameterOrder": [
2515	//     "bucket",
2516	//     "entity"
2517	//   ],
2518	//   "parameters": {
2519	//     "bucket": {
2520	//       "description": "Name of a bucket.",
2521	//       "location": "path",
2522	//       "required": true,
2523	//       "type": "string"
2524	//     },
2525	//     "entity": {
2526	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2527	//       "location": "path",
2528	//       "required": true,
2529	//       "type": "string"
2530	//     },
2531	//     "userProject": {
2532	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
2533	//       "location": "query",
2534	//       "type": "string"
2535	//     }
2536	//   },
2537	//   "path": "b/{bucket}/acl/{entity}",
2538	//   "request": {
2539	//     "$ref": "BucketAccessControl"
2540	//   },
2541	//   "response": {
2542	//     "$ref": "BucketAccessControl"
2543	//   },
2544	//   "scopes": [
2545	//     "https://www.googleapis.com/auth/cloud-platform",
2546	//     "https://www.googleapis.com/auth/devstorage.full_control"
2547	//   ]
2548	// }
2549
2550}
2551
2552// method id "storage.bucketAccessControls.update":
2553
2554type BucketAccessControlsUpdateCall struct {
2555	s                   *Service
2556	bucket              string
2557	entity              string
2558	bucketaccesscontrol *BucketAccessControl
2559	urlParams_          gensupport.URLParams
2560	ctx_                context.Context
2561	header_             http.Header
2562}
2563
2564// Update: Updates an ACL entry on the specified bucket.
2565func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
2566	c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2567	c.bucket = bucket
2568	c.entity = entity
2569	c.bucketaccesscontrol = bucketaccesscontrol
2570	return c
2571}
2572
2573// UserProject sets the optional parameter "userProject": The project to
2574// be billed for this request, for Requester Pays buckets.
2575func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
2576	c.urlParams_.Set("userProject", userProject)
2577	return c
2578}
2579
2580// Fields allows partial responses to be retrieved. See
2581// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2582// for more information.
2583func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
2584	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2585	return c
2586}
2587
2588// Context sets the context to be used in this call's Do method. Any
2589// pending HTTP request will be aborted if the provided context is
2590// canceled.
2591func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
2592	c.ctx_ = ctx
2593	return c
2594}
2595
2596// Header returns an http.Header that can be modified by the caller to
2597// add HTTP headers to the request.
2598func (c *BucketAccessControlsUpdateCall) Header() http.Header {
2599	if c.header_ == nil {
2600		c.header_ = make(http.Header)
2601	}
2602	return c.header_
2603}
2604
2605func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
2606	reqHeaders := make(http.Header)
2607	for k, v := range c.header_ {
2608		reqHeaders[k] = v
2609	}
2610	reqHeaders.Set("User-Agent", c.s.userAgent())
2611	var body io.Reader = nil
2612	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2613	if err != nil {
2614		return nil, err
2615	}
2616	reqHeaders.Set("Content-Type", "application/json")
2617	c.urlParams_.Set("alt", alt)
2618	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2619	urls += "?" + c.urlParams_.Encode()
2620	req, _ := http.NewRequest("PUT", urls, body)
2621	req.Header = reqHeaders
2622	googleapi.Expand(req.URL, map[string]string{
2623		"bucket": c.bucket,
2624		"entity": c.entity,
2625	})
2626	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2627}
2628
2629// Do executes the "storage.bucketAccessControls.update" call.
2630// Exactly one of *BucketAccessControl or error will be non-nil. Any
2631// non-2xx status code is an error. Response headers are in either
2632// *BucketAccessControl.ServerResponse.Header or (if a response was
2633// returned at all) in error.(*googleapi.Error).Header. Use
2634// googleapi.IsNotModified to check whether the returned error was
2635// because http.StatusNotModified was returned.
2636func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2637	gensupport.SetOptions(c.urlParams_, opts...)
2638	res, err := c.doRequest("json")
2639	if res != nil && res.StatusCode == http.StatusNotModified {
2640		if res.Body != nil {
2641			res.Body.Close()
2642		}
2643		return nil, &googleapi.Error{
2644			Code:   res.StatusCode,
2645			Header: res.Header,
2646		}
2647	}
2648	if err != nil {
2649		return nil, err
2650	}
2651	defer googleapi.CloseBody(res)
2652	if err := googleapi.CheckResponse(res); err != nil {
2653		return nil, err
2654	}
2655	ret := &BucketAccessControl{
2656		ServerResponse: googleapi.ServerResponse{
2657			Header:         res.Header,
2658			HTTPStatusCode: res.StatusCode,
2659		},
2660	}
2661	target := &ret
2662	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
2663		return nil, err
2664	}
2665	return ret, nil
2666	// {
2667	//   "description": "Updates an ACL entry on the specified bucket.",
2668	//   "httpMethod": "PUT",
2669	//   "id": "storage.bucketAccessControls.update",
2670	//   "parameterOrder": [
2671	//     "bucket",
2672	//     "entity"
2673	//   ],
2674	//   "parameters": {
2675	//     "bucket": {
2676	//       "description": "Name of a bucket.",
2677	//       "location": "path",
2678	//       "required": true,
2679	//       "type": "string"
2680	//     },
2681	//     "entity": {
2682	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2683	//       "location": "path",
2684	//       "required": true,
2685	//       "type": "string"
2686	//     },
2687	//     "userProject": {
2688	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
2689	//       "location": "query",
2690	//       "type": "string"
2691	//     }
2692	//   },
2693	//   "path": "b/{bucket}/acl/{entity}",
2694	//   "request": {
2695	//     "$ref": "BucketAccessControl"
2696	//   },
2697	//   "response": {
2698	//     "$ref": "BucketAccessControl"
2699	//   },
2700	//   "scopes": [
2701	//     "https://www.googleapis.com/auth/cloud-platform",
2702	//     "https://www.googleapis.com/auth/devstorage.full_control"
2703	//   ]
2704	// }
2705
2706}
2707
2708// method id "storage.buckets.delete":
2709
2710type BucketsDeleteCall struct {
2711	s          *Service
2712	bucket     string
2713	urlParams_ gensupport.URLParams
2714	ctx_       context.Context
2715	header_    http.Header
2716}
2717
2718// Delete: Permanently deletes an empty bucket.
2719func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
2720	c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2721	c.bucket = bucket
2722	return c
2723}
2724
2725// IfMetagenerationMatch sets the optional parameter
2726// "ifMetagenerationMatch": If set, only deletes the bucket if its
2727// metageneration matches this value.
2728func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall {
2729	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
2730	return c
2731}
2732
2733// IfMetagenerationNotMatch sets the optional parameter
2734// "ifMetagenerationNotMatch": If set, only deletes the bucket if its
2735// metageneration does not match this value.
2736func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall {
2737	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
2738	return c
2739}
2740
2741// UserProject sets the optional parameter "userProject": The project to
2742// be billed for this request, for Requester Pays buckets.
2743func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
2744	c.urlParams_.Set("userProject", userProject)
2745	return c
2746}
2747
2748// Fields allows partial responses to be retrieved. See
2749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2750// for more information.
2751func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
2752	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2753	return c
2754}
2755
2756// Context sets the context to be used in this call's Do method. Any
2757// pending HTTP request will be aborted if the provided context is
2758// canceled.
2759func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
2760	c.ctx_ = ctx
2761	return c
2762}
2763
2764// Header returns an http.Header that can be modified by the caller to
2765// add HTTP headers to the request.
2766func (c *BucketsDeleteCall) Header() http.Header {
2767	if c.header_ == nil {
2768		c.header_ = make(http.Header)
2769	}
2770	return c.header_
2771}
2772
2773func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
2774	reqHeaders := make(http.Header)
2775	for k, v := range c.header_ {
2776		reqHeaders[k] = v
2777	}
2778	reqHeaders.Set("User-Agent", c.s.userAgent())
2779	var body io.Reader = nil
2780	c.urlParams_.Set("alt", alt)
2781	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
2782	urls += "?" + c.urlParams_.Encode()
2783	req, _ := http.NewRequest("DELETE", urls, body)
2784	req.Header = reqHeaders
2785	googleapi.Expand(req.URL, map[string]string{
2786		"bucket": c.bucket,
2787	})
2788	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2789}
2790
2791// Do executes the "storage.buckets.delete" call.
2792func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
2793	gensupport.SetOptions(c.urlParams_, opts...)
2794	res, err := c.doRequest("json")
2795	if err != nil {
2796		return err
2797	}
2798	defer googleapi.CloseBody(res)
2799	if err := googleapi.CheckResponse(res); err != nil {
2800		return err
2801	}
2802	return nil
2803	// {
2804	//   "description": "Permanently deletes an empty bucket.",
2805	//   "httpMethod": "DELETE",
2806	//   "id": "storage.buckets.delete",
2807	//   "parameterOrder": [
2808	//     "bucket"
2809	//   ],
2810	//   "parameters": {
2811	//     "bucket": {
2812	//       "description": "Name of a bucket.",
2813	//       "location": "path",
2814	//       "required": true,
2815	//       "type": "string"
2816	//     },
2817	//     "ifMetagenerationMatch": {
2818	//       "description": "If set, only deletes the bucket if its metageneration matches this value.",
2819	//       "format": "int64",
2820	//       "location": "query",
2821	//       "type": "string"
2822	//     },
2823	//     "ifMetagenerationNotMatch": {
2824	//       "description": "If set, only deletes the bucket if its metageneration does not match this value.",
2825	//       "format": "int64",
2826	//       "location": "query",
2827	//       "type": "string"
2828	//     },
2829	//     "userProject": {
2830	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
2831	//       "location": "query",
2832	//       "type": "string"
2833	//     }
2834	//   },
2835	//   "path": "b/{bucket}",
2836	//   "scopes": [
2837	//     "https://www.googleapis.com/auth/cloud-platform",
2838	//     "https://www.googleapis.com/auth/devstorage.full_control",
2839	//     "https://www.googleapis.com/auth/devstorage.read_write"
2840	//   ]
2841	// }
2842
2843}
2844
2845// method id "storage.buckets.get":
2846
2847type BucketsGetCall struct {
2848	s            *Service
2849	bucket       string
2850	urlParams_   gensupport.URLParams
2851	ifNoneMatch_ string
2852	ctx_         context.Context
2853	header_      http.Header
2854}
2855
2856// Get: Returns metadata for the specified bucket.
2857func (r *BucketsService) Get(bucket string) *BucketsGetCall {
2858	c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2859	c.bucket = bucket
2860	return c
2861}
2862
2863// IfMetagenerationMatch sets the optional parameter
2864// "ifMetagenerationMatch": Makes the return of the bucket metadata
2865// conditional on whether the bucket's current metageneration matches
2866// the given value.
2867func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
2868	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
2869	return c
2870}
2871
2872// IfMetagenerationNotMatch sets the optional parameter
2873// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
2874// conditional on whether the bucket's current metageneration does not
2875// match the given value.
2876func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall {
2877	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
2878	return c
2879}
2880
2881// Projection sets the optional parameter "projection": Set of
2882// properties to return. Defaults to noAcl.
2883//
2884// Possible values:
2885//   "full" - Include all properties.
2886//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
2887func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
2888	c.urlParams_.Set("projection", projection)
2889	return c
2890}
2891
2892// UserProject sets the optional parameter "userProject": The project to
2893// be billed for this request, for Requester Pays buckets.
2894func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
2895	c.urlParams_.Set("userProject", userProject)
2896	return c
2897}
2898
2899// Fields allows partial responses to be retrieved. See
2900// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2901// for more information.
2902func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
2903	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2904	return c
2905}
2906
2907// IfNoneMatch sets the optional parameter which makes the operation
2908// fail if the object's ETag matches the given value. This is useful for
2909// getting updates only after the object has changed since the last
2910// request. Use googleapi.IsNotModified to check whether the response
2911// error from Do is the result of In-None-Match.
2912func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
2913	c.ifNoneMatch_ = entityTag
2914	return c
2915}
2916
2917// Context sets the context to be used in this call's Do method. Any
2918// pending HTTP request will be aborted if the provided context is
2919// canceled.
2920func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
2921	c.ctx_ = ctx
2922	return c
2923}
2924
2925// Header returns an http.Header that can be modified by the caller to
2926// add HTTP headers to the request.
2927func (c *BucketsGetCall) Header() http.Header {
2928	if c.header_ == nil {
2929		c.header_ = make(http.Header)
2930	}
2931	return c.header_
2932}
2933
2934func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
2935	reqHeaders := make(http.Header)
2936	for k, v := range c.header_ {
2937		reqHeaders[k] = v
2938	}
2939	reqHeaders.Set("User-Agent", c.s.userAgent())
2940	if c.ifNoneMatch_ != "" {
2941		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2942	}
2943	var body io.Reader = nil
2944	c.urlParams_.Set("alt", alt)
2945	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
2946	urls += "?" + c.urlParams_.Encode()
2947	req, _ := http.NewRequest("GET", urls, body)
2948	req.Header = reqHeaders
2949	googleapi.Expand(req.URL, map[string]string{
2950		"bucket": c.bucket,
2951	})
2952	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2953}
2954
2955// Do executes the "storage.buckets.get" call.
2956// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
2957// code is an error. Response headers are in either
2958// *Bucket.ServerResponse.Header or (if a response was returned at all)
2959// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2960// check whether the returned error was because http.StatusNotModified
2961// was returned.
2962func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
2963	gensupport.SetOptions(c.urlParams_, opts...)
2964	res, err := c.doRequest("json")
2965	if res != nil && res.StatusCode == http.StatusNotModified {
2966		if res.Body != nil {
2967			res.Body.Close()
2968		}
2969		return nil, &googleapi.Error{
2970			Code:   res.StatusCode,
2971			Header: res.Header,
2972		}
2973	}
2974	if err != nil {
2975		return nil, err
2976	}
2977	defer googleapi.CloseBody(res)
2978	if err := googleapi.CheckResponse(res); err != nil {
2979		return nil, err
2980	}
2981	ret := &Bucket{
2982		ServerResponse: googleapi.ServerResponse{
2983			Header:         res.Header,
2984			HTTPStatusCode: res.StatusCode,
2985		},
2986	}
2987	target := &ret
2988	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
2989		return nil, err
2990	}
2991	return ret, nil
2992	// {
2993	//   "description": "Returns metadata for the specified bucket.",
2994	//   "httpMethod": "GET",
2995	//   "id": "storage.buckets.get",
2996	//   "parameterOrder": [
2997	//     "bucket"
2998	//   ],
2999	//   "parameters": {
3000	//     "bucket": {
3001	//       "description": "Name of a bucket.",
3002	//       "location": "path",
3003	//       "required": true,
3004	//       "type": "string"
3005	//     },
3006	//     "ifMetagenerationMatch": {
3007	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
3008	//       "format": "int64",
3009	//       "location": "query",
3010	//       "type": "string"
3011	//     },
3012	//     "ifMetagenerationNotMatch": {
3013	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
3014	//       "format": "int64",
3015	//       "location": "query",
3016	//       "type": "string"
3017	//     },
3018	//     "projection": {
3019	//       "description": "Set of properties to return. Defaults to noAcl.",
3020	//       "enum": [
3021	//         "full",
3022	//         "noAcl"
3023	//       ],
3024	//       "enumDescriptions": [
3025	//         "Include all properties.",
3026	//         "Omit owner, acl and defaultObjectAcl properties."
3027	//       ],
3028	//       "location": "query",
3029	//       "type": "string"
3030	//     },
3031	//     "userProject": {
3032	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
3033	//       "location": "query",
3034	//       "type": "string"
3035	//     }
3036	//   },
3037	//   "path": "b/{bucket}",
3038	//   "response": {
3039	//     "$ref": "Bucket"
3040	//   },
3041	//   "scopes": [
3042	//     "https://www.googleapis.com/auth/cloud-platform",
3043	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3044	//     "https://www.googleapis.com/auth/devstorage.full_control",
3045	//     "https://www.googleapis.com/auth/devstorage.read_only",
3046	//     "https://www.googleapis.com/auth/devstorage.read_write"
3047	//   ]
3048	// }
3049
3050}
3051
3052// method id "storage.buckets.getIamPolicy":
3053
3054type BucketsGetIamPolicyCall struct {
3055	s            *Service
3056	bucket       string
3057	urlParams_   gensupport.URLParams
3058	ifNoneMatch_ string
3059	ctx_         context.Context
3060	header_      http.Header
3061}
3062
3063// GetIamPolicy: Returns an IAM policy for the specified bucket.
3064func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
3065	c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3066	c.bucket = bucket
3067	return c
3068}
3069
3070// UserProject sets the optional parameter "userProject": The project to
3071// be billed for this request, for Requester Pays buckets.
3072func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
3073	c.urlParams_.Set("userProject", userProject)
3074	return c
3075}
3076
3077// Fields allows partial responses to be retrieved. See
3078// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3079// for more information.
3080func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall {
3081	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3082	return c
3083}
3084
3085// IfNoneMatch sets the optional parameter which makes the operation
3086// fail if the object's ETag matches the given value. This is useful for
3087// getting updates only after the object has changed since the last
3088// request. Use googleapi.IsNotModified to check whether the response
3089// error from Do is the result of In-None-Match.
3090func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall {
3091	c.ifNoneMatch_ = entityTag
3092	return c
3093}
3094
3095// Context sets the context to be used in this call's Do method. Any
3096// pending HTTP request will be aborted if the provided context is
3097// canceled.
3098func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
3099	c.ctx_ = ctx
3100	return c
3101}
3102
3103// Header returns an http.Header that can be modified by the caller to
3104// add HTTP headers to the request.
3105func (c *BucketsGetIamPolicyCall) Header() http.Header {
3106	if c.header_ == nil {
3107		c.header_ = make(http.Header)
3108	}
3109	return c.header_
3110}
3111
3112func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3113	reqHeaders := make(http.Header)
3114	for k, v := range c.header_ {
3115		reqHeaders[k] = v
3116	}
3117	reqHeaders.Set("User-Agent", c.s.userAgent())
3118	if c.ifNoneMatch_ != "" {
3119		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3120	}
3121	var body io.Reader = nil
3122	c.urlParams_.Set("alt", alt)
3123	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
3124	urls += "?" + c.urlParams_.Encode()
3125	req, _ := http.NewRequest("GET", urls, body)
3126	req.Header = reqHeaders
3127	googleapi.Expand(req.URL, map[string]string{
3128		"bucket": c.bucket,
3129	})
3130	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3131}
3132
3133// Do executes the "storage.buckets.getIamPolicy" call.
3134// Exactly one of *Policy or error will be non-nil. Any non-2xx status
3135// code is an error. Response headers are in either
3136// *Policy.ServerResponse.Header or (if a response was returned at all)
3137// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3138// check whether the returned error was because http.StatusNotModified
3139// was returned.
3140func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3141	gensupport.SetOptions(c.urlParams_, opts...)
3142	res, err := c.doRequest("json")
3143	if res != nil && res.StatusCode == http.StatusNotModified {
3144		if res.Body != nil {
3145			res.Body.Close()
3146		}
3147		return nil, &googleapi.Error{
3148			Code:   res.StatusCode,
3149			Header: res.Header,
3150		}
3151	}
3152	if err != nil {
3153		return nil, err
3154	}
3155	defer googleapi.CloseBody(res)
3156	if err := googleapi.CheckResponse(res); err != nil {
3157		return nil, err
3158	}
3159	ret := &Policy{
3160		ServerResponse: googleapi.ServerResponse{
3161			Header:         res.Header,
3162			HTTPStatusCode: res.StatusCode,
3163		},
3164	}
3165	target := &ret
3166	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
3167		return nil, err
3168	}
3169	return ret, nil
3170	// {
3171	//   "description": "Returns an IAM policy for the specified bucket.",
3172	//   "httpMethod": "GET",
3173	//   "id": "storage.buckets.getIamPolicy",
3174	//   "parameterOrder": [
3175	//     "bucket"
3176	//   ],
3177	//   "parameters": {
3178	//     "bucket": {
3179	//       "description": "Name of a bucket.",
3180	//       "location": "path",
3181	//       "required": true,
3182	//       "type": "string"
3183	//     },
3184	//     "userProject": {
3185	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
3186	//       "location": "query",
3187	//       "type": "string"
3188	//     }
3189	//   },
3190	//   "path": "b/{bucket}/iam",
3191	//   "response": {
3192	//     "$ref": "Policy"
3193	//   },
3194	//   "scopes": [
3195	//     "https://www.googleapis.com/auth/cloud-platform",
3196	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3197	//     "https://www.googleapis.com/auth/devstorage.full_control",
3198	//     "https://www.googleapis.com/auth/devstorage.read_only",
3199	//     "https://www.googleapis.com/auth/devstorage.read_write"
3200	//   ]
3201	// }
3202
3203}
3204
3205// method id "storage.buckets.insert":
3206
3207type BucketsInsertCall struct {
3208	s          *Service
3209	bucket     *Bucket
3210	urlParams_ gensupport.URLParams
3211	ctx_       context.Context
3212	header_    http.Header
3213}
3214
3215// Insert: Creates a new bucket.
3216func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
3217	c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3218	c.urlParams_.Set("project", projectid)
3219	c.bucket = bucket
3220	return c
3221}
3222
3223// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
3224// predefined set of access controls to this bucket.
3225//
3226// Possible values:
3227//   "authenticatedRead" - Project team owners get OWNER access, and
3228// allAuthenticatedUsers get READER access.
3229//   "private" - Project team owners get OWNER access.
3230//   "projectPrivate" - Project team members get access according to
3231// their roles.
3232//   "publicRead" - Project team owners get OWNER access, and allUsers
3233// get READER access.
3234//   "publicReadWrite" - Project team owners get OWNER access, and
3235// allUsers get WRITER access.
3236func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall {
3237	c.urlParams_.Set("predefinedAcl", predefinedAcl)
3238	return c
3239}
3240
3241// PredefinedDefaultObjectAcl sets the optional parameter
3242// "predefinedDefaultObjectAcl": Apply a predefined set of default
3243// object access controls to this bucket.
3244//
3245// Possible values:
3246//   "authenticatedRead" - Object owner gets OWNER access, and
3247// allAuthenticatedUsers get READER access.
3248//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
3249// project team owners get OWNER access.
3250//   "bucketOwnerRead" - Object owner gets OWNER access, and project
3251// team owners get READER access.
3252//   "private" - Object owner gets OWNER access.
3253//   "projectPrivate" - Object owner gets OWNER access, and project team
3254// members get access according to their roles.
3255//   "publicRead" - Object owner gets OWNER access, and allUsers get
3256// READER access.
3257func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
3258	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
3259	return c
3260}
3261
3262// Projection sets the optional parameter "projection": Set of
3263// properties to return. Defaults to noAcl, unless the bucket resource
3264// specifies acl or defaultObjectAcl properties, when it defaults to
3265// full.
3266//
3267// Possible values:
3268//   "full" - Include all properties.
3269//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3270func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
3271	c.urlParams_.Set("projection", projection)
3272	return c
3273}
3274
3275// Fields allows partial responses to be retrieved. See
3276// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3277// for more information.
3278func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
3279	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3280	return c
3281}
3282
3283// Context sets the context to be used in this call's Do method. Any
3284// pending HTTP request will be aborted if the provided context is
3285// canceled.
3286func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
3287	c.ctx_ = ctx
3288	return c
3289}
3290
3291// Header returns an http.Header that can be modified by the caller to
3292// add HTTP headers to the request.
3293func (c *BucketsInsertCall) Header() http.Header {
3294	if c.header_ == nil {
3295		c.header_ = make(http.Header)
3296	}
3297	return c.header_
3298}
3299
3300func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
3301	reqHeaders := make(http.Header)
3302	for k, v := range c.header_ {
3303		reqHeaders[k] = v
3304	}
3305	reqHeaders.Set("User-Agent", c.s.userAgent())
3306	var body io.Reader = nil
3307	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
3308	if err != nil {
3309		return nil, err
3310	}
3311	reqHeaders.Set("Content-Type", "application/json")
3312	c.urlParams_.Set("alt", alt)
3313	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
3314	urls += "?" + c.urlParams_.Encode()
3315	req, _ := http.NewRequest("POST", urls, body)
3316	req.Header = reqHeaders
3317	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3318}
3319
3320// Do executes the "storage.buckets.insert" call.
3321// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3322// code is an error. Response headers are in either
3323// *Bucket.ServerResponse.Header or (if a response was returned at all)
3324// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3325// check whether the returned error was because http.StatusNotModified
3326// was returned.
3327func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3328	gensupport.SetOptions(c.urlParams_, opts...)
3329	res, err := c.doRequest("json")
3330	if res != nil && res.StatusCode == http.StatusNotModified {
3331		if res.Body != nil {
3332			res.Body.Close()
3333		}
3334		return nil, &googleapi.Error{
3335			Code:   res.StatusCode,
3336			Header: res.Header,
3337		}
3338	}
3339	if err != nil {
3340		return nil, err
3341	}
3342	defer googleapi.CloseBody(res)
3343	if err := googleapi.CheckResponse(res); err != nil {
3344		return nil, err
3345	}
3346	ret := &Bucket{
3347		ServerResponse: googleapi.ServerResponse{
3348			Header:         res.Header,
3349			HTTPStatusCode: res.StatusCode,
3350		},
3351	}
3352	target := &ret
3353	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
3354		return nil, err
3355	}
3356	return ret, nil
3357	// {
3358	//   "description": "Creates a new bucket.",
3359	//   "httpMethod": "POST",
3360	//   "id": "storage.buckets.insert",
3361	//   "parameterOrder": [
3362	//     "project"
3363	//   ],
3364	//   "parameters": {
3365	//     "predefinedAcl": {
3366	//       "description": "Apply a predefined set of access controls to this bucket.",
3367	//       "enum": [
3368	//         "authenticatedRead",
3369	//         "private",
3370	//         "projectPrivate",
3371	//         "publicRead",
3372	//         "publicReadWrite"
3373	//       ],
3374	//       "enumDescriptions": [
3375	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
3376	//         "Project team owners get OWNER access.",
3377	//         "Project team members get access according to their roles.",
3378	//         "Project team owners get OWNER access, and allUsers get READER access.",
3379	//         "Project team owners get OWNER access, and allUsers get WRITER access."
3380	//       ],
3381	//       "location": "query",
3382	//       "type": "string"
3383	//     },
3384	//     "predefinedDefaultObjectAcl": {
3385	//       "description": "Apply a predefined set of default object access controls to this bucket.",
3386	//       "enum": [
3387	//         "authenticatedRead",
3388	//         "bucketOwnerFullControl",
3389	//         "bucketOwnerRead",
3390	//         "private",
3391	//         "projectPrivate",
3392	//         "publicRead"
3393	//       ],
3394	//       "enumDescriptions": [
3395	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
3396	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
3397	//         "Object owner gets OWNER access, and project team owners get READER access.",
3398	//         "Object owner gets OWNER access.",
3399	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
3400	//         "Object owner gets OWNER access, and allUsers get READER access."
3401	//       ],
3402	//       "location": "query",
3403	//       "type": "string"
3404	//     },
3405	//     "project": {
3406	//       "description": "A valid API project identifier.",
3407	//       "location": "query",
3408	//       "required": true,
3409	//       "type": "string"
3410	//     },
3411	//     "projection": {
3412	//       "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
3413	//       "enum": [
3414	//         "full",
3415	//         "noAcl"
3416	//       ],
3417	//       "enumDescriptions": [
3418	//         "Include all properties.",
3419	//         "Omit owner, acl and defaultObjectAcl properties."
3420	//       ],
3421	//       "location": "query",
3422	//       "type": "string"
3423	//     }
3424	//   },
3425	//   "path": "b",
3426	//   "request": {
3427	//     "$ref": "Bucket"
3428	//   },
3429	//   "response": {
3430	//     "$ref": "Bucket"
3431	//   },
3432	//   "scopes": [
3433	//     "https://www.googleapis.com/auth/cloud-platform",
3434	//     "https://www.googleapis.com/auth/devstorage.full_control",
3435	//     "https://www.googleapis.com/auth/devstorage.read_write"
3436	//   ]
3437	// }
3438
3439}
3440
3441// method id "storage.buckets.list":
3442
3443type BucketsListCall struct {
3444	s            *Service
3445	urlParams_   gensupport.URLParams
3446	ifNoneMatch_ string
3447	ctx_         context.Context
3448	header_      http.Header
3449}
3450
3451// List: Retrieves a list of buckets for a given project.
3452func (r *BucketsService) List(projectid string) *BucketsListCall {
3453	c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3454	c.urlParams_.Set("project", projectid)
3455	return c
3456}
3457
3458// MaxResults sets the optional parameter "maxResults": Maximum number
3459// of buckets to return in a single response. The service will use this
3460// parameter or 1,000 items, whichever is smaller.
3461func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
3462	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3463	return c
3464}
3465
3466// PageToken sets the optional parameter "pageToken": A
3467// previously-returned page token representing part of the larger set of
3468// results to view.
3469func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
3470	c.urlParams_.Set("pageToken", pageToken)
3471	return c
3472}
3473
3474// Prefix sets the optional parameter "prefix": Filter results to
3475// buckets whose names begin with this prefix.
3476func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall {
3477	c.urlParams_.Set("prefix", prefix)
3478	return c
3479}
3480
3481// Projection sets the optional parameter "projection": Set of
3482// properties to return. Defaults to noAcl.
3483//
3484// Possible values:
3485//   "full" - Include all properties.
3486//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3487func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
3488	c.urlParams_.Set("projection", projection)
3489	return c
3490}
3491
3492// Fields allows partial responses to be retrieved. See
3493// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3494// for more information.
3495func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
3496	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3497	return c
3498}
3499
3500// IfNoneMatch sets the optional parameter which makes the operation
3501// fail if the object's ETag matches the given value. This is useful for
3502// getting updates only after the object has changed since the last
3503// request. Use googleapi.IsNotModified to check whether the response
3504// error from Do is the result of In-None-Match.
3505func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
3506	c.ifNoneMatch_ = entityTag
3507	return c
3508}
3509
3510// Context sets the context to be used in this call's Do method. Any
3511// pending HTTP request will be aborted if the provided context is
3512// canceled.
3513func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
3514	c.ctx_ = ctx
3515	return c
3516}
3517
3518// Header returns an http.Header that can be modified by the caller to
3519// add HTTP headers to the request.
3520func (c *BucketsListCall) Header() http.Header {
3521	if c.header_ == nil {
3522		c.header_ = make(http.Header)
3523	}
3524	return c.header_
3525}
3526
3527func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
3528	reqHeaders := make(http.Header)
3529	for k, v := range c.header_ {
3530		reqHeaders[k] = v
3531	}
3532	reqHeaders.Set("User-Agent", c.s.userAgent())
3533	if c.ifNoneMatch_ != "" {
3534		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3535	}
3536	var body io.Reader = nil
3537	c.urlParams_.Set("alt", alt)
3538	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
3539	urls += "?" + c.urlParams_.Encode()
3540	req, _ := http.NewRequest("GET", urls, body)
3541	req.Header = reqHeaders
3542	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3543}
3544
3545// Do executes the "storage.buckets.list" call.
3546// Exactly one of *Buckets or error will be non-nil. Any non-2xx status
3547// code is an error. Response headers are in either
3548// *Buckets.ServerResponse.Header or (if a response was returned at all)
3549// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3550// check whether the returned error was because http.StatusNotModified
3551// was returned.
3552func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
3553	gensupport.SetOptions(c.urlParams_, opts...)
3554	res, err := c.doRequest("json")
3555	if res != nil && res.StatusCode == http.StatusNotModified {
3556		if res.Body != nil {
3557			res.Body.Close()
3558		}
3559		return nil, &googleapi.Error{
3560			Code:   res.StatusCode,
3561			Header: res.Header,
3562		}
3563	}
3564	if err != nil {
3565		return nil, err
3566	}
3567	defer googleapi.CloseBody(res)
3568	if err := googleapi.CheckResponse(res); err != nil {
3569		return nil, err
3570	}
3571	ret := &Buckets{
3572		ServerResponse: googleapi.ServerResponse{
3573			Header:         res.Header,
3574			HTTPStatusCode: res.StatusCode,
3575		},
3576	}
3577	target := &ret
3578	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
3579		return nil, err
3580	}
3581	return ret, nil
3582	// {
3583	//   "description": "Retrieves a list of buckets for a given project.",
3584	//   "httpMethod": "GET",
3585	//   "id": "storage.buckets.list",
3586	//   "parameterOrder": [
3587	//     "project"
3588	//   ],
3589	//   "parameters": {
3590	//     "maxResults": {
3591	//       "default": "1000",
3592	//       "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
3593	//       "format": "uint32",
3594	//       "location": "query",
3595	//       "minimum": "0",
3596	//       "type": "integer"
3597	//     },
3598	//     "pageToken": {
3599	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
3600	//       "location": "query",
3601	//       "type": "string"
3602	//     },
3603	//     "prefix": {
3604	//       "description": "Filter results to buckets whose names begin with this prefix.",
3605	//       "location": "query",
3606	//       "type": "string"
3607	//     },
3608	//     "project": {
3609	//       "description": "A valid API project identifier.",
3610	//       "location": "query",
3611	//       "required": true,
3612	//       "type": "string"
3613	//     },
3614	//     "projection": {
3615	//       "description": "Set of properties to return. Defaults to noAcl.",
3616	//       "enum": [
3617	//         "full",
3618	//         "noAcl"
3619	//       ],
3620	//       "enumDescriptions": [
3621	//         "Include all properties.",
3622	//         "Omit owner, acl and defaultObjectAcl properties."
3623	//       ],
3624	//       "location": "query",
3625	//       "type": "string"
3626	//     }
3627	//   },
3628	//   "path": "b",
3629	//   "response": {
3630	//     "$ref": "Buckets"
3631	//   },
3632	//   "scopes": [
3633	//     "https://www.googleapis.com/auth/cloud-platform",
3634	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3635	//     "https://www.googleapis.com/auth/devstorage.full_control",
3636	//     "https://www.googleapis.com/auth/devstorage.read_only",
3637	//     "https://www.googleapis.com/auth/devstorage.read_write"
3638	//   ]
3639	// }
3640
3641}
3642
3643// Pages invokes f for each page of results.
3644// A non-nil error returned from f will halt the iteration.
3645// The provided context supersedes any context provided to the Context method.
3646func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
3647	c.ctx_ = ctx
3648	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3649	for {
3650		x, err := c.Do()
3651		if err != nil {
3652			return err
3653		}
3654		if err := f(x); err != nil {
3655			return err
3656		}
3657		if x.NextPageToken == "" {
3658			return nil
3659		}
3660		c.PageToken(x.NextPageToken)
3661	}
3662}
3663
3664// method id "storage.buckets.patch":
3665
3666type BucketsPatchCall struct {
3667	s          *Service
3668	bucket     string
3669	bucket2    *Bucket
3670	urlParams_ gensupport.URLParams
3671	ctx_       context.Context
3672	header_    http.Header
3673}
3674
3675// Patch: Updates a bucket. Changes to the bucket will be readable
3676// immediately after writing, but configuration changes may take time to
3677// propagate. This method supports patch semantics.
3678func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
3679	c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3680	c.bucket = bucket
3681	c.bucket2 = bucket2
3682	return c
3683}
3684
3685// IfMetagenerationMatch sets the optional parameter
3686// "ifMetagenerationMatch": Makes the return of the bucket metadata
3687// conditional on whether the bucket's current metageneration matches
3688// the given value.
3689func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
3690	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3691	return c
3692}
3693
3694// IfMetagenerationNotMatch sets the optional parameter
3695// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
3696// conditional on whether the bucket's current metageneration does not
3697// match the given value.
3698func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall {
3699	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3700	return c
3701}
3702
3703// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
3704// predefined set of access controls to this bucket.
3705//
3706// Possible values:
3707//   "authenticatedRead" - Project team owners get OWNER access, and
3708// allAuthenticatedUsers get READER access.
3709//   "private" - Project team owners get OWNER access.
3710//   "projectPrivate" - Project team members get access according to
3711// their roles.
3712//   "publicRead" - Project team owners get OWNER access, and allUsers
3713// get READER access.
3714//   "publicReadWrite" - Project team owners get OWNER access, and
3715// allUsers get WRITER access.
3716func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall {
3717	c.urlParams_.Set("predefinedAcl", predefinedAcl)
3718	return c
3719}
3720
3721// PredefinedDefaultObjectAcl sets the optional parameter
3722// "predefinedDefaultObjectAcl": Apply a predefined set of default
3723// object access controls to this bucket.
3724//
3725// Possible values:
3726//   "authenticatedRead" - Object owner gets OWNER access, and
3727// allAuthenticatedUsers get READER access.
3728//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
3729// project team owners get OWNER access.
3730//   "bucketOwnerRead" - Object owner gets OWNER access, and project
3731// team owners get READER access.
3732//   "private" - Object owner gets OWNER access.
3733//   "projectPrivate" - Object owner gets OWNER access, and project team
3734// members get access according to their roles.
3735//   "publicRead" - Object owner gets OWNER access, and allUsers get
3736// READER access.
3737func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
3738	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
3739	return c
3740}
3741
3742// Projection sets the optional parameter "projection": Set of
3743// properties to return. Defaults to full.
3744//
3745// Possible values:
3746//   "full" - Include all properties.
3747//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3748func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
3749	c.urlParams_.Set("projection", projection)
3750	return c
3751}
3752
3753// UserProject sets the optional parameter "userProject": The project to
3754// be billed for this request, for Requester Pays buckets.
3755func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
3756	c.urlParams_.Set("userProject", userProject)
3757	return c
3758}
3759
3760// Fields allows partial responses to be retrieved. See
3761// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3762// for more information.
3763func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
3764	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3765	return c
3766}
3767
3768// Context sets the context to be used in this call's Do method. Any
3769// pending HTTP request will be aborted if the provided context is
3770// canceled.
3771func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
3772	c.ctx_ = ctx
3773	return c
3774}
3775
3776// Header returns an http.Header that can be modified by the caller to
3777// add HTTP headers to the request.
3778func (c *BucketsPatchCall) Header() http.Header {
3779	if c.header_ == nil {
3780		c.header_ = make(http.Header)
3781	}
3782	return c.header_
3783}
3784
3785func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
3786	reqHeaders := make(http.Header)
3787	for k, v := range c.header_ {
3788		reqHeaders[k] = v
3789	}
3790	reqHeaders.Set("User-Agent", c.s.userAgent())
3791	var body io.Reader = nil
3792	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
3793	if err != nil {
3794		return nil, err
3795	}
3796	reqHeaders.Set("Content-Type", "application/json")
3797	c.urlParams_.Set("alt", alt)
3798	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3799	urls += "?" + c.urlParams_.Encode()
3800	req, _ := http.NewRequest("PATCH", urls, body)
3801	req.Header = reqHeaders
3802	googleapi.Expand(req.URL, map[string]string{
3803		"bucket": c.bucket,
3804	})
3805	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3806}
3807
3808// Do executes the "storage.buckets.patch" call.
3809// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3810// code is an error. Response headers are in either
3811// *Bucket.ServerResponse.Header or (if a response was returned at all)
3812// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3813// check whether the returned error was because http.StatusNotModified
3814// was returned.
3815func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3816	gensupport.SetOptions(c.urlParams_, opts...)
3817	res, err := c.doRequest("json")
3818	if res != nil && res.StatusCode == http.StatusNotModified {
3819		if res.Body != nil {
3820			res.Body.Close()
3821		}
3822		return nil, &googleapi.Error{
3823			Code:   res.StatusCode,
3824			Header: res.Header,
3825		}
3826	}
3827	if err != nil {
3828		return nil, err
3829	}
3830	defer googleapi.CloseBody(res)
3831	if err := googleapi.CheckResponse(res); err != nil {
3832		return nil, err
3833	}
3834	ret := &Bucket{
3835		ServerResponse: googleapi.ServerResponse{
3836			Header:         res.Header,
3837			HTTPStatusCode: res.StatusCode,
3838		},
3839	}
3840	target := &ret
3841	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
3842		return nil, err
3843	}
3844	return ret, nil
3845	// {
3846	//   "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics.",
3847	//   "httpMethod": "PATCH",
3848	//   "id": "storage.buckets.patch",
3849	//   "parameterOrder": [
3850	//     "bucket"
3851	//   ],
3852	//   "parameters": {
3853	//     "bucket": {
3854	//       "description": "Name of a bucket.",
3855	//       "location": "path",
3856	//       "required": true,
3857	//       "type": "string"
3858	//     },
3859	//     "ifMetagenerationMatch": {
3860	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
3861	//       "format": "int64",
3862	//       "location": "query",
3863	//       "type": "string"
3864	//     },
3865	//     "ifMetagenerationNotMatch": {
3866	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
3867	//       "format": "int64",
3868	//       "location": "query",
3869	//       "type": "string"
3870	//     },
3871	//     "predefinedAcl": {
3872	//       "description": "Apply a predefined set of access controls to this bucket.",
3873	//       "enum": [
3874	//         "authenticatedRead",
3875	//         "private",
3876	//         "projectPrivate",
3877	//         "publicRead",
3878	//         "publicReadWrite"
3879	//       ],
3880	//       "enumDescriptions": [
3881	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
3882	//         "Project team owners get OWNER access.",
3883	//         "Project team members get access according to their roles.",
3884	//         "Project team owners get OWNER access, and allUsers get READER access.",
3885	//         "Project team owners get OWNER access, and allUsers get WRITER access."
3886	//       ],
3887	//       "location": "query",
3888	//       "type": "string"
3889	//     },
3890	//     "predefinedDefaultObjectAcl": {
3891	//       "description": "Apply a predefined set of default object access controls to this bucket.",
3892	//       "enum": [
3893	//         "authenticatedRead",
3894	//         "bucketOwnerFullControl",
3895	//         "bucketOwnerRead",
3896	//         "private",
3897	//         "projectPrivate",
3898	//         "publicRead"
3899	//       ],
3900	//       "enumDescriptions": [
3901	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
3902	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
3903	//         "Object owner gets OWNER access, and project team owners get READER access.",
3904	//         "Object owner gets OWNER access.",
3905	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
3906	//         "Object owner gets OWNER access, and allUsers get READER access."
3907	//       ],
3908	//       "location": "query",
3909	//       "type": "string"
3910	//     },
3911	//     "projection": {
3912	//       "description": "Set of properties to return. Defaults to full.",
3913	//       "enum": [
3914	//         "full",
3915	//         "noAcl"
3916	//       ],
3917	//       "enumDescriptions": [
3918	//         "Include all properties.",
3919	//         "Omit owner, acl and defaultObjectAcl properties."
3920	//       ],
3921	//       "location": "query",
3922	//       "type": "string"
3923	//     },
3924	//     "userProject": {
3925	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
3926	//       "location": "query",
3927	//       "type": "string"
3928	//     }
3929	//   },
3930	//   "path": "b/{bucket}",
3931	//   "request": {
3932	//     "$ref": "Bucket"
3933	//   },
3934	//   "response": {
3935	//     "$ref": "Bucket"
3936	//   },
3937	//   "scopes": [
3938	//     "https://www.googleapis.com/auth/cloud-platform",
3939	//     "https://www.googleapis.com/auth/devstorage.full_control"
3940	//   ]
3941	// }
3942
3943}
3944
3945// method id "storage.buckets.setIamPolicy":
3946
3947type BucketsSetIamPolicyCall struct {
3948	s          *Service
3949	bucket     string
3950	policy     *Policy
3951	urlParams_ gensupport.URLParams
3952	ctx_       context.Context
3953	header_    http.Header
3954}
3955
3956// SetIamPolicy: Updates an IAM policy for the specified bucket.
3957func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall {
3958	c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3959	c.bucket = bucket
3960	c.policy = policy
3961	return c
3962}
3963
3964// UserProject sets the optional parameter "userProject": The project to
3965// be billed for this request, for Requester Pays buckets.
3966func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
3967	c.urlParams_.Set("userProject", userProject)
3968	return c
3969}
3970
3971// Fields allows partial responses to be retrieved. See
3972// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3973// for more information.
3974func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall {
3975	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3976	return c
3977}
3978
3979// Context sets the context to be used in this call's Do method. Any
3980// pending HTTP request will be aborted if the provided context is
3981// canceled.
3982func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
3983	c.ctx_ = ctx
3984	return c
3985}
3986
3987// Header returns an http.Header that can be modified by the caller to
3988// add HTTP headers to the request.
3989func (c *BucketsSetIamPolicyCall) Header() http.Header {
3990	if c.header_ == nil {
3991		c.header_ = make(http.Header)
3992	}
3993	return c.header_
3994}
3995
3996func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3997	reqHeaders := make(http.Header)
3998	for k, v := range c.header_ {
3999		reqHeaders[k] = v
4000	}
4001	reqHeaders.Set("User-Agent", c.s.userAgent())
4002	var body io.Reader = nil
4003	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
4004	if err != nil {
4005		return nil, err
4006	}
4007	reqHeaders.Set("Content-Type", "application/json")
4008	c.urlParams_.Set("alt", alt)
4009	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
4010	urls += "?" + c.urlParams_.Encode()
4011	req, _ := http.NewRequest("PUT", urls, body)
4012	req.Header = reqHeaders
4013	googleapi.Expand(req.URL, map[string]string{
4014		"bucket": c.bucket,
4015	})
4016	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4017}
4018
4019// Do executes the "storage.buckets.setIamPolicy" call.
4020// Exactly one of *Policy or error will be non-nil. Any non-2xx status
4021// code is an error. Response headers are in either
4022// *Policy.ServerResponse.Header or (if a response was returned at all)
4023// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4024// check whether the returned error was because http.StatusNotModified
4025// was returned.
4026func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4027	gensupport.SetOptions(c.urlParams_, opts...)
4028	res, err := c.doRequest("json")
4029	if res != nil && res.StatusCode == http.StatusNotModified {
4030		if res.Body != nil {
4031			res.Body.Close()
4032		}
4033		return nil, &googleapi.Error{
4034			Code:   res.StatusCode,
4035			Header: res.Header,
4036		}
4037	}
4038	if err != nil {
4039		return nil, err
4040	}
4041	defer googleapi.CloseBody(res)
4042	if err := googleapi.CheckResponse(res); err != nil {
4043		return nil, err
4044	}
4045	ret := &Policy{
4046		ServerResponse: googleapi.ServerResponse{
4047			Header:         res.Header,
4048			HTTPStatusCode: res.StatusCode,
4049		},
4050	}
4051	target := &ret
4052	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
4053		return nil, err
4054	}
4055	return ret, nil
4056	// {
4057	//   "description": "Updates an IAM policy for the specified bucket.",
4058	//   "httpMethod": "PUT",
4059	//   "id": "storage.buckets.setIamPolicy",
4060	//   "parameterOrder": [
4061	//     "bucket"
4062	//   ],
4063	//   "parameters": {
4064	//     "bucket": {
4065	//       "description": "Name of a bucket.",
4066	//       "location": "path",
4067	//       "required": true,
4068	//       "type": "string"
4069	//     },
4070	//     "userProject": {
4071	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
4072	//       "location": "query",
4073	//       "type": "string"
4074	//     }
4075	//   },
4076	//   "path": "b/{bucket}/iam",
4077	//   "request": {
4078	//     "$ref": "Policy"
4079	//   },
4080	//   "response": {
4081	//     "$ref": "Policy"
4082	//   },
4083	//   "scopes": [
4084	//     "https://www.googleapis.com/auth/cloud-platform",
4085	//     "https://www.googleapis.com/auth/devstorage.full_control",
4086	//     "https://www.googleapis.com/auth/devstorage.read_write"
4087	//   ]
4088	// }
4089
4090}
4091
4092// method id "storage.buckets.testIamPermissions":
4093
4094type BucketsTestIamPermissionsCall struct {
4095	s            *Service
4096	bucket       string
4097	urlParams_   gensupport.URLParams
4098	ifNoneMatch_ string
4099	ctx_         context.Context
4100	header_      http.Header
4101}
4102
4103// TestIamPermissions: Tests a set of permissions on the given bucket to
4104// see which, if any, are held by the caller.
4105func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall {
4106	c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4107	c.bucket = bucket
4108	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
4109	return c
4110}
4111
4112// UserProject sets the optional parameter "userProject": The project to
4113// be billed for this request, for Requester Pays buckets.
4114func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
4115	c.urlParams_.Set("userProject", userProject)
4116	return c
4117}
4118
4119// Fields allows partial responses to be retrieved. See
4120// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4121// for more information.
4122func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall {
4123	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4124	return c
4125}
4126
4127// IfNoneMatch sets the optional parameter which makes the operation
4128// fail if the object's ETag matches the given value. This is useful for
4129// getting updates only after the object has changed since the last
4130// request. Use googleapi.IsNotModified to check whether the response
4131// error from Do is the result of In-None-Match.
4132func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall {
4133	c.ifNoneMatch_ = entityTag
4134	return c
4135}
4136
4137// Context sets the context to be used in this call's Do method. Any
4138// pending HTTP request will be aborted if the provided context is
4139// canceled.
4140func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
4141	c.ctx_ = ctx
4142	return c
4143}
4144
4145// Header returns an http.Header that can be modified by the caller to
4146// add HTTP headers to the request.
4147func (c *BucketsTestIamPermissionsCall) Header() http.Header {
4148	if c.header_ == nil {
4149		c.header_ = make(http.Header)
4150	}
4151	return c.header_
4152}
4153
4154func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4155	reqHeaders := make(http.Header)
4156	for k, v := range c.header_ {
4157		reqHeaders[k] = v
4158	}
4159	reqHeaders.Set("User-Agent", c.s.userAgent())
4160	if c.ifNoneMatch_ != "" {
4161		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4162	}
4163	var body io.Reader = nil
4164	c.urlParams_.Set("alt", alt)
4165	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions")
4166	urls += "?" + c.urlParams_.Encode()
4167	req, _ := http.NewRequest("GET", urls, body)
4168	req.Header = reqHeaders
4169	googleapi.Expand(req.URL, map[string]string{
4170		"bucket": c.bucket,
4171	})
4172	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4173}
4174
4175// Do executes the "storage.buckets.testIamPermissions" call.
4176// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
4177// Any non-2xx status code is an error. Response headers are in either
4178// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
4179// was returned at all) in error.(*googleapi.Error).Header. Use
4180// googleapi.IsNotModified to check whether the returned error was
4181// because http.StatusNotModified was returned.
4182func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4183	gensupport.SetOptions(c.urlParams_, opts...)
4184	res, err := c.doRequest("json")
4185	if res != nil && res.StatusCode == http.StatusNotModified {
4186		if res.Body != nil {
4187			res.Body.Close()
4188		}
4189		return nil, &googleapi.Error{
4190			Code:   res.StatusCode,
4191			Header: res.Header,
4192		}
4193	}
4194	if err != nil {
4195		return nil, err
4196	}
4197	defer googleapi.CloseBody(res)
4198	if err := googleapi.CheckResponse(res); err != nil {
4199		return nil, err
4200	}
4201	ret := &TestIamPermissionsResponse{
4202		ServerResponse: googleapi.ServerResponse{
4203			Header:         res.Header,
4204			HTTPStatusCode: res.StatusCode,
4205		},
4206	}
4207	target := &ret
4208	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
4209		return nil, err
4210	}
4211	return ret, nil
4212	// {
4213	//   "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
4214	//   "httpMethod": "GET",
4215	//   "id": "storage.buckets.testIamPermissions",
4216	//   "parameterOrder": [
4217	//     "bucket",
4218	//     "permissions"
4219	//   ],
4220	//   "parameters": {
4221	//     "bucket": {
4222	//       "description": "Name of a bucket.",
4223	//       "location": "path",
4224	//       "required": true,
4225	//       "type": "string"
4226	//     },
4227	//     "permissions": {
4228	//       "description": "Permissions to test.",
4229	//       "location": "query",
4230	//       "repeated": true,
4231	//       "required": true,
4232	//       "type": "string"
4233	//     },
4234	//     "userProject": {
4235	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
4236	//       "location": "query",
4237	//       "type": "string"
4238	//     }
4239	//   },
4240	//   "path": "b/{bucket}/iam/testPermissions",
4241	//   "response": {
4242	//     "$ref": "TestIamPermissionsResponse"
4243	//   },
4244	//   "scopes": [
4245	//     "https://www.googleapis.com/auth/cloud-platform",
4246	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4247	//     "https://www.googleapis.com/auth/devstorage.full_control",
4248	//     "https://www.googleapis.com/auth/devstorage.read_only",
4249	//     "https://www.googleapis.com/auth/devstorage.read_write"
4250	//   ]
4251	// }
4252
4253}
4254
4255// method id "storage.buckets.update":
4256
4257type BucketsUpdateCall struct {
4258	s          *Service
4259	bucket     string
4260	bucket2    *Bucket
4261	urlParams_ gensupport.URLParams
4262	ctx_       context.Context
4263	header_    http.Header
4264}
4265
4266// Update: Updates a bucket. Changes to the bucket will be readable
4267// immediately after writing, but configuration changes may take time to
4268// propagate.
4269func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
4270	c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4271	c.bucket = bucket
4272	c.bucket2 = bucket2
4273	return c
4274}
4275
4276// IfMetagenerationMatch sets the optional parameter
4277// "ifMetagenerationMatch": Makes the return of the bucket metadata
4278// conditional on whether the bucket's current metageneration matches
4279// the given value.
4280func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
4281	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4282	return c
4283}
4284
4285// IfMetagenerationNotMatch sets the optional parameter
4286// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
4287// conditional on whether the bucket's current metageneration does not
4288// match the given value.
4289func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall {
4290	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
4291	return c
4292}
4293
4294// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4295// predefined set of access controls to this bucket.
4296//
4297// Possible values:
4298//   "authenticatedRead" - Project team owners get OWNER access, and
4299// allAuthenticatedUsers get READER access.
4300//   "private" - Project team owners get OWNER access.
4301//   "projectPrivate" - Project team members get access according to
4302// their roles.
4303//   "publicRead" - Project team owners get OWNER access, and allUsers
4304// get READER access.
4305//   "publicReadWrite" - Project team owners get OWNER access, and
4306// allUsers get WRITER access.
4307func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall {
4308	c.urlParams_.Set("predefinedAcl", predefinedAcl)
4309	return c
4310}
4311
4312// PredefinedDefaultObjectAcl sets the optional parameter
4313// "predefinedDefaultObjectAcl": Apply a predefined set of default
4314// object access controls to this bucket.
4315//
4316// Possible values:
4317//   "authenticatedRead" - Object owner gets OWNER access, and
4318// allAuthenticatedUsers get READER access.
4319//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
4320// project team owners get OWNER access.
4321//   "bucketOwnerRead" - Object owner gets OWNER access, and project
4322// team owners get READER access.
4323//   "private" - Object owner gets OWNER access.
4324//   "projectPrivate" - Object owner gets OWNER access, and project team
4325// members get access according to their roles.
4326//   "publicRead" - Object owner gets OWNER access, and allUsers get
4327// READER access.
4328func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
4329	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4330	return c
4331}
4332
4333// Projection sets the optional parameter "projection": Set of
4334// properties to return. Defaults to full.
4335//
4336// Possible values:
4337//   "full" - Include all properties.
4338//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4339func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
4340	c.urlParams_.Set("projection", projection)
4341	return c
4342}
4343
4344// UserProject sets the optional parameter "userProject": The project to
4345// be billed for this request, for Requester Pays buckets.
4346func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
4347	c.urlParams_.Set("userProject", userProject)
4348	return c
4349}
4350
4351// Fields allows partial responses to be retrieved. See
4352// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4353// for more information.
4354func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
4355	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4356	return c
4357}
4358
4359// Context sets the context to be used in this call's Do method. Any
4360// pending HTTP request will be aborted if the provided context is
4361// canceled.
4362func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
4363	c.ctx_ = ctx
4364	return c
4365}
4366
4367// Header returns an http.Header that can be modified by the caller to
4368// add HTTP headers to the request.
4369func (c *BucketsUpdateCall) Header() http.Header {
4370	if c.header_ == nil {
4371		c.header_ = make(http.Header)
4372	}
4373	return c.header_
4374}
4375
4376func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
4377	reqHeaders := make(http.Header)
4378	for k, v := range c.header_ {
4379		reqHeaders[k] = v
4380	}
4381	reqHeaders.Set("User-Agent", c.s.userAgent())
4382	var body io.Reader = nil
4383	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
4384	if err != nil {
4385		return nil, err
4386	}
4387	reqHeaders.Set("Content-Type", "application/json")
4388	c.urlParams_.Set("alt", alt)
4389	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
4390	urls += "?" + c.urlParams_.Encode()
4391	req, _ := http.NewRequest("PUT", urls, body)
4392	req.Header = reqHeaders
4393	googleapi.Expand(req.URL, map[string]string{
4394		"bucket": c.bucket,
4395	})
4396	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4397}
4398
4399// Do executes the "storage.buckets.update" call.
4400// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4401// code is an error. Response headers are in either
4402// *Bucket.ServerResponse.Header or (if a response was returned at all)
4403// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4404// check whether the returned error was because http.StatusNotModified
4405// was returned.
4406func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4407	gensupport.SetOptions(c.urlParams_, opts...)
4408	res, err := c.doRequest("json")
4409	if res != nil && res.StatusCode == http.StatusNotModified {
4410		if res.Body != nil {
4411			res.Body.Close()
4412		}
4413		return nil, &googleapi.Error{
4414			Code:   res.StatusCode,
4415			Header: res.Header,
4416		}
4417	}
4418	if err != nil {
4419		return nil, err
4420	}
4421	defer googleapi.CloseBody(res)
4422	if err := googleapi.CheckResponse(res); err != nil {
4423		return nil, err
4424	}
4425	ret := &Bucket{
4426		ServerResponse: googleapi.ServerResponse{
4427			Header:         res.Header,
4428			HTTPStatusCode: res.StatusCode,
4429		},
4430	}
4431	target := &ret
4432	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
4433		return nil, err
4434	}
4435	return ret, nil
4436	// {
4437	//   "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
4438	//   "httpMethod": "PUT",
4439	//   "id": "storage.buckets.update",
4440	//   "parameterOrder": [
4441	//     "bucket"
4442	//   ],
4443	//   "parameters": {
4444	//     "bucket": {
4445	//       "description": "Name of a bucket.",
4446	//       "location": "path",
4447	//       "required": true,
4448	//       "type": "string"
4449	//     },
4450	//     "ifMetagenerationMatch": {
4451	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
4452	//       "format": "int64",
4453	//       "location": "query",
4454	//       "type": "string"
4455	//     },
4456	//     "ifMetagenerationNotMatch": {
4457	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
4458	//       "format": "int64",
4459	//       "location": "query",
4460	//       "type": "string"
4461	//     },
4462	//     "predefinedAcl": {
4463	//       "description": "Apply a predefined set of access controls to this bucket.",
4464	//       "enum": [
4465	//         "authenticatedRead",
4466	//         "private",
4467	//         "projectPrivate",
4468	//         "publicRead",
4469	//         "publicReadWrite"
4470	//       ],
4471	//       "enumDescriptions": [
4472	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4473	//         "Project team owners get OWNER access.",
4474	//         "Project team members get access according to their roles.",
4475	//         "Project team owners get OWNER access, and allUsers get READER access.",
4476	//         "Project team owners get OWNER access, and allUsers get WRITER access."
4477	//       ],
4478	//       "location": "query",
4479	//       "type": "string"
4480	//     },
4481	//     "predefinedDefaultObjectAcl": {
4482	//       "description": "Apply a predefined set of default object access controls to this bucket.",
4483	//       "enum": [
4484	//         "authenticatedRead",
4485	//         "bucketOwnerFullControl",
4486	//         "bucketOwnerRead",
4487	//         "private",
4488	//         "projectPrivate",
4489	//         "publicRead"
4490	//       ],
4491	//       "enumDescriptions": [
4492	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4493	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
4494	//         "Object owner gets OWNER access, and project team owners get READER access.",
4495	//         "Object owner gets OWNER access.",
4496	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
4497	//         "Object owner gets OWNER access, and allUsers get READER access."
4498	//       ],
4499	//       "location": "query",
4500	//       "type": "string"
4501	//     },
4502	//     "projection": {
4503	//       "description": "Set of properties to return. Defaults to full.",
4504	//       "enum": [
4505	//         "full",
4506	//         "noAcl"
4507	//       ],
4508	//       "enumDescriptions": [
4509	//         "Include all properties.",
4510	//         "Omit owner, acl and defaultObjectAcl properties."
4511	//       ],
4512	//       "location": "query",
4513	//       "type": "string"
4514	//     },
4515	//     "userProject": {
4516	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
4517	//       "location": "query",
4518	//       "type": "string"
4519	//     }
4520	//   },
4521	//   "path": "b/{bucket}",
4522	//   "request": {
4523	//     "$ref": "Bucket"
4524	//   },
4525	//   "response": {
4526	//     "$ref": "Bucket"
4527	//   },
4528	//   "scopes": [
4529	//     "https://www.googleapis.com/auth/cloud-platform",
4530	//     "https://www.googleapis.com/auth/devstorage.full_control"
4531	//   ]
4532	// }
4533
4534}
4535
4536// method id "storage.channels.stop":
4537
4538type ChannelsStopCall struct {
4539	s          *Service
4540	channel    *Channel
4541	urlParams_ gensupport.URLParams
4542	ctx_       context.Context
4543	header_    http.Header
4544}
4545
4546// Stop: Stop watching resources through this channel
4547func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
4548	c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4549	c.channel = channel
4550	return c
4551}
4552
4553// Fields allows partial responses to be retrieved. See
4554// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4555// for more information.
4556func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
4557	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4558	return c
4559}
4560
4561// Context sets the context to be used in this call's Do method. Any
4562// pending HTTP request will be aborted if the provided context is
4563// canceled.
4564func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
4565	c.ctx_ = ctx
4566	return c
4567}
4568
4569// Header returns an http.Header that can be modified by the caller to
4570// add HTTP headers to the request.
4571func (c *ChannelsStopCall) Header() http.Header {
4572	if c.header_ == nil {
4573		c.header_ = make(http.Header)
4574	}
4575	return c.header_
4576}
4577
4578func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
4579	reqHeaders := make(http.Header)
4580	for k, v := range c.header_ {
4581		reqHeaders[k] = v
4582	}
4583	reqHeaders.Set("User-Agent", c.s.userAgent())
4584	var body io.Reader = nil
4585	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
4586	if err != nil {
4587		return nil, err
4588	}
4589	reqHeaders.Set("Content-Type", "application/json")
4590	c.urlParams_.Set("alt", alt)
4591	urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
4592	urls += "?" + c.urlParams_.Encode()
4593	req, _ := http.NewRequest("POST", urls, body)
4594	req.Header = reqHeaders
4595	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4596}
4597
4598// Do executes the "storage.channels.stop" call.
4599func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
4600	gensupport.SetOptions(c.urlParams_, opts...)
4601	res, err := c.doRequest("json")
4602	if err != nil {
4603		return err
4604	}
4605	defer googleapi.CloseBody(res)
4606	if err := googleapi.CheckResponse(res); err != nil {
4607		return err
4608	}
4609	return nil
4610	// {
4611	//   "description": "Stop watching resources through this channel",
4612	//   "httpMethod": "POST",
4613	//   "id": "storage.channels.stop",
4614	//   "path": "channels/stop",
4615	//   "request": {
4616	//     "$ref": "Channel",
4617	//     "parameterName": "resource"
4618	//   },
4619	//   "scopes": [
4620	//     "https://www.googleapis.com/auth/cloud-platform",
4621	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4622	//     "https://www.googleapis.com/auth/devstorage.full_control",
4623	//     "https://www.googleapis.com/auth/devstorage.read_only",
4624	//     "https://www.googleapis.com/auth/devstorage.read_write"
4625	//   ]
4626	// }
4627
4628}
4629
4630// method id "storage.defaultObjectAccessControls.delete":
4631
4632type DefaultObjectAccessControlsDeleteCall struct {
4633	s          *Service
4634	bucket     string
4635	entity     string
4636	urlParams_ gensupport.URLParams
4637	ctx_       context.Context
4638	header_    http.Header
4639}
4640
4641// Delete: Permanently deletes the default object ACL entry for the
4642// specified entity on the specified bucket.
4643func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
4644	c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4645	c.bucket = bucket
4646	c.entity = entity
4647	return c
4648}
4649
4650// UserProject sets the optional parameter "userProject": The project to
4651// be billed for this request, for Requester Pays buckets.
4652func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
4653	c.urlParams_.Set("userProject", userProject)
4654	return c
4655}
4656
4657// Fields allows partial responses to be retrieved. See
4658// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4659// for more information.
4660func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
4661	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4662	return c
4663}
4664
4665// Context sets the context to be used in this call's Do method. Any
4666// pending HTTP request will be aborted if the provided context is
4667// canceled.
4668func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
4669	c.ctx_ = ctx
4670	return c
4671}
4672
4673// Header returns an http.Header that can be modified by the caller to
4674// add HTTP headers to the request.
4675func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
4676	if c.header_ == nil {
4677		c.header_ = make(http.Header)
4678	}
4679	return c.header_
4680}
4681
4682func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
4683	reqHeaders := make(http.Header)
4684	for k, v := range c.header_ {
4685		reqHeaders[k] = v
4686	}
4687	reqHeaders.Set("User-Agent", c.s.userAgent())
4688	var body io.Reader = nil
4689	c.urlParams_.Set("alt", alt)
4690	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
4691	urls += "?" + c.urlParams_.Encode()
4692	req, _ := http.NewRequest("DELETE", urls, body)
4693	req.Header = reqHeaders
4694	googleapi.Expand(req.URL, map[string]string{
4695		"bucket": c.bucket,
4696		"entity": c.entity,
4697	})
4698	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4699}
4700
4701// Do executes the "storage.defaultObjectAccessControls.delete" call.
4702func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
4703	gensupport.SetOptions(c.urlParams_, opts...)
4704	res, err := c.doRequest("json")
4705	if err != nil {
4706		return err
4707	}
4708	defer googleapi.CloseBody(res)
4709	if err := googleapi.CheckResponse(res); err != nil {
4710		return err
4711	}
4712	return nil
4713	// {
4714	//   "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
4715	//   "httpMethod": "DELETE",
4716	//   "id": "storage.defaultObjectAccessControls.delete",
4717	//   "parameterOrder": [
4718	//     "bucket",
4719	//     "entity"
4720	//   ],
4721	//   "parameters": {
4722	//     "bucket": {
4723	//       "description": "Name of a bucket.",
4724	//       "location": "path",
4725	//       "required": true,
4726	//       "type": "string"
4727	//     },
4728	//     "entity": {
4729	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
4730	//       "location": "path",
4731	//       "required": true,
4732	//       "type": "string"
4733	//     },
4734	//     "userProject": {
4735	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
4736	//       "location": "query",
4737	//       "type": "string"
4738	//     }
4739	//   },
4740	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
4741	//   "scopes": [
4742	//     "https://www.googleapis.com/auth/cloud-platform",
4743	//     "https://www.googleapis.com/auth/devstorage.full_control"
4744	//   ]
4745	// }
4746
4747}
4748
4749// method id "storage.defaultObjectAccessControls.get":
4750
4751type DefaultObjectAccessControlsGetCall struct {
4752	s            *Service
4753	bucket       string
4754	entity       string
4755	urlParams_   gensupport.URLParams
4756	ifNoneMatch_ string
4757	ctx_         context.Context
4758	header_      http.Header
4759}
4760
4761// Get: Returns the default object ACL entry for the specified entity on
4762// the specified bucket.
4763func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
4764	c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4765	c.bucket = bucket
4766	c.entity = entity
4767	return c
4768}
4769
4770// UserProject sets the optional parameter "userProject": The project to
4771// be billed for this request, for Requester Pays buckets.
4772func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
4773	c.urlParams_.Set("userProject", userProject)
4774	return c
4775}
4776
4777// Fields allows partial responses to be retrieved. See
4778// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4779// for more information.
4780func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
4781	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4782	return c
4783}
4784
4785// IfNoneMatch sets the optional parameter which makes the operation
4786// fail if the object's ETag matches the given value. This is useful for
4787// getting updates only after the object has changed since the last
4788// request. Use googleapi.IsNotModified to check whether the response
4789// error from Do is the result of In-None-Match.
4790func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
4791	c.ifNoneMatch_ = entityTag
4792	return c
4793}
4794
4795// Context sets the context to be used in this call's Do method. Any
4796// pending HTTP request will be aborted if the provided context is
4797// canceled.
4798func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
4799	c.ctx_ = ctx
4800	return c
4801}
4802
4803// Header returns an http.Header that can be modified by the caller to
4804// add HTTP headers to the request.
4805func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
4806	if c.header_ == nil {
4807		c.header_ = make(http.Header)
4808	}
4809	return c.header_
4810}
4811
4812func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
4813	reqHeaders := make(http.Header)
4814	for k, v := range c.header_ {
4815		reqHeaders[k] = v
4816	}
4817	reqHeaders.Set("User-Agent", c.s.userAgent())
4818	if c.ifNoneMatch_ != "" {
4819		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4820	}
4821	var body io.Reader = nil
4822	c.urlParams_.Set("alt", alt)
4823	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
4824	urls += "?" + c.urlParams_.Encode()
4825	req, _ := http.NewRequest("GET", urls, body)
4826	req.Header = reqHeaders
4827	googleapi.Expand(req.URL, map[string]string{
4828		"bucket": c.bucket,
4829		"entity": c.entity,
4830	})
4831	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4832}
4833
4834// Do executes the "storage.defaultObjectAccessControls.get" call.
4835// Exactly one of *ObjectAccessControl or error will be non-nil. Any
4836// non-2xx status code is an error. Response headers are in either
4837// *ObjectAccessControl.ServerResponse.Header or (if a response was
4838// returned at all) in error.(*googleapi.Error).Header. Use
4839// googleapi.IsNotModified to check whether the returned error was
4840// because http.StatusNotModified was returned.
4841func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
4842	gensupport.SetOptions(c.urlParams_, opts...)
4843	res, err := c.doRequest("json")
4844	if res != nil && res.StatusCode == http.StatusNotModified {
4845		if res.Body != nil {
4846			res.Body.Close()
4847		}
4848		return nil, &googleapi.Error{
4849			Code:   res.StatusCode,
4850			Header: res.Header,
4851		}
4852	}
4853	if err != nil {
4854		return nil, err
4855	}
4856	defer googleapi.CloseBody(res)
4857	if err := googleapi.CheckResponse(res); err != nil {
4858		return nil, err
4859	}
4860	ret := &ObjectAccessControl{
4861		ServerResponse: googleapi.ServerResponse{
4862			Header:         res.Header,
4863			HTTPStatusCode: res.StatusCode,
4864		},
4865	}
4866	target := &ret
4867	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
4868		return nil, err
4869	}
4870	return ret, nil
4871	// {
4872	//   "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
4873	//   "httpMethod": "GET",
4874	//   "id": "storage.defaultObjectAccessControls.get",
4875	//   "parameterOrder": [
4876	//     "bucket",
4877	//     "entity"
4878	//   ],
4879	//   "parameters": {
4880	//     "bucket": {
4881	//       "description": "Name of a bucket.",
4882	//       "location": "path",
4883	//       "required": true,
4884	//       "type": "string"
4885	//     },
4886	//     "entity": {
4887	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
4888	//       "location": "path",
4889	//       "required": true,
4890	//       "type": "string"
4891	//     },
4892	//     "userProject": {
4893	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
4894	//       "location": "query",
4895	//       "type": "string"
4896	//     }
4897	//   },
4898	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
4899	//   "response": {
4900	//     "$ref": "ObjectAccessControl"
4901	//   },
4902	//   "scopes": [
4903	//     "https://www.googleapis.com/auth/cloud-platform",
4904	//     "https://www.googleapis.com/auth/devstorage.full_control"
4905	//   ]
4906	// }
4907
4908}
4909
4910// method id "storage.defaultObjectAccessControls.insert":
4911
4912type DefaultObjectAccessControlsInsertCall struct {
4913	s                   *Service
4914	bucket              string
4915	objectaccesscontrol *ObjectAccessControl
4916	urlParams_          gensupport.URLParams
4917	ctx_                context.Context
4918	header_             http.Header
4919}
4920
4921// Insert: Creates a new default object ACL entry on the specified
4922// bucket.
4923func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
4924	c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4925	c.bucket = bucket
4926	c.objectaccesscontrol = objectaccesscontrol
4927	return c
4928}
4929
4930// UserProject sets the optional parameter "userProject": The project to
4931// be billed for this request, for Requester Pays buckets.
4932func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
4933	c.urlParams_.Set("userProject", userProject)
4934	return c
4935}
4936
4937// Fields allows partial responses to be retrieved. See
4938// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4939// for more information.
4940func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
4941	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4942	return c
4943}
4944
4945// Context sets the context to be used in this call's Do method. Any
4946// pending HTTP request will be aborted if the provided context is
4947// canceled.
4948func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
4949	c.ctx_ = ctx
4950	return c
4951}
4952
4953// Header returns an http.Header that can be modified by the caller to
4954// add HTTP headers to the request.
4955func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
4956	if c.header_ == nil {
4957		c.header_ = make(http.Header)
4958	}
4959	return c.header_
4960}
4961
4962func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
4963	reqHeaders := make(http.Header)
4964	for k, v := range c.header_ {
4965		reqHeaders[k] = v
4966	}
4967	reqHeaders.Set("User-Agent", c.s.userAgent())
4968	var body io.Reader = nil
4969	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
4970	if err != nil {
4971		return nil, err
4972	}
4973	reqHeaders.Set("Content-Type", "application/json")
4974	c.urlParams_.Set("alt", alt)
4975	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
4976	urls += "?" + c.urlParams_.Encode()
4977	req, _ := http.NewRequest("POST", urls, body)
4978	req.Header = reqHeaders
4979	googleapi.Expand(req.URL, map[string]string{
4980		"bucket": c.bucket,
4981	})
4982	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4983}
4984
4985// Do executes the "storage.defaultObjectAccessControls.insert" call.
4986// Exactly one of *ObjectAccessControl or error will be non-nil. Any
4987// non-2xx status code is an error. Response headers are in either
4988// *ObjectAccessControl.ServerResponse.Header or (if a response was
4989// returned at all) in error.(*googleapi.Error).Header. Use
4990// googleapi.IsNotModified to check whether the returned error was
4991// because http.StatusNotModified was returned.
4992func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
4993	gensupport.SetOptions(c.urlParams_, opts...)
4994	res, err := c.doRequest("json")
4995	if res != nil && res.StatusCode == http.StatusNotModified {
4996		if res.Body != nil {
4997			res.Body.Close()
4998		}
4999		return nil, &googleapi.Error{
5000			Code:   res.StatusCode,
5001			Header: res.Header,
5002		}
5003	}
5004	if err != nil {
5005		return nil, err
5006	}
5007	defer googleapi.CloseBody(res)
5008	if err := googleapi.CheckResponse(res); err != nil {
5009		return nil, err
5010	}
5011	ret := &ObjectAccessControl{
5012		ServerResponse: googleapi.ServerResponse{
5013			Header:         res.Header,
5014			HTTPStatusCode: res.StatusCode,
5015		},
5016	}
5017	target := &ret
5018	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
5019		return nil, err
5020	}
5021	return ret, nil
5022	// {
5023	//   "description": "Creates a new default object ACL entry on the specified bucket.",
5024	//   "httpMethod": "POST",
5025	//   "id": "storage.defaultObjectAccessControls.insert",
5026	//   "parameterOrder": [
5027	//     "bucket"
5028	//   ],
5029	//   "parameters": {
5030	//     "bucket": {
5031	//       "description": "Name of a bucket.",
5032	//       "location": "path",
5033	//       "required": true,
5034	//       "type": "string"
5035	//     },
5036	//     "userProject": {
5037	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
5038	//       "location": "query",
5039	//       "type": "string"
5040	//     }
5041	//   },
5042	//   "path": "b/{bucket}/defaultObjectAcl",
5043	//   "request": {
5044	//     "$ref": "ObjectAccessControl"
5045	//   },
5046	//   "response": {
5047	//     "$ref": "ObjectAccessControl"
5048	//   },
5049	//   "scopes": [
5050	//     "https://www.googleapis.com/auth/cloud-platform",
5051	//     "https://www.googleapis.com/auth/devstorage.full_control"
5052	//   ]
5053	// }
5054
5055}
5056
5057// method id "storage.defaultObjectAccessControls.list":
5058
5059type DefaultObjectAccessControlsListCall struct {
5060	s            *Service
5061	bucket       string
5062	urlParams_   gensupport.URLParams
5063	ifNoneMatch_ string
5064	ctx_         context.Context
5065	header_      http.Header
5066}
5067
5068// List: Retrieves default object ACL entries on the specified bucket.
5069func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
5070	c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5071	c.bucket = bucket
5072	return c
5073}
5074
5075// IfMetagenerationMatch sets the optional parameter
5076// "ifMetagenerationMatch": If present, only return default ACL listing
5077// if the bucket's current metageneration matches this value.
5078func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
5079	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5080	return c
5081}
5082
5083// IfMetagenerationNotMatch sets the optional parameter
5084// "ifMetagenerationNotMatch": If present, only return default ACL
5085// listing if the bucket's current metageneration does not match the
5086// given value.
5087func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
5088	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5089	return c
5090}
5091
5092// UserProject sets the optional parameter "userProject": The project to
5093// be billed for this request, for Requester Pays buckets.
5094func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
5095	c.urlParams_.Set("userProject", userProject)
5096	return c
5097}
5098
5099// Fields allows partial responses to be retrieved. See
5100// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5101// for more information.
5102func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
5103	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5104	return c
5105}
5106
5107// IfNoneMatch sets the optional parameter which makes the operation
5108// fail if the object's ETag matches the given value. This is useful for
5109// getting updates only after the object has changed since the last
5110// request. Use googleapi.IsNotModified to check whether the response
5111// error from Do is the result of In-None-Match.
5112func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
5113	c.ifNoneMatch_ = entityTag
5114	return c
5115}
5116
5117// Context sets the context to be used in this call's Do method. Any
5118// pending HTTP request will be aborted if the provided context is
5119// canceled.
5120func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
5121	c.ctx_ = ctx
5122	return c
5123}
5124
5125// Header returns an http.Header that can be modified by the caller to
5126// add HTTP headers to the request.
5127func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
5128	if c.header_ == nil {
5129		c.header_ = make(http.Header)
5130	}
5131	return c.header_
5132}
5133
5134func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
5135	reqHeaders := make(http.Header)
5136	for k, v := range c.header_ {
5137		reqHeaders[k] = v
5138	}
5139	reqHeaders.Set("User-Agent", c.s.userAgent())
5140	if c.ifNoneMatch_ != "" {
5141		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5142	}
5143	var body io.Reader = nil
5144	c.urlParams_.Set("alt", alt)
5145	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
5146	urls += "?" + c.urlParams_.Encode()
5147	req, _ := http.NewRequest("GET", urls, body)
5148	req.Header = reqHeaders
5149	googleapi.Expand(req.URL, map[string]string{
5150		"bucket": c.bucket,
5151	})
5152	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5153}
5154
5155// Do executes the "storage.defaultObjectAccessControls.list" call.
5156// Exactly one of *ObjectAccessControls or error will be non-nil. Any
5157// non-2xx status code is an error. Response headers are in either
5158// *ObjectAccessControls.ServerResponse.Header or (if a response was
5159// returned at all) in error.(*googleapi.Error).Header. Use
5160// googleapi.IsNotModified to check whether the returned error was
5161// because http.StatusNotModified was returned.
5162func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
5163	gensupport.SetOptions(c.urlParams_, opts...)
5164	res, err := c.doRequest("json")
5165	if res != nil && res.StatusCode == http.StatusNotModified {
5166		if res.Body != nil {
5167			res.Body.Close()
5168		}
5169		return nil, &googleapi.Error{
5170			Code:   res.StatusCode,
5171			Header: res.Header,
5172		}
5173	}
5174	if err != nil {
5175		return nil, err
5176	}
5177	defer googleapi.CloseBody(res)
5178	if err := googleapi.CheckResponse(res); err != nil {
5179		return nil, err
5180	}
5181	ret := &ObjectAccessControls{
5182		ServerResponse: googleapi.ServerResponse{
5183			Header:         res.Header,
5184			HTTPStatusCode: res.StatusCode,
5185		},
5186	}
5187	target := &ret
5188	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
5189		return nil, err
5190	}
5191	return ret, nil
5192	// {
5193	//   "description": "Retrieves default object ACL entries on the specified bucket.",
5194	//   "httpMethod": "GET",
5195	//   "id": "storage.defaultObjectAccessControls.list",
5196	//   "parameterOrder": [
5197	//     "bucket"
5198	//   ],
5199	//   "parameters": {
5200	//     "bucket": {
5201	//       "description": "Name of a bucket.",
5202	//       "location": "path",
5203	//       "required": true,
5204	//       "type": "string"
5205	//     },
5206	//     "ifMetagenerationMatch": {
5207	//       "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
5208	//       "format": "int64",
5209	//       "location": "query",
5210	//       "type": "string"
5211	//     },
5212	//     "ifMetagenerationNotMatch": {
5213	//       "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
5214	//       "format": "int64",
5215	//       "location": "query",
5216	//       "type": "string"
5217	//     },
5218	//     "userProject": {
5219	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
5220	//       "location": "query",
5221	//       "type": "string"
5222	//     }
5223	//   },
5224	//   "path": "b/{bucket}/defaultObjectAcl",
5225	//   "response": {
5226	//     "$ref": "ObjectAccessControls"
5227	//   },
5228	//   "scopes": [
5229	//     "https://www.googleapis.com/auth/cloud-platform",
5230	//     "https://www.googleapis.com/auth/devstorage.full_control"
5231	//   ]
5232	// }
5233
5234}
5235
5236// method id "storage.defaultObjectAccessControls.patch":
5237
5238type DefaultObjectAccessControlsPatchCall struct {
5239	s                   *Service
5240	bucket              string
5241	entity              string
5242	objectaccesscontrol *ObjectAccessControl
5243	urlParams_          gensupport.URLParams
5244	ctx_                context.Context
5245	header_             http.Header
5246}
5247
5248// Patch: Updates a default object ACL entry on the specified bucket.
5249// This method supports patch semantics.
5250func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
5251	c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5252	c.bucket = bucket
5253	c.entity = entity
5254	c.objectaccesscontrol = objectaccesscontrol
5255	return c
5256}
5257
5258// UserProject sets the optional parameter "userProject": The project to
5259// be billed for this request, for Requester Pays buckets.
5260func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
5261	c.urlParams_.Set("userProject", userProject)
5262	return c
5263}
5264
5265// Fields allows partial responses to be retrieved. See
5266// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5267// for more information.
5268func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
5269	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5270	return c
5271}
5272
5273// Context sets the context to be used in this call's Do method. Any
5274// pending HTTP request will be aborted if the provided context is
5275// canceled.
5276func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
5277	c.ctx_ = ctx
5278	return c
5279}
5280
5281// Header returns an http.Header that can be modified by the caller to
5282// add HTTP headers to the request.
5283func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
5284	if c.header_ == nil {
5285		c.header_ = make(http.Header)
5286	}
5287	return c.header_
5288}
5289
5290func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
5291	reqHeaders := make(http.Header)
5292	for k, v := range c.header_ {
5293		reqHeaders[k] = v
5294	}
5295	reqHeaders.Set("User-Agent", c.s.userAgent())
5296	var body io.Reader = nil
5297	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
5298	if err != nil {
5299		return nil, err
5300	}
5301	reqHeaders.Set("Content-Type", "application/json")
5302	c.urlParams_.Set("alt", alt)
5303	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5304	urls += "?" + c.urlParams_.Encode()
5305	req, _ := http.NewRequest("PATCH", urls, body)
5306	req.Header = reqHeaders
5307	googleapi.Expand(req.URL, map[string]string{
5308		"bucket": c.bucket,
5309		"entity": c.entity,
5310	})
5311	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5312}
5313
5314// Do executes the "storage.defaultObjectAccessControls.patch" call.
5315// Exactly one of *ObjectAccessControl or error will be non-nil. Any
5316// non-2xx status code is an error. Response headers are in either
5317// *ObjectAccessControl.ServerResponse.Header or (if a response was
5318// returned at all) in error.(*googleapi.Error).Header. Use
5319// googleapi.IsNotModified to check whether the returned error was
5320// because http.StatusNotModified was returned.
5321func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5322	gensupport.SetOptions(c.urlParams_, opts...)
5323	res, err := c.doRequest("json")
5324	if res != nil && res.StatusCode == http.StatusNotModified {
5325		if res.Body != nil {
5326			res.Body.Close()
5327		}
5328		return nil, &googleapi.Error{
5329			Code:   res.StatusCode,
5330			Header: res.Header,
5331		}
5332	}
5333	if err != nil {
5334		return nil, err
5335	}
5336	defer googleapi.CloseBody(res)
5337	if err := googleapi.CheckResponse(res); err != nil {
5338		return nil, err
5339	}
5340	ret := &ObjectAccessControl{
5341		ServerResponse: googleapi.ServerResponse{
5342			Header:         res.Header,
5343			HTTPStatusCode: res.StatusCode,
5344		},
5345	}
5346	target := &ret
5347	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
5348		return nil, err
5349	}
5350	return ret, nil
5351	// {
5352	//   "description": "Updates a default object ACL entry on the specified bucket. This method supports patch semantics.",
5353	//   "httpMethod": "PATCH",
5354	//   "id": "storage.defaultObjectAccessControls.patch",
5355	//   "parameterOrder": [
5356	//     "bucket",
5357	//     "entity"
5358	//   ],
5359	//   "parameters": {
5360	//     "bucket": {
5361	//       "description": "Name of a bucket.",
5362	//       "location": "path",
5363	//       "required": true,
5364	//       "type": "string"
5365	//     },
5366	//     "entity": {
5367	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5368	//       "location": "path",
5369	//       "required": true,
5370	//       "type": "string"
5371	//     },
5372	//     "userProject": {
5373	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
5374	//       "location": "query",
5375	//       "type": "string"
5376	//     }
5377	//   },
5378	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5379	//   "request": {
5380	//     "$ref": "ObjectAccessControl"
5381	//   },
5382	//   "response": {
5383	//     "$ref": "ObjectAccessControl"
5384	//   },
5385	//   "scopes": [
5386	//     "https://www.googleapis.com/auth/cloud-platform",
5387	//     "https://www.googleapis.com/auth/devstorage.full_control"
5388	//   ]
5389	// }
5390
5391}
5392
5393// method id "storage.defaultObjectAccessControls.update":
5394
5395type DefaultObjectAccessControlsUpdateCall struct {
5396	s                   *Service
5397	bucket              string
5398	entity              string
5399	objectaccesscontrol *ObjectAccessControl
5400	urlParams_          gensupport.URLParams
5401	ctx_                context.Context
5402	header_             http.Header
5403}
5404
5405// Update: Updates a default object ACL entry on the specified bucket.
5406func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
5407	c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5408	c.bucket = bucket
5409	c.entity = entity
5410	c.objectaccesscontrol = objectaccesscontrol
5411	return c
5412}
5413
5414// UserProject sets the optional parameter "userProject": The project to
5415// be billed for this request, for Requester Pays buckets.
5416func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
5417	c.urlParams_.Set("userProject", userProject)
5418	return c
5419}
5420
5421// Fields allows partial responses to be retrieved. See
5422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5423// for more information.
5424func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
5425	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5426	return c
5427}
5428
5429// Context sets the context to be used in this call's Do method. Any
5430// pending HTTP request will be aborted if the provided context is
5431// canceled.
5432func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
5433	c.ctx_ = ctx
5434	return c
5435}
5436
5437// Header returns an http.Header that can be modified by the caller to
5438// add HTTP headers to the request.
5439func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
5440	if c.header_ == nil {
5441		c.header_ = make(http.Header)
5442	}
5443	return c.header_
5444}
5445
5446func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
5447	reqHeaders := make(http.Header)
5448	for k, v := range c.header_ {
5449		reqHeaders[k] = v
5450	}
5451	reqHeaders.Set("User-Agent", c.s.userAgent())
5452	var body io.Reader = nil
5453	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
5454	if err != nil {
5455		return nil, err
5456	}
5457	reqHeaders.Set("Content-Type", "application/json")
5458	c.urlParams_.Set("alt", alt)
5459	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5460	urls += "?" + c.urlParams_.Encode()
5461	req, _ := http.NewRequest("PUT", urls, body)
5462	req.Header = reqHeaders
5463	googleapi.Expand(req.URL, map[string]string{
5464		"bucket": c.bucket,
5465		"entity": c.entity,
5466	})
5467	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5468}
5469
5470// Do executes the "storage.defaultObjectAccessControls.update" call.
5471// Exactly one of *ObjectAccessControl or error will be non-nil. Any
5472// non-2xx status code is an error. Response headers are in either
5473// *ObjectAccessControl.ServerResponse.Header or (if a response was
5474// returned at all) in error.(*googleapi.Error).Header. Use
5475// googleapi.IsNotModified to check whether the returned error was
5476// because http.StatusNotModified was returned.
5477func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5478	gensupport.SetOptions(c.urlParams_, opts...)
5479	res, err := c.doRequest("json")
5480	if res != nil && res.StatusCode == http.StatusNotModified {
5481		if res.Body != nil {
5482			res.Body.Close()
5483		}
5484		return nil, &googleapi.Error{
5485			Code:   res.StatusCode,
5486			Header: res.Header,
5487		}
5488	}
5489	if err != nil {
5490		return nil, err
5491	}
5492	defer googleapi.CloseBody(res)
5493	if err := googleapi.CheckResponse(res); err != nil {
5494		return nil, err
5495	}
5496	ret := &ObjectAccessControl{
5497		ServerResponse: googleapi.ServerResponse{
5498			Header:         res.Header,
5499			HTTPStatusCode: res.StatusCode,
5500		},
5501	}
5502	target := &ret
5503	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
5504		return nil, err
5505	}
5506	return ret, nil
5507	// {
5508	//   "description": "Updates a default object ACL entry on the specified bucket.",
5509	//   "httpMethod": "PUT",
5510	//   "id": "storage.defaultObjectAccessControls.update",
5511	//   "parameterOrder": [
5512	//     "bucket",
5513	//     "entity"
5514	//   ],
5515	//   "parameters": {
5516	//     "bucket": {
5517	//       "description": "Name of a bucket.",
5518	//       "location": "path",
5519	//       "required": true,
5520	//       "type": "string"
5521	//     },
5522	//     "entity": {
5523	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5524	//       "location": "path",
5525	//       "required": true,
5526	//       "type": "string"
5527	//     },
5528	//     "userProject": {
5529	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
5530	//       "location": "query",
5531	//       "type": "string"
5532	//     }
5533	//   },
5534	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5535	//   "request": {
5536	//     "$ref": "ObjectAccessControl"
5537	//   },
5538	//   "response": {
5539	//     "$ref": "ObjectAccessControl"
5540	//   },
5541	//   "scopes": [
5542	//     "https://www.googleapis.com/auth/cloud-platform",
5543	//     "https://www.googleapis.com/auth/devstorage.full_control"
5544	//   ]
5545	// }
5546
5547}
5548
5549// method id "storage.notifications.delete":
5550
5551type NotificationsDeleteCall struct {
5552	s            *Service
5553	bucket       string
5554	notification string
5555	urlParams_   gensupport.URLParams
5556	ctx_         context.Context
5557	header_      http.Header
5558}
5559
5560// Delete: Permanently deletes a notification subscription.
5561func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
5562	c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5563	c.bucket = bucket
5564	c.notification = notification
5565	return c
5566}
5567
5568// UserProject sets the optional parameter "userProject": The project to
5569// be billed for this request, for Requester Pays buckets.
5570func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
5571	c.urlParams_.Set("userProject", userProject)
5572	return c
5573}
5574
5575// Fields allows partial responses to be retrieved. See
5576// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5577// for more information.
5578func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
5579	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5580	return c
5581}
5582
5583// Context sets the context to be used in this call's Do method. Any
5584// pending HTTP request will be aborted if the provided context is
5585// canceled.
5586func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
5587	c.ctx_ = ctx
5588	return c
5589}
5590
5591// Header returns an http.Header that can be modified by the caller to
5592// add HTTP headers to the request.
5593func (c *NotificationsDeleteCall) Header() http.Header {
5594	if c.header_ == nil {
5595		c.header_ = make(http.Header)
5596	}
5597	return c.header_
5598}
5599
5600func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
5601	reqHeaders := make(http.Header)
5602	for k, v := range c.header_ {
5603		reqHeaders[k] = v
5604	}
5605	reqHeaders.Set("User-Agent", c.s.userAgent())
5606	var body io.Reader = nil
5607	c.urlParams_.Set("alt", alt)
5608	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
5609	urls += "?" + c.urlParams_.Encode()
5610	req, _ := http.NewRequest("DELETE", urls, body)
5611	req.Header = reqHeaders
5612	googleapi.Expand(req.URL, map[string]string{
5613		"bucket":       c.bucket,
5614		"notification": c.notification,
5615	})
5616	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5617}
5618
5619// Do executes the "storage.notifications.delete" call.
5620func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
5621	gensupport.SetOptions(c.urlParams_, opts...)
5622	res, err := c.doRequest("json")
5623	if err != nil {
5624		return err
5625	}
5626	defer googleapi.CloseBody(res)
5627	if err := googleapi.CheckResponse(res); err != nil {
5628		return err
5629	}
5630	return nil
5631	// {
5632	//   "description": "Permanently deletes a notification subscription.",
5633	//   "httpMethod": "DELETE",
5634	//   "id": "storage.notifications.delete",
5635	//   "parameterOrder": [
5636	//     "bucket",
5637	//     "notification"
5638	//   ],
5639	//   "parameters": {
5640	//     "bucket": {
5641	//       "description": "The parent bucket of the notification.",
5642	//       "location": "path",
5643	//       "required": true,
5644	//       "type": "string"
5645	//     },
5646	//     "notification": {
5647	//       "description": "ID of the notification to delete.",
5648	//       "location": "path",
5649	//       "required": true,
5650	//       "type": "string"
5651	//     },
5652	//     "userProject": {
5653	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
5654	//       "location": "query",
5655	//       "type": "string"
5656	//     }
5657	//   },
5658	//   "path": "b/{bucket}/notificationConfigs/{notification}",
5659	//   "scopes": [
5660	//     "https://www.googleapis.com/auth/cloud-platform",
5661	//     "https://www.googleapis.com/auth/devstorage.full_control",
5662	//     "https://www.googleapis.com/auth/devstorage.read_write"
5663	//   ]
5664	// }
5665
5666}
5667
5668// method id "storage.notifications.get":
5669
5670type NotificationsGetCall struct {
5671	s            *Service
5672	bucket       string
5673	notification string
5674	urlParams_   gensupport.URLParams
5675	ifNoneMatch_ string
5676	ctx_         context.Context
5677	header_      http.Header
5678}
5679
5680// Get: View a notification configuration.
5681func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
5682	c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5683	c.bucket = bucket
5684	c.notification = notification
5685	return c
5686}
5687
5688// UserProject sets the optional parameter "userProject": The project to
5689// be billed for this request, for Requester Pays buckets.
5690func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
5691	c.urlParams_.Set("userProject", userProject)
5692	return c
5693}
5694
5695// Fields allows partial responses to be retrieved. See
5696// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5697// for more information.
5698func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
5699	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5700	return c
5701}
5702
5703// IfNoneMatch sets the optional parameter which makes the operation
5704// fail if the object's ETag matches the given value. This is useful for
5705// getting updates only after the object has changed since the last
5706// request. Use googleapi.IsNotModified to check whether the response
5707// error from Do is the result of In-None-Match.
5708func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
5709	c.ifNoneMatch_ = entityTag
5710	return c
5711}
5712
5713// Context sets the context to be used in this call's Do method. Any
5714// pending HTTP request will be aborted if the provided context is
5715// canceled.
5716func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
5717	c.ctx_ = ctx
5718	return c
5719}
5720
5721// Header returns an http.Header that can be modified by the caller to
5722// add HTTP headers to the request.
5723func (c *NotificationsGetCall) Header() http.Header {
5724	if c.header_ == nil {
5725		c.header_ = make(http.Header)
5726	}
5727	return c.header_
5728}
5729
5730func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
5731	reqHeaders := make(http.Header)
5732	for k, v := range c.header_ {
5733		reqHeaders[k] = v
5734	}
5735	reqHeaders.Set("User-Agent", c.s.userAgent())
5736	if c.ifNoneMatch_ != "" {
5737		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5738	}
5739	var body io.Reader = nil
5740	c.urlParams_.Set("alt", alt)
5741	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
5742	urls += "?" + c.urlParams_.Encode()
5743	req, _ := http.NewRequest("GET", urls, body)
5744	req.Header = reqHeaders
5745	googleapi.Expand(req.URL, map[string]string{
5746		"bucket":       c.bucket,
5747		"notification": c.notification,
5748	})
5749	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5750}
5751
5752// Do executes the "storage.notifications.get" call.
5753// Exactly one of *Notification or error will be non-nil. Any non-2xx
5754// status code is an error. Response headers are in either
5755// *Notification.ServerResponse.Header or (if a response was returned at
5756// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5757// to check whether the returned error was because
5758// http.StatusNotModified was returned.
5759func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
5760	gensupport.SetOptions(c.urlParams_, opts...)
5761	res, err := c.doRequest("json")
5762	if res != nil && res.StatusCode == http.StatusNotModified {
5763		if res.Body != nil {
5764			res.Body.Close()
5765		}
5766		return nil, &googleapi.Error{
5767			Code:   res.StatusCode,
5768			Header: res.Header,
5769		}
5770	}
5771	if err != nil {
5772		return nil, err
5773	}
5774	defer googleapi.CloseBody(res)
5775	if err := googleapi.CheckResponse(res); err != nil {
5776		return nil, err
5777	}
5778	ret := &Notification{
5779		ServerResponse: googleapi.ServerResponse{
5780			Header:         res.Header,
5781			HTTPStatusCode: res.StatusCode,
5782		},
5783	}
5784	target := &ret
5785	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
5786		return nil, err
5787	}
5788	return ret, nil
5789	// {
5790	//   "description": "View a notification configuration.",
5791	//   "httpMethod": "GET",
5792	//   "id": "storage.notifications.get",
5793	//   "parameterOrder": [
5794	//     "bucket",
5795	//     "notification"
5796	//   ],
5797	//   "parameters": {
5798	//     "bucket": {
5799	//       "description": "The parent bucket of the notification.",
5800	//       "location": "path",
5801	//       "required": true,
5802	//       "type": "string"
5803	//     },
5804	//     "notification": {
5805	//       "description": "Notification ID",
5806	//       "location": "path",
5807	//       "required": true,
5808	//       "type": "string"
5809	//     },
5810	//     "userProject": {
5811	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
5812	//       "location": "query",
5813	//       "type": "string"
5814	//     }
5815	//   },
5816	//   "path": "b/{bucket}/notificationConfigs/{notification}",
5817	//   "response": {
5818	//     "$ref": "Notification"
5819	//   },
5820	//   "scopes": [
5821	//     "https://www.googleapis.com/auth/cloud-platform",
5822	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5823	//     "https://www.googleapis.com/auth/devstorage.full_control",
5824	//     "https://www.googleapis.com/auth/devstorage.read_only",
5825	//     "https://www.googleapis.com/auth/devstorage.read_write"
5826	//   ]
5827	// }
5828
5829}
5830
5831// method id "storage.notifications.insert":
5832
5833type NotificationsInsertCall struct {
5834	s            *Service
5835	bucket       string
5836	notification *Notification
5837	urlParams_   gensupport.URLParams
5838	ctx_         context.Context
5839	header_      http.Header
5840}
5841
5842// Insert: Creates a notification subscription for a given bucket.
5843func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
5844	c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5845	c.bucket = bucket
5846	c.notification = notification
5847	return c
5848}
5849
5850// UserProject sets the optional parameter "userProject": The project to
5851// be billed for this request, for Requester Pays buckets.
5852func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
5853	c.urlParams_.Set("userProject", userProject)
5854	return c
5855}
5856
5857// Fields allows partial responses to be retrieved. See
5858// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5859// for more information.
5860func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
5861	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5862	return c
5863}
5864
5865// Context sets the context to be used in this call's Do method. Any
5866// pending HTTP request will be aborted if the provided context is
5867// canceled.
5868func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
5869	c.ctx_ = ctx
5870	return c
5871}
5872
5873// Header returns an http.Header that can be modified by the caller to
5874// add HTTP headers to the request.
5875func (c *NotificationsInsertCall) Header() http.Header {
5876	if c.header_ == nil {
5877		c.header_ = make(http.Header)
5878	}
5879	return c.header_
5880}
5881
5882func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
5883	reqHeaders := make(http.Header)
5884	for k, v := range c.header_ {
5885		reqHeaders[k] = v
5886	}
5887	reqHeaders.Set("User-Agent", c.s.userAgent())
5888	var body io.Reader = nil
5889	body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
5890	if err != nil {
5891		return nil, err
5892	}
5893	reqHeaders.Set("Content-Type", "application/json")
5894	c.urlParams_.Set("alt", alt)
5895	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
5896	urls += "?" + c.urlParams_.Encode()
5897	req, _ := http.NewRequest("POST", urls, body)
5898	req.Header = reqHeaders
5899	googleapi.Expand(req.URL, map[string]string{
5900		"bucket": c.bucket,
5901	})
5902	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5903}
5904
5905// Do executes the "storage.notifications.insert" call.
5906// Exactly one of *Notification or error will be non-nil. Any non-2xx
5907// status code is an error. Response headers are in either
5908// *Notification.ServerResponse.Header or (if a response was returned at
5909// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5910// to check whether the returned error was because
5911// http.StatusNotModified was returned.
5912func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
5913	gensupport.SetOptions(c.urlParams_, opts...)
5914	res, err := c.doRequest("json")
5915	if res != nil && res.StatusCode == http.StatusNotModified {
5916		if res.Body != nil {
5917			res.Body.Close()
5918		}
5919		return nil, &googleapi.Error{
5920			Code:   res.StatusCode,
5921			Header: res.Header,
5922		}
5923	}
5924	if err != nil {
5925		return nil, err
5926	}
5927	defer googleapi.CloseBody(res)
5928	if err := googleapi.CheckResponse(res); err != nil {
5929		return nil, err
5930	}
5931	ret := &Notification{
5932		ServerResponse: googleapi.ServerResponse{
5933			Header:         res.Header,
5934			HTTPStatusCode: res.StatusCode,
5935		},
5936	}
5937	target := &ret
5938	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
5939		return nil, err
5940	}
5941	return ret, nil
5942	// {
5943	//   "description": "Creates a notification subscription for a given bucket.",
5944	//   "httpMethod": "POST",
5945	//   "id": "storage.notifications.insert",
5946	//   "parameterOrder": [
5947	//     "bucket"
5948	//   ],
5949	//   "parameters": {
5950	//     "bucket": {
5951	//       "description": "The parent bucket of the notification.",
5952	//       "location": "path",
5953	//       "required": true,
5954	//       "type": "string"
5955	//     },
5956	//     "userProject": {
5957	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
5958	//       "location": "query",
5959	//       "type": "string"
5960	//     }
5961	//   },
5962	//   "path": "b/{bucket}/notificationConfigs",
5963	//   "request": {
5964	//     "$ref": "Notification"
5965	//   },
5966	//   "response": {
5967	//     "$ref": "Notification"
5968	//   },
5969	//   "scopes": [
5970	//     "https://www.googleapis.com/auth/cloud-platform",
5971	//     "https://www.googleapis.com/auth/devstorage.full_control",
5972	//     "https://www.googleapis.com/auth/devstorage.read_write"
5973	//   ]
5974	// }
5975
5976}
5977
5978// method id "storage.notifications.list":
5979
5980type NotificationsListCall struct {
5981	s            *Service
5982	bucket       string
5983	urlParams_   gensupport.URLParams
5984	ifNoneMatch_ string
5985	ctx_         context.Context
5986	header_      http.Header
5987}
5988
5989// List: Retrieves a list of notification subscriptions for a given
5990// bucket.
5991func (r *NotificationsService) List(bucket string) *NotificationsListCall {
5992	c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5993	c.bucket = bucket
5994	return c
5995}
5996
5997// UserProject sets the optional parameter "userProject": The project to
5998// be billed for this request, for Requester Pays buckets.
5999func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
6000	c.urlParams_.Set("userProject", userProject)
6001	return c
6002}
6003
6004// Fields allows partial responses to be retrieved. See
6005// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6006// for more information.
6007func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
6008	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6009	return c
6010}
6011
6012// IfNoneMatch sets the optional parameter which makes the operation
6013// fail if the object's ETag matches the given value. This is useful for
6014// getting updates only after the object has changed since the last
6015// request. Use googleapi.IsNotModified to check whether the response
6016// error from Do is the result of In-None-Match.
6017func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
6018	c.ifNoneMatch_ = entityTag
6019	return c
6020}
6021
6022// Context sets the context to be used in this call's Do method. Any
6023// pending HTTP request will be aborted if the provided context is
6024// canceled.
6025func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
6026	c.ctx_ = ctx
6027	return c
6028}
6029
6030// Header returns an http.Header that can be modified by the caller to
6031// add HTTP headers to the request.
6032func (c *NotificationsListCall) Header() http.Header {
6033	if c.header_ == nil {
6034		c.header_ = make(http.Header)
6035	}
6036	return c.header_
6037}
6038
6039func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
6040	reqHeaders := make(http.Header)
6041	for k, v := range c.header_ {
6042		reqHeaders[k] = v
6043	}
6044	reqHeaders.Set("User-Agent", c.s.userAgent())
6045	if c.ifNoneMatch_ != "" {
6046		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6047	}
6048	var body io.Reader = nil
6049	c.urlParams_.Set("alt", alt)
6050	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
6051	urls += "?" + c.urlParams_.Encode()
6052	req, _ := http.NewRequest("GET", urls, body)
6053	req.Header = reqHeaders
6054	googleapi.Expand(req.URL, map[string]string{
6055		"bucket": c.bucket,
6056	})
6057	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6058}
6059
6060// Do executes the "storage.notifications.list" call.
6061// Exactly one of *Notifications or error will be non-nil. Any non-2xx
6062// status code is an error. Response headers are in either
6063// *Notifications.ServerResponse.Header or (if a response was returned
6064// at all) in error.(*googleapi.Error).Header. Use
6065// googleapi.IsNotModified to check whether the returned error was
6066// because http.StatusNotModified was returned.
6067func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
6068	gensupport.SetOptions(c.urlParams_, opts...)
6069	res, err := c.doRequest("json")
6070	if res != nil && res.StatusCode == http.StatusNotModified {
6071		if res.Body != nil {
6072			res.Body.Close()
6073		}
6074		return nil, &googleapi.Error{
6075			Code:   res.StatusCode,
6076			Header: res.Header,
6077		}
6078	}
6079	if err != nil {
6080		return nil, err
6081	}
6082	defer googleapi.CloseBody(res)
6083	if err := googleapi.CheckResponse(res); err != nil {
6084		return nil, err
6085	}
6086	ret := &Notifications{
6087		ServerResponse: googleapi.ServerResponse{
6088			Header:         res.Header,
6089			HTTPStatusCode: res.StatusCode,
6090		},
6091	}
6092	target := &ret
6093	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
6094		return nil, err
6095	}
6096	return ret, nil
6097	// {
6098	//   "description": "Retrieves a list of notification subscriptions for a given bucket.",
6099	//   "httpMethod": "GET",
6100	//   "id": "storage.notifications.list",
6101	//   "parameterOrder": [
6102	//     "bucket"
6103	//   ],
6104	//   "parameters": {
6105	//     "bucket": {
6106	//       "description": "Name of a Google Cloud Storage bucket.",
6107	//       "location": "path",
6108	//       "required": true,
6109	//       "type": "string"
6110	//     },
6111	//     "userProject": {
6112	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
6113	//       "location": "query",
6114	//       "type": "string"
6115	//     }
6116	//   },
6117	//   "path": "b/{bucket}/notificationConfigs",
6118	//   "response": {
6119	//     "$ref": "Notifications"
6120	//   },
6121	//   "scopes": [
6122	//     "https://www.googleapis.com/auth/cloud-platform",
6123	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6124	//     "https://www.googleapis.com/auth/devstorage.full_control",
6125	//     "https://www.googleapis.com/auth/devstorage.read_only",
6126	//     "https://www.googleapis.com/auth/devstorage.read_write"
6127	//   ]
6128	// }
6129
6130}
6131
6132// method id "storage.objectAccessControls.delete":
6133
6134type ObjectAccessControlsDeleteCall struct {
6135	s          *Service
6136	bucket     string
6137	object     string
6138	entity     string
6139	urlParams_ gensupport.URLParams
6140	ctx_       context.Context
6141	header_    http.Header
6142}
6143
6144// Delete: Permanently deletes the ACL entry for the specified entity on
6145// the specified object.
6146func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
6147	c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6148	c.bucket = bucket
6149	c.object = object
6150	c.entity = entity
6151	return c
6152}
6153
6154// Generation sets the optional parameter "generation": If present,
6155// selects a specific revision of this object (as opposed to the latest
6156// version, the default).
6157func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall {
6158	c.urlParams_.Set("generation", fmt.Sprint(generation))
6159	return c
6160}
6161
6162// UserProject sets the optional parameter "userProject": The project to
6163// be billed for this request, for Requester Pays buckets.
6164func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
6165	c.urlParams_.Set("userProject", userProject)
6166	return c
6167}
6168
6169// Fields allows partial responses to be retrieved. See
6170// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6171// for more information.
6172func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
6173	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6174	return c
6175}
6176
6177// Context sets the context to be used in this call's Do method. Any
6178// pending HTTP request will be aborted if the provided context is
6179// canceled.
6180func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
6181	c.ctx_ = ctx
6182	return c
6183}
6184
6185// Header returns an http.Header that can be modified by the caller to
6186// add HTTP headers to the request.
6187func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
6188	if c.header_ == nil {
6189		c.header_ = make(http.Header)
6190	}
6191	return c.header_
6192}
6193
6194func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
6195	reqHeaders := make(http.Header)
6196	for k, v := range c.header_ {
6197		reqHeaders[k] = v
6198	}
6199	reqHeaders.Set("User-Agent", c.s.userAgent())
6200	var body io.Reader = nil
6201	c.urlParams_.Set("alt", alt)
6202	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
6203	urls += "?" + c.urlParams_.Encode()
6204	req, _ := http.NewRequest("DELETE", urls, body)
6205	req.Header = reqHeaders
6206	googleapi.Expand(req.URL, map[string]string{
6207		"bucket": c.bucket,
6208		"object": c.object,
6209		"entity": c.entity,
6210	})
6211	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6212}
6213
6214// Do executes the "storage.objectAccessControls.delete" call.
6215func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
6216	gensupport.SetOptions(c.urlParams_, opts...)
6217	res, err := c.doRequest("json")
6218	if err != nil {
6219		return err
6220	}
6221	defer googleapi.CloseBody(res)
6222	if err := googleapi.CheckResponse(res); err != nil {
6223		return err
6224	}
6225	return nil
6226	// {
6227	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
6228	//   "httpMethod": "DELETE",
6229	//   "id": "storage.objectAccessControls.delete",
6230	//   "parameterOrder": [
6231	//     "bucket",
6232	//     "object",
6233	//     "entity"
6234	//   ],
6235	//   "parameters": {
6236	//     "bucket": {
6237	//       "description": "Name of a bucket.",
6238	//       "location": "path",
6239	//       "required": true,
6240	//       "type": "string"
6241	//     },
6242	//     "entity": {
6243	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6244	//       "location": "path",
6245	//       "required": true,
6246	//       "type": "string"
6247	//     },
6248	//     "generation": {
6249	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
6250	//       "format": "int64",
6251	//       "location": "query",
6252	//       "type": "string"
6253	//     },
6254	//     "object": {
6255	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
6256	//       "location": "path",
6257	//       "required": true,
6258	//       "type": "string"
6259	//     },
6260	//     "userProject": {
6261	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
6262	//       "location": "query",
6263	//       "type": "string"
6264	//     }
6265	//   },
6266	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
6267	//   "scopes": [
6268	//     "https://www.googleapis.com/auth/cloud-platform",
6269	//     "https://www.googleapis.com/auth/devstorage.full_control"
6270	//   ]
6271	// }
6272
6273}
6274
6275// method id "storage.objectAccessControls.get":
6276
6277type ObjectAccessControlsGetCall struct {
6278	s            *Service
6279	bucket       string
6280	object       string
6281	entity       string
6282	urlParams_   gensupport.URLParams
6283	ifNoneMatch_ string
6284	ctx_         context.Context
6285	header_      http.Header
6286}
6287
6288// Get: Returns the ACL entry for the specified entity on the specified
6289// object.
6290func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
6291	c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6292	c.bucket = bucket
6293	c.object = object
6294	c.entity = entity
6295	return c
6296}
6297
6298// Generation sets the optional parameter "generation": If present,
6299// selects a specific revision of this object (as opposed to the latest
6300// version, the default).
6301func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall {
6302	c.urlParams_.Set("generation", fmt.Sprint(generation))
6303	return c
6304}
6305
6306// UserProject sets the optional parameter "userProject": The project to
6307// be billed for this request, for Requester Pays buckets.
6308func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
6309	c.urlParams_.Set("userProject", userProject)
6310	return c
6311}
6312
6313// Fields allows partial responses to be retrieved. See
6314// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6315// for more information.
6316func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
6317	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6318	return c
6319}
6320
6321// IfNoneMatch sets the optional parameter which makes the operation
6322// fail if the object's ETag matches the given value. This is useful for
6323// getting updates only after the object has changed since the last
6324// request. Use googleapi.IsNotModified to check whether the response
6325// error from Do is the result of In-None-Match.
6326func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
6327	c.ifNoneMatch_ = entityTag
6328	return c
6329}
6330
6331// Context sets the context to be used in this call's Do method. Any
6332// pending HTTP request will be aborted if the provided context is
6333// canceled.
6334func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
6335	c.ctx_ = ctx
6336	return c
6337}
6338
6339// Header returns an http.Header that can be modified by the caller to
6340// add HTTP headers to the request.
6341func (c *ObjectAccessControlsGetCall) Header() http.Header {
6342	if c.header_ == nil {
6343		c.header_ = make(http.Header)
6344	}
6345	return c.header_
6346}
6347
6348func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
6349	reqHeaders := make(http.Header)
6350	for k, v := range c.header_ {
6351		reqHeaders[k] = v
6352	}
6353	reqHeaders.Set("User-Agent", c.s.userAgent())
6354	if c.ifNoneMatch_ != "" {
6355		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6356	}
6357	var body io.Reader = nil
6358	c.urlParams_.Set("alt", alt)
6359	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
6360	urls += "?" + c.urlParams_.Encode()
6361	req, _ := http.NewRequest("GET", urls, body)
6362	req.Header = reqHeaders
6363	googleapi.Expand(req.URL, map[string]string{
6364		"bucket": c.bucket,
6365		"object": c.object,
6366		"entity": c.entity,
6367	})
6368	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6369}
6370
6371// Do executes the "storage.objectAccessControls.get" call.
6372// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6373// non-2xx status code is an error. Response headers are in either
6374// *ObjectAccessControl.ServerResponse.Header or (if a response was
6375// returned at all) in error.(*googleapi.Error).Header. Use
6376// googleapi.IsNotModified to check whether the returned error was
6377// because http.StatusNotModified was returned.
6378func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6379	gensupport.SetOptions(c.urlParams_, opts...)
6380	res, err := c.doRequest("json")
6381	if res != nil && res.StatusCode == http.StatusNotModified {
6382		if res.Body != nil {
6383			res.Body.Close()
6384		}
6385		return nil, &googleapi.Error{
6386			Code:   res.StatusCode,
6387			Header: res.Header,
6388		}
6389	}
6390	if err != nil {
6391		return nil, err
6392	}
6393	defer googleapi.CloseBody(res)
6394	if err := googleapi.CheckResponse(res); err != nil {
6395		return nil, err
6396	}
6397	ret := &ObjectAccessControl{
6398		ServerResponse: googleapi.ServerResponse{
6399			Header:         res.Header,
6400			HTTPStatusCode: res.StatusCode,
6401		},
6402	}
6403	target := &ret
6404	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
6405		return nil, err
6406	}
6407	return ret, nil
6408	// {
6409	//   "description": "Returns the ACL entry for the specified entity on the specified object.",
6410	//   "httpMethod": "GET",
6411	//   "id": "storage.objectAccessControls.get",
6412	//   "parameterOrder": [
6413	//     "bucket",
6414	//     "object",
6415	//     "entity"
6416	//   ],
6417	//   "parameters": {
6418	//     "bucket": {
6419	//       "description": "Name of a bucket.",
6420	//       "location": "path",
6421	//       "required": true,
6422	//       "type": "string"
6423	//     },
6424	//     "entity": {
6425	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6426	//       "location": "path",
6427	//       "required": true,
6428	//       "type": "string"
6429	//     },
6430	//     "generation": {
6431	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
6432	//       "format": "int64",
6433	//       "location": "query",
6434	//       "type": "string"
6435	//     },
6436	//     "object": {
6437	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
6438	//       "location": "path",
6439	//       "required": true,
6440	//       "type": "string"
6441	//     },
6442	//     "userProject": {
6443	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
6444	//       "location": "query",
6445	//       "type": "string"
6446	//     }
6447	//   },
6448	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
6449	//   "response": {
6450	//     "$ref": "ObjectAccessControl"
6451	//   },
6452	//   "scopes": [
6453	//     "https://www.googleapis.com/auth/cloud-platform",
6454	//     "https://www.googleapis.com/auth/devstorage.full_control"
6455	//   ]
6456	// }
6457
6458}
6459
6460// method id "storage.objectAccessControls.insert":
6461
6462type ObjectAccessControlsInsertCall struct {
6463	s                   *Service
6464	bucket              string
6465	object              string
6466	objectaccesscontrol *ObjectAccessControl
6467	urlParams_          gensupport.URLParams
6468	ctx_                context.Context
6469	header_             http.Header
6470}
6471
6472// Insert: Creates a new ACL entry on the specified object.
6473func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
6474	c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6475	c.bucket = bucket
6476	c.object = object
6477	c.objectaccesscontrol = objectaccesscontrol
6478	return c
6479}
6480
6481// Generation sets the optional parameter "generation": If present,
6482// selects a specific revision of this object (as opposed to the latest
6483// version, the default).
6484func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall {
6485	c.urlParams_.Set("generation", fmt.Sprint(generation))
6486	return c
6487}
6488
6489// UserProject sets the optional parameter "userProject": The project to
6490// be billed for this request, for Requester Pays buckets.
6491func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
6492	c.urlParams_.Set("userProject", userProject)
6493	return c
6494}
6495
6496// Fields allows partial responses to be retrieved. See
6497// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6498// for more information.
6499func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
6500	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6501	return c
6502}
6503
6504// Context sets the context to be used in this call's Do method. Any
6505// pending HTTP request will be aborted if the provided context is
6506// canceled.
6507func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
6508	c.ctx_ = ctx
6509	return c
6510}
6511
6512// Header returns an http.Header that can be modified by the caller to
6513// add HTTP headers to the request.
6514func (c *ObjectAccessControlsInsertCall) Header() http.Header {
6515	if c.header_ == nil {
6516		c.header_ = make(http.Header)
6517	}
6518	return c.header_
6519}
6520
6521func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
6522	reqHeaders := make(http.Header)
6523	for k, v := range c.header_ {
6524		reqHeaders[k] = v
6525	}
6526	reqHeaders.Set("User-Agent", c.s.userAgent())
6527	var body io.Reader = nil
6528	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6529	if err != nil {
6530		return nil, err
6531	}
6532	reqHeaders.Set("Content-Type", "application/json")
6533	c.urlParams_.Set("alt", alt)
6534	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
6535	urls += "?" + c.urlParams_.Encode()
6536	req, _ := http.NewRequest("POST", urls, body)
6537	req.Header = reqHeaders
6538	googleapi.Expand(req.URL, map[string]string{
6539		"bucket": c.bucket,
6540		"object": c.object,
6541	})
6542	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6543}
6544
6545// Do executes the "storage.objectAccessControls.insert" call.
6546// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6547// non-2xx status code is an error. Response headers are in either
6548// *ObjectAccessControl.ServerResponse.Header or (if a response was
6549// returned at all) in error.(*googleapi.Error).Header. Use
6550// googleapi.IsNotModified to check whether the returned error was
6551// because http.StatusNotModified was returned.
6552func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6553	gensupport.SetOptions(c.urlParams_, opts...)
6554	res, err := c.doRequest("json")
6555	if res != nil && res.StatusCode == http.StatusNotModified {
6556		if res.Body != nil {
6557			res.Body.Close()
6558		}
6559		return nil, &googleapi.Error{
6560			Code:   res.StatusCode,
6561			Header: res.Header,
6562		}
6563	}
6564	if err != nil {
6565		return nil, err
6566	}
6567	defer googleapi.CloseBody(res)
6568	if err := googleapi.CheckResponse(res); err != nil {
6569		return nil, err
6570	}
6571	ret := &ObjectAccessControl{
6572		ServerResponse: googleapi.ServerResponse{
6573			Header:         res.Header,
6574			HTTPStatusCode: res.StatusCode,
6575		},
6576	}
6577	target := &ret
6578	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
6579		return nil, err
6580	}
6581	return ret, nil
6582	// {
6583	//   "description": "Creates a new ACL entry on the specified object.",
6584	//   "httpMethod": "POST",
6585	//   "id": "storage.objectAccessControls.insert",
6586	//   "parameterOrder": [
6587	//     "bucket",
6588	//     "object"
6589	//   ],
6590	//   "parameters": {
6591	//     "bucket": {
6592	//       "description": "Name of a bucket.",
6593	//       "location": "path",
6594	//       "required": true,
6595	//       "type": "string"
6596	//     },
6597	//     "generation": {
6598	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
6599	//       "format": "int64",
6600	//       "location": "query",
6601	//       "type": "string"
6602	//     },
6603	//     "object": {
6604	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
6605	//       "location": "path",
6606	//       "required": true,
6607	//       "type": "string"
6608	//     },
6609	//     "userProject": {
6610	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
6611	//       "location": "query",
6612	//       "type": "string"
6613	//     }
6614	//   },
6615	//   "path": "b/{bucket}/o/{object}/acl",
6616	//   "request": {
6617	//     "$ref": "ObjectAccessControl"
6618	//   },
6619	//   "response": {
6620	//     "$ref": "ObjectAccessControl"
6621	//   },
6622	//   "scopes": [
6623	//     "https://www.googleapis.com/auth/cloud-platform",
6624	//     "https://www.googleapis.com/auth/devstorage.full_control"
6625	//   ]
6626	// }
6627
6628}
6629
6630// method id "storage.objectAccessControls.list":
6631
6632type ObjectAccessControlsListCall struct {
6633	s            *Service
6634	bucket       string
6635	object       string
6636	urlParams_   gensupport.URLParams
6637	ifNoneMatch_ string
6638	ctx_         context.Context
6639	header_      http.Header
6640}
6641
6642// List: Retrieves ACL entries on the specified object.
6643func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
6644	c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6645	c.bucket = bucket
6646	c.object = object
6647	return c
6648}
6649
6650// Generation sets the optional parameter "generation": If present,
6651// selects a specific revision of this object (as opposed to the latest
6652// version, the default).
6653func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall {
6654	c.urlParams_.Set("generation", fmt.Sprint(generation))
6655	return c
6656}
6657
6658// UserProject sets the optional parameter "userProject": The project to
6659// be billed for this request, for Requester Pays buckets.
6660func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
6661	c.urlParams_.Set("userProject", userProject)
6662	return c
6663}
6664
6665// Fields allows partial responses to be retrieved. See
6666// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6667// for more information.
6668func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
6669	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6670	return c
6671}
6672
6673// IfNoneMatch sets the optional parameter which makes the operation
6674// fail if the object's ETag matches the given value. This is useful for
6675// getting updates only after the object has changed since the last
6676// request. Use googleapi.IsNotModified to check whether the response
6677// error from Do is the result of In-None-Match.
6678func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
6679	c.ifNoneMatch_ = entityTag
6680	return c
6681}
6682
6683// Context sets the context to be used in this call's Do method. Any
6684// pending HTTP request will be aborted if the provided context is
6685// canceled.
6686func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
6687	c.ctx_ = ctx
6688	return c
6689}
6690
6691// Header returns an http.Header that can be modified by the caller to
6692// add HTTP headers to the request.
6693func (c *ObjectAccessControlsListCall) Header() http.Header {
6694	if c.header_ == nil {
6695		c.header_ = make(http.Header)
6696	}
6697	return c.header_
6698}
6699
6700func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
6701	reqHeaders := make(http.Header)
6702	for k, v := range c.header_ {
6703		reqHeaders[k] = v
6704	}
6705	reqHeaders.Set("User-Agent", c.s.userAgent())
6706	if c.ifNoneMatch_ != "" {
6707		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6708	}
6709	var body io.Reader = nil
6710	c.urlParams_.Set("alt", alt)
6711	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
6712	urls += "?" + c.urlParams_.Encode()
6713	req, _ := http.NewRequest("GET", urls, body)
6714	req.Header = reqHeaders
6715	googleapi.Expand(req.URL, map[string]string{
6716		"bucket": c.bucket,
6717		"object": c.object,
6718	})
6719	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6720}
6721
6722// Do executes the "storage.objectAccessControls.list" call.
6723// Exactly one of *ObjectAccessControls or error will be non-nil. Any
6724// non-2xx status code is an error. Response headers are in either
6725// *ObjectAccessControls.ServerResponse.Header or (if a response was
6726// returned at all) in error.(*googleapi.Error).Header. Use
6727// googleapi.IsNotModified to check whether the returned error was
6728// because http.StatusNotModified was returned.
6729func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
6730	gensupport.SetOptions(c.urlParams_, opts...)
6731	res, err := c.doRequest("json")
6732	if res != nil && res.StatusCode == http.StatusNotModified {
6733		if res.Body != nil {
6734			res.Body.Close()
6735		}
6736		return nil, &googleapi.Error{
6737			Code:   res.StatusCode,
6738			Header: res.Header,
6739		}
6740	}
6741	if err != nil {
6742		return nil, err
6743	}
6744	defer googleapi.CloseBody(res)
6745	if err := googleapi.CheckResponse(res); err != nil {
6746		return nil, err
6747	}
6748	ret := &ObjectAccessControls{
6749		ServerResponse: googleapi.ServerResponse{
6750			Header:         res.Header,
6751			HTTPStatusCode: res.StatusCode,
6752		},
6753	}
6754	target := &ret
6755	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
6756		return nil, err
6757	}
6758	return ret, nil
6759	// {
6760	//   "description": "Retrieves ACL entries on the specified object.",
6761	//   "httpMethod": "GET",
6762	//   "id": "storage.objectAccessControls.list",
6763	//   "parameterOrder": [
6764	//     "bucket",
6765	//     "object"
6766	//   ],
6767	//   "parameters": {
6768	//     "bucket": {
6769	//       "description": "Name of a bucket.",
6770	//       "location": "path",
6771	//       "required": true,
6772	//       "type": "string"
6773	//     },
6774	//     "generation": {
6775	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
6776	//       "format": "int64",
6777	//       "location": "query",
6778	//       "type": "string"
6779	//     },
6780	//     "object": {
6781	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
6782	//       "location": "path",
6783	//       "required": true,
6784	//       "type": "string"
6785	//     },
6786	//     "userProject": {
6787	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
6788	//       "location": "query",
6789	//       "type": "string"
6790	//     }
6791	//   },
6792	//   "path": "b/{bucket}/o/{object}/acl",
6793	//   "response": {
6794	//     "$ref": "ObjectAccessControls"
6795	//   },
6796	//   "scopes": [
6797	//     "https://www.googleapis.com/auth/cloud-platform",
6798	//     "https://www.googleapis.com/auth/devstorage.full_control"
6799	//   ]
6800	// }
6801
6802}
6803
6804// method id "storage.objectAccessControls.patch":
6805
6806type ObjectAccessControlsPatchCall struct {
6807	s                   *Service
6808	bucket              string
6809	object              string
6810	entity              string
6811	objectaccesscontrol *ObjectAccessControl
6812	urlParams_          gensupport.URLParams
6813	ctx_                context.Context
6814	header_             http.Header
6815}
6816
6817// Patch: Updates an ACL entry on the specified object. This method
6818// supports patch semantics.
6819func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
6820	c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6821	c.bucket = bucket
6822	c.object = object
6823	c.entity = entity
6824	c.objectaccesscontrol = objectaccesscontrol
6825	return c
6826}
6827
6828// Generation sets the optional parameter "generation": If present,
6829// selects a specific revision of this object (as opposed to the latest
6830// version, the default).
6831func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall {
6832	c.urlParams_.Set("generation", fmt.Sprint(generation))
6833	return c
6834}
6835
6836// UserProject sets the optional parameter "userProject": The project to
6837// be billed for this request, for Requester Pays buckets.
6838func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
6839	c.urlParams_.Set("userProject", userProject)
6840	return c
6841}
6842
6843// Fields allows partial responses to be retrieved. See
6844// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6845// for more information.
6846func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
6847	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6848	return c
6849}
6850
6851// Context sets the context to be used in this call's Do method. Any
6852// pending HTTP request will be aborted if the provided context is
6853// canceled.
6854func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
6855	c.ctx_ = ctx
6856	return c
6857}
6858
6859// Header returns an http.Header that can be modified by the caller to
6860// add HTTP headers to the request.
6861func (c *ObjectAccessControlsPatchCall) Header() http.Header {
6862	if c.header_ == nil {
6863		c.header_ = make(http.Header)
6864	}
6865	return c.header_
6866}
6867
6868func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
6869	reqHeaders := make(http.Header)
6870	for k, v := range c.header_ {
6871		reqHeaders[k] = v
6872	}
6873	reqHeaders.Set("User-Agent", c.s.userAgent())
6874	var body io.Reader = nil
6875	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6876	if err != nil {
6877		return nil, err
6878	}
6879	reqHeaders.Set("Content-Type", "application/json")
6880	c.urlParams_.Set("alt", alt)
6881	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
6882	urls += "?" + c.urlParams_.Encode()
6883	req, _ := http.NewRequest("PATCH", urls, body)
6884	req.Header = reqHeaders
6885	googleapi.Expand(req.URL, map[string]string{
6886		"bucket": c.bucket,
6887		"object": c.object,
6888		"entity": c.entity,
6889	})
6890	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6891}
6892
6893// Do executes the "storage.objectAccessControls.patch" call.
6894// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6895// non-2xx status code is an error. Response headers are in either
6896// *ObjectAccessControl.ServerResponse.Header or (if a response was
6897// returned at all) in error.(*googleapi.Error).Header. Use
6898// googleapi.IsNotModified to check whether the returned error was
6899// because http.StatusNotModified was returned.
6900func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6901	gensupport.SetOptions(c.urlParams_, opts...)
6902	res, err := c.doRequest("json")
6903	if res != nil && res.StatusCode == http.StatusNotModified {
6904		if res.Body != nil {
6905			res.Body.Close()
6906		}
6907		return nil, &googleapi.Error{
6908			Code:   res.StatusCode,
6909			Header: res.Header,
6910		}
6911	}
6912	if err != nil {
6913		return nil, err
6914	}
6915	defer googleapi.CloseBody(res)
6916	if err := googleapi.CheckResponse(res); err != nil {
6917		return nil, err
6918	}
6919	ret := &ObjectAccessControl{
6920		ServerResponse: googleapi.ServerResponse{
6921			Header:         res.Header,
6922			HTTPStatusCode: res.StatusCode,
6923		},
6924	}
6925	target := &ret
6926	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
6927		return nil, err
6928	}
6929	return ret, nil
6930	// {
6931	//   "description": "Updates an ACL entry on the specified object. This method supports patch semantics.",
6932	//   "httpMethod": "PATCH",
6933	//   "id": "storage.objectAccessControls.patch",
6934	//   "parameterOrder": [
6935	//     "bucket",
6936	//     "object",
6937	//     "entity"
6938	//   ],
6939	//   "parameters": {
6940	//     "bucket": {
6941	//       "description": "Name of a bucket.",
6942	//       "location": "path",
6943	//       "required": true,
6944	//       "type": "string"
6945	//     },
6946	//     "entity": {
6947	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6948	//       "location": "path",
6949	//       "required": true,
6950	//       "type": "string"
6951	//     },
6952	//     "generation": {
6953	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
6954	//       "format": "int64",
6955	//       "location": "query",
6956	//       "type": "string"
6957	//     },
6958	//     "object": {
6959	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
6960	//       "location": "path",
6961	//       "required": true,
6962	//       "type": "string"
6963	//     },
6964	//     "userProject": {
6965	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
6966	//       "location": "query",
6967	//       "type": "string"
6968	//     }
6969	//   },
6970	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
6971	//   "request": {
6972	//     "$ref": "ObjectAccessControl"
6973	//   },
6974	//   "response": {
6975	//     "$ref": "ObjectAccessControl"
6976	//   },
6977	//   "scopes": [
6978	//     "https://www.googleapis.com/auth/cloud-platform",
6979	//     "https://www.googleapis.com/auth/devstorage.full_control"
6980	//   ]
6981	// }
6982
6983}
6984
6985// method id "storage.objectAccessControls.update":
6986
6987type ObjectAccessControlsUpdateCall struct {
6988	s                   *Service
6989	bucket              string
6990	object              string
6991	entity              string
6992	objectaccesscontrol *ObjectAccessControl
6993	urlParams_          gensupport.URLParams
6994	ctx_                context.Context
6995	header_             http.Header
6996}
6997
6998// Update: Updates an ACL entry on the specified object.
6999func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
7000	c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7001	c.bucket = bucket
7002	c.object = object
7003	c.entity = entity
7004	c.objectaccesscontrol = objectaccesscontrol
7005	return c
7006}
7007
7008// Generation sets the optional parameter "generation": If present,
7009// selects a specific revision of this object (as opposed to the latest
7010// version, the default).
7011func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall {
7012	c.urlParams_.Set("generation", fmt.Sprint(generation))
7013	return c
7014}
7015
7016// UserProject sets the optional parameter "userProject": The project to
7017// be billed for this request, for Requester Pays buckets.
7018func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
7019	c.urlParams_.Set("userProject", userProject)
7020	return c
7021}
7022
7023// Fields allows partial responses to be retrieved. See
7024// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7025// for more information.
7026func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
7027	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7028	return c
7029}
7030
7031// Context sets the context to be used in this call's Do method. Any
7032// pending HTTP request will be aborted if the provided context is
7033// canceled.
7034func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
7035	c.ctx_ = ctx
7036	return c
7037}
7038
7039// Header returns an http.Header that can be modified by the caller to
7040// add HTTP headers to the request.
7041func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
7042	if c.header_ == nil {
7043		c.header_ = make(http.Header)
7044	}
7045	return c.header_
7046}
7047
7048func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
7049	reqHeaders := make(http.Header)
7050	for k, v := range c.header_ {
7051		reqHeaders[k] = v
7052	}
7053	reqHeaders.Set("User-Agent", c.s.userAgent())
7054	var body io.Reader = nil
7055	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
7056	if err != nil {
7057		return nil, err
7058	}
7059	reqHeaders.Set("Content-Type", "application/json")
7060	c.urlParams_.Set("alt", alt)
7061	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7062	urls += "?" + c.urlParams_.Encode()
7063	req, _ := http.NewRequest("PUT", urls, body)
7064	req.Header = reqHeaders
7065	googleapi.Expand(req.URL, map[string]string{
7066		"bucket": c.bucket,
7067		"object": c.object,
7068		"entity": c.entity,
7069	})
7070	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7071}
7072
7073// Do executes the "storage.objectAccessControls.update" call.
7074// Exactly one of *ObjectAccessControl or error will be non-nil. Any
7075// non-2xx status code is an error. Response headers are in either
7076// *ObjectAccessControl.ServerResponse.Header or (if a response was
7077// returned at all) in error.(*googleapi.Error).Header. Use
7078// googleapi.IsNotModified to check whether the returned error was
7079// because http.StatusNotModified was returned.
7080func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7081	gensupport.SetOptions(c.urlParams_, opts...)
7082	res, err := c.doRequest("json")
7083	if res != nil && res.StatusCode == http.StatusNotModified {
7084		if res.Body != nil {
7085			res.Body.Close()
7086		}
7087		return nil, &googleapi.Error{
7088			Code:   res.StatusCode,
7089			Header: res.Header,
7090		}
7091	}
7092	if err != nil {
7093		return nil, err
7094	}
7095	defer googleapi.CloseBody(res)
7096	if err := googleapi.CheckResponse(res); err != nil {
7097		return nil, err
7098	}
7099	ret := &ObjectAccessControl{
7100		ServerResponse: googleapi.ServerResponse{
7101			Header:         res.Header,
7102			HTTPStatusCode: res.StatusCode,
7103		},
7104	}
7105	target := &ret
7106	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
7107		return nil, err
7108	}
7109	return ret, nil
7110	// {
7111	//   "description": "Updates an ACL entry on the specified object.",
7112	//   "httpMethod": "PUT",
7113	//   "id": "storage.objectAccessControls.update",
7114	//   "parameterOrder": [
7115	//     "bucket",
7116	//     "object",
7117	//     "entity"
7118	//   ],
7119	//   "parameters": {
7120	//     "bucket": {
7121	//       "description": "Name of a bucket.",
7122	//       "location": "path",
7123	//       "required": true,
7124	//       "type": "string"
7125	//     },
7126	//     "entity": {
7127	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7128	//       "location": "path",
7129	//       "required": true,
7130	//       "type": "string"
7131	//     },
7132	//     "generation": {
7133	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7134	//       "format": "int64",
7135	//       "location": "query",
7136	//       "type": "string"
7137	//     },
7138	//     "object": {
7139	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7140	//       "location": "path",
7141	//       "required": true,
7142	//       "type": "string"
7143	//     },
7144	//     "userProject": {
7145	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
7146	//       "location": "query",
7147	//       "type": "string"
7148	//     }
7149	//   },
7150	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
7151	//   "request": {
7152	//     "$ref": "ObjectAccessControl"
7153	//   },
7154	//   "response": {
7155	//     "$ref": "ObjectAccessControl"
7156	//   },
7157	//   "scopes": [
7158	//     "https://www.googleapis.com/auth/cloud-platform",
7159	//     "https://www.googleapis.com/auth/devstorage.full_control"
7160	//   ]
7161	// }
7162
7163}
7164
7165// method id "storage.objects.compose":
7166
7167type ObjectsComposeCall struct {
7168	s                 *Service
7169	destinationBucket string
7170	destinationObject string
7171	composerequest    *ComposeRequest
7172	urlParams_        gensupport.URLParams
7173	ctx_              context.Context
7174	header_           http.Header
7175}
7176
7177// Compose: Concatenates a list of existing objects into a new object in
7178// the same bucket.
7179func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
7180	c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7181	c.destinationBucket = destinationBucket
7182	c.destinationObject = destinationObject
7183	c.composerequest = composerequest
7184	return c
7185}
7186
7187// DestinationPredefinedAcl sets the optional parameter
7188// "destinationPredefinedAcl": Apply a predefined set of access controls
7189// to the destination object.
7190//
7191// Possible values:
7192//   "authenticatedRead" - Object owner gets OWNER access, and
7193// allAuthenticatedUsers get READER access.
7194//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
7195// project team owners get OWNER access.
7196//   "bucketOwnerRead" - Object owner gets OWNER access, and project
7197// team owners get READER access.
7198//   "private" - Object owner gets OWNER access.
7199//   "projectPrivate" - Object owner gets OWNER access, and project team
7200// members get access according to their roles.
7201//   "publicRead" - Object owner gets OWNER access, and allUsers get
7202// READER access.
7203func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
7204	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
7205	return c
7206}
7207
7208// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
7209// Makes the operation conditional on whether the object's current
7210// generation matches the given value. Setting to 0 makes the operation
7211// succeed only if there are no live versions of the object.
7212func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
7213	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
7214	return c
7215}
7216
7217// IfMetagenerationMatch sets the optional parameter
7218// "ifMetagenerationMatch": Makes the operation conditional on whether
7219// the object's current metageneration matches the given value.
7220func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall {
7221	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
7222	return c
7223}
7224
7225// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
7226// the Cloud KMS key, of the form
7227// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
7228//  that will be used to encrypt the object. Overrides the object
7229// metadata's kms_key_name value, if any.
7230func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall {
7231	c.urlParams_.Set("kmsKeyName", kmsKeyName)
7232	return c
7233}
7234
7235// UserProject sets the optional parameter "userProject": The project to
7236// be billed for this request, for Requester Pays buckets.
7237func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
7238	c.urlParams_.Set("userProject", userProject)
7239	return c
7240}
7241
7242// Fields allows partial responses to be retrieved. See
7243// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7244// for more information.
7245func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
7246	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7247	return c
7248}
7249
7250// Context sets the context to be used in this call's Do and Download
7251// methods. Any pending HTTP request will be aborted if the provided
7252// context is canceled.
7253func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
7254	c.ctx_ = ctx
7255	return c
7256}
7257
7258// Header returns an http.Header that can be modified by the caller to
7259// add HTTP headers to the request.
7260func (c *ObjectsComposeCall) Header() http.Header {
7261	if c.header_ == nil {
7262		c.header_ = make(http.Header)
7263	}
7264	return c.header_
7265}
7266
7267func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
7268	reqHeaders := make(http.Header)
7269	for k, v := range c.header_ {
7270		reqHeaders[k] = v
7271	}
7272	reqHeaders.Set("User-Agent", c.s.userAgent())
7273	var body io.Reader = nil
7274	body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
7275	if err != nil {
7276		return nil, err
7277	}
7278	reqHeaders.Set("Content-Type", "application/json")
7279	c.urlParams_.Set("alt", alt)
7280	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
7281	urls += "?" + c.urlParams_.Encode()
7282	req, _ := http.NewRequest("POST", urls, body)
7283	req.Header = reqHeaders
7284	googleapi.Expand(req.URL, map[string]string{
7285		"destinationBucket": c.destinationBucket,
7286		"destinationObject": c.destinationObject,
7287	})
7288	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7289}
7290
7291// Download fetches the API endpoint's "media" value, instead of the normal
7292// API response value. If the returned error is nil, the Response is guaranteed to
7293// have a 2xx status code. Callers must close the Response.Body as usual.
7294func (c *ObjectsComposeCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
7295	gensupport.SetOptions(c.urlParams_, opts...)
7296	res, err := c.doRequest("media")
7297	if err != nil {
7298		return nil, err
7299	}
7300	if err := googleapi.CheckMediaResponse(res); err != nil {
7301		res.Body.Close()
7302		return nil, err
7303	}
7304	return res, nil
7305}
7306
7307// Do executes the "storage.objects.compose" call.
7308// Exactly one of *Object or error will be non-nil. Any non-2xx status
7309// code is an error. Response headers are in either
7310// *Object.ServerResponse.Header or (if a response was returned at all)
7311// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7312// check whether the returned error was because http.StatusNotModified
7313// was returned.
7314func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
7315	gensupport.SetOptions(c.urlParams_, opts...)
7316	res, err := c.doRequest("json")
7317	if res != nil && res.StatusCode == http.StatusNotModified {
7318		if res.Body != nil {
7319			res.Body.Close()
7320		}
7321		return nil, &googleapi.Error{
7322			Code:   res.StatusCode,
7323			Header: res.Header,
7324		}
7325	}
7326	if err != nil {
7327		return nil, err
7328	}
7329	defer googleapi.CloseBody(res)
7330	if err := googleapi.CheckResponse(res); err != nil {
7331		return nil, err
7332	}
7333	ret := &Object{
7334		ServerResponse: googleapi.ServerResponse{
7335			Header:         res.Header,
7336			HTTPStatusCode: res.StatusCode,
7337		},
7338	}
7339	target := &ret
7340	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
7341		return nil, err
7342	}
7343	return ret, nil
7344	// {
7345	//   "description": "Concatenates a list of existing objects into a new object in the same bucket.",
7346	//   "httpMethod": "POST",
7347	//   "id": "storage.objects.compose",
7348	//   "parameterOrder": [
7349	//     "destinationBucket",
7350	//     "destinationObject"
7351	//   ],
7352	//   "parameters": {
7353	//     "destinationBucket": {
7354	//       "description": "Name of the bucket in which to store the new object.",
7355	//       "location": "path",
7356	//       "required": true,
7357	//       "type": "string"
7358	//     },
7359	//     "destinationObject": {
7360	//       "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7361	//       "location": "path",
7362	//       "required": true,
7363	//       "type": "string"
7364	//     },
7365	//     "destinationPredefinedAcl": {
7366	//       "description": "Apply a predefined set of access controls to the destination object.",
7367	//       "enum": [
7368	//         "authenticatedRead",
7369	//         "bucketOwnerFullControl",
7370	//         "bucketOwnerRead",
7371	//         "private",
7372	//         "projectPrivate",
7373	//         "publicRead"
7374	//       ],
7375	//       "enumDescriptions": [
7376	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
7377	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
7378	//         "Object owner gets OWNER access, and project team owners get READER access.",
7379	//         "Object owner gets OWNER access.",
7380	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
7381	//         "Object owner gets OWNER access, and allUsers get READER access."
7382	//       ],
7383	//       "location": "query",
7384	//       "type": "string"
7385	//     },
7386	//     "ifGenerationMatch": {
7387	//       "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.",
7388	//       "format": "int64",
7389	//       "location": "query",
7390	//       "type": "string"
7391	//     },
7392	//     "ifMetagenerationMatch": {
7393	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
7394	//       "format": "int64",
7395	//       "location": "query",
7396	//       "type": "string"
7397	//     },
7398	//     "kmsKeyName": {
7399	//       "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.",
7400	//       "location": "query",
7401	//       "type": "string"
7402	//     },
7403	//     "userProject": {
7404	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
7405	//       "location": "query",
7406	//       "type": "string"
7407	//     }
7408	//   },
7409	//   "path": "b/{destinationBucket}/o/{destinationObject}/compose",
7410	//   "request": {
7411	//     "$ref": "ComposeRequest"
7412	//   },
7413	//   "response": {
7414	//     "$ref": "Object"
7415	//   },
7416	//   "scopes": [
7417	//     "https://www.googleapis.com/auth/cloud-platform",
7418	//     "https://www.googleapis.com/auth/devstorage.full_control",
7419	//     "https://www.googleapis.com/auth/devstorage.read_write"
7420	//   ],
7421	//   "supportsMediaDownload": true,
7422	//   "useMediaDownloadService": true
7423	// }
7424
7425}
7426
7427// method id "storage.objects.copy":
7428
7429type ObjectsCopyCall struct {
7430	s                 *Service
7431	sourceBucket      string
7432	sourceObject      string
7433	destinationBucket string
7434	destinationObject string
7435	object            *Object
7436	urlParams_        gensupport.URLParams
7437	ctx_              context.Context
7438	header_           http.Header
7439}
7440
7441// Copy: Copies a source object to a destination object. Optionally
7442// overrides metadata.
7443func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
7444	c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7445	c.sourceBucket = sourceBucket
7446	c.sourceObject = sourceObject
7447	c.destinationBucket = destinationBucket
7448	c.destinationObject = destinationObject
7449	c.object = object
7450	return c
7451}
7452
7453// DestinationPredefinedAcl sets the optional parameter
7454// "destinationPredefinedAcl": Apply a predefined set of access controls
7455// to the destination object.
7456//
7457// Possible values:
7458//   "authenticatedRead" - Object owner gets OWNER access, and
7459// allAuthenticatedUsers get READER access.
7460//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
7461// project team owners get OWNER access.
7462//   "bucketOwnerRead" - Object owner gets OWNER access, and project
7463// team owners get READER access.
7464//   "private" - Object owner gets OWNER access.
7465//   "projectPrivate" - Object owner gets OWNER access, and project team
7466// members get access according to their roles.
7467//   "publicRead" - Object owner gets OWNER access, and allUsers get
7468// READER access.
7469func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
7470	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
7471	return c
7472}
7473
7474// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
7475// Makes the operation conditional on whether the destination object's
7476// current generation matches the given value. Setting to 0 makes the
7477// operation succeed only if there are no live versions of the object.
7478func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
7479	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
7480	return c
7481}
7482
7483// IfGenerationNotMatch sets the optional parameter
7484// "ifGenerationNotMatch": Makes the operation conditional on whether
7485// the destination object's current generation does not match the given
7486// value. If no live object exists, the precondition fails. Setting to 0
7487// makes the operation succeed only if there is a live version of the
7488// object.
7489func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
7490	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
7491	return c
7492}
7493
7494// IfMetagenerationMatch sets the optional parameter
7495// "ifMetagenerationMatch": Makes the operation conditional on whether
7496// the destination object's current metageneration matches the given
7497// value.
7498func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
7499	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
7500	return c
7501}
7502
7503// IfMetagenerationNotMatch sets the optional parameter
7504// "ifMetagenerationNotMatch": Makes the operation conditional on
7505// whether the destination object's current metageneration does not
7506// match the given value.
7507func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall {
7508	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
7509	return c
7510}
7511
7512// IfSourceGenerationMatch sets the optional parameter
7513// "ifSourceGenerationMatch": Makes the operation conditional on whether
7514// the source object's current generation matches the given value.
7515func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
7516	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
7517	return c
7518}
7519
7520// IfSourceGenerationNotMatch sets the optional parameter
7521// "ifSourceGenerationNotMatch": Makes the operation conditional on
7522// whether the source object's current generation does not match the
7523// given value.
7524func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
7525	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
7526	return c
7527}
7528
7529// IfSourceMetagenerationMatch sets the optional parameter
7530// "ifSourceMetagenerationMatch": Makes the operation conditional on
7531// whether the source object's current metageneration matches the given
7532// value.
7533func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
7534	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
7535	return c
7536}
7537
7538// IfSourceMetagenerationNotMatch sets the optional parameter
7539// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
7540// whether the source object's current metageneration does not match the
7541// given value.
7542func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
7543	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
7544	return c
7545}
7546
7547// Projection sets the optional parameter "projection": Set of
7548// properties to return. Defaults to noAcl, unless the object resource
7549// specifies the acl property, when it defaults to full.
7550//
7551// Possible values:
7552//   "full" - Include all properties.
7553//   "noAcl" - Omit the owner, acl property.
7554func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
7555	c.urlParams_.Set("projection", projection)
7556	return c
7557}
7558
7559// SourceGeneration sets the optional parameter "sourceGeneration": If
7560// present, selects a specific revision of the source object (as opposed
7561// to the latest version, the default).
7562func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall {
7563	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
7564	return c
7565}
7566
7567// UserProject sets the optional parameter "userProject": The project to
7568// be billed for this request, for Requester Pays buckets.
7569func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
7570	c.urlParams_.Set("userProject", userProject)
7571	return c
7572}
7573
7574// Fields allows partial responses to be retrieved. See
7575// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7576// for more information.
7577func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
7578	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7579	return c
7580}
7581
7582// Context sets the context to be used in this call's Do and Download
7583// methods. Any pending HTTP request will be aborted if the provided
7584// context is canceled.
7585func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
7586	c.ctx_ = ctx
7587	return c
7588}
7589
7590// Header returns an http.Header that can be modified by the caller to
7591// add HTTP headers to the request.
7592func (c *ObjectsCopyCall) Header() http.Header {
7593	if c.header_ == nil {
7594		c.header_ = make(http.Header)
7595	}
7596	return c.header_
7597}
7598
7599func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
7600	reqHeaders := make(http.Header)
7601	for k, v := range c.header_ {
7602		reqHeaders[k] = v
7603	}
7604	reqHeaders.Set("User-Agent", c.s.userAgent())
7605	var body io.Reader = nil
7606	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
7607	if err != nil {
7608		return nil, err
7609	}
7610	reqHeaders.Set("Content-Type", "application/json")
7611	c.urlParams_.Set("alt", alt)
7612	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
7613	urls += "?" + c.urlParams_.Encode()
7614	req, _ := http.NewRequest("POST", urls, body)
7615	req.Header = reqHeaders
7616	googleapi.Expand(req.URL, map[string]string{
7617		"sourceBucket":      c.sourceBucket,
7618		"sourceObject":      c.sourceObject,
7619		"destinationBucket": c.destinationBucket,
7620		"destinationObject": c.destinationObject,
7621	})
7622	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7623}
7624
7625// Download fetches the API endpoint's "media" value, instead of the normal
7626// API response value. If the returned error is nil, the Response is guaranteed to
7627// have a 2xx status code. Callers must close the Response.Body as usual.
7628func (c *ObjectsCopyCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
7629	gensupport.SetOptions(c.urlParams_, opts...)
7630	res, err := c.doRequest("media")
7631	if err != nil {
7632		return nil, err
7633	}
7634	if err := googleapi.CheckMediaResponse(res); err != nil {
7635		res.Body.Close()
7636		return nil, err
7637	}
7638	return res, nil
7639}
7640
7641// Do executes the "storage.objects.copy" call.
7642// Exactly one of *Object or error will be non-nil. Any non-2xx status
7643// code is an error. Response headers are in either
7644// *Object.ServerResponse.Header or (if a response was returned at all)
7645// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7646// check whether the returned error was because http.StatusNotModified
7647// was returned.
7648func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
7649	gensupport.SetOptions(c.urlParams_, opts...)
7650	res, err := c.doRequest("json")
7651	if res != nil && res.StatusCode == http.StatusNotModified {
7652		if res.Body != nil {
7653			res.Body.Close()
7654		}
7655		return nil, &googleapi.Error{
7656			Code:   res.StatusCode,
7657			Header: res.Header,
7658		}
7659	}
7660	if err != nil {
7661		return nil, err
7662	}
7663	defer googleapi.CloseBody(res)
7664	if err := googleapi.CheckResponse(res); err != nil {
7665		return nil, err
7666	}
7667	ret := &Object{
7668		ServerResponse: googleapi.ServerResponse{
7669			Header:         res.Header,
7670			HTTPStatusCode: res.StatusCode,
7671		},
7672	}
7673	target := &ret
7674	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
7675		return nil, err
7676	}
7677	return ret, nil
7678	// {
7679	//   "description": "Copies a source object to a destination object. Optionally overrides metadata.",
7680	//   "httpMethod": "POST",
7681	//   "id": "storage.objects.copy",
7682	//   "parameterOrder": [
7683	//     "sourceBucket",
7684	//     "sourceObject",
7685	//     "destinationBucket",
7686	//     "destinationObject"
7687	//   ],
7688	//   "parameters": {
7689	//     "destinationBucket": {
7690	//       "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.",
7691	//       "location": "path",
7692	//       "required": true,
7693	//       "type": "string"
7694	//     },
7695	//     "destinationObject": {
7696	//       "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
7697	//       "location": "path",
7698	//       "required": true,
7699	//       "type": "string"
7700	//     },
7701	//     "destinationPredefinedAcl": {
7702	//       "description": "Apply a predefined set of access controls to the destination object.",
7703	//       "enum": [
7704	//         "authenticatedRead",
7705	//         "bucketOwnerFullControl",
7706	//         "bucketOwnerRead",
7707	//         "private",
7708	//         "projectPrivate",
7709	//         "publicRead"
7710	//       ],
7711	//       "enumDescriptions": [
7712	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
7713	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
7714	//         "Object owner gets OWNER access, and project team owners get READER access.",
7715	//         "Object owner gets OWNER access.",
7716	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
7717	//         "Object owner gets OWNER access, and allUsers get READER access."
7718	//       ],
7719	//       "location": "query",
7720	//       "type": "string"
7721	//     },
7722	//     "ifGenerationMatch": {
7723	//       "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.",
7724	//       "format": "int64",
7725	//       "location": "query",
7726	//       "type": "string"
7727	//     },
7728	//     "ifGenerationNotMatch": {
7729	//       "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.",
7730	//       "format": "int64",
7731	//       "location": "query",
7732	//       "type": "string"
7733	//     },
7734	//     "ifMetagenerationMatch": {
7735	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
7736	//       "format": "int64",
7737	//       "location": "query",
7738	//       "type": "string"
7739	//     },
7740	//     "ifMetagenerationNotMatch": {
7741	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
7742	//       "format": "int64",
7743	//       "location": "query",
7744	//       "type": "string"
7745	//     },
7746	//     "ifSourceGenerationMatch": {
7747	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
7748	//       "format": "int64",
7749	//       "location": "query",
7750	//       "type": "string"
7751	//     },
7752	//     "ifSourceGenerationNotMatch": {
7753	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
7754	//       "format": "int64",
7755	//       "location": "query",
7756	//       "type": "string"
7757	//     },
7758	//     "ifSourceMetagenerationMatch": {
7759	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
7760	//       "format": "int64",
7761	//       "location": "query",
7762	//       "type": "string"
7763	//     },
7764	//     "ifSourceMetagenerationNotMatch": {
7765	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
7766	//       "format": "int64",
7767	//       "location": "query",
7768	//       "type": "string"
7769	//     },
7770	//     "projection": {
7771	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
7772	//       "enum": [
7773	//         "full",
7774	//         "noAcl"
7775	//       ],
7776	//       "enumDescriptions": [
7777	//         "Include all properties.",
7778	//         "Omit the owner, acl property."
7779	//       ],
7780	//       "location": "query",
7781	//       "type": "string"
7782	//     },
7783	//     "sourceBucket": {
7784	//       "description": "Name of the bucket in which to find the source object.",
7785	//       "location": "path",
7786	//       "required": true,
7787	//       "type": "string"
7788	//     },
7789	//     "sourceGeneration": {
7790	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
7791	//       "format": "int64",
7792	//       "location": "query",
7793	//       "type": "string"
7794	//     },
7795	//     "sourceObject": {
7796	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7797	//       "location": "path",
7798	//       "required": true,
7799	//       "type": "string"
7800	//     },
7801	//     "userProject": {
7802	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
7803	//       "location": "query",
7804	//       "type": "string"
7805	//     }
7806	//   },
7807	//   "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
7808	//   "request": {
7809	//     "$ref": "Object"
7810	//   },
7811	//   "response": {
7812	//     "$ref": "Object"
7813	//   },
7814	//   "scopes": [
7815	//     "https://www.googleapis.com/auth/cloud-platform",
7816	//     "https://www.googleapis.com/auth/devstorage.full_control",
7817	//     "https://www.googleapis.com/auth/devstorage.read_write"
7818	//   ],
7819	//   "supportsMediaDownload": true,
7820	//   "useMediaDownloadService": true
7821	// }
7822
7823}
7824
7825// method id "storage.objects.delete":
7826
7827type ObjectsDeleteCall struct {
7828	s          *Service
7829	bucket     string
7830	object     string
7831	urlParams_ gensupport.URLParams
7832	ctx_       context.Context
7833	header_    http.Header
7834}
7835
7836// Delete: Deletes an object and its metadata. Deletions are permanent
7837// if versioning is not enabled for the bucket, or if the generation
7838// parameter is used.
7839func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
7840	c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7841	c.bucket = bucket
7842	c.object = object
7843	return c
7844}
7845
7846// Generation sets the optional parameter "generation": If present,
7847// permanently deletes a specific revision of this object (as opposed to
7848// the latest version, the default).
7849func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
7850	c.urlParams_.Set("generation", fmt.Sprint(generation))
7851	return c
7852}
7853
7854// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
7855// Makes the operation conditional on whether the object's current
7856// generation matches the given value. Setting to 0 makes the operation
7857// succeed only if there are no live versions of the object.
7858func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
7859	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
7860	return c
7861}
7862
7863// IfGenerationNotMatch sets the optional parameter
7864// "ifGenerationNotMatch": Makes the operation conditional on whether
7865// the object's current generation does not match the given value. If no
7866// live object exists, the precondition fails. Setting to 0 makes the
7867// operation succeed only if there is a live version of the object.
7868func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
7869	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
7870	return c
7871}
7872
7873// IfMetagenerationMatch sets the optional parameter
7874// "ifMetagenerationMatch": Makes the operation conditional on whether
7875// the object's current metageneration matches the given value.
7876func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall {
7877	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
7878	return c
7879}
7880
7881// IfMetagenerationNotMatch sets the optional parameter
7882// "ifMetagenerationNotMatch": Makes the operation conditional on
7883// whether the object's current metageneration does not match the given
7884// value.
7885func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
7886	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
7887	return c
7888}
7889
7890// UserProject sets the optional parameter "userProject": The project to
7891// be billed for this request, for Requester Pays buckets.
7892func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
7893	c.urlParams_.Set("userProject", userProject)
7894	return c
7895}
7896
7897// Fields allows partial responses to be retrieved. See
7898// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7899// for more information.
7900func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
7901	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7902	return c
7903}
7904
7905// Context sets the context to be used in this call's Do method. Any
7906// pending HTTP request will be aborted if the provided context is
7907// canceled.
7908func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
7909	c.ctx_ = ctx
7910	return c
7911}
7912
7913// Header returns an http.Header that can be modified by the caller to
7914// add HTTP headers to the request.
7915func (c *ObjectsDeleteCall) Header() http.Header {
7916	if c.header_ == nil {
7917		c.header_ = make(http.Header)
7918	}
7919	return c.header_
7920}
7921
7922func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
7923	reqHeaders := make(http.Header)
7924	for k, v := range c.header_ {
7925		reqHeaders[k] = v
7926	}
7927	reqHeaders.Set("User-Agent", c.s.userAgent())
7928	var body io.Reader = nil
7929	c.urlParams_.Set("alt", alt)
7930	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
7931	urls += "?" + c.urlParams_.Encode()
7932	req, _ := http.NewRequest("DELETE", urls, body)
7933	req.Header = reqHeaders
7934	googleapi.Expand(req.URL, map[string]string{
7935		"bucket": c.bucket,
7936		"object": c.object,
7937	})
7938	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7939}
7940
7941// Do executes the "storage.objects.delete" call.
7942func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
7943	gensupport.SetOptions(c.urlParams_, opts...)
7944	res, err := c.doRequest("json")
7945	if err != nil {
7946		return err
7947	}
7948	defer googleapi.CloseBody(res)
7949	if err := googleapi.CheckResponse(res); err != nil {
7950		return err
7951	}
7952	return nil
7953	// {
7954	//   "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.",
7955	//   "httpMethod": "DELETE",
7956	//   "id": "storage.objects.delete",
7957	//   "parameterOrder": [
7958	//     "bucket",
7959	//     "object"
7960	//   ],
7961	//   "parameters": {
7962	//     "bucket": {
7963	//       "description": "Name of the bucket in which the object resides.",
7964	//       "location": "path",
7965	//       "required": true,
7966	//       "type": "string"
7967	//     },
7968	//     "generation": {
7969	//       "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
7970	//       "format": "int64",
7971	//       "location": "query",
7972	//       "type": "string"
7973	//     },
7974	//     "ifGenerationMatch": {
7975	//       "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.",
7976	//       "format": "int64",
7977	//       "location": "query",
7978	//       "type": "string"
7979	//     },
7980	//     "ifGenerationNotMatch": {
7981	//       "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.",
7982	//       "format": "int64",
7983	//       "location": "query",
7984	//       "type": "string"
7985	//     },
7986	//     "ifMetagenerationMatch": {
7987	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
7988	//       "format": "int64",
7989	//       "location": "query",
7990	//       "type": "string"
7991	//     },
7992	//     "ifMetagenerationNotMatch": {
7993	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
7994	//       "format": "int64",
7995	//       "location": "query",
7996	//       "type": "string"
7997	//     },
7998	//     "object": {
7999	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8000	//       "location": "path",
8001	//       "required": true,
8002	//       "type": "string"
8003	//     },
8004	//     "userProject": {
8005	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
8006	//       "location": "query",
8007	//       "type": "string"
8008	//     }
8009	//   },
8010	//   "path": "b/{bucket}/o/{object}",
8011	//   "scopes": [
8012	//     "https://www.googleapis.com/auth/cloud-platform",
8013	//     "https://www.googleapis.com/auth/devstorage.full_control",
8014	//     "https://www.googleapis.com/auth/devstorage.read_write"
8015	//   ]
8016	// }
8017
8018}
8019
8020// method id "storage.objects.get":
8021
8022type ObjectsGetCall struct {
8023	s            *Service
8024	bucket       string
8025	object       string
8026	urlParams_   gensupport.URLParams
8027	ifNoneMatch_ string
8028	ctx_         context.Context
8029	header_      http.Header
8030}
8031
8032// Get: Retrieves an object or its metadata.
8033func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
8034	c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8035	c.bucket = bucket
8036	c.object = object
8037	return c
8038}
8039
8040// Generation sets the optional parameter "generation": If present,
8041// selects a specific revision of this object (as opposed to the latest
8042// version, the default).
8043func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
8044	c.urlParams_.Set("generation", fmt.Sprint(generation))
8045	return c
8046}
8047
8048// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8049// Makes the operation conditional on whether the object's current
8050// generation matches the given value. Setting to 0 makes the operation
8051// succeed only if there are no live versions of the object.
8052func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
8053	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8054	return c
8055}
8056
8057// IfGenerationNotMatch sets the optional parameter
8058// "ifGenerationNotMatch": Makes the operation conditional on whether
8059// the object's current generation does not match the given value. If no
8060// live object exists, the precondition fails. Setting to 0 makes the
8061// operation succeed only if there is a live version of the object.
8062func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
8063	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
8064	return c
8065}
8066
8067// IfMetagenerationMatch sets the optional parameter
8068// "ifMetagenerationMatch": Makes the operation conditional on whether
8069// the object's current metageneration matches the given value.
8070func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall {
8071	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8072	return c
8073}
8074
8075// IfMetagenerationNotMatch sets the optional parameter
8076// "ifMetagenerationNotMatch": Makes the operation conditional on
8077// whether the object's current metageneration does not match the given
8078// value.
8079func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
8080	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8081	return c
8082}
8083
8084// Projection sets the optional parameter "projection": Set of
8085// properties to return. Defaults to noAcl.
8086//
8087// Possible values:
8088//   "full" - Include all properties.
8089//   "noAcl" - Omit the owner, acl property.
8090func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
8091	c.urlParams_.Set("projection", projection)
8092	return c
8093}
8094
8095// UserProject sets the optional parameter "userProject": The project to
8096// be billed for this request, for Requester Pays buckets.
8097func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
8098	c.urlParams_.Set("userProject", userProject)
8099	return c
8100}
8101
8102// Fields allows partial responses to be retrieved. See
8103// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8104// for more information.
8105func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
8106	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8107	return c
8108}
8109
8110// IfNoneMatch sets the optional parameter which makes the operation
8111// fail if the object's ETag matches the given value. This is useful for
8112// getting updates only after the object has changed since the last
8113// request. Use googleapi.IsNotModified to check whether the response
8114// error from Do is the result of In-None-Match.
8115func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
8116	c.ifNoneMatch_ = entityTag
8117	return c
8118}
8119
8120// Context sets the context to be used in this call's Do and Download
8121// methods. Any pending HTTP request will be aborted if the provided
8122// context is canceled.
8123func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
8124	c.ctx_ = ctx
8125	return c
8126}
8127
8128// Header returns an http.Header that can be modified by the caller to
8129// add HTTP headers to the request.
8130func (c *ObjectsGetCall) Header() http.Header {
8131	if c.header_ == nil {
8132		c.header_ = make(http.Header)
8133	}
8134	return c.header_
8135}
8136
8137func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
8138	reqHeaders := make(http.Header)
8139	for k, v := range c.header_ {
8140		reqHeaders[k] = v
8141	}
8142	reqHeaders.Set("User-Agent", c.s.userAgent())
8143	if c.ifNoneMatch_ != "" {
8144		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8145	}
8146	var body io.Reader = nil
8147	c.urlParams_.Set("alt", alt)
8148	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
8149	urls += "?" + c.urlParams_.Encode()
8150	req, _ := http.NewRequest("GET", urls, body)
8151	req.Header = reqHeaders
8152	googleapi.Expand(req.URL, map[string]string{
8153		"bucket": c.bucket,
8154		"object": c.object,
8155	})
8156	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8157}
8158
8159// Download fetches the API endpoint's "media" value, instead of the normal
8160// API response value. If the returned error is nil, the Response is guaranteed to
8161// have a 2xx status code. Callers must close the Response.Body as usual.
8162func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
8163	gensupport.SetOptions(c.urlParams_, opts...)
8164	res, err := c.doRequest("media")
8165	if err != nil {
8166		return nil, err
8167	}
8168	if err := googleapi.CheckMediaResponse(res); err != nil {
8169		res.Body.Close()
8170		return nil, err
8171	}
8172	return res, nil
8173}
8174
8175// Do executes the "storage.objects.get" call.
8176// Exactly one of *Object or error will be non-nil. Any non-2xx status
8177// code is an error. Response headers are in either
8178// *Object.ServerResponse.Header or (if a response was returned at all)
8179// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8180// check whether the returned error was because http.StatusNotModified
8181// was returned.
8182func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8183	gensupport.SetOptions(c.urlParams_, opts...)
8184	res, err := c.doRequest("json")
8185	if res != nil && res.StatusCode == http.StatusNotModified {
8186		if res.Body != nil {
8187			res.Body.Close()
8188		}
8189		return nil, &googleapi.Error{
8190			Code:   res.StatusCode,
8191			Header: res.Header,
8192		}
8193	}
8194	if err != nil {
8195		return nil, err
8196	}
8197	defer googleapi.CloseBody(res)
8198	if err := googleapi.CheckResponse(res); err != nil {
8199		return nil, err
8200	}
8201	ret := &Object{
8202		ServerResponse: googleapi.ServerResponse{
8203			Header:         res.Header,
8204			HTTPStatusCode: res.StatusCode,
8205		},
8206	}
8207	target := &ret
8208	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
8209		return nil, err
8210	}
8211	return ret, nil
8212	// {
8213	//   "description": "Retrieves an object or its metadata.",
8214	//   "httpMethod": "GET",
8215	//   "id": "storage.objects.get",
8216	//   "parameterOrder": [
8217	//     "bucket",
8218	//     "object"
8219	//   ],
8220	//   "parameters": {
8221	//     "bucket": {
8222	//       "description": "Name of the bucket in which the object resides.",
8223	//       "location": "path",
8224	//       "required": true,
8225	//       "type": "string"
8226	//     },
8227	//     "generation": {
8228	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8229	//       "format": "int64",
8230	//       "location": "query",
8231	//       "type": "string"
8232	//     },
8233	//     "ifGenerationMatch": {
8234	//       "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.",
8235	//       "format": "int64",
8236	//       "location": "query",
8237	//       "type": "string"
8238	//     },
8239	//     "ifGenerationNotMatch": {
8240	//       "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.",
8241	//       "format": "int64",
8242	//       "location": "query",
8243	//       "type": "string"
8244	//     },
8245	//     "ifMetagenerationMatch": {
8246	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
8247	//       "format": "int64",
8248	//       "location": "query",
8249	//       "type": "string"
8250	//     },
8251	//     "ifMetagenerationNotMatch": {
8252	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
8253	//       "format": "int64",
8254	//       "location": "query",
8255	//       "type": "string"
8256	//     },
8257	//     "object": {
8258	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8259	//       "location": "path",
8260	//       "required": true,
8261	//       "type": "string"
8262	//     },
8263	//     "projection": {
8264	//       "description": "Set of properties to return. Defaults to noAcl.",
8265	//       "enum": [
8266	//         "full",
8267	//         "noAcl"
8268	//       ],
8269	//       "enumDescriptions": [
8270	//         "Include all properties.",
8271	//         "Omit the owner, acl property."
8272	//       ],
8273	//       "location": "query",
8274	//       "type": "string"
8275	//     },
8276	//     "userProject": {
8277	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
8278	//       "location": "query",
8279	//       "type": "string"
8280	//     }
8281	//   },
8282	//   "path": "b/{bucket}/o/{object}",
8283	//   "response": {
8284	//     "$ref": "Object"
8285	//   },
8286	//   "scopes": [
8287	//     "https://www.googleapis.com/auth/cloud-platform",
8288	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8289	//     "https://www.googleapis.com/auth/devstorage.full_control",
8290	//     "https://www.googleapis.com/auth/devstorage.read_only",
8291	//     "https://www.googleapis.com/auth/devstorage.read_write"
8292	//   ],
8293	//   "supportsMediaDownload": true,
8294	//   "useMediaDownloadService": true
8295	// }
8296
8297}
8298
8299// method id "storage.objects.getIamPolicy":
8300
8301type ObjectsGetIamPolicyCall struct {
8302	s            *Service
8303	bucket       string
8304	object       string
8305	urlParams_   gensupport.URLParams
8306	ifNoneMatch_ string
8307	ctx_         context.Context
8308	header_      http.Header
8309}
8310
8311// GetIamPolicy: Returns an IAM policy for the specified object.
8312func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall {
8313	c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8314	c.bucket = bucket
8315	c.object = object
8316	return c
8317}
8318
8319// Generation sets the optional parameter "generation": If present,
8320// selects a specific revision of this object (as opposed to the latest
8321// version, the default).
8322func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall {
8323	c.urlParams_.Set("generation", fmt.Sprint(generation))
8324	return c
8325}
8326
8327// UserProject sets the optional parameter "userProject": The project to
8328// be billed for this request, for Requester Pays buckets.
8329func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
8330	c.urlParams_.Set("userProject", userProject)
8331	return c
8332}
8333
8334// Fields allows partial responses to be retrieved. See
8335// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8336// for more information.
8337func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall {
8338	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8339	return c
8340}
8341
8342// IfNoneMatch sets the optional parameter which makes the operation
8343// fail if the object's ETag matches the given value. This is useful for
8344// getting updates only after the object has changed since the last
8345// request. Use googleapi.IsNotModified to check whether the response
8346// error from Do is the result of In-None-Match.
8347func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall {
8348	c.ifNoneMatch_ = entityTag
8349	return c
8350}
8351
8352// Context sets the context to be used in this call's Do method. Any
8353// pending HTTP request will be aborted if the provided context is
8354// canceled.
8355func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
8356	c.ctx_ = ctx
8357	return c
8358}
8359
8360// Header returns an http.Header that can be modified by the caller to
8361// add HTTP headers to the request.
8362func (c *ObjectsGetIamPolicyCall) Header() http.Header {
8363	if c.header_ == nil {
8364		c.header_ = make(http.Header)
8365	}
8366	return c.header_
8367}
8368
8369func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
8370	reqHeaders := make(http.Header)
8371	for k, v := range c.header_ {
8372		reqHeaders[k] = v
8373	}
8374	reqHeaders.Set("User-Agent", c.s.userAgent())
8375	if c.ifNoneMatch_ != "" {
8376		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8377	}
8378	var body io.Reader = nil
8379	c.urlParams_.Set("alt", alt)
8380	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
8381	urls += "?" + c.urlParams_.Encode()
8382	req, _ := http.NewRequest("GET", urls, body)
8383	req.Header = reqHeaders
8384	googleapi.Expand(req.URL, map[string]string{
8385		"bucket": c.bucket,
8386		"object": c.object,
8387	})
8388	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8389}
8390
8391// Do executes the "storage.objects.getIamPolicy" call.
8392// Exactly one of *Policy or error will be non-nil. Any non-2xx status
8393// code is an error. Response headers are in either
8394// *Policy.ServerResponse.Header or (if a response was returned at all)
8395// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8396// check whether the returned error was because http.StatusNotModified
8397// was returned.
8398func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
8399	gensupport.SetOptions(c.urlParams_, opts...)
8400	res, err := c.doRequest("json")
8401	if res != nil && res.StatusCode == http.StatusNotModified {
8402		if res.Body != nil {
8403			res.Body.Close()
8404		}
8405		return nil, &googleapi.Error{
8406			Code:   res.StatusCode,
8407			Header: res.Header,
8408		}
8409	}
8410	if err != nil {
8411		return nil, err
8412	}
8413	defer googleapi.CloseBody(res)
8414	if err := googleapi.CheckResponse(res); err != nil {
8415		return nil, err
8416	}
8417	ret := &Policy{
8418		ServerResponse: googleapi.ServerResponse{
8419			Header:         res.Header,
8420			HTTPStatusCode: res.StatusCode,
8421		},
8422	}
8423	target := &ret
8424	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
8425		return nil, err
8426	}
8427	return ret, nil
8428	// {
8429	//   "description": "Returns an IAM policy for the specified object.",
8430	//   "httpMethod": "GET",
8431	//   "id": "storage.objects.getIamPolicy",
8432	//   "parameterOrder": [
8433	//     "bucket",
8434	//     "object"
8435	//   ],
8436	//   "parameters": {
8437	//     "bucket": {
8438	//       "description": "Name of the bucket in which the object resides.",
8439	//       "location": "path",
8440	//       "required": true,
8441	//       "type": "string"
8442	//     },
8443	//     "generation": {
8444	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8445	//       "format": "int64",
8446	//       "location": "query",
8447	//       "type": "string"
8448	//     },
8449	//     "object": {
8450	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8451	//       "location": "path",
8452	//       "required": true,
8453	//       "type": "string"
8454	//     },
8455	//     "userProject": {
8456	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
8457	//       "location": "query",
8458	//       "type": "string"
8459	//     }
8460	//   },
8461	//   "path": "b/{bucket}/o/{object}/iam",
8462	//   "response": {
8463	//     "$ref": "Policy"
8464	//   },
8465	//   "scopes": [
8466	//     "https://www.googleapis.com/auth/cloud-platform",
8467	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8468	//     "https://www.googleapis.com/auth/devstorage.full_control",
8469	//     "https://www.googleapis.com/auth/devstorage.read_only",
8470	//     "https://www.googleapis.com/auth/devstorage.read_write"
8471	//   ]
8472	// }
8473
8474}
8475
8476// method id "storage.objects.insert":
8477
8478type ObjectsInsertCall struct {
8479	s                *Service
8480	bucket           string
8481	object           *Object
8482	urlParams_       gensupport.URLParams
8483	media_           io.Reader
8484	mediaBuffer_     *gensupport.MediaBuffer
8485	mediaType_       string
8486	mediaSize_       int64 // mediaSize, if known.  Used only for calls to progressUpdater_.
8487	progressUpdater_ googleapi.ProgressUpdater
8488	ctx_             context.Context
8489	header_          http.Header
8490}
8491
8492// Insert: Stores a new object and metadata.
8493func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
8494	c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8495	c.bucket = bucket
8496	c.object = object
8497	return c
8498}
8499
8500// ContentEncoding sets the optional parameter "contentEncoding": If
8501// set, sets the contentEncoding property of the final object to this
8502// value. Setting this parameter is equivalent to setting the
8503// contentEncoding metadata property. This can be useful when uploading
8504// an object with uploadType=media to indicate the encoding of the
8505// content being uploaded.
8506func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall {
8507	c.urlParams_.Set("contentEncoding", contentEncoding)
8508	return c
8509}
8510
8511// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8512// Makes the operation conditional on whether the object's current
8513// generation matches the given value. Setting to 0 makes the operation
8514// succeed only if there are no live versions of the object.
8515func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
8516	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8517	return c
8518}
8519
8520// IfGenerationNotMatch sets the optional parameter
8521// "ifGenerationNotMatch": Makes the operation conditional on whether
8522// the object's current generation does not match the given value. If no
8523// live object exists, the precondition fails. Setting to 0 makes the
8524// operation succeed only if there is a live version of the object.
8525func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
8526	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
8527	return c
8528}
8529
8530// IfMetagenerationMatch sets the optional parameter
8531// "ifMetagenerationMatch": Makes the operation conditional on whether
8532// the object's current metageneration matches the given value.
8533func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall {
8534	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8535	return c
8536}
8537
8538// IfMetagenerationNotMatch sets the optional parameter
8539// "ifMetagenerationNotMatch": Makes the operation conditional on
8540// whether the object's current metageneration does not match the given
8541// value.
8542func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
8543	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8544	return c
8545}
8546
8547// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
8548// the Cloud KMS key, of the form
8549// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
8550//  that will be used to encrypt the object. Overrides the object
8551// metadata's kms_key_name value, if any.
8552func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall {
8553	c.urlParams_.Set("kmsKeyName", kmsKeyName)
8554	return c
8555}
8556
8557// Name sets the optional parameter "name": Name of the object. Required
8558// when the object metadata is not otherwise provided. Overrides the
8559// object metadata's name value, if any. For information about how to
8560// URL encode object names to be path safe, see Encoding URI Path Parts.
8561func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
8562	c.urlParams_.Set("name", name)
8563	return c
8564}
8565
8566// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
8567// predefined set of access controls to this object.
8568//
8569// Possible values:
8570//   "authenticatedRead" - Object owner gets OWNER access, and
8571// allAuthenticatedUsers get READER access.
8572//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
8573// project team owners get OWNER access.
8574//   "bucketOwnerRead" - Object owner gets OWNER access, and project
8575// team owners get READER access.
8576//   "private" - Object owner gets OWNER access.
8577//   "projectPrivate" - Object owner gets OWNER access, and project team
8578// members get access according to their roles.
8579//   "publicRead" - Object owner gets OWNER access, and allUsers get
8580// READER access.
8581func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
8582	c.urlParams_.Set("predefinedAcl", predefinedAcl)
8583	return c
8584}
8585
8586// Projection sets the optional parameter "projection": Set of
8587// properties to return. Defaults to noAcl, unless the object resource
8588// specifies the acl property, when it defaults to full.
8589//
8590// Possible values:
8591//   "full" - Include all properties.
8592//   "noAcl" - Omit the owner, acl property.
8593func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
8594	c.urlParams_.Set("projection", projection)
8595	return c
8596}
8597
8598// UserProject sets the optional parameter "userProject": The project to
8599// be billed for this request, for Requester Pays buckets.
8600func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
8601	c.urlParams_.Set("userProject", userProject)
8602	return c
8603}
8604
8605// Media specifies the media to upload in one or more chunks. The chunk
8606// size may be controlled by supplying a MediaOption generated by
8607// googleapi.ChunkSize. The chunk size defaults to
8608// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
8609// upload request will be determined by sniffing the contents of r,
8610// unless a MediaOption generated by googleapi.ContentType is
8611// supplied.
8612// At most one of Media and ResumableMedia may be set.
8613func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
8614	if ct := c.object.ContentType; ct != "" {
8615		options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
8616	}
8617	opts := googleapi.ProcessMediaOptions(options)
8618	chunkSize := opts.ChunkSize
8619	if !opts.ForceEmptyContentType {
8620		r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
8621	}
8622	c.media_, c.mediaBuffer_ = gensupport.PrepareUpload(r, chunkSize)
8623	return c
8624}
8625
8626// ResumableMedia specifies the media to upload in chunks and can be
8627// canceled with ctx.
8628//
8629// Deprecated: use Media instead.
8630//
8631// At most one of Media and ResumableMedia may be set. mediaType
8632// identifies the MIME media type of the upload, such as "image/png". If
8633// mediaType is "", it will be auto-detected. The provided ctx will
8634// supersede any context previously provided to the Context method.
8635func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
8636	c.ctx_ = ctx
8637	rdr := gensupport.ReaderAtToReader(r, size)
8638	rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
8639	c.mediaBuffer_ = gensupport.NewMediaBuffer(rdr, googleapi.DefaultUploadChunkSize)
8640	c.media_ = nil
8641	c.mediaSize_ = size
8642	return c
8643}
8644
8645// ProgressUpdater provides a callback function that will be called
8646// after every chunk. It should be a low-latency function in order to
8647// not slow down the upload operation. This should only be called when
8648// using ResumableMedia (as opposed to Media).
8649func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
8650	c.progressUpdater_ = pu
8651	return c
8652}
8653
8654// Fields allows partial responses to be retrieved. See
8655// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8656// for more information.
8657func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
8658	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8659	return c
8660}
8661
8662// Context sets the context to be used in this call's Do method. Any
8663// pending HTTP request will be aborted if the provided context is
8664// canceled.
8665// This context will supersede any context previously provided to the
8666// ResumableMedia method.
8667func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
8668	c.ctx_ = ctx
8669	return c
8670}
8671
8672// Header returns an http.Header that can be modified by the caller to
8673// add HTTP headers to the request.
8674func (c *ObjectsInsertCall) Header() http.Header {
8675	if c.header_ == nil {
8676		c.header_ = make(http.Header)
8677	}
8678	return c.header_
8679}
8680
8681func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
8682	reqHeaders := make(http.Header)
8683	for k, v := range c.header_ {
8684		reqHeaders[k] = v
8685	}
8686	reqHeaders.Set("User-Agent", c.s.userAgent())
8687	var body io.Reader = nil
8688	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
8689	if err != nil {
8690		return nil, err
8691	}
8692	reqHeaders.Set("Content-Type", "application/json")
8693	c.urlParams_.Set("alt", alt)
8694	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
8695	if c.media_ != nil || c.mediaBuffer_ != nil {
8696		urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
8697		protocol := "multipart"
8698		if c.mediaBuffer_ != nil {
8699			protocol = "resumable"
8700		}
8701		c.urlParams_.Set("uploadType", protocol)
8702	}
8703	if body == nil {
8704		body = new(bytes.Buffer)
8705		reqHeaders.Set("Content-Type", "application/json")
8706	}
8707	if c.media_ != nil {
8708		combined, ctype := gensupport.CombineBodyMedia(body, "application/json", c.media_, c.mediaType_)
8709		defer combined.Close()
8710		reqHeaders.Set("Content-Type", ctype)
8711		body = combined
8712	}
8713	if c.mediaBuffer_ != nil && c.mediaType_ != "" {
8714		reqHeaders.Set("X-Upload-Content-Type", c.mediaType_)
8715	}
8716	urls += "?" + c.urlParams_.Encode()
8717	req, _ := http.NewRequest("POST", urls, body)
8718	req.Header = reqHeaders
8719	googleapi.Expand(req.URL, map[string]string{
8720		"bucket": c.bucket,
8721	})
8722	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8723}
8724
8725// Do executes the "storage.objects.insert" call.
8726// Exactly one of *Object or error will be non-nil. Any non-2xx status
8727// code is an error. Response headers are in either
8728// *Object.ServerResponse.Header or (if a response was returned at all)
8729// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8730// check whether the returned error was because http.StatusNotModified
8731// was returned.
8732func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8733	gensupport.SetOptions(c.urlParams_, opts...)
8734	res, err := c.doRequest("json")
8735	if res != nil && res.StatusCode == http.StatusNotModified {
8736		if res.Body != nil {
8737			res.Body.Close()
8738		}
8739		return nil, &googleapi.Error{
8740			Code:   res.StatusCode,
8741			Header: res.Header,
8742		}
8743	}
8744	if err != nil {
8745		return nil, err
8746	}
8747	defer googleapi.CloseBody(res)
8748	if err := googleapi.CheckResponse(res); err != nil {
8749		return nil, err
8750	}
8751	if c.mediaBuffer_ != nil {
8752		loc := res.Header.Get("Location")
8753		rx := &gensupport.ResumableUpload{
8754			Client:    c.s.client,
8755			UserAgent: c.s.userAgent(),
8756			URI:       loc,
8757			Media:     c.mediaBuffer_,
8758			MediaType: c.mediaType_,
8759			Callback: func(curr int64) {
8760				if c.progressUpdater_ != nil {
8761					c.progressUpdater_(curr, c.mediaSize_)
8762				}
8763			},
8764		}
8765		ctx := c.ctx_
8766		if ctx == nil {
8767			ctx = context.TODO()
8768		}
8769		res, err = rx.Upload(ctx)
8770		if err != nil {
8771			return nil, err
8772		}
8773		defer res.Body.Close()
8774		if err := googleapi.CheckResponse(res); err != nil {
8775			return nil, err
8776		}
8777	}
8778	ret := &Object{
8779		ServerResponse: googleapi.ServerResponse{
8780			Header:         res.Header,
8781			HTTPStatusCode: res.StatusCode,
8782		},
8783	}
8784	target := &ret
8785	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
8786		return nil, err
8787	}
8788	return ret, nil
8789	// {
8790	//   "description": "Stores a new object and metadata.",
8791	//   "httpMethod": "POST",
8792	//   "id": "storage.objects.insert",
8793	//   "mediaUpload": {
8794	//     "accept": [
8795	//       "*/*"
8796	//     ],
8797	//     "protocols": {
8798	//       "resumable": {
8799	//         "multipart": true,
8800	//         "path": "/resumable/upload/storage/v1/b/{bucket}/o"
8801	//       },
8802	//       "simple": {
8803	//         "multipart": true,
8804	//         "path": "/upload/storage/v1/b/{bucket}/o"
8805	//       }
8806	//     }
8807	//   },
8808	//   "parameterOrder": [
8809	//     "bucket"
8810	//   ],
8811	//   "parameters": {
8812	//     "bucket": {
8813	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
8814	//       "location": "path",
8815	//       "required": true,
8816	//       "type": "string"
8817	//     },
8818	//     "contentEncoding": {
8819	//       "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.",
8820	//       "location": "query",
8821	//       "type": "string"
8822	//     },
8823	//     "ifGenerationMatch": {
8824	//       "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.",
8825	//       "format": "int64",
8826	//       "location": "query",
8827	//       "type": "string"
8828	//     },
8829	//     "ifGenerationNotMatch": {
8830	//       "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.",
8831	//       "format": "int64",
8832	//       "location": "query",
8833	//       "type": "string"
8834	//     },
8835	//     "ifMetagenerationMatch": {
8836	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
8837	//       "format": "int64",
8838	//       "location": "query",
8839	//       "type": "string"
8840	//     },
8841	//     "ifMetagenerationNotMatch": {
8842	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
8843	//       "format": "int64",
8844	//       "location": "query",
8845	//       "type": "string"
8846	//     },
8847	//     "kmsKeyName": {
8848	//       "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.",
8849	//       "location": "query",
8850	//       "type": "string"
8851	//     },
8852	//     "name": {
8853	//       "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.",
8854	//       "location": "query",
8855	//       "type": "string"
8856	//     },
8857	//     "predefinedAcl": {
8858	//       "description": "Apply a predefined set of access controls to this object.",
8859	//       "enum": [
8860	//         "authenticatedRead",
8861	//         "bucketOwnerFullControl",
8862	//         "bucketOwnerRead",
8863	//         "private",
8864	//         "projectPrivate",
8865	//         "publicRead"
8866	//       ],
8867	//       "enumDescriptions": [
8868	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8869	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
8870	//         "Object owner gets OWNER access, and project team owners get READER access.",
8871	//         "Object owner gets OWNER access.",
8872	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
8873	//         "Object owner gets OWNER access, and allUsers get READER access."
8874	//       ],
8875	//       "location": "query",
8876	//       "type": "string"
8877	//     },
8878	//     "projection": {
8879	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
8880	//       "enum": [
8881	//         "full",
8882	//         "noAcl"
8883	//       ],
8884	//       "enumDescriptions": [
8885	//         "Include all properties.",
8886	//         "Omit the owner, acl property."
8887	//       ],
8888	//       "location": "query",
8889	//       "type": "string"
8890	//     },
8891	//     "userProject": {
8892	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
8893	//       "location": "query",
8894	//       "type": "string"
8895	//     }
8896	//   },
8897	//   "path": "b/{bucket}/o",
8898	//   "request": {
8899	//     "$ref": "Object"
8900	//   },
8901	//   "response": {
8902	//     "$ref": "Object"
8903	//   },
8904	//   "scopes": [
8905	//     "https://www.googleapis.com/auth/cloud-platform",
8906	//     "https://www.googleapis.com/auth/devstorage.full_control",
8907	//     "https://www.googleapis.com/auth/devstorage.read_write"
8908	//   ],
8909	//   "supportsMediaDownload": true,
8910	//   "supportsMediaUpload": true,
8911	//   "useMediaDownloadService": true
8912	// }
8913
8914}
8915
8916// method id "storage.objects.list":
8917
8918type ObjectsListCall struct {
8919	s            *Service
8920	bucket       string
8921	urlParams_   gensupport.URLParams
8922	ifNoneMatch_ string
8923	ctx_         context.Context
8924	header_      http.Header
8925}
8926
8927// List: Retrieves a list of objects matching the criteria.
8928func (r *ObjectsService) List(bucket string) *ObjectsListCall {
8929	c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8930	c.bucket = bucket
8931	return c
8932}
8933
8934// Delimiter sets the optional parameter "delimiter": Returns results in
8935// a directory-like mode. items will contain only objects whose names,
8936// aside from the prefix, do not contain delimiter. Objects whose names,
8937// aside from the prefix, contain delimiter will have their name,
8938// truncated after the delimiter, returned in prefixes. Duplicate
8939// prefixes are omitted.
8940func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
8941	c.urlParams_.Set("delimiter", delimiter)
8942	return c
8943}
8944
8945// MaxResults sets the optional parameter "maxResults": Maximum number
8946// of items plus prefixes to return in a single page of responses. As
8947// duplicate prefixes are omitted, fewer total results may be returned
8948// than requested. The service will use this parameter or 1,000 items,
8949// whichever is smaller.
8950func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
8951	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
8952	return c
8953}
8954
8955// PageToken sets the optional parameter "pageToken": A
8956// previously-returned page token representing part of the larger set of
8957// results to view.
8958func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
8959	c.urlParams_.Set("pageToken", pageToken)
8960	return c
8961}
8962
8963// Prefix sets the optional parameter "prefix": Filter results to
8964// objects whose names begin with this prefix.
8965func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
8966	c.urlParams_.Set("prefix", prefix)
8967	return c
8968}
8969
8970// Projection sets the optional parameter "projection": Set of
8971// properties to return. Defaults to noAcl.
8972//
8973// Possible values:
8974//   "full" - Include all properties.
8975//   "noAcl" - Omit the owner, acl property.
8976func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
8977	c.urlParams_.Set("projection", projection)
8978	return c
8979}
8980
8981// UserProject sets the optional parameter "userProject": The project to
8982// be billed for this request, for Requester Pays buckets.
8983func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
8984	c.urlParams_.Set("userProject", userProject)
8985	return c
8986}
8987
8988// Versions sets the optional parameter "versions": If true, lists all
8989// versions of an object as distinct results. The default is false. For
8990// more information, see Object Versioning.
8991func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
8992	c.urlParams_.Set("versions", fmt.Sprint(versions))
8993	return c
8994}
8995
8996// Fields allows partial responses to be retrieved. See
8997// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8998// for more information.
8999func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
9000	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9001	return c
9002}
9003
9004// IfNoneMatch sets the optional parameter which makes the operation
9005// fail if the object's ETag matches the given value. This is useful for
9006// getting updates only after the object has changed since the last
9007// request. Use googleapi.IsNotModified to check whether the response
9008// error from Do is the result of In-None-Match.
9009func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
9010	c.ifNoneMatch_ = entityTag
9011	return c
9012}
9013
9014// Context sets the context to be used in this call's Do method. Any
9015// pending HTTP request will be aborted if the provided context is
9016// canceled.
9017func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
9018	c.ctx_ = ctx
9019	return c
9020}
9021
9022// Header returns an http.Header that can be modified by the caller to
9023// add HTTP headers to the request.
9024func (c *ObjectsListCall) Header() http.Header {
9025	if c.header_ == nil {
9026		c.header_ = make(http.Header)
9027	}
9028	return c.header_
9029}
9030
9031func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
9032	reqHeaders := make(http.Header)
9033	for k, v := range c.header_ {
9034		reqHeaders[k] = v
9035	}
9036	reqHeaders.Set("User-Agent", c.s.userAgent())
9037	if c.ifNoneMatch_ != "" {
9038		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9039	}
9040	var body io.Reader = nil
9041	c.urlParams_.Set("alt", alt)
9042	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
9043	urls += "?" + c.urlParams_.Encode()
9044	req, _ := http.NewRequest("GET", urls, body)
9045	req.Header = reqHeaders
9046	googleapi.Expand(req.URL, map[string]string{
9047		"bucket": c.bucket,
9048	})
9049	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9050}
9051
9052// Do executes the "storage.objects.list" call.
9053// Exactly one of *Objects or error will be non-nil. Any non-2xx status
9054// code is an error. Response headers are in either
9055// *Objects.ServerResponse.Header or (if a response was returned at all)
9056// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9057// check whether the returned error was because http.StatusNotModified
9058// was returned.
9059func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
9060	gensupport.SetOptions(c.urlParams_, opts...)
9061	res, err := c.doRequest("json")
9062	if res != nil && res.StatusCode == http.StatusNotModified {
9063		if res.Body != nil {
9064			res.Body.Close()
9065		}
9066		return nil, &googleapi.Error{
9067			Code:   res.StatusCode,
9068			Header: res.Header,
9069		}
9070	}
9071	if err != nil {
9072		return nil, err
9073	}
9074	defer googleapi.CloseBody(res)
9075	if err := googleapi.CheckResponse(res); err != nil {
9076		return nil, err
9077	}
9078	ret := &Objects{
9079		ServerResponse: googleapi.ServerResponse{
9080			Header:         res.Header,
9081			HTTPStatusCode: res.StatusCode,
9082		},
9083	}
9084	target := &ret
9085	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
9086		return nil, err
9087	}
9088	return ret, nil
9089	// {
9090	//   "description": "Retrieves a list of objects matching the criteria.",
9091	//   "httpMethod": "GET",
9092	//   "id": "storage.objects.list",
9093	//   "parameterOrder": [
9094	//     "bucket"
9095	//   ],
9096	//   "parameters": {
9097	//     "bucket": {
9098	//       "description": "Name of the bucket in which to look for objects.",
9099	//       "location": "path",
9100	//       "required": true,
9101	//       "type": "string"
9102	//     },
9103	//     "delimiter": {
9104	//       "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.",
9105	//       "location": "query",
9106	//       "type": "string"
9107	//     },
9108	//     "maxResults": {
9109	//       "default": "1000",
9110	//       "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.",
9111	//       "format": "uint32",
9112	//       "location": "query",
9113	//       "minimum": "0",
9114	//       "type": "integer"
9115	//     },
9116	//     "pageToken": {
9117	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
9118	//       "location": "query",
9119	//       "type": "string"
9120	//     },
9121	//     "prefix": {
9122	//       "description": "Filter results to objects whose names begin with this prefix.",
9123	//       "location": "query",
9124	//       "type": "string"
9125	//     },
9126	//     "projection": {
9127	//       "description": "Set of properties to return. Defaults to noAcl.",
9128	//       "enum": [
9129	//         "full",
9130	//         "noAcl"
9131	//       ],
9132	//       "enumDescriptions": [
9133	//         "Include all properties.",
9134	//         "Omit the owner, acl property."
9135	//       ],
9136	//       "location": "query",
9137	//       "type": "string"
9138	//     },
9139	//     "userProject": {
9140	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
9141	//       "location": "query",
9142	//       "type": "string"
9143	//     },
9144	//     "versions": {
9145	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
9146	//       "location": "query",
9147	//       "type": "boolean"
9148	//     }
9149	//   },
9150	//   "path": "b/{bucket}/o",
9151	//   "response": {
9152	//     "$ref": "Objects"
9153	//   },
9154	//   "scopes": [
9155	//     "https://www.googleapis.com/auth/cloud-platform",
9156	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9157	//     "https://www.googleapis.com/auth/devstorage.full_control",
9158	//     "https://www.googleapis.com/auth/devstorage.read_only",
9159	//     "https://www.googleapis.com/auth/devstorage.read_write"
9160	//   ],
9161	//   "supportsSubscription": true
9162	// }
9163
9164}
9165
9166// Pages invokes f for each page of results.
9167// A non-nil error returned from f will halt the iteration.
9168// The provided context supersedes any context provided to the Context method.
9169func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
9170	c.ctx_ = ctx
9171	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9172	for {
9173		x, err := c.Do()
9174		if err != nil {
9175			return err
9176		}
9177		if err := f(x); err != nil {
9178			return err
9179		}
9180		if x.NextPageToken == "" {
9181			return nil
9182		}
9183		c.PageToken(x.NextPageToken)
9184	}
9185}
9186
9187// method id "storage.objects.patch":
9188
9189type ObjectsPatchCall struct {
9190	s          *Service
9191	bucket     string
9192	object     string
9193	object2    *Object
9194	urlParams_ gensupport.URLParams
9195	ctx_       context.Context
9196	header_    http.Header
9197}
9198
9199// Patch: Updates an object's metadata. This method supports patch
9200// semantics.
9201func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
9202	c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9203	c.bucket = bucket
9204	c.object = object
9205	c.object2 = object2
9206	return c
9207}
9208
9209// Generation sets the optional parameter "generation": If present,
9210// selects a specific revision of this object (as opposed to the latest
9211// version, the default).
9212func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
9213	c.urlParams_.Set("generation", fmt.Sprint(generation))
9214	return c
9215}
9216
9217// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9218// Makes the operation conditional on whether the object's current
9219// generation matches the given value. Setting to 0 makes the operation
9220// succeed only if there are no live versions of the object.
9221func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
9222	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9223	return c
9224}
9225
9226// IfGenerationNotMatch sets the optional parameter
9227// "ifGenerationNotMatch": Makes the operation conditional on whether
9228// the object's current generation does not match the given value. If no
9229// live object exists, the precondition fails. Setting to 0 makes the
9230// operation succeed only if there is a live version of the object.
9231func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
9232	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9233	return c
9234}
9235
9236// IfMetagenerationMatch sets the optional parameter
9237// "ifMetagenerationMatch": Makes the operation conditional on whether
9238// the object's current metageneration matches the given value.
9239func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall {
9240	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9241	return c
9242}
9243
9244// IfMetagenerationNotMatch sets the optional parameter
9245// "ifMetagenerationNotMatch": Makes the operation conditional on
9246// whether the object's current metageneration does not match the given
9247// value.
9248func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
9249	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9250	return c
9251}
9252
9253// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9254// predefined set of access controls to this object.
9255//
9256// Possible values:
9257//   "authenticatedRead" - Object owner gets OWNER access, and
9258// allAuthenticatedUsers get READER access.
9259//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
9260// project team owners get OWNER access.
9261//   "bucketOwnerRead" - Object owner gets OWNER access, and project
9262// team owners get READER access.
9263//   "private" - Object owner gets OWNER access.
9264//   "projectPrivate" - Object owner gets OWNER access, and project team
9265// members get access according to their roles.
9266//   "publicRead" - Object owner gets OWNER access, and allUsers get
9267// READER access.
9268func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
9269	c.urlParams_.Set("predefinedAcl", predefinedAcl)
9270	return c
9271}
9272
9273// Projection sets the optional parameter "projection": Set of
9274// properties to return. Defaults to full.
9275//
9276// Possible values:
9277//   "full" - Include all properties.
9278//   "noAcl" - Omit the owner, acl property.
9279func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
9280	c.urlParams_.Set("projection", projection)
9281	return c
9282}
9283
9284// UserProject sets the optional parameter "userProject": The project to
9285// be billed for this request, for Requester Pays buckets.
9286func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
9287	c.urlParams_.Set("userProject", userProject)
9288	return c
9289}
9290
9291// Fields allows partial responses to be retrieved. See
9292// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9293// for more information.
9294func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
9295	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9296	return c
9297}
9298
9299// Context sets the context to be used in this call's Do method. Any
9300// pending HTTP request will be aborted if the provided context is
9301// canceled.
9302func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
9303	c.ctx_ = ctx
9304	return c
9305}
9306
9307// Header returns an http.Header that can be modified by the caller to
9308// add HTTP headers to the request.
9309func (c *ObjectsPatchCall) Header() http.Header {
9310	if c.header_ == nil {
9311		c.header_ = make(http.Header)
9312	}
9313	return c.header_
9314}
9315
9316func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
9317	reqHeaders := make(http.Header)
9318	for k, v := range c.header_ {
9319		reqHeaders[k] = v
9320	}
9321	reqHeaders.Set("User-Agent", c.s.userAgent())
9322	var body io.Reader = nil
9323	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
9324	if err != nil {
9325		return nil, err
9326	}
9327	reqHeaders.Set("Content-Type", "application/json")
9328	c.urlParams_.Set("alt", alt)
9329	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9330	urls += "?" + c.urlParams_.Encode()
9331	req, _ := http.NewRequest("PATCH", urls, body)
9332	req.Header = reqHeaders
9333	googleapi.Expand(req.URL, map[string]string{
9334		"bucket": c.bucket,
9335		"object": c.object,
9336	})
9337	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9338}
9339
9340// Do executes the "storage.objects.patch" call.
9341// Exactly one of *Object or error will be non-nil. Any non-2xx status
9342// code is an error. Response headers are in either
9343// *Object.ServerResponse.Header or (if a response was returned at all)
9344// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9345// check whether the returned error was because http.StatusNotModified
9346// was returned.
9347func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
9348	gensupport.SetOptions(c.urlParams_, opts...)
9349	res, err := c.doRequest("json")
9350	if res != nil && res.StatusCode == http.StatusNotModified {
9351		if res.Body != nil {
9352			res.Body.Close()
9353		}
9354		return nil, &googleapi.Error{
9355			Code:   res.StatusCode,
9356			Header: res.Header,
9357		}
9358	}
9359	if err != nil {
9360		return nil, err
9361	}
9362	defer googleapi.CloseBody(res)
9363	if err := googleapi.CheckResponse(res); err != nil {
9364		return nil, err
9365	}
9366	ret := &Object{
9367		ServerResponse: googleapi.ServerResponse{
9368			Header:         res.Header,
9369			HTTPStatusCode: res.StatusCode,
9370		},
9371	}
9372	target := &ret
9373	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
9374		return nil, err
9375	}
9376	return ret, nil
9377	// {
9378	//   "description": "Updates an object's metadata. This method supports patch semantics.",
9379	//   "httpMethod": "PATCH",
9380	//   "id": "storage.objects.patch",
9381	//   "parameterOrder": [
9382	//     "bucket",
9383	//     "object"
9384	//   ],
9385	//   "parameters": {
9386	//     "bucket": {
9387	//       "description": "Name of the bucket in which the object resides.",
9388	//       "location": "path",
9389	//       "required": true,
9390	//       "type": "string"
9391	//     },
9392	//     "generation": {
9393	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9394	//       "format": "int64",
9395	//       "location": "query",
9396	//       "type": "string"
9397	//     },
9398	//     "ifGenerationMatch": {
9399	//       "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.",
9400	//       "format": "int64",
9401	//       "location": "query",
9402	//       "type": "string"
9403	//     },
9404	//     "ifGenerationNotMatch": {
9405	//       "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.",
9406	//       "format": "int64",
9407	//       "location": "query",
9408	//       "type": "string"
9409	//     },
9410	//     "ifMetagenerationMatch": {
9411	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9412	//       "format": "int64",
9413	//       "location": "query",
9414	//       "type": "string"
9415	//     },
9416	//     "ifMetagenerationNotMatch": {
9417	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9418	//       "format": "int64",
9419	//       "location": "query",
9420	//       "type": "string"
9421	//     },
9422	//     "object": {
9423	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9424	//       "location": "path",
9425	//       "required": true,
9426	//       "type": "string"
9427	//     },
9428	//     "predefinedAcl": {
9429	//       "description": "Apply a predefined set of access controls to this object.",
9430	//       "enum": [
9431	//         "authenticatedRead",
9432	//         "bucketOwnerFullControl",
9433	//         "bucketOwnerRead",
9434	//         "private",
9435	//         "projectPrivate",
9436	//         "publicRead"
9437	//       ],
9438	//       "enumDescriptions": [
9439	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
9440	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
9441	//         "Object owner gets OWNER access, and project team owners get READER access.",
9442	//         "Object owner gets OWNER access.",
9443	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
9444	//         "Object owner gets OWNER access, and allUsers get READER access."
9445	//       ],
9446	//       "location": "query",
9447	//       "type": "string"
9448	//     },
9449	//     "projection": {
9450	//       "description": "Set of properties to return. Defaults to full.",
9451	//       "enum": [
9452	//         "full",
9453	//         "noAcl"
9454	//       ],
9455	//       "enumDescriptions": [
9456	//         "Include all properties.",
9457	//         "Omit the owner, acl property."
9458	//       ],
9459	//       "location": "query",
9460	//       "type": "string"
9461	//     },
9462	//     "userProject": {
9463	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
9464	//       "location": "query",
9465	//       "type": "string"
9466	//     }
9467	//   },
9468	//   "path": "b/{bucket}/o/{object}",
9469	//   "request": {
9470	//     "$ref": "Object"
9471	//   },
9472	//   "response": {
9473	//     "$ref": "Object"
9474	//   },
9475	//   "scopes": [
9476	//     "https://www.googleapis.com/auth/cloud-platform",
9477	//     "https://www.googleapis.com/auth/devstorage.full_control"
9478	//   ]
9479	// }
9480
9481}
9482
9483// method id "storage.objects.rewrite":
9484
9485type ObjectsRewriteCall struct {
9486	s                 *Service
9487	sourceBucket      string
9488	sourceObject      string
9489	destinationBucket string
9490	destinationObject string
9491	object            *Object
9492	urlParams_        gensupport.URLParams
9493	ctx_              context.Context
9494	header_           http.Header
9495}
9496
9497// Rewrite: Rewrites a source object to a destination object. Optionally
9498// overrides metadata.
9499func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall {
9500	c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9501	c.sourceBucket = sourceBucket
9502	c.sourceObject = sourceObject
9503	c.destinationBucket = destinationBucket
9504	c.destinationObject = destinationObject
9505	c.object = object
9506	return c
9507}
9508
9509// DestinationKmsKeyName sets the optional parameter
9510// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the
9511// form
9512// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
9513//  that will be used to encrypt the object. Overrides the object
9514// metadata's kms_key_name value, if any.
9515func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall {
9516	c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
9517	return c
9518}
9519
9520// DestinationPredefinedAcl sets the optional parameter
9521// "destinationPredefinedAcl": Apply a predefined set of access controls
9522// to the destination object.
9523//
9524// Possible values:
9525//   "authenticatedRead" - Object owner gets OWNER access, and
9526// allAuthenticatedUsers get READER access.
9527//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
9528// project team owners get OWNER access.
9529//   "bucketOwnerRead" - Object owner gets OWNER access, and project
9530// team owners get READER access.
9531//   "private" - Object owner gets OWNER access.
9532//   "projectPrivate" - Object owner gets OWNER access, and project team
9533// members get access according to their roles.
9534//   "publicRead" - Object owner gets OWNER access, and allUsers get
9535// READER access.
9536func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
9537	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
9538	return c
9539}
9540
9541// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9542// Makes the operation conditional on whether the object's current
9543// generation matches the given value. Setting to 0 makes the operation
9544// succeed only if there are no live versions of the object.
9545func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
9546	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9547	return c
9548}
9549
9550// IfGenerationNotMatch sets the optional parameter
9551// "ifGenerationNotMatch": Makes the operation conditional on whether
9552// the object's current generation does not match the given value. If no
9553// live object exists, the precondition fails. Setting to 0 makes the
9554// operation succeed only if there is a live version of the object.
9555func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
9556	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9557	return c
9558}
9559
9560// IfMetagenerationMatch sets the optional parameter
9561// "ifMetagenerationMatch": Makes the operation conditional on whether
9562// the destination object's current metageneration matches the given
9563// value.
9564func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
9565	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9566	return c
9567}
9568
9569// IfMetagenerationNotMatch sets the optional parameter
9570// "ifMetagenerationNotMatch": Makes the operation conditional on
9571// whether the destination object's current metageneration does not
9572// match the given value.
9573func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall {
9574	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9575	return c
9576}
9577
9578// IfSourceGenerationMatch sets the optional parameter
9579// "ifSourceGenerationMatch": Makes the operation conditional on whether
9580// the source object's current generation matches the given value.
9581func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
9582	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
9583	return c
9584}
9585
9586// IfSourceGenerationNotMatch sets the optional parameter
9587// "ifSourceGenerationNotMatch": Makes the operation conditional on
9588// whether the source object's current generation does not match the
9589// given value.
9590func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
9591	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
9592	return c
9593}
9594
9595// IfSourceMetagenerationMatch sets the optional parameter
9596// "ifSourceMetagenerationMatch": Makes the operation conditional on
9597// whether the source object's current metageneration matches the given
9598// value.
9599func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
9600	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
9601	return c
9602}
9603
9604// IfSourceMetagenerationNotMatch sets the optional parameter
9605// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
9606// whether the source object's current metageneration does not match the
9607// given value.
9608func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
9609	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
9610	return c
9611}
9612
9613// MaxBytesRewrittenPerCall sets the optional parameter
9614// "maxBytesRewrittenPerCall": The maximum number of bytes that will be
9615// rewritten per rewrite request. Most callers shouldn't need to specify
9616// this parameter - it is primarily in place to support testing. If
9617// specified the value must be an integral multiple of 1 MiB (1048576).
9618// Also, this only applies to requests where the source and destination
9619// span locations and/or storage classes. Finally, this value must not
9620// change across rewrite calls else you'll get an error that the
9621// rewriteToken is invalid.
9622func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall {
9623	c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall))
9624	return c
9625}
9626
9627// Projection sets the optional parameter "projection": Set of
9628// properties to return. Defaults to noAcl, unless the object resource
9629// specifies the acl property, when it defaults to full.
9630//
9631// Possible values:
9632//   "full" - Include all properties.
9633//   "noAcl" - Omit the owner, acl property.
9634func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall {
9635	c.urlParams_.Set("projection", projection)
9636	return c
9637}
9638
9639// RewriteToken sets the optional parameter "rewriteToken": Include this
9640// field (from the previous rewrite response) on each rewrite request
9641// after the first one, until the rewrite response 'done' flag is true.
9642// Calls that provide a rewriteToken can omit all other request fields,
9643// but if included those fields must match the values provided in the
9644// first rewrite request.
9645func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall {
9646	c.urlParams_.Set("rewriteToken", rewriteToken)
9647	return c
9648}
9649
9650// SourceGeneration sets the optional parameter "sourceGeneration": If
9651// present, selects a specific revision of the source object (as opposed
9652// to the latest version, the default).
9653func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall {
9654	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
9655	return c
9656}
9657
9658// UserProject sets the optional parameter "userProject": The project to
9659// be billed for this request, for Requester Pays buckets.
9660func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
9661	c.urlParams_.Set("userProject", userProject)
9662	return c
9663}
9664
9665// Fields allows partial responses to be retrieved. See
9666// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9667// for more information.
9668func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall {
9669	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9670	return c
9671}
9672
9673// Context sets the context to be used in this call's Do method. Any
9674// pending HTTP request will be aborted if the provided context is
9675// canceled.
9676func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
9677	c.ctx_ = ctx
9678	return c
9679}
9680
9681// Header returns an http.Header that can be modified by the caller to
9682// add HTTP headers to the request.
9683func (c *ObjectsRewriteCall) Header() http.Header {
9684	if c.header_ == nil {
9685		c.header_ = make(http.Header)
9686	}
9687	return c.header_
9688}
9689
9690func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
9691	reqHeaders := make(http.Header)
9692	for k, v := range c.header_ {
9693		reqHeaders[k] = v
9694	}
9695	reqHeaders.Set("User-Agent", c.s.userAgent())
9696	var body io.Reader = nil
9697	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
9698	if err != nil {
9699		return nil, err
9700	}
9701	reqHeaders.Set("Content-Type", "application/json")
9702	c.urlParams_.Set("alt", alt)
9703	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}")
9704	urls += "?" + c.urlParams_.Encode()
9705	req, _ := http.NewRequest("POST", urls, body)
9706	req.Header = reqHeaders
9707	googleapi.Expand(req.URL, map[string]string{
9708		"sourceBucket":      c.sourceBucket,
9709		"sourceObject":      c.sourceObject,
9710		"destinationBucket": c.destinationBucket,
9711		"destinationObject": c.destinationObject,
9712	})
9713	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9714}
9715
9716// Do executes the "storage.objects.rewrite" call.
9717// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx
9718// status code is an error. Response headers are in either
9719// *RewriteResponse.ServerResponse.Header or (if a response was returned
9720// at all) in error.(*googleapi.Error).Header. Use
9721// googleapi.IsNotModified to check whether the returned error was
9722// because http.StatusNotModified was returned.
9723func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) {
9724	gensupport.SetOptions(c.urlParams_, opts...)
9725	res, err := c.doRequest("json")
9726	if res != nil && res.StatusCode == http.StatusNotModified {
9727		if res.Body != nil {
9728			res.Body.Close()
9729		}
9730		return nil, &googleapi.Error{
9731			Code:   res.StatusCode,
9732			Header: res.Header,
9733		}
9734	}
9735	if err != nil {
9736		return nil, err
9737	}
9738	defer googleapi.CloseBody(res)
9739	if err := googleapi.CheckResponse(res); err != nil {
9740		return nil, err
9741	}
9742	ret := &RewriteResponse{
9743		ServerResponse: googleapi.ServerResponse{
9744			Header:         res.Header,
9745			HTTPStatusCode: res.StatusCode,
9746		},
9747	}
9748	target := &ret
9749	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
9750		return nil, err
9751	}
9752	return ret, nil
9753	// {
9754	//   "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
9755	//   "httpMethod": "POST",
9756	//   "id": "storage.objects.rewrite",
9757	//   "parameterOrder": [
9758	//     "sourceBucket",
9759	//     "sourceObject",
9760	//     "destinationBucket",
9761	//     "destinationObject"
9762	//   ],
9763	//   "parameters": {
9764	//     "destinationBucket": {
9765	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
9766	//       "location": "path",
9767	//       "required": true,
9768	//       "type": "string"
9769	//     },
9770	//     "destinationKmsKeyName": {
9771	//       "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.",
9772	//       "location": "query",
9773	//       "type": "string"
9774	//     },
9775	//     "destinationObject": {
9776	//       "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.",
9777	//       "location": "path",
9778	//       "required": true,
9779	//       "type": "string"
9780	//     },
9781	//     "destinationPredefinedAcl": {
9782	//       "description": "Apply a predefined set of access controls to the destination object.",
9783	//       "enum": [
9784	//         "authenticatedRead",
9785	//         "bucketOwnerFullControl",
9786	//         "bucketOwnerRead",
9787	//         "private",
9788	//         "projectPrivate",
9789	//         "publicRead"
9790	//       ],
9791	//       "enumDescriptions": [
9792	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
9793	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
9794	//         "Object owner gets OWNER access, and project team owners get READER access.",
9795	//         "Object owner gets OWNER access.",
9796	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
9797	//         "Object owner gets OWNER access, and allUsers get READER access."
9798	//       ],
9799	//       "location": "query",
9800	//       "type": "string"
9801	//     },
9802	//     "ifGenerationMatch": {
9803	//       "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.",
9804	//       "format": "int64",
9805	//       "location": "query",
9806	//       "type": "string"
9807	//     },
9808	//     "ifGenerationNotMatch": {
9809	//       "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.",
9810	//       "format": "int64",
9811	//       "location": "query",
9812	//       "type": "string"
9813	//     },
9814	//     "ifMetagenerationMatch": {
9815	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
9816	//       "format": "int64",
9817	//       "location": "query",
9818	//       "type": "string"
9819	//     },
9820	//     "ifMetagenerationNotMatch": {
9821	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
9822	//       "format": "int64",
9823	//       "location": "query",
9824	//       "type": "string"
9825	//     },
9826	//     "ifSourceGenerationMatch": {
9827	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
9828	//       "format": "int64",
9829	//       "location": "query",
9830	//       "type": "string"
9831	//     },
9832	//     "ifSourceGenerationNotMatch": {
9833	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
9834	//       "format": "int64",
9835	//       "location": "query",
9836	//       "type": "string"
9837	//     },
9838	//     "ifSourceMetagenerationMatch": {
9839	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
9840	//       "format": "int64",
9841	//       "location": "query",
9842	//       "type": "string"
9843	//     },
9844	//     "ifSourceMetagenerationNotMatch": {
9845	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
9846	//       "format": "int64",
9847	//       "location": "query",
9848	//       "type": "string"
9849	//     },
9850	//     "maxBytesRewrittenPerCall": {
9851	//       "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.",
9852	//       "format": "int64",
9853	//       "location": "query",
9854	//       "type": "string"
9855	//     },
9856	//     "projection": {
9857	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
9858	//       "enum": [
9859	//         "full",
9860	//         "noAcl"
9861	//       ],
9862	//       "enumDescriptions": [
9863	//         "Include all properties.",
9864	//         "Omit the owner, acl property."
9865	//       ],
9866	//       "location": "query",
9867	//       "type": "string"
9868	//     },
9869	//     "rewriteToken": {
9870	//       "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.",
9871	//       "location": "query",
9872	//       "type": "string"
9873	//     },
9874	//     "sourceBucket": {
9875	//       "description": "Name of the bucket in which to find the source object.",
9876	//       "location": "path",
9877	//       "required": true,
9878	//       "type": "string"
9879	//     },
9880	//     "sourceGeneration": {
9881	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
9882	//       "format": "int64",
9883	//       "location": "query",
9884	//       "type": "string"
9885	//     },
9886	//     "sourceObject": {
9887	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9888	//       "location": "path",
9889	//       "required": true,
9890	//       "type": "string"
9891	//     },
9892	//     "userProject": {
9893	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
9894	//       "location": "query",
9895	//       "type": "string"
9896	//     }
9897	//   },
9898	//   "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
9899	//   "request": {
9900	//     "$ref": "Object"
9901	//   },
9902	//   "response": {
9903	//     "$ref": "RewriteResponse"
9904	//   },
9905	//   "scopes": [
9906	//     "https://www.googleapis.com/auth/cloud-platform",
9907	//     "https://www.googleapis.com/auth/devstorage.full_control",
9908	//     "https://www.googleapis.com/auth/devstorage.read_write"
9909	//   ]
9910	// }
9911
9912}
9913
9914// method id "storage.objects.setIamPolicy":
9915
9916type ObjectsSetIamPolicyCall struct {
9917	s          *Service
9918	bucket     string
9919	object     string
9920	policy     *Policy
9921	urlParams_ gensupport.URLParams
9922	ctx_       context.Context
9923	header_    http.Header
9924}
9925
9926// SetIamPolicy: Updates an IAM policy for the specified object.
9927func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall {
9928	c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9929	c.bucket = bucket
9930	c.object = object
9931	c.policy = policy
9932	return c
9933}
9934
9935// Generation sets the optional parameter "generation": If present,
9936// selects a specific revision of this object (as opposed to the latest
9937// version, the default).
9938func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall {
9939	c.urlParams_.Set("generation", fmt.Sprint(generation))
9940	return c
9941}
9942
9943// UserProject sets the optional parameter "userProject": The project to
9944// be billed for this request, for Requester Pays buckets.
9945func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
9946	c.urlParams_.Set("userProject", userProject)
9947	return c
9948}
9949
9950// Fields allows partial responses to be retrieved. See
9951// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9952// for more information.
9953func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall {
9954	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9955	return c
9956}
9957
9958// Context sets the context to be used in this call's Do method. Any
9959// pending HTTP request will be aborted if the provided context is
9960// canceled.
9961func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
9962	c.ctx_ = ctx
9963	return c
9964}
9965
9966// Header returns an http.Header that can be modified by the caller to
9967// add HTTP headers to the request.
9968func (c *ObjectsSetIamPolicyCall) Header() http.Header {
9969	if c.header_ == nil {
9970		c.header_ = make(http.Header)
9971	}
9972	return c.header_
9973}
9974
9975func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9976	reqHeaders := make(http.Header)
9977	for k, v := range c.header_ {
9978		reqHeaders[k] = v
9979	}
9980	reqHeaders.Set("User-Agent", c.s.userAgent())
9981	var body io.Reader = nil
9982	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
9983	if err != nil {
9984		return nil, err
9985	}
9986	reqHeaders.Set("Content-Type", "application/json")
9987	c.urlParams_.Set("alt", alt)
9988	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
9989	urls += "?" + c.urlParams_.Encode()
9990	req, _ := http.NewRequest("PUT", urls, body)
9991	req.Header = reqHeaders
9992	googleapi.Expand(req.URL, map[string]string{
9993		"bucket": c.bucket,
9994		"object": c.object,
9995	})
9996	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9997}
9998
9999// Do executes the "storage.objects.setIamPolicy" call.
10000// Exactly one of *Policy or error will be non-nil. Any non-2xx status
10001// code is an error. Response headers are in either
10002// *Policy.ServerResponse.Header or (if a response was returned at all)
10003// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10004// check whether the returned error was because http.StatusNotModified
10005// was returned.
10006func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
10007	gensupport.SetOptions(c.urlParams_, opts...)
10008	res, err := c.doRequest("json")
10009	if res != nil && res.StatusCode == http.StatusNotModified {
10010		if res.Body != nil {
10011			res.Body.Close()
10012		}
10013		return nil, &googleapi.Error{
10014			Code:   res.StatusCode,
10015			Header: res.Header,
10016		}
10017	}
10018	if err != nil {
10019		return nil, err
10020	}
10021	defer googleapi.CloseBody(res)
10022	if err := googleapi.CheckResponse(res); err != nil {
10023		return nil, err
10024	}
10025	ret := &Policy{
10026		ServerResponse: googleapi.ServerResponse{
10027			Header:         res.Header,
10028			HTTPStatusCode: res.StatusCode,
10029		},
10030	}
10031	target := &ret
10032	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
10033		return nil, err
10034	}
10035	return ret, nil
10036	// {
10037	//   "description": "Updates an IAM policy for the specified object.",
10038	//   "httpMethod": "PUT",
10039	//   "id": "storage.objects.setIamPolicy",
10040	//   "parameterOrder": [
10041	//     "bucket",
10042	//     "object"
10043	//   ],
10044	//   "parameters": {
10045	//     "bucket": {
10046	//       "description": "Name of the bucket in which the object resides.",
10047	//       "location": "path",
10048	//       "required": true,
10049	//       "type": "string"
10050	//     },
10051	//     "generation": {
10052	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10053	//       "format": "int64",
10054	//       "location": "query",
10055	//       "type": "string"
10056	//     },
10057	//     "object": {
10058	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10059	//       "location": "path",
10060	//       "required": true,
10061	//       "type": "string"
10062	//     },
10063	//     "userProject": {
10064	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
10065	//       "location": "query",
10066	//       "type": "string"
10067	//     }
10068	//   },
10069	//   "path": "b/{bucket}/o/{object}/iam",
10070	//   "request": {
10071	//     "$ref": "Policy"
10072	//   },
10073	//   "response": {
10074	//     "$ref": "Policy"
10075	//   },
10076	//   "scopes": [
10077	//     "https://www.googleapis.com/auth/cloud-platform",
10078	//     "https://www.googleapis.com/auth/devstorage.full_control",
10079	//     "https://www.googleapis.com/auth/devstorage.read_write"
10080	//   ]
10081	// }
10082
10083}
10084
10085// method id "storage.objects.testIamPermissions":
10086
10087type ObjectsTestIamPermissionsCall struct {
10088	s            *Service
10089	bucket       string
10090	object       string
10091	urlParams_   gensupport.URLParams
10092	ifNoneMatch_ string
10093	ctx_         context.Context
10094	header_      http.Header
10095}
10096
10097// TestIamPermissions: Tests a set of permissions on the given object to
10098// see which, if any, are held by the caller.
10099func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall {
10100	c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10101	c.bucket = bucket
10102	c.object = object
10103	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
10104	return c
10105}
10106
10107// Generation sets the optional parameter "generation": If present,
10108// selects a specific revision of this object (as opposed to the latest
10109// version, the default).
10110func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall {
10111	c.urlParams_.Set("generation", fmt.Sprint(generation))
10112	return c
10113}
10114
10115// UserProject sets the optional parameter "userProject": The project to
10116// be billed for this request, for Requester Pays buckets.
10117func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
10118	c.urlParams_.Set("userProject", userProject)
10119	return c
10120}
10121
10122// Fields allows partial responses to be retrieved. See
10123// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10124// for more information.
10125func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall {
10126	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10127	return c
10128}
10129
10130// IfNoneMatch sets the optional parameter which makes the operation
10131// fail if the object's ETag matches the given value. This is useful for
10132// getting updates only after the object has changed since the last
10133// request. Use googleapi.IsNotModified to check whether the response
10134// error from Do is the result of In-None-Match.
10135func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall {
10136	c.ifNoneMatch_ = entityTag
10137	return c
10138}
10139
10140// Context sets the context to be used in this call's Do method. Any
10141// pending HTTP request will be aborted if the provided context is
10142// canceled.
10143func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
10144	c.ctx_ = ctx
10145	return c
10146}
10147
10148// Header returns an http.Header that can be modified by the caller to
10149// add HTTP headers to the request.
10150func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
10151	if c.header_ == nil {
10152		c.header_ = make(http.Header)
10153	}
10154	return c.header_
10155}
10156
10157func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
10158	reqHeaders := make(http.Header)
10159	for k, v := range c.header_ {
10160		reqHeaders[k] = v
10161	}
10162	reqHeaders.Set("User-Agent", c.s.userAgent())
10163	if c.ifNoneMatch_ != "" {
10164		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10165	}
10166	var body io.Reader = nil
10167	c.urlParams_.Set("alt", alt)
10168	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions")
10169	urls += "?" + c.urlParams_.Encode()
10170	req, _ := http.NewRequest("GET", urls, body)
10171	req.Header = reqHeaders
10172	googleapi.Expand(req.URL, map[string]string{
10173		"bucket": c.bucket,
10174		"object": c.object,
10175	})
10176	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10177}
10178
10179// Do executes the "storage.objects.testIamPermissions" call.
10180// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
10181// Any non-2xx status code is an error. Response headers are in either
10182// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
10183// was returned at all) in error.(*googleapi.Error).Header. Use
10184// googleapi.IsNotModified to check whether the returned error was
10185// because http.StatusNotModified was returned.
10186func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
10187	gensupport.SetOptions(c.urlParams_, opts...)
10188	res, err := c.doRequest("json")
10189	if res != nil && res.StatusCode == http.StatusNotModified {
10190		if res.Body != nil {
10191			res.Body.Close()
10192		}
10193		return nil, &googleapi.Error{
10194			Code:   res.StatusCode,
10195			Header: res.Header,
10196		}
10197	}
10198	if err != nil {
10199		return nil, err
10200	}
10201	defer googleapi.CloseBody(res)
10202	if err := googleapi.CheckResponse(res); err != nil {
10203		return nil, err
10204	}
10205	ret := &TestIamPermissionsResponse{
10206		ServerResponse: googleapi.ServerResponse{
10207			Header:         res.Header,
10208			HTTPStatusCode: res.StatusCode,
10209		},
10210	}
10211	target := &ret
10212	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
10213		return nil, err
10214	}
10215	return ret, nil
10216	// {
10217	//   "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
10218	//   "httpMethod": "GET",
10219	//   "id": "storage.objects.testIamPermissions",
10220	//   "parameterOrder": [
10221	//     "bucket",
10222	//     "object",
10223	//     "permissions"
10224	//   ],
10225	//   "parameters": {
10226	//     "bucket": {
10227	//       "description": "Name of the bucket in which the object resides.",
10228	//       "location": "path",
10229	//       "required": true,
10230	//       "type": "string"
10231	//     },
10232	//     "generation": {
10233	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10234	//       "format": "int64",
10235	//       "location": "query",
10236	//       "type": "string"
10237	//     },
10238	//     "object": {
10239	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10240	//       "location": "path",
10241	//       "required": true,
10242	//       "type": "string"
10243	//     },
10244	//     "permissions": {
10245	//       "description": "Permissions to test.",
10246	//       "location": "query",
10247	//       "repeated": true,
10248	//       "required": true,
10249	//       "type": "string"
10250	//     },
10251	//     "userProject": {
10252	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
10253	//       "location": "query",
10254	//       "type": "string"
10255	//     }
10256	//   },
10257	//   "path": "b/{bucket}/o/{object}/iam/testPermissions",
10258	//   "response": {
10259	//     "$ref": "TestIamPermissionsResponse"
10260	//   },
10261	//   "scopes": [
10262	//     "https://www.googleapis.com/auth/cloud-platform",
10263	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10264	//     "https://www.googleapis.com/auth/devstorage.full_control",
10265	//     "https://www.googleapis.com/auth/devstorage.read_only",
10266	//     "https://www.googleapis.com/auth/devstorage.read_write"
10267	//   ]
10268	// }
10269
10270}
10271
10272// method id "storage.objects.update":
10273
10274type ObjectsUpdateCall struct {
10275	s          *Service
10276	bucket     string
10277	object     string
10278	object2    *Object
10279	urlParams_ gensupport.URLParams
10280	ctx_       context.Context
10281	header_    http.Header
10282}
10283
10284// Update: Updates an object's metadata.
10285func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
10286	c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10287	c.bucket = bucket
10288	c.object = object
10289	c.object2 = object2
10290	return c
10291}
10292
10293// Generation sets the optional parameter "generation": If present,
10294// selects a specific revision of this object (as opposed to the latest
10295// version, the default).
10296func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
10297	c.urlParams_.Set("generation", fmt.Sprint(generation))
10298	return c
10299}
10300
10301// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10302// Makes the operation conditional on whether the object's current
10303// generation matches the given value. Setting to 0 makes the operation
10304// succeed only if there are no live versions of the object.
10305func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
10306	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10307	return c
10308}
10309
10310// IfGenerationNotMatch sets the optional parameter
10311// "ifGenerationNotMatch": Makes the operation conditional on whether
10312// the object's current generation does not match the given value. If no
10313// live object exists, the precondition fails. Setting to 0 makes the
10314// operation succeed only if there is a live version of the object.
10315func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
10316	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10317	return c
10318}
10319
10320// IfMetagenerationMatch sets the optional parameter
10321// "ifMetagenerationMatch": Makes the operation conditional on whether
10322// the object's current metageneration matches the given value.
10323func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall {
10324	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10325	return c
10326}
10327
10328// IfMetagenerationNotMatch sets the optional parameter
10329// "ifMetagenerationNotMatch": Makes the operation conditional on
10330// whether the object's current metageneration does not match the given
10331// value.
10332func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
10333	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10334	return c
10335}
10336
10337// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
10338// predefined set of access controls to this object.
10339//
10340// Possible values:
10341//   "authenticatedRead" - Object owner gets OWNER access, and
10342// allAuthenticatedUsers get READER access.
10343//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
10344// project team owners get OWNER access.
10345//   "bucketOwnerRead" - Object owner gets OWNER access, and project
10346// team owners get READER access.
10347//   "private" - Object owner gets OWNER access.
10348//   "projectPrivate" - Object owner gets OWNER access, and project team
10349// members get access according to their roles.
10350//   "publicRead" - Object owner gets OWNER access, and allUsers get
10351// READER access.
10352func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
10353	c.urlParams_.Set("predefinedAcl", predefinedAcl)
10354	return c
10355}
10356
10357// Projection sets the optional parameter "projection": Set of
10358// properties to return. Defaults to full.
10359//
10360// Possible values:
10361//   "full" - Include all properties.
10362//   "noAcl" - Omit the owner, acl property.
10363func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
10364	c.urlParams_.Set("projection", projection)
10365	return c
10366}
10367
10368// UserProject sets the optional parameter "userProject": The project to
10369// be billed for this request, for Requester Pays buckets.
10370func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
10371	c.urlParams_.Set("userProject", userProject)
10372	return c
10373}
10374
10375// Fields allows partial responses to be retrieved. See
10376// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10377// for more information.
10378func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
10379	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10380	return c
10381}
10382
10383// Context sets the context to be used in this call's Do and Download
10384// methods. Any pending HTTP request will be aborted if the provided
10385// context is canceled.
10386func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
10387	c.ctx_ = ctx
10388	return c
10389}
10390
10391// Header returns an http.Header that can be modified by the caller to
10392// add HTTP headers to the request.
10393func (c *ObjectsUpdateCall) Header() http.Header {
10394	if c.header_ == nil {
10395		c.header_ = make(http.Header)
10396	}
10397	return c.header_
10398}
10399
10400func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
10401	reqHeaders := make(http.Header)
10402	for k, v := range c.header_ {
10403		reqHeaders[k] = v
10404	}
10405	reqHeaders.Set("User-Agent", c.s.userAgent())
10406	var body io.Reader = nil
10407	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
10408	if err != nil {
10409		return nil, err
10410	}
10411	reqHeaders.Set("Content-Type", "application/json")
10412	c.urlParams_.Set("alt", alt)
10413	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
10414	urls += "?" + c.urlParams_.Encode()
10415	req, _ := http.NewRequest("PUT", urls, body)
10416	req.Header = reqHeaders
10417	googleapi.Expand(req.URL, map[string]string{
10418		"bucket": c.bucket,
10419		"object": c.object,
10420	})
10421	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10422}
10423
10424// Download fetches the API endpoint's "media" value, instead of the normal
10425// API response value. If the returned error is nil, the Response is guaranteed to
10426// have a 2xx status code. Callers must close the Response.Body as usual.
10427func (c *ObjectsUpdateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
10428	gensupport.SetOptions(c.urlParams_, opts...)
10429	res, err := c.doRequest("media")
10430	if err != nil {
10431		return nil, err
10432	}
10433	if err := googleapi.CheckMediaResponse(res); err != nil {
10434		res.Body.Close()
10435		return nil, err
10436	}
10437	return res, nil
10438}
10439
10440// Do executes the "storage.objects.update" call.
10441// Exactly one of *Object or error will be non-nil. Any non-2xx status
10442// code is an error. Response headers are in either
10443// *Object.ServerResponse.Header or (if a response was returned at all)
10444// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10445// check whether the returned error was because http.StatusNotModified
10446// was returned.
10447func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
10448	gensupport.SetOptions(c.urlParams_, opts...)
10449	res, err := c.doRequest("json")
10450	if res != nil && res.StatusCode == http.StatusNotModified {
10451		if res.Body != nil {
10452			res.Body.Close()
10453		}
10454		return nil, &googleapi.Error{
10455			Code:   res.StatusCode,
10456			Header: res.Header,
10457		}
10458	}
10459	if err != nil {
10460		return nil, err
10461	}
10462	defer googleapi.CloseBody(res)
10463	if err := googleapi.CheckResponse(res); err != nil {
10464		return nil, err
10465	}
10466	ret := &Object{
10467		ServerResponse: googleapi.ServerResponse{
10468			Header:         res.Header,
10469			HTTPStatusCode: res.StatusCode,
10470		},
10471	}
10472	target := &ret
10473	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
10474		return nil, err
10475	}
10476	return ret, nil
10477	// {
10478	//   "description": "Updates an object's metadata.",
10479	//   "httpMethod": "PUT",
10480	//   "id": "storage.objects.update",
10481	//   "parameterOrder": [
10482	//     "bucket",
10483	//     "object"
10484	//   ],
10485	//   "parameters": {
10486	//     "bucket": {
10487	//       "description": "Name of the bucket in which the object resides.",
10488	//       "location": "path",
10489	//       "required": true,
10490	//       "type": "string"
10491	//     },
10492	//     "generation": {
10493	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10494	//       "format": "int64",
10495	//       "location": "query",
10496	//       "type": "string"
10497	//     },
10498	//     "ifGenerationMatch": {
10499	//       "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.",
10500	//       "format": "int64",
10501	//       "location": "query",
10502	//       "type": "string"
10503	//     },
10504	//     "ifGenerationNotMatch": {
10505	//       "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.",
10506	//       "format": "int64",
10507	//       "location": "query",
10508	//       "type": "string"
10509	//     },
10510	//     "ifMetagenerationMatch": {
10511	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10512	//       "format": "int64",
10513	//       "location": "query",
10514	//       "type": "string"
10515	//     },
10516	//     "ifMetagenerationNotMatch": {
10517	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10518	//       "format": "int64",
10519	//       "location": "query",
10520	//       "type": "string"
10521	//     },
10522	//     "object": {
10523	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10524	//       "location": "path",
10525	//       "required": true,
10526	//       "type": "string"
10527	//     },
10528	//     "predefinedAcl": {
10529	//       "description": "Apply a predefined set of access controls to this object.",
10530	//       "enum": [
10531	//         "authenticatedRead",
10532	//         "bucketOwnerFullControl",
10533	//         "bucketOwnerRead",
10534	//         "private",
10535	//         "projectPrivate",
10536	//         "publicRead"
10537	//       ],
10538	//       "enumDescriptions": [
10539	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10540	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
10541	//         "Object owner gets OWNER access, and project team owners get READER access.",
10542	//         "Object owner gets OWNER access.",
10543	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
10544	//         "Object owner gets OWNER access, and allUsers get READER access."
10545	//       ],
10546	//       "location": "query",
10547	//       "type": "string"
10548	//     },
10549	//     "projection": {
10550	//       "description": "Set of properties to return. Defaults to full.",
10551	//       "enum": [
10552	//         "full",
10553	//         "noAcl"
10554	//       ],
10555	//       "enumDescriptions": [
10556	//         "Include all properties.",
10557	//         "Omit the owner, acl property."
10558	//       ],
10559	//       "location": "query",
10560	//       "type": "string"
10561	//     },
10562	//     "userProject": {
10563	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
10564	//       "location": "query",
10565	//       "type": "string"
10566	//     }
10567	//   },
10568	//   "path": "b/{bucket}/o/{object}",
10569	//   "request": {
10570	//     "$ref": "Object"
10571	//   },
10572	//   "response": {
10573	//     "$ref": "Object"
10574	//   },
10575	//   "scopes": [
10576	//     "https://www.googleapis.com/auth/cloud-platform",
10577	//     "https://www.googleapis.com/auth/devstorage.full_control"
10578	//   ],
10579	//   "supportsMediaDownload": true,
10580	//   "useMediaDownloadService": true
10581	// }
10582
10583}
10584
10585// method id "storage.objects.watchAll":
10586
10587type ObjectsWatchAllCall struct {
10588	s          *Service
10589	bucket     string
10590	channel    *Channel
10591	urlParams_ gensupport.URLParams
10592	ctx_       context.Context
10593	header_    http.Header
10594}
10595
10596// WatchAll: Watch for changes on all objects in a bucket.
10597func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
10598	c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10599	c.bucket = bucket
10600	c.channel = channel
10601	return c
10602}
10603
10604// Delimiter sets the optional parameter "delimiter": Returns results in
10605// a directory-like mode. items will contain only objects whose names,
10606// aside from the prefix, do not contain delimiter. Objects whose names,
10607// aside from the prefix, contain delimiter will have their name,
10608// truncated after the delimiter, returned in prefixes. Duplicate
10609// prefixes are omitted.
10610func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
10611	c.urlParams_.Set("delimiter", delimiter)
10612	return c
10613}
10614
10615// MaxResults sets the optional parameter "maxResults": Maximum number
10616// of items plus prefixes to return in a single page of responses. As
10617// duplicate prefixes are omitted, fewer total results may be returned
10618// than requested. The service will use this parameter or 1,000 items,
10619// whichever is smaller.
10620func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
10621	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
10622	return c
10623}
10624
10625// PageToken sets the optional parameter "pageToken": A
10626// previously-returned page token representing part of the larger set of
10627// results to view.
10628func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
10629	c.urlParams_.Set("pageToken", pageToken)
10630	return c
10631}
10632
10633// Prefix sets the optional parameter "prefix": Filter results to
10634// objects whose names begin with this prefix.
10635func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
10636	c.urlParams_.Set("prefix", prefix)
10637	return c
10638}
10639
10640// Projection sets the optional parameter "projection": Set of
10641// properties to return. Defaults to noAcl.
10642//
10643// Possible values:
10644//   "full" - Include all properties.
10645//   "noAcl" - Omit the owner, acl property.
10646func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
10647	c.urlParams_.Set("projection", projection)
10648	return c
10649}
10650
10651// UserProject sets the optional parameter "userProject": The project to
10652// be billed for this request, for Requester Pays buckets.
10653func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
10654	c.urlParams_.Set("userProject", userProject)
10655	return c
10656}
10657
10658// Versions sets the optional parameter "versions": If true, lists all
10659// versions of an object as distinct results. The default is false. For
10660// more information, see Object Versioning.
10661func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
10662	c.urlParams_.Set("versions", fmt.Sprint(versions))
10663	return c
10664}
10665
10666// Fields allows partial responses to be retrieved. See
10667// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10668// for more information.
10669func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
10670	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10671	return c
10672}
10673
10674// Context sets the context to be used in this call's Do method. Any
10675// pending HTTP request will be aborted if the provided context is
10676// canceled.
10677func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
10678	c.ctx_ = ctx
10679	return c
10680}
10681
10682// Header returns an http.Header that can be modified by the caller to
10683// add HTTP headers to the request.
10684func (c *ObjectsWatchAllCall) Header() http.Header {
10685	if c.header_ == nil {
10686		c.header_ = make(http.Header)
10687	}
10688	return c.header_
10689}
10690
10691func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
10692	reqHeaders := make(http.Header)
10693	for k, v := range c.header_ {
10694		reqHeaders[k] = v
10695	}
10696	reqHeaders.Set("User-Agent", c.s.userAgent())
10697	var body io.Reader = nil
10698	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
10699	if err != nil {
10700		return nil, err
10701	}
10702	reqHeaders.Set("Content-Type", "application/json")
10703	c.urlParams_.Set("alt", alt)
10704	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
10705	urls += "?" + c.urlParams_.Encode()
10706	req, _ := http.NewRequest("POST", urls, body)
10707	req.Header = reqHeaders
10708	googleapi.Expand(req.URL, map[string]string{
10709		"bucket": c.bucket,
10710	})
10711	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10712}
10713
10714// Do executes the "storage.objects.watchAll" call.
10715// Exactly one of *Channel or error will be non-nil. Any non-2xx status
10716// code is an error. Response headers are in either
10717// *Channel.ServerResponse.Header or (if a response was returned at all)
10718// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10719// check whether the returned error was because http.StatusNotModified
10720// was returned.
10721func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
10722	gensupport.SetOptions(c.urlParams_, opts...)
10723	res, err := c.doRequest("json")
10724	if res != nil && res.StatusCode == http.StatusNotModified {
10725		if res.Body != nil {
10726			res.Body.Close()
10727		}
10728		return nil, &googleapi.Error{
10729			Code:   res.StatusCode,
10730			Header: res.Header,
10731		}
10732	}
10733	if err != nil {
10734		return nil, err
10735	}
10736	defer googleapi.CloseBody(res)
10737	if err := googleapi.CheckResponse(res); err != nil {
10738		return nil, err
10739	}
10740	ret := &Channel{
10741		ServerResponse: googleapi.ServerResponse{
10742			Header:         res.Header,
10743			HTTPStatusCode: res.StatusCode,
10744		},
10745	}
10746	target := &ret
10747	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
10748		return nil, err
10749	}
10750	return ret, nil
10751	// {
10752	//   "description": "Watch for changes on all objects in a bucket.",
10753	//   "httpMethod": "POST",
10754	//   "id": "storage.objects.watchAll",
10755	//   "parameterOrder": [
10756	//     "bucket"
10757	//   ],
10758	//   "parameters": {
10759	//     "bucket": {
10760	//       "description": "Name of the bucket in which to look for objects.",
10761	//       "location": "path",
10762	//       "required": true,
10763	//       "type": "string"
10764	//     },
10765	//     "delimiter": {
10766	//       "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.",
10767	//       "location": "query",
10768	//       "type": "string"
10769	//     },
10770	//     "maxResults": {
10771	//       "default": "1000",
10772	//       "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.",
10773	//       "format": "uint32",
10774	//       "location": "query",
10775	//       "minimum": "0",
10776	//       "type": "integer"
10777	//     },
10778	//     "pageToken": {
10779	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
10780	//       "location": "query",
10781	//       "type": "string"
10782	//     },
10783	//     "prefix": {
10784	//       "description": "Filter results to objects whose names begin with this prefix.",
10785	//       "location": "query",
10786	//       "type": "string"
10787	//     },
10788	//     "projection": {
10789	//       "description": "Set of properties to return. Defaults to noAcl.",
10790	//       "enum": [
10791	//         "full",
10792	//         "noAcl"
10793	//       ],
10794	//       "enumDescriptions": [
10795	//         "Include all properties.",
10796	//         "Omit the owner, acl property."
10797	//       ],
10798	//       "location": "query",
10799	//       "type": "string"
10800	//     },
10801	//     "userProject": {
10802	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
10803	//       "location": "query",
10804	//       "type": "string"
10805	//     },
10806	//     "versions": {
10807	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
10808	//       "location": "query",
10809	//       "type": "boolean"
10810	//     }
10811	//   },
10812	//   "path": "b/{bucket}/o/watch",
10813	//   "request": {
10814	//     "$ref": "Channel",
10815	//     "parameterName": "resource"
10816	//   },
10817	//   "response": {
10818	//     "$ref": "Channel"
10819	//   },
10820	//   "scopes": [
10821	//     "https://www.googleapis.com/auth/cloud-platform",
10822	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10823	//     "https://www.googleapis.com/auth/devstorage.full_control",
10824	//     "https://www.googleapis.com/auth/devstorage.read_only",
10825	//     "https://www.googleapis.com/auth/devstorage.read_write"
10826	//   ],
10827	//   "supportsSubscription": true
10828	// }
10829
10830}
10831
10832// method id "storage.projects.serviceAccount.get":
10833
10834type ProjectsServiceAccountGetCall struct {
10835	s            *Service
10836	projectId    string
10837	urlParams_   gensupport.URLParams
10838	ifNoneMatch_ string
10839	ctx_         context.Context
10840	header_      http.Header
10841}
10842
10843// Get: Get the email address of this project's Google Cloud Storage
10844// service account.
10845func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
10846	c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10847	c.projectId = projectId
10848	return c
10849}
10850
10851// Fields allows partial responses to be retrieved. See
10852// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10853// for more information.
10854func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
10855	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10856	return c
10857}
10858
10859// IfNoneMatch sets the optional parameter which makes the operation
10860// fail if the object's ETag matches the given value. This is useful for
10861// getting updates only after the object has changed since the last
10862// request. Use googleapi.IsNotModified to check whether the response
10863// error from Do is the result of In-None-Match.
10864func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
10865	c.ifNoneMatch_ = entityTag
10866	return c
10867}
10868
10869// Context sets the context to be used in this call's Do method. Any
10870// pending HTTP request will be aborted if the provided context is
10871// canceled.
10872func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
10873	c.ctx_ = ctx
10874	return c
10875}
10876
10877// Header returns an http.Header that can be modified by the caller to
10878// add HTTP headers to the request.
10879func (c *ProjectsServiceAccountGetCall) Header() http.Header {
10880	if c.header_ == nil {
10881		c.header_ = make(http.Header)
10882	}
10883	return c.header_
10884}
10885
10886func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
10887	reqHeaders := make(http.Header)
10888	for k, v := range c.header_ {
10889		reqHeaders[k] = v
10890	}
10891	reqHeaders.Set("User-Agent", c.s.userAgent())
10892	if c.ifNoneMatch_ != "" {
10893		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10894	}
10895	var body io.Reader = nil
10896	c.urlParams_.Set("alt", alt)
10897	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
10898	urls += "?" + c.urlParams_.Encode()
10899	req, _ := http.NewRequest("GET", urls, body)
10900	req.Header = reqHeaders
10901	googleapi.Expand(req.URL, map[string]string{
10902		"projectId": c.projectId,
10903	})
10904	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10905}
10906
10907// Do executes the "storage.projects.serviceAccount.get" call.
10908// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
10909// status code is an error. Response headers are in either
10910// *ServiceAccount.ServerResponse.Header or (if a response was returned
10911// at all) in error.(*googleapi.Error).Header. Use
10912// googleapi.IsNotModified to check whether the returned error was
10913// because http.StatusNotModified was returned.
10914func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
10915	gensupport.SetOptions(c.urlParams_, opts...)
10916	res, err := c.doRequest("json")
10917	if res != nil && res.StatusCode == http.StatusNotModified {
10918		if res.Body != nil {
10919			res.Body.Close()
10920		}
10921		return nil, &googleapi.Error{
10922			Code:   res.StatusCode,
10923			Header: res.Header,
10924		}
10925	}
10926	if err != nil {
10927		return nil, err
10928	}
10929	defer googleapi.CloseBody(res)
10930	if err := googleapi.CheckResponse(res); err != nil {
10931		return nil, err
10932	}
10933	ret := &ServiceAccount{
10934		ServerResponse: googleapi.ServerResponse{
10935			Header:         res.Header,
10936			HTTPStatusCode: res.StatusCode,
10937		},
10938	}
10939	target := &ret
10940	if err := json.NewDecoder(res.Body).Decode(target); err != nil {
10941		return nil, err
10942	}
10943	return ret, nil
10944	// {
10945	//   "description": "Get the email address of this project's Google Cloud Storage service account.",
10946	//   "httpMethod": "GET",
10947	//   "id": "storage.projects.serviceAccount.get",
10948	//   "parameterOrder": [
10949	//     "projectId"
10950	//   ],
10951	//   "parameters": {
10952	//     "projectId": {
10953	//       "description": "Project ID",
10954	//       "location": "path",
10955	//       "required": true,
10956	//       "type": "string"
10957	//     }
10958	//   },
10959	//   "path": "projects/{projectId}/serviceAccount",
10960	//   "response": {
10961	//     "$ref": "ServiceAccount"
10962	//   },
10963	//   "scopes": [
10964	//     "https://www.googleapis.com/auth/cloud-platform",
10965	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10966	//     "https://www.googleapis.com/auth/devstorage.full_control",
10967	//     "https://www.googleapis.com/auth/devstorage.read_only",
10968	//     "https://www.googleapis.com/auth/devstorage.read_write"
10969	//   ]
10970	// }
10971
10972}
10973