1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package storage provides access to the Cloud Storage JSON API.
8//
9// This package is DEPRECATED. Use package cloud.google.com/go/storage instead.
10//
11// For product documentation, see: https://developers.google.com/storage/docs/json_api/
12//
13// Creating a client
14//
15// Usage example:
16//
17//   import "google.golang.org/api/storage/v1"
18//   ...
19//   ctx := context.Background()
20//   storageService, err := storage.NewService(ctx)
21//
22// In this example, Google Application Default Credentials are used for authentication.
23//
24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
25//
26// Other authentication options
27//
28// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
29//
30//   storageService, err := storage.NewService(ctx, option.WithScopes(storage.DevstorageReadWriteScope))
31//
32// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
33//
34//   storageService, err := storage.NewService(ctx, option.WithAPIKey("AIza..."))
35//
36// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
37//
38//   config := &oauth2.Config{...}
39//   // ...
40//   token, err := config.Exchange(ctx, ...)
41//   storageService, err := storage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
42//
43// See https://godoc.org/google.golang.org/api/option/ for details on options.
44package storage // import "google.golang.org/api/storage/v1"
45
46import (
47	"bytes"
48	"context"
49	"encoding/json"
50	"errors"
51	"fmt"
52	"io"
53	"net/http"
54	"net/url"
55	"strconv"
56	"strings"
57
58	gensupport "google.golang.org/api/gensupport"
59	googleapi "google.golang.org/api/googleapi"
60	option "google.golang.org/api/option"
61	htransport "google.golang.org/api/transport/http"
62)
63
64// Always reference these packages, just in case the auto-generated code
65// below doesn't.
66var _ = bytes.NewBuffer
67var _ = strconv.Itoa
68var _ = fmt.Sprintf
69var _ = json.NewDecoder
70var _ = io.Copy
71var _ = url.Parse
72var _ = gensupport.MarshalJSON
73var _ = googleapi.Version
74var _ = errors.New
75var _ = strings.Replace
76var _ = context.Canceled
77
78const apiId = "storage:v1"
79const apiName = "storage"
80const apiVersion = "v1"
81const basePath = "https://www.googleapis.com/storage/v1/"
82
83// OAuth2 scopes used by this API.
84const (
85	// View and manage your data across Google Cloud Platform services
86	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
87
88	// View your data across Google Cloud Platform services
89	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
90
91	// Manage your data and permissions in Google Cloud Storage
92	DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
93
94	// View your data in Google Cloud Storage
95	DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
96
97	// Manage your data in Google Cloud Storage
98	DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
99)
100
101// NewService creates a new Service.
102func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
103	scopesOption := option.WithScopes(
104		"https://www.googleapis.com/auth/cloud-platform",
105		"https://www.googleapis.com/auth/cloud-platform.read-only",
106		"https://www.googleapis.com/auth/devstorage.full_control",
107		"https://www.googleapis.com/auth/devstorage.read_only",
108		"https://www.googleapis.com/auth/devstorage.read_write",
109	)
110	// NOTE: prepend, so we don't override user-specified scopes.
111	opts = append([]option.ClientOption{scopesOption}, opts...)
112	client, endpoint, err := htransport.NewClient(ctx, opts...)
113	if err != nil {
114		return nil, err
115	}
116	s, err := New(client)
117	if err != nil {
118		return nil, err
119	}
120	if endpoint != "" {
121		s.BasePath = endpoint
122	}
123	return s, nil
124}
125
126// New creates a new Service. It uses the provided http.Client for requests.
127//
128// Deprecated: please use NewService instead.
129// To provide a custom HTTP client, use option.WithHTTPClient.
130// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
131func New(client *http.Client) (*Service, error) {
132	if client == nil {
133		return nil, errors.New("client is nil")
134	}
135	s := &Service{client: client, BasePath: basePath}
136	s.BucketAccessControls = NewBucketAccessControlsService(s)
137	s.Buckets = NewBucketsService(s)
138	s.Channels = NewChannelsService(s)
139	s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
140	s.Notifications = NewNotificationsService(s)
141	s.ObjectAccessControls = NewObjectAccessControlsService(s)
142	s.Objects = NewObjectsService(s)
143	s.Projects = NewProjectsService(s)
144	return s, nil
145}
146
147type Service struct {
148	client    *http.Client
149	BasePath  string // API endpoint base URL
150	UserAgent string // optional additional User-Agent fragment
151
152	BucketAccessControls *BucketAccessControlsService
153
154	Buckets *BucketsService
155
156	Channels *ChannelsService
157
158	DefaultObjectAccessControls *DefaultObjectAccessControlsService
159
160	Notifications *NotificationsService
161
162	ObjectAccessControls *ObjectAccessControlsService
163
164	Objects *ObjectsService
165
166	Projects *ProjectsService
167}
168
169func (s *Service) userAgent() string {
170	if s.UserAgent == "" {
171		return googleapi.UserAgent
172	}
173	return googleapi.UserAgent + " " + s.UserAgent
174}
175
176func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
177	rs := &BucketAccessControlsService{s: s}
178	return rs
179}
180
181type BucketAccessControlsService struct {
182	s *Service
183}
184
185func NewBucketsService(s *Service) *BucketsService {
186	rs := &BucketsService{s: s}
187	return rs
188}
189
190type BucketsService struct {
191	s *Service
192}
193
194func NewChannelsService(s *Service) *ChannelsService {
195	rs := &ChannelsService{s: s}
196	return rs
197}
198
199type ChannelsService struct {
200	s *Service
201}
202
203func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
204	rs := &DefaultObjectAccessControlsService{s: s}
205	return rs
206}
207
208type DefaultObjectAccessControlsService struct {
209	s *Service
210}
211
212func NewNotificationsService(s *Service) *NotificationsService {
213	rs := &NotificationsService{s: s}
214	return rs
215}
216
217type NotificationsService struct {
218	s *Service
219}
220
221func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
222	rs := &ObjectAccessControlsService{s: s}
223	return rs
224}
225
226type ObjectAccessControlsService struct {
227	s *Service
228}
229
230func NewObjectsService(s *Service) *ObjectsService {
231	rs := &ObjectsService{s: s}
232	return rs
233}
234
235type ObjectsService struct {
236	s *Service
237}
238
239func NewProjectsService(s *Service) *ProjectsService {
240	rs := &ProjectsService{s: s}
241	rs.HmacKeys = NewProjectsHmacKeysService(s)
242	rs.ServiceAccount = NewProjectsServiceAccountService(s)
243	return rs
244}
245
246type ProjectsService struct {
247	s *Service
248
249	HmacKeys *ProjectsHmacKeysService
250
251	ServiceAccount *ProjectsServiceAccountService
252}
253
254func NewProjectsHmacKeysService(s *Service) *ProjectsHmacKeysService {
255	rs := &ProjectsHmacKeysService{s: s}
256	return rs
257}
258
259type ProjectsHmacKeysService struct {
260	s *Service
261}
262
263func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
264	rs := &ProjectsServiceAccountService{s: s}
265	return rs
266}
267
268type ProjectsServiceAccountService struct {
269	s *Service
270}
271
272// Bucket: A bucket.
273type Bucket struct {
274	// Acl: Access controls on the bucket.
275	Acl []*BucketAccessControl `json:"acl,omitempty"`
276
277	// Billing: The bucket's billing configuration.
278	Billing *BucketBilling `json:"billing,omitempty"`
279
280	// Cors: The bucket's Cross-Origin Resource Sharing (CORS)
281	// configuration.
282	Cors []*BucketCors `json:"cors,omitempty"`
283
284	// DefaultEventBasedHold: The default value for event-based hold on
285	// newly created objects in this bucket. Event-based hold is a way to
286	// retain objects indefinitely until an event occurs, signified by the
287	// hold's release. After being released, such objects will be subject to
288	// bucket-level retention (if any). One sample use case of this flag is
289	// for banks to hold loan documents for at least 3 years after loan is
290	// paid in full. Here, bucket-level retention is 3 years and the event
291	// is loan being paid in full. In this example, these objects will be
292	// held intact for any number of years until the event has occurred
293	// (event-based hold on the object is released) and then 3 more years
294	// after that. That means retention duration of the objects begins from
295	// the moment event-based hold transitioned from true to false. Objects
296	// under event-based hold cannot be deleted, overwritten or archived
297	// until the hold is removed.
298	DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
299
300	// DefaultObjectAcl: Default access controls to apply to new objects
301	// when no ACL is provided.
302	DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
303
304	// Encryption: Encryption configuration for a bucket.
305	Encryption *BucketEncryption `json:"encryption,omitempty"`
306
307	// Etag: HTTP 1.1 Entity tag for the bucket.
308	Etag string `json:"etag,omitempty"`
309
310	// IamConfiguration: The bucket's IAM configuration.
311	IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"`
312
313	// Id: The ID of the bucket. For buckets, the id and name properties are
314	// the same.
315	Id string `json:"id,omitempty"`
316
317	// Kind: The kind of item this is. For buckets, this is always
318	// storage#bucket.
319	Kind string `json:"kind,omitempty"`
320
321	// Labels: User-provided labels, in key/value pairs.
322	Labels map[string]string `json:"labels,omitempty"`
323
324	// Lifecycle: The bucket's lifecycle configuration. See lifecycle
325	// management for more information.
326	Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
327
328	// Location: The location of the bucket. Object data for objects in the
329	// bucket resides in physical storage within this region. Defaults to
330	// US. See the developer's guide for the authoritative list.
331	Location string `json:"location,omitempty"`
332
333	// LocationType: The type of the bucket location.
334	LocationType string `json:"locationType,omitempty"`
335
336	// Logging: The bucket's logging configuration, which defines the
337	// destination bucket and optional name prefix for the current bucket's
338	// logs.
339	Logging *BucketLogging `json:"logging,omitempty"`
340
341	// Metageneration: The metadata generation of this bucket.
342	Metageneration int64 `json:"metageneration,omitempty,string"`
343
344	// Name: The name of the bucket.
345	Name string `json:"name,omitempty"`
346
347	// Owner: The owner of the bucket. This is always the project team's
348	// owner group.
349	Owner *BucketOwner `json:"owner,omitempty"`
350
351	// ProjectNumber: The project number of the project the bucket belongs
352	// to.
353	ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
354
355	// RetentionPolicy: The bucket's retention policy. The retention policy
356	// enforces a minimum retention time for all objects contained in the
357	// bucket, based on their creation time. Any attempt to overwrite or
358	// delete objects younger than the retention period will result in a
359	// PERMISSION_DENIED error. An unlocked retention policy can be modified
360	// or removed from the bucket via a storage.buckets.update operation. A
361	// locked retention policy cannot be removed or shortened in duration
362	// for the lifetime of the bucket. Attempting to remove or decrease
363	// period of a locked retention policy will result in a
364	// PERMISSION_DENIED error.
365	RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"`
366
367	// SelfLink: The URI of this bucket.
368	SelfLink string `json:"selfLink,omitempty"`
369
370	// StorageClass: The bucket's default storage class, used whenever no
371	// storageClass is specified for a newly-created object. This defines
372	// how objects in the bucket are stored and determines the SLA and the
373	// cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD,
374	// NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value
375	// is not specified when the bucket is created, it will default to
376	// STANDARD. For more information, see storage classes.
377	StorageClass string `json:"storageClass,omitempty"`
378
379	// TimeCreated: The creation time of the bucket in RFC 3339 format.
380	TimeCreated string `json:"timeCreated,omitempty"`
381
382	// Updated: The modification time of the bucket in RFC 3339 format.
383	Updated string `json:"updated,omitempty"`
384
385	// Versioning: The bucket's versioning configuration.
386	Versioning *BucketVersioning `json:"versioning,omitempty"`
387
388	// Website: The bucket's website configuration, controlling how the
389	// service behaves when accessing bucket contents as a web site. See the
390	// Static Website Examples for more information.
391	Website *BucketWebsite `json:"website,omitempty"`
392
393	// ServerResponse contains the HTTP response code and headers from the
394	// server.
395	googleapi.ServerResponse `json:"-"`
396
397	// ForceSendFields is a list of field names (e.g. "Acl") to
398	// unconditionally include in API requests. By default, fields with
399	// empty values are omitted from API requests. However, any non-pointer,
400	// non-interface field appearing in ForceSendFields will be sent to the
401	// server regardless of whether the field is empty or not. This may be
402	// used to include empty fields in Patch requests.
403	ForceSendFields []string `json:"-"`
404
405	// NullFields is a list of field names (e.g. "Acl") to include in API
406	// requests with the JSON null value. By default, fields with empty
407	// values are omitted from API requests. However, any field with an
408	// empty value appearing in NullFields will be sent to the server as
409	// null. It is an error if a field in this list has a non-empty value.
410	// This may be used to include null fields in Patch requests.
411	NullFields []string `json:"-"`
412}
413
414func (s *Bucket) MarshalJSON() ([]byte, error) {
415	type NoMethod Bucket
416	raw := NoMethod(*s)
417	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
418}
419
420// BucketBilling: The bucket's billing configuration.
421type BucketBilling struct {
422	// RequesterPays: When set to true, Requester Pays is enabled for this
423	// bucket.
424	RequesterPays bool `json:"requesterPays,omitempty"`
425
426	// ForceSendFields is a list of field names (e.g. "RequesterPays") to
427	// unconditionally include in API requests. By default, fields with
428	// empty values are omitted from API requests. However, any non-pointer,
429	// non-interface field appearing in ForceSendFields will be sent to the
430	// server regardless of whether the field is empty or not. This may be
431	// used to include empty fields in Patch requests.
432	ForceSendFields []string `json:"-"`
433
434	// NullFields is a list of field names (e.g. "RequesterPays") to include
435	// in API requests with the JSON null value. By default, fields with
436	// empty values are omitted from API requests. However, any field with
437	// an empty value appearing in NullFields will be sent to the server as
438	// null. It is an error if a field in this list has a non-empty value.
439	// This may be used to include null fields in Patch requests.
440	NullFields []string `json:"-"`
441}
442
443func (s *BucketBilling) MarshalJSON() ([]byte, error) {
444	type NoMethod BucketBilling
445	raw := NoMethod(*s)
446	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
447}
448
449type BucketCors struct {
450	// MaxAgeSeconds: The value, in seconds, to return in the
451	// Access-Control-Max-Age header used in preflight responses.
452	MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
453
454	// Method: The list of HTTP methods on which to include CORS response
455	// headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list
456	// of methods, and means "any method".
457	Method []string `json:"method,omitempty"`
458
459	// Origin: The list of Origins eligible to receive CORS response
460	// headers. Note: "*" is permitted in the list of origins, and means
461	// "any Origin".
462	Origin []string `json:"origin,omitempty"`
463
464	// ResponseHeader: The list of HTTP headers other than the simple
465	// response headers to give permission for the user-agent to share
466	// across domains.
467	ResponseHeader []string `json:"responseHeader,omitempty"`
468
469	// ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
470	// unconditionally include in API requests. By default, fields with
471	// empty values are omitted from API requests. However, any non-pointer,
472	// non-interface field appearing in ForceSendFields will be sent to the
473	// server regardless of whether the field is empty or not. This may be
474	// used to include empty fields in Patch requests.
475	ForceSendFields []string `json:"-"`
476
477	// NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
478	// in API requests with the JSON null value. By default, fields with
479	// empty values are omitted from API requests. However, any field with
480	// an empty value appearing in NullFields will be sent to the server as
481	// null. It is an error if a field in this list has a non-empty value.
482	// This may be used to include null fields in Patch requests.
483	NullFields []string `json:"-"`
484}
485
486func (s *BucketCors) MarshalJSON() ([]byte, error) {
487	type NoMethod BucketCors
488	raw := NoMethod(*s)
489	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
490}
491
492// BucketEncryption: Encryption configuration for a bucket.
493type BucketEncryption struct {
494	// DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt
495	// objects inserted into this bucket, if no encryption method is
496	// specified.
497	DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
498
499	// ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName")
500	// to unconditionally include in API requests. By default, fields with
501	// empty values are omitted from API requests. However, any non-pointer,
502	// non-interface field appearing in ForceSendFields will be sent to the
503	// server regardless of whether the field is empty or not. This may be
504	// used to include empty fields in Patch requests.
505	ForceSendFields []string `json:"-"`
506
507	// NullFields is a list of field names (e.g. "DefaultKmsKeyName") to
508	// include in API requests with the JSON null value. By default, fields
509	// with empty values are omitted from API requests. However, any field
510	// with an empty value appearing in NullFields will be sent to the
511	// server as null. It is an error if a field in this list has a
512	// non-empty value. This may be used to include null fields in Patch
513	// requests.
514	NullFields []string `json:"-"`
515}
516
517func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
518	type NoMethod BucketEncryption
519	raw := NoMethod(*s)
520	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
521}
522
523// BucketIamConfiguration: The bucket's IAM configuration.
524type BucketIamConfiguration struct {
525	// BucketPolicyOnly: The bucket's Bucket Policy Only configuration.
526	BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"`
527
528	// ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to
529	// unconditionally include in API requests. By default, fields with
530	// empty values are omitted from API requests. However, any non-pointer,
531	// non-interface field appearing in ForceSendFields will be sent to the
532	// server regardless of whether the field is empty or not. This may be
533	// used to include empty fields in Patch requests.
534	ForceSendFields []string `json:"-"`
535
536	// NullFields is a list of field names (e.g. "BucketPolicyOnly") to
537	// include in API requests with the JSON null value. By default, fields
538	// with empty values are omitted from API requests. However, any field
539	// with an empty value appearing in NullFields will be sent to the
540	// server as null. It is an error if a field in this list has a
541	// non-empty value. This may be used to include null fields in Patch
542	// requests.
543	NullFields []string `json:"-"`
544}
545
546func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) {
547	type NoMethod BucketIamConfiguration
548	raw := NoMethod(*s)
549	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
550}
551
552// BucketIamConfigurationBucketPolicyOnly: The bucket's Bucket Policy
553// Only configuration.
554type BucketIamConfigurationBucketPolicyOnly struct {
555	// Enabled: If set, access checks only use bucket-level IAM policies or
556	// above.
557	Enabled bool `json:"enabled,omitempty"`
558
559	// LockedTime: The deadline time for changing
560	// iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC
561	// 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed
562	// from true to false until the locked time, after which the field is
563	// immutable.
564	LockedTime string `json:"lockedTime,omitempty"`
565
566	// ForceSendFields is a list of field names (e.g. "Enabled") to
567	// unconditionally include in API requests. By default, fields with
568	// empty values are omitted from API requests. However, any non-pointer,
569	// non-interface field appearing in ForceSendFields will be sent to the
570	// server regardless of whether the field is empty or not. This may be
571	// used to include empty fields in Patch requests.
572	ForceSendFields []string `json:"-"`
573
574	// NullFields is a list of field names (e.g. "Enabled") to include in
575	// API requests with the JSON null value. By default, fields with empty
576	// values are omitted from API requests. However, any field with an
577	// empty value appearing in NullFields will be sent to the server as
578	// null. It is an error if a field in this list has a non-empty value.
579	// This may be used to include null fields in Patch requests.
580	NullFields []string `json:"-"`
581}
582
583func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) {
584	type NoMethod BucketIamConfigurationBucketPolicyOnly
585	raw := NoMethod(*s)
586	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
587}
588
589// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
590// management for more information.
591type BucketLifecycle struct {
592	// Rule: A lifecycle management rule, which is made of an action to take
593	// and the condition(s) under which the action will be taken.
594	Rule []*BucketLifecycleRule `json:"rule,omitempty"`
595
596	// ForceSendFields is a list of field names (e.g. "Rule") to
597	// unconditionally include in API requests. By default, fields with
598	// empty values are omitted from API requests. However, any non-pointer,
599	// non-interface field appearing in ForceSendFields will be sent to the
600	// server regardless of whether the field is empty or not. This may be
601	// used to include empty fields in Patch requests.
602	ForceSendFields []string `json:"-"`
603
604	// NullFields is a list of field names (e.g. "Rule") to include in API
605	// requests with the JSON null value. By default, fields with empty
606	// values are omitted from API requests. However, any field with an
607	// empty value appearing in NullFields will be sent to the server as
608	// null. It is an error if a field in this list has a non-empty value.
609	// This may be used to include null fields in Patch requests.
610	NullFields []string `json:"-"`
611}
612
613func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
614	type NoMethod BucketLifecycle
615	raw := NoMethod(*s)
616	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
617}
618
619type BucketLifecycleRule struct {
620	// Action: The action to take.
621	Action *BucketLifecycleRuleAction `json:"action,omitempty"`
622
623	// Condition: The condition(s) under which the action will be taken.
624	Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
625
626	// ForceSendFields is a list of field names (e.g. "Action") 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. "Action") to include in API
635	// 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 *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
644	type NoMethod BucketLifecycleRule
645	raw := NoMethod(*s)
646	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
647}
648
649// BucketLifecycleRuleAction: The action to take.
650type BucketLifecycleRuleAction struct {
651	// StorageClass: Target storage class. Required iff the type of the
652	// action is SetStorageClass.
653	StorageClass string `json:"storageClass,omitempty"`
654
655	// Type: Type of the action. Currently, only Delete and SetStorageClass
656	// are supported.
657	Type string `json:"type,omitempty"`
658
659	// ForceSendFields is a list of field names (e.g. "StorageClass") to
660	// unconditionally include in API requests. By default, fields with
661	// empty values are omitted from API requests. However, any non-pointer,
662	// non-interface field appearing in ForceSendFields will be sent to the
663	// server regardless of whether the field is empty or not. This may be
664	// used to include empty fields in Patch requests.
665	ForceSendFields []string `json:"-"`
666
667	// NullFields is a list of field names (e.g. "StorageClass") to include
668	// in API requests with the JSON null value. By default, fields with
669	// empty values are omitted from API requests. However, any field with
670	// an empty value appearing in NullFields will be sent to the server as
671	// null. It is an error if a field in this list has a non-empty value.
672	// This may be used to include null fields in Patch requests.
673	NullFields []string `json:"-"`
674}
675
676func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
677	type NoMethod BucketLifecycleRuleAction
678	raw := NoMethod(*s)
679	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
680}
681
682// BucketLifecycleRuleCondition: The condition(s) under which the action
683// will be taken.
684type BucketLifecycleRuleCondition struct {
685	// Age: Age of an object (in days). This condition is satisfied when an
686	// object reaches the specified age.
687	Age int64 `json:"age,omitempty"`
688
689	// CreatedBefore: A date in RFC 3339 format with only the date part (for
690	// instance, "2013-01-15"). This condition is satisfied when an object
691	// is created before midnight of the specified date in UTC.
692	CreatedBefore string `json:"createdBefore,omitempty"`
693
694	// IsLive: Relevant only for versioned objects. If the value is true,
695	// this condition matches live objects; if the value is false, it
696	// matches archived objects.
697	IsLive *bool `json:"isLive,omitempty"`
698
699	// MatchesPattern: A regular expression that satisfies the RE2 syntax.
700	// This condition is satisfied when the name of the object matches the
701	// RE2 pattern. Note: This feature is currently in the "Early Access"
702	// launch stage and is only available to a whitelisted set of users;
703	// that means that this feature may be changed in backward-incompatible
704	// ways and that it is not guaranteed to be released.
705	MatchesPattern string `json:"matchesPattern,omitempty"`
706
707	// MatchesStorageClass: Objects having any of the storage classes
708	// specified by this condition will be matched. Values include
709	// MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and
710	// DURABLE_REDUCED_AVAILABILITY.
711	MatchesStorageClass []string `json:"matchesStorageClass,omitempty"`
712
713	// NumNewerVersions: Relevant only for versioned objects. If the value
714	// is N, this condition is satisfied when there are at least N versions
715	// (including the live version) newer than this version of the object.
716	NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
717
718	// ForceSendFields is a list of field names (e.g. "Age") to
719	// unconditionally include in API requests. By default, fields with
720	// empty values are omitted from API requests. However, any non-pointer,
721	// non-interface field appearing in ForceSendFields will be sent to the
722	// server regardless of whether the field is empty or not. This may be
723	// used to include empty fields in Patch requests.
724	ForceSendFields []string `json:"-"`
725
726	// NullFields is a list of field names (e.g. "Age") to include in API
727	// requests with the JSON null value. By default, fields with empty
728	// values are omitted from API requests. However, any field with an
729	// empty value appearing in NullFields will be sent to the server as
730	// null. It is an error if a field in this list has a non-empty value.
731	// This may be used to include null fields in Patch requests.
732	NullFields []string `json:"-"`
733}
734
735func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
736	type NoMethod BucketLifecycleRuleCondition
737	raw := NoMethod(*s)
738	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
739}
740
741// BucketLogging: The bucket's logging configuration, which defines the
742// destination bucket and optional name prefix for the current bucket's
743// logs.
744type BucketLogging struct {
745	// LogBucket: The destination bucket where the current bucket's logs
746	// should be placed.
747	LogBucket string `json:"logBucket,omitempty"`
748
749	// LogObjectPrefix: A prefix for log object names.
750	LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
751
752	// ForceSendFields is a list of field names (e.g. "LogBucket") to
753	// unconditionally include in API requests. By default, fields with
754	// empty values are omitted from API requests. However, any non-pointer,
755	// non-interface field appearing in ForceSendFields will be sent to the
756	// server regardless of whether the field is empty or not. This may be
757	// used to include empty fields in Patch requests.
758	ForceSendFields []string `json:"-"`
759
760	// NullFields is a list of field names (e.g. "LogBucket") to include in
761	// API requests with the JSON null value. By default, fields with empty
762	// values are omitted from API requests. However, any field with an
763	// empty value appearing in NullFields will be sent to the server as
764	// null. It is an error if a field in this list has a non-empty value.
765	// This may be used to include null fields in Patch requests.
766	NullFields []string `json:"-"`
767}
768
769func (s *BucketLogging) MarshalJSON() ([]byte, error) {
770	type NoMethod BucketLogging
771	raw := NoMethod(*s)
772	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
773}
774
775// BucketOwner: The owner of the bucket. This is always the project
776// team's owner group.
777type BucketOwner struct {
778	// Entity: The entity, in the form project-owner-projectId.
779	Entity string `json:"entity,omitempty"`
780
781	// EntityId: The ID for the entity.
782	EntityId string `json:"entityId,omitempty"`
783
784	// ForceSendFields is a list of field names (e.g. "Entity") to
785	// unconditionally include in API requests. By default, fields with
786	// empty values are omitted from API requests. However, any non-pointer,
787	// non-interface field appearing in ForceSendFields will be sent to the
788	// server regardless of whether the field is empty or not. This may be
789	// used to include empty fields in Patch requests.
790	ForceSendFields []string `json:"-"`
791
792	// NullFields is a list of field names (e.g. "Entity") to include in API
793	// requests with the JSON null value. By default, fields with empty
794	// values are omitted from API requests. However, any field with an
795	// empty value appearing in NullFields will be sent to the server as
796	// null. It is an error if a field in this list has a non-empty value.
797	// This may be used to include null fields in Patch requests.
798	NullFields []string `json:"-"`
799}
800
801func (s *BucketOwner) MarshalJSON() ([]byte, error) {
802	type NoMethod BucketOwner
803	raw := NoMethod(*s)
804	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
805}
806
807// BucketRetentionPolicy: The bucket's retention policy. The retention
808// policy enforces a minimum retention time for all objects contained in
809// the bucket, based on their creation time. Any attempt to overwrite or
810// delete objects younger than the retention period will result in a
811// PERMISSION_DENIED error. An unlocked retention policy can be modified
812// or removed from the bucket via a storage.buckets.update operation. A
813// locked retention policy cannot be removed or shortened in duration
814// for the lifetime of the bucket. Attempting to remove or decrease
815// period of a locked retention policy will result in a
816// PERMISSION_DENIED error.
817type BucketRetentionPolicy struct {
818	// EffectiveTime: Server-determined value that indicates the time from
819	// which policy was enforced and effective. This value is in RFC 3339
820	// format.
821	EffectiveTime string `json:"effectiveTime,omitempty"`
822
823	// IsLocked: Once locked, an object retention policy cannot be modified.
824	IsLocked bool `json:"isLocked,omitempty"`
825
826	// RetentionPeriod: The duration in seconds that objects need to be
827	// retained. Retention duration must be greater than zero and less than
828	// 100 years. Note that enforcement of retention periods less than a day
829	// is not guaranteed. Such periods should only be used for testing
830	// purposes.
831	RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"`
832
833	// ForceSendFields is a list of field names (e.g. "EffectiveTime") to
834	// unconditionally include in API requests. By default, fields with
835	// empty values are omitted from API requests. However, any non-pointer,
836	// non-interface field appearing in ForceSendFields will be sent to the
837	// server regardless of whether the field is empty or not. This may be
838	// used to include empty fields in Patch requests.
839	ForceSendFields []string `json:"-"`
840
841	// NullFields is a list of field names (e.g. "EffectiveTime") to include
842	// in API requests with the JSON null value. By default, fields with
843	// empty values are omitted from API requests. However, any field with
844	// an empty value appearing in NullFields will be sent to the server as
845	// null. It is an error if a field in this list has a non-empty value.
846	// This may be used to include null fields in Patch requests.
847	NullFields []string `json:"-"`
848}
849
850func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) {
851	type NoMethod BucketRetentionPolicy
852	raw := NoMethod(*s)
853	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
854}
855
856// BucketVersioning: The bucket's versioning configuration.
857type BucketVersioning struct {
858	// Enabled: While set to true, versioning is fully enabled for this
859	// bucket.
860	Enabled bool `json:"enabled,omitempty"`
861
862	// ForceSendFields is a list of field names (e.g. "Enabled") to
863	// unconditionally include in API requests. By default, fields with
864	// empty values are omitted from API requests. However, any non-pointer,
865	// non-interface field appearing in ForceSendFields will be sent to the
866	// server regardless of whether the field is empty or not. This may be
867	// used to include empty fields in Patch requests.
868	ForceSendFields []string `json:"-"`
869
870	// NullFields is a list of field names (e.g. "Enabled") to include in
871	// API requests with the JSON null value. By default, fields with empty
872	// values are omitted from API requests. However, any field with an
873	// empty value appearing in NullFields will be sent to the server as
874	// null. It is an error if a field in this list has a non-empty value.
875	// This may be used to include null fields in Patch requests.
876	NullFields []string `json:"-"`
877}
878
879func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
880	type NoMethod BucketVersioning
881	raw := NoMethod(*s)
882	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
883}
884
885// BucketWebsite: The bucket's website configuration, controlling how
886// the service behaves when accessing bucket contents as a web site. See
887// the Static Website Examples for more information.
888type BucketWebsite struct {
889	// MainPageSuffix: If the requested object path is missing, the service
890	// will ensure the path has a trailing '/', append this suffix, and
891	// attempt to retrieve the resulting object. This allows the creation of
892	// index.html objects to represent directory pages.
893	MainPageSuffix string `json:"mainPageSuffix,omitempty"`
894
895	// NotFoundPage: If the requested object path is missing, and any
896	// mainPageSuffix object is missing, if applicable, the service will
897	// return the named object from this bucket as the content for a 404 Not
898	// Found result.
899	NotFoundPage string `json:"notFoundPage,omitempty"`
900
901	// ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
902	// unconditionally include in API requests. By default, fields with
903	// empty values are omitted from API requests. However, any non-pointer,
904	// non-interface field appearing in ForceSendFields will be sent to the
905	// server regardless of whether the field is empty or not. This may be
906	// used to include empty fields in Patch requests.
907	ForceSendFields []string `json:"-"`
908
909	// NullFields is a list of field names (e.g. "MainPageSuffix") to
910	// include in API requests with the JSON null value. By default, fields
911	// with empty values are omitted from API requests. However, any field
912	// with an empty value appearing in NullFields will be sent to the
913	// server as null. It is an error if a field in this list has a
914	// non-empty value. This may be used to include null fields in Patch
915	// requests.
916	NullFields []string `json:"-"`
917}
918
919func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
920	type NoMethod BucketWebsite
921	raw := NoMethod(*s)
922	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
923}
924
925// BucketAccessControl: An access-control entry.
926type BucketAccessControl struct {
927	// Bucket: The name of the bucket.
928	Bucket string `json:"bucket,omitempty"`
929
930	// Domain: The domain associated with the entity, if any.
931	Domain string `json:"domain,omitempty"`
932
933	// Email: The email address associated with the entity, if any.
934	Email string `json:"email,omitempty"`
935
936	// Entity: The entity holding the permission, in one of the following
937	// forms:
938	// - user-userId
939	// - user-email
940	// - group-groupId
941	// - group-email
942	// - domain-domain
943	// - project-team-projectId
944	// - allUsers
945	// - allAuthenticatedUsers Examples:
946	// - The user liz@example.com would be user-liz@example.com.
947	// - The group example@googlegroups.com would be
948	// group-example@googlegroups.com.
949	// - To refer to all members of the Google Apps for Business domain
950	// example.com, the entity would be domain-example.com.
951	Entity string `json:"entity,omitempty"`
952
953	// EntityId: The ID for the entity, if any.
954	EntityId string `json:"entityId,omitempty"`
955
956	// Etag: HTTP 1.1 Entity tag for the access-control entry.
957	Etag string `json:"etag,omitempty"`
958
959	// Id: The ID of the access-control entry.
960	Id string `json:"id,omitempty"`
961
962	// Kind: The kind of item this is. For bucket access control entries,
963	// this is always storage#bucketAccessControl.
964	Kind string `json:"kind,omitempty"`
965
966	// ProjectTeam: The project team associated with the entity, if any.
967	ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
968
969	// Role: The access permission for the entity.
970	Role string `json:"role,omitempty"`
971
972	// SelfLink: The link to this access-control entry.
973	SelfLink string `json:"selfLink,omitempty"`
974
975	// ServerResponse contains the HTTP response code and headers from the
976	// server.
977	googleapi.ServerResponse `json:"-"`
978
979	// ForceSendFields is a list of field names (e.g. "Bucket") to
980	// unconditionally include in API requests. By default, fields with
981	// empty values are omitted from API requests. However, any non-pointer,
982	// non-interface field appearing in ForceSendFields will be sent to the
983	// server regardless of whether the field is empty or not. This may be
984	// used to include empty fields in Patch requests.
985	ForceSendFields []string `json:"-"`
986
987	// NullFields is a list of field names (e.g. "Bucket") to include in API
988	// requests with the JSON null value. By default, fields with empty
989	// values are omitted from API requests. However, any field with an
990	// empty value appearing in NullFields will be sent to the server as
991	// null. It is an error if a field in this list has a non-empty value.
992	// This may be used to include null fields in Patch requests.
993	NullFields []string `json:"-"`
994}
995
996func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
997	type NoMethod BucketAccessControl
998	raw := NoMethod(*s)
999	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1000}
1001
1002// BucketAccessControlProjectTeam: The project team associated with the
1003// entity, if any.
1004type BucketAccessControlProjectTeam struct {
1005	// ProjectNumber: The project number.
1006	ProjectNumber string `json:"projectNumber,omitempty"`
1007
1008	// Team: The team.
1009	Team string `json:"team,omitempty"`
1010
1011	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1012	// unconditionally include in API requests. By default, fields with
1013	// empty values are omitted from API requests. However, any non-pointer,
1014	// non-interface field appearing in ForceSendFields will be sent to the
1015	// server regardless of whether the field is empty or not. This may be
1016	// used to include empty fields in Patch requests.
1017	ForceSendFields []string `json:"-"`
1018
1019	// NullFields is a list of field names (e.g. "ProjectNumber") to include
1020	// in API requests with the JSON null value. By default, fields with
1021	// empty values are omitted from API requests. However, any field with
1022	// an empty value appearing in NullFields will be sent to the server as
1023	// null. It is an error if a field in this list has a non-empty value.
1024	// This may be used to include null fields in Patch requests.
1025	NullFields []string `json:"-"`
1026}
1027
1028func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1029	type NoMethod BucketAccessControlProjectTeam
1030	raw := NoMethod(*s)
1031	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1032}
1033
1034// BucketAccessControls: An access-control list.
1035type BucketAccessControls struct {
1036	// Items: The list of items.
1037	Items []*BucketAccessControl `json:"items,omitempty"`
1038
1039	// Kind: The kind of item this is. For lists of bucket access control
1040	// entries, this is always storage#bucketAccessControls.
1041	Kind string `json:"kind,omitempty"`
1042
1043	// ServerResponse contains the HTTP response code and headers from the
1044	// server.
1045	googleapi.ServerResponse `json:"-"`
1046
1047	// ForceSendFields is a list of field names (e.g. "Items") to
1048	// unconditionally include in API requests. By default, fields with
1049	// empty values are omitted from API requests. However, any non-pointer,
1050	// non-interface field appearing in ForceSendFields will be sent to the
1051	// server regardless of whether the field is empty or not. This may be
1052	// used to include empty fields in Patch requests.
1053	ForceSendFields []string `json:"-"`
1054
1055	// NullFields is a list of field names (e.g. "Items") to include in API
1056	// requests with the JSON null value. By default, fields with empty
1057	// values are omitted from API requests. However, any field with an
1058	// empty value appearing in NullFields will be sent to the server as
1059	// null. It is an error if a field in this list has a non-empty value.
1060	// This may be used to include null fields in Patch requests.
1061	NullFields []string `json:"-"`
1062}
1063
1064func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
1065	type NoMethod BucketAccessControls
1066	raw := NoMethod(*s)
1067	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1068}
1069
1070// Buckets: A list of buckets.
1071type Buckets struct {
1072	// Items: The list of items.
1073	Items []*Bucket `json:"items,omitempty"`
1074
1075	// Kind: The kind of item this is. For lists of buckets, this is always
1076	// storage#buckets.
1077	Kind string `json:"kind,omitempty"`
1078
1079	// NextPageToken: The continuation token, used to page through large
1080	// result sets. Provide this value in a subsequent request to return the
1081	// next page of results.
1082	NextPageToken string `json:"nextPageToken,omitempty"`
1083
1084	// ServerResponse contains the HTTP response code and headers from the
1085	// server.
1086	googleapi.ServerResponse `json:"-"`
1087
1088	// ForceSendFields is a list of field names (e.g. "Items") to
1089	// unconditionally include in API requests. By default, fields with
1090	// empty values are omitted from API requests. However, any non-pointer,
1091	// non-interface field appearing in ForceSendFields will be sent to the
1092	// server regardless of whether the field is empty or not. This may be
1093	// used to include empty fields in Patch requests.
1094	ForceSendFields []string `json:"-"`
1095
1096	// NullFields is a list of field names (e.g. "Items") to include in API
1097	// requests with the JSON null value. By default, fields with empty
1098	// values are omitted from API requests. However, any field with an
1099	// empty value appearing in NullFields will be sent to the server as
1100	// null. It is an error if a field in this list has a non-empty value.
1101	// This may be used to include null fields in Patch requests.
1102	NullFields []string `json:"-"`
1103}
1104
1105func (s *Buckets) MarshalJSON() ([]byte, error) {
1106	type NoMethod Buckets
1107	raw := NoMethod(*s)
1108	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1109}
1110
1111// Channel: An notification channel used to watch for resource changes.
1112type Channel struct {
1113	// Address: The address where notifications are delivered for this
1114	// channel.
1115	Address string `json:"address,omitempty"`
1116
1117	// Expiration: Date and time of notification channel expiration,
1118	// expressed as a Unix timestamp, in milliseconds. Optional.
1119	Expiration int64 `json:"expiration,omitempty,string"`
1120
1121	// Id: A UUID or similar unique string that identifies this channel.
1122	Id string `json:"id,omitempty"`
1123
1124	// Kind: Identifies this as a notification channel used to watch for
1125	// changes to a resource. Value: the fixed string "api#channel".
1126	Kind string `json:"kind,omitempty"`
1127
1128	// Params: Additional parameters controlling delivery channel behavior.
1129	// Optional.
1130	Params map[string]string `json:"params,omitempty"`
1131
1132	// Payload: A Boolean value to indicate whether payload is wanted.
1133	// Optional.
1134	Payload bool `json:"payload,omitempty"`
1135
1136	// ResourceId: An opaque ID that identifies the resource being watched
1137	// on this channel. Stable across different API versions.
1138	ResourceId string `json:"resourceId,omitempty"`
1139
1140	// ResourceUri: A version-specific identifier for the watched resource.
1141	ResourceUri string `json:"resourceUri,omitempty"`
1142
1143	// Token: An arbitrary string delivered to the target address with each
1144	// notification delivered over this channel. Optional.
1145	Token string `json:"token,omitempty"`
1146
1147	// Type: The type of delivery mechanism used for this channel.
1148	Type string `json:"type,omitempty"`
1149
1150	// ServerResponse contains the HTTP response code and headers from the
1151	// server.
1152	googleapi.ServerResponse `json:"-"`
1153
1154	// ForceSendFields is a list of field names (e.g. "Address") to
1155	// unconditionally include in API requests. By default, fields with
1156	// empty values are omitted from API requests. However, any non-pointer,
1157	// non-interface field appearing in ForceSendFields will be sent to the
1158	// server regardless of whether the field is empty or not. This may be
1159	// used to include empty fields in Patch requests.
1160	ForceSendFields []string `json:"-"`
1161
1162	// NullFields is a list of field names (e.g. "Address") to include in
1163	// API requests with the JSON null value. By default, fields with empty
1164	// values are omitted from API requests. However, any field with an
1165	// empty value appearing in NullFields will be sent to the server as
1166	// null. It is an error if a field in this list has a non-empty value.
1167	// This may be used to include null fields in Patch requests.
1168	NullFields []string `json:"-"`
1169}
1170
1171func (s *Channel) MarshalJSON() ([]byte, error) {
1172	type NoMethod Channel
1173	raw := NoMethod(*s)
1174	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1175}
1176
1177// ComposeRequest: A Compose request.
1178type ComposeRequest struct {
1179	// Destination: Properties of the resulting object.
1180	Destination *Object `json:"destination,omitempty"`
1181
1182	// Kind: The kind of item this is.
1183	Kind string `json:"kind,omitempty"`
1184
1185	// SourceObjects: The list of source objects that will be concatenated
1186	// into a single object.
1187	SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
1188
1189	// ForceSendFields is a list of field names (e.g. "Destination") to
1190	// unconditionally include in API requests. By default, fields with
1191	// empty values are omitted from API requests. However, any non-pointer,
1192	// non-interface field appearing in ForceSendFields will be sent to the
1193	// server regardless of whether the field is empty or not. This may be
1194	// used to include empty fields in Patch requests.
1195	ForceSendFields []string `json:"-"`
1196
1197	// NullFields is a list of field names (e.g. "Destination") to include
1198	// in API requests with the JSON null value. By default, fields with
1199	// empty values are omitted from API requests. However, any field with
1200	// an empty value appearing in NullFields will be sent to the server as
1201	// null. It is an error if a field in this list has a non-empty value.
1202	// This may be used to include null fields in Patch requests.
1203	NullFields []string `json:"-"`
1204}
1205
1206func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
1207	type NoMethod ComposeRequest
1208	raw := NoMethod(*s)
1209	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1210}
1211
1212type ComposeRequestSourceObjects struct {
1213	// Generation: The generation of this object to use as the source.
1214	Generation int64 `json:"generation,omitempty,string"`
1215
1216	// Name: The source object's name. All source objects must reside in the
1217	// same bucket.
1218	Name string `json:"name,omitempty"`
1219
1220	// ObjectPreconditions: Conditions that must be met for this operation
1221	// to execute.
1222	ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
1223
1224	// ForceSendFields is a list of field names (e.g. "Generation") to
1225	// unconditionally include in API requests. By default, fields with
1226	// empty values are omitted from API requests. However, any non-pointer,
1227	// non-interface field appearing in ForceSendFields will be sent to the
1228	// server regardless of whether the field is empty or not. This may be
1229	// used to include empty fields in Patch requests.
1230	ForceSendFields []string `json:"-"`
1231
1232	// NullFields is a list of field names (e.g. "Generation") to include in
1233	// API requests with the JSON null value. By default, fields with empty
1234	// values are omitted from API requests. However, any field with an
1235	// empty value appearing in NullFields will be sent to the server as
1236	// null. It is an error if a field in this list has a non-empty value.
1237	// This may be used to include null fields in Patch requests.
1238	NullFields []string `json:"-"`
1239}
1240
1241func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
1242	type NoMethod ComposeRequestSourceObjects
1243	raw := NoMethod(*s)
1244	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1245}
1246
1247// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
1248// be met for this operation to execute.
1249type ComposeRequestSourceObjectsObjectPreconditions struct {
1250	// IfGenerationMatch: Only perform the composition if the generation of
1251	// the source object that would be used matches this value. If this
1252	// value and a generation are both specified, they must be the same
1253	// value or the call will fail.
1254	IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
1255
1256	// ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
1257	// to unconditionally include in API requests. By default, fields with
1258	// empty values are omitted from API requests. However, any non-pointer,
1259	// non-interface field appearing in ForceSendFields will be sent to the
1260	// server regardless of whether the field is empty or not. This may be
1261	// used to include empty fields in Patch requests.
1262	ForceSendFields []string `json:"-"`
1263
1264	// NullFields is a list of field names (e.g. "IfGenerationMatch") to
1265	// include in API requests with the JSON null value. By default, fields
1266	// with empty values are omitted from API requests. However, any field
1267	// with an empty value appearing in NullFields will be sent to the
1268	// server as null. It is an error if a field in this list has a
1269	// non-empty value. This may be used to include null fields in Patch
1270	// requests.
1271	NullFields []string `json:"-"`
1272}
1273
1274func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
1275	type NoMethod ComposeRequestSourceObjectsObjectPreconditions
1276	raw := NoMethod(*s)
1277	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1278}
1279
1280// Expr: Represents an expression text. Example: title: "User account
1281// presence" description: "Determines whether the request has a user
1282// account" expression: "size(request.user) > 0"
1283type Expr struct {
1284	// Description: An optional description of the expression. This is a
1285	// longer text which describes the expression, e.g. when hovered over it
1286	// in a UI.
1287	Description string `json:"description,omitempty"`
1288
1289	// Expression: Textual representation of an expression in Common
1290	// Expression Language syntax. The application context of the containing
1291	// message determines which well-known feature set of CEL is supported.
1292	Expression string `json:"expression,omitempty"`
1293
1294	// Kind: The kind of item this is. For storage, this is always
1295	// storage#expr. This field is ignored on input.
1296	Kind string `json:"kind,omitempty"`
1297
1298	// Location: An optional string indicating the location of the
1299	// expression for error reporting, e.g. a file name and a position in
1300	// the file.
1301	Location string `json:"location,omitempty"`
1302
1303	// Title: An optional title for the expression, i.e. a short string
1304	// describing its purpose. This can be used e.g. in UIs which allow to
1305	// enter the expression.
1306	Title string `json:"title,omitempty"`
1307
1308	// ForceSendFields is a list of field names (e.g. "Description") to
1309	// unconditionally include in API requests. By default, fields with
1310	// empty values are omitted from API requests. However, any non-pointer,
1311	// non-interface field appearing in ForceSendFields will be sent to the
1312	// server regardless of whether the field is empty or not. This may be
1313	// used to include empty fields in Patch requests.
1314	ForceSendFields []string `json:"-"`
1315
1316	// NullFields is a list of field names (e.g. "Description") to include
1317	// in API requests with the JSON null value. By default, fields with
1318	// empty values are omitted from API requests. However, any field with
1319	// an empty value appearing in NullFields will be sent to the server as
1320	// null. It is an error if a field in this list has a non-empty value.
1321	// This may be used to include null fields in Patch requests.
1322	NullFields []string `json:"-"`
1323}
1324
1325func (s *Expr) MarshalJSON() ([]byte, error) {
1326	type NoMethod Expr
1327	raw := NoMethod(*s)
1328	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1329}
1330
1331// HmacKey: JSON template to produce a JSON-style HMAC Key resource for
1332// Create responses.
1333type HmacKey struct {
1334	// Kind: The kind of item this is. For HMAC keys, this is always
1335	// storage#hmacKey.
1336	Kind string `json:"kind,omitempty"`
1337
1338	// Metadata: Key metadata.
1339	Metadata *HmacKeyMetadata `json:"metadata,omitempty"`
1340
1341	// Secret: HMAC secret key material.
1342	Secret string `json:"secret,omitempty"`
1343
1344	// ServerResponse contains the HTTP response code and headers from the
1345	// server.
1346	googleapi.ServerResponse `json:"-"`
1347
1348	// ForceSendFields is a list of field names (e.g. "Kind") to
1349	// unconditionally include in API requests. By default, fields with
1350	// empty values are omitted from API requests. However, any non-pointer,
1351	// non-interface field appearing in ForceSendFields will be sent to the
1352	// server regardless of whether the field is empty or not. This may be
1353	// used to include empty fields in Patch requests.
1354	ForceSendFields []string `json:"-"`
1355
1356	// NullFields is a list of field names (e.g. "Kind") to include in API
1357	// requests with the JSON null value. By default, fields with empty
1358	// values are omitted from API requests. However, any field with an
1359	// empty value appearing in NullFields will be sent to the server as
1360	// null. It is an error if a field in this list has a non-empty value.
1361	// This may be used to include null fields in Patch requests.
1362	NullFields []string `json:"-"`
1363}
1364
1365func (s *HmacKey) MarshalJSON() ([]byte, error) {
1366	type NoMethod HmacKey
1367	raw := NoMethod(*s)
1368	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1369}
1370
1371// HmacKeyMetadata: JSON template to produce a JSON-style HMAC Key
1372// metadata resource.
1373type HmacKeyMetadata struct {
1374	// AccessId: The ID of the HMAC Key.
1375	AccessId string `json:"accessId,omitempty"`
1376
1377	// Etag: HTTP 1.1 Entity tag for the HMAC key.
1378	Etag string `json:"etag,omitempty"`
1379
1380	// Id: The ID of the HMAC key, including the Project ID and the Access
1381	// ID.
1382	Id string `json:"id,omitempty"`
1383
1384	// Kind: The kind of item this is. For HMAC Key metadata, this is always
1385	// storage#hmacKeyMetadata.
1386	Kind string `json:"kind,omitempty"`
1387
1388	// ProjectId: Project ID owning the service account to which the key
1389	// authenticates.
1390	ProjectId string `json:"projectId,omitempty"`
1391
1392	// SelfLink: The link to this resource.
1393	SelfLink string `json:"selfLink,omitempty"`
1394
1395	// ServiceAccountEmail: The email address of the key's associated
1396	// service account.
1397	ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
1398
1399	// State: The state of the key. Can be one of ACTIVE, INACTIVE, or
1400	// DELETED.
1401	State string `json:"state,omitempty"`
1402
1403	// TimeCreated: The creation time of the HMAC key in RFC 3339 format.
1404	TimeCreated string `json:"timeCreated,omitempty"`
1405
1406	// Updated: The last modification time of the HMAC key metadata in RFC
1407	// 3339 format.
1408	Updated string `json:"updated,omitempty"`
1409
1410	// ServerResponse contains the HTTP response code and headers from the
1411	// server.
1412	googleapi.ServerResponse `json:"-"`
1413
1414	// ForceSendFields is a list of field names (e.g. "AccessId") to
1415	// unconditionally include in API requests. By default, fields with
1416	// empty values are omitted from API requests. However, any non-pointer,
1417	// non-interface field appearing in ForceSendFields will be sent to the
1418	// server regardless of whether the field is empty or not. This may be
1419	// used to include empty fields in Patch requests.
1420	ForceSendFields []string `json:"-"`
1421
1422	// NullFields is a list of field names (e.g. "AccessId") to include in
1423	// API requests with the JSON null value. By default, fields with empty
1424	// values are omitted from API requests. However, any field with an
1425	// empty value appearing in NullFields will be sent to the server as
1426	// null. It is an error if a field in this list has a non-empty value.
1427	// This may be used to include null fields in Patch requests.
1428	NullFields []string `json:"-"`
1429}
1430
1431func (s *HmacKeyMetadata) MarshalJSON() ([]byte, error) {
1432	type NoMethod HmacKeyMetadata
1433	raw := NoMethod(*s)
1434	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1435}
1436
1437// HmacKeysMetadata: A list of hmacKeys.
1438type HmacKeysMetadata struct {
1439	// Items: The list of items.
1440	Items []*HmacKeyMetadata `json:"items,omitempty"`
1441
1442	// Kind: The kind of item this is. For lists of hmacKeys, this is always
1443	// storage#hmacKeysMetadata.
1444	Kind string `json:"kind,omitempty"`
1445
1446	// NextPageToken: The continuation token, used to page through large
1447	// result sets. Provide this value in a subsequent request to return the
1448	// next page of results.
1449	NextPageToken string `json:"nextPageToken,omitempty"`
1450
1451	// ServerResponse contains the HTTP response code and headers from the
1452	// server.
1453	googleapi.ServerResponse `json:"-"`
1454
1455	// ForceSendFields is a list of field names (e.g. "Items") to
1456	// unconditionally include in API requests. By default, fields with
1457	// empty values are omitted from API requests. However, any non-pointer,
1458	// non-interface field appearing in ForceSendFields will be sent to the
1459	// server regardless of whether the field is empty or not. This may be
1460	// used to include empty fields in Patch requests.
1461	ForceSendFields []string `json:"-"`
1462
1463	// NullFields is a list of field names (e.g. "Items") to include in API
1464	// requests with the JSON null value. By default, fields with empty
1465	// values are omitted from API requests. However, any field with an
1466	// empty value appearing in NullFields will be sent to the server as
1467	// null. It is an error if a field in this list has a non-empty value.
1468	// This may be used to include null fields in Patch requests.
1469	NullFields []string `json:"-"`
1470}
1471
1472func (s *HmacKeysMetadata) MarshalJSON() ([]byte, error) {
1473	type NoMethod HmacKeysMetadata
1474	raw := NoMethod(*s)
1475	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1476}
1477
1478// Notification: A subscription to receive Google PubSub notifications.
1479type Notification struct {
1480	// CustomAttributes: An optional list of additional attributes to attach
1481	// to each Cloud PubSub message published for this notification
1482	// subscription.
1483	CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
1484
1485	// Etag: HTTP 1.1 Entity tag for this subscription notification.
1486	Etag string `json:"etag,omitempty"`
1487
1488	// EventTypes: If present, only send notifications about listed event
1489	// types. If empty, sent notifications for all event types.
1490	EventTypes []string `json:"event_types,omitempty"`
1491
1492	// Id: The ID of the notification.
1493	Id string `json:"id,omitempty"`
1494
1495	// Kind: The kind of item this is. For notifications, this is always
1496	// storage#notification.
1497	Kind string `json:"kind,omitempty"`
1498
1499	// ObjectNamePrefix: If present, only apply this notification
1500	// configuration to object names that begin with this prefix.
1501	ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
1502
1503	// PayloadFormat: The desired content of the Payload.
1504	PayloadFormat string `json:"payload_format,omitempty"`
1505
1506	// SelfLink: The canonical URL of this notification.
1507	SelfLink string `json:"selfLink,omitempty"`
1508
1509	// Topic: The Cloud PubSub topic to which this subscription publishes.
1510	// Formatted as:
1511	// '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
1512	// c}'
1513	Topic string `json:"topic,omitempty"`
1514
1515	// ServerResponse contains the HTTP response code and headers from the
1516	// server.
1517	googleapi.ServerResponse `json:"-"`
1518
1519	// ForceSendFields is a list of field names (e.g. "CustomAttributes") to
1520	// unconditionally include in API requests. By default, fields with
1521	// empty values are omitted from API requests. However, any non-pointer,
1522	// non-interface field appearing in ForceSendFields will be sent to the
1523	// server regardless of whether the field is empty or not. This may be
1524	// used to include empty fields in Patch requests.
1525	ForceSendFields []string `json:"-"`
1526
1527	// NullFields is a list of field names (e.g. "CustomAttributes") to
1528	// include in API requests with the JSON null value. By default, fields
1529	// with empty values are omitted from API requests. However, any field
1530	// with an empty value appearing in NullFields will be sent to the
1531	// server as null. It is an error if a field in this list has a
1532	// non-empty value. This may be used to include null fields in Patch
1533	// requests.
1534	NullFields []string `json:"-"`
1535}
1536
1537func (s *Notification) MarshalJSON() ([]byte, error) {
1538	type NoMethod Notification
1539	raw := NoMethod(*s)
1540	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1541}
1542
1543// Notifications: A list of notification subscriptions.
1544type Notifications struct {
1545	// Items: The list of items.
1546	Items []*Notification `json:"items,omitempty"`
1547
1548	// Kind: The kind of item this is. For lists of notifications, this is
1549	// always storage#notifications.
1550	Kind string `json:"kind,omitempty"`
1551
1552	// ServerResponse contains the HTTP response code and headers from the
1553	// server.
1554	googleapi.ServerResponse `json:"-"`
1555
1556	// ForceSendFields is a list of field names (e.g. "Items") to
1557	// unconditionally include in API requests. By default, fields with
1558	// empty values are omitted from API requests. However, any non-pointer,
1559	// non-interface field appearing in ForceSendFields will be sent to the
1560	// server regardless of whether the field is empty or not. This may be
1561	// used to include empty fields in Patch requests.
1562	ForceSendFields []string `json:"-"`
1563
1564	// NullFields is a list of field names (e.g. "Items") to include in API
1565	// requests with the JSON null value. By default, fields with empty
1566	// values are omitted from API requests. However, any field with an
1567	// empty value appearing in NullFields will be sent to the server as
1568	// null. It is an error if a field in this list has a non-empty value.
1569	// This may be used to include null fields in Patch requests.
1570	NullFields []string `json:"-"`
1571}
1572
1573func (s *Notifications) MarshalJSON() ([]byte, error) {
1574	type NoMethod Notifications
1575	raw := NoMethod(*s)
1576	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1577}
1578
1579// Object: An object.
1580type Object struct {
1581	// Acl: Access controls on the object.
1582	Acl []*ObjectAccessControl `json:"acl,omitempty"`
1583
1584	// Bucket: The name of the bucket containing this object.
1585	Bucket string `json:"bucket,omitempty"`
1586
1587	// CacheControl: Cache-Control directive for the object data. If
1588	// omitted, and the object is accessible to all anonymous users, the
1589	// default will be public, max-age=3600.
1590	CacheControl string `json:"cacheControl,omitempty"`
1591
1592	// ComponentCount: Number of underlying components that make up this
1593	// object. Components are accumulated by compose operations.
1594	ComponentCount int64 `json:"componentCount,omitempty"`
1595
1596	// ContentDisposition: Content-Disposition of the object data.
1597	ContentDisposition string `json:"contentDisposition,omitempty"`
1598
1599	// ContentEncoding: Content-Encoding of the object data.
1600	ContentEncoding string `json:"contentEncoding,omitempty"`
1601
1602	// ContentLanguage: Content-Language of the object data.
1603	ContentLanguage string `json:"contentLanguage,omitempty"`
1604
1605	// ContentType: Content-Type of the object data. If an object is stored
1606	// without a Content-Type, it is served as application/octet-stream.
1607	ContentType string `json:"contentType,omitempty"`
1608
1609	// Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
1610	// encoded using base64 in big-endian byte order. For more information
1611	// about using the CRC32c checksum, see Hashes and ETags: Best
1612	// Practices.
1613	Crc32c string `json:"crc32c,omitempty"`
1614
1615	// CustomerEncryption: Metadata of customer-supplied encryption key, if
1616	// the object is encrypted by such a key.
1617	CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
1618
1619	// Etag: HTTP 1.1 Entity tag for the object.
1620	Etag string `json:"etag,omitempty"`
1621
1622	// EventBasedHold: Whether an object is under event-based hold.
1623	// Event-based hold is a way to retain objects until an event occurs,
1624	// which is signified by the hold's release (i.e. this value is set to
1625	// false). After being released (set to false), such objects will be
1626	// subject to bucket-level retention (if any). One sample use case of
1627	// this flag is for banks to hold loan documents for at least 3 years
1628	// after loan is paid in full. Here, bucket-level retention is 3 years
1629	// and the event is the loan being paid in full. In this example, these
1630	// objects will be held intact for any number of years until the event
1631	// has occurred (event-based hold on the object is released) and then 3
1632	// more years after that. That means retention duration of the objects
1633	// begins from the moment event-based hold transitioned from true to
1634	// false.
1635	EventBasedHold bool `json:"eventBasedHold,omitempty"`
1636
1637	// Generation: The content generation of this object. Used for object
1638	// versioning.
1639	Generation int64 `json:"generation,omitempty,string"`
1640
1641	// Id: The ID of the object, including the bucket name, object name, and
1642	// generation number.
1643	Id string `json:"id,omitempty"`
1644
1645	// Kind: The kind of item this is. For objects, this is always
1646	// storage#object.
1647	Kind string `json:"kind,omitempty"`
1648
1649	// KmsKeyName: Cloud KMS Key used to encrypt this object, if the object
1650	// is encrypted by such a key.
1651	KmsKeyName string `json:"kmsKeyName,omitempty"`
1652
1653	// Md5Hash: MD5 hash of the data; encoded using base64. For more
1654	// information about using the MD5 hash, see Hashes and ETags: Best
1655	// Practices.
1656	Md5Hash string `json:"md5Hash,omitempty"`
1657
1658	// MediaLink: Media download link.
1659	MediaLink string `json:"mediaLink,omitempty"`
1660
1661	// Metadata: User-provided metadata, in key/value pairs.
1662	Metadata map[string]string `json:"metadata,omitempty"`
1663
1664	// Metageneration: The version of the metadata for this object at this
1665	// generation. Used for preconditions and for detecting changes in
1666	// metadata. A metageneration number is only meaningful in the context
1667	// of a particular generation of a particular object.
1668	Metageneration int64 `json:"metageneration,omitempty,string"`
1669
1670	// Name: The name of the object. Required if not specified by URL
1671	// parameter.
1672	Name string `json:"name,omitempty"`
1673
1674	// Owner: The owner of the object. This will always be the uploader of
1675	// the object.
1676	Owner *ObjectOwner `json:"owner,omitempty"`
1677
1678	// RetentionExpirationTime: A server-determined value that specifies the
1679	// earliest time that the object's retention period expires. This value
1680	// is in RFC 3339 format. Note 1: This field is not provided for objects
1681	// with an active event-based hold, since retention expiration is
1682	// unknown until the hold is removed. Note 2: This value can be provided
1683	// even when temporary hold is set (so that the user can reason about
1684	// policy without having to first unset the temporary hold).
1685	RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"`
1686
1687	// SelfLink: The link to this object.
1688	SelfLink string `json:"selfLink,omitempty"`
1689
1690	// Size: Content-Length of the data in bytes.
1691	Size uint64 `json:"size,omitempty,string"`
1692
1693	// StorageClass: Storage class of the object.
1694	StorageClass string `json:"storageClass,omitempty"`
1695
1696	// TemporaryHold: Whether an object is under temporary hold. While this
1697	// flag is set to true, the object is protected against deletion and
1698	// overwrites. A common use case of this flag is regulatory
1699	// investigations where objects need to be retained while the
1700	// investigation is ongoing. Note that unlike event-based hold,
1701	// temporary hold does not impact retention expiration time of an
1702	// object.
1703	TemporaryHold bool `json:"temporaryHold,omitempty"`
1704
1705	// TimeCreated: The creation time of the object in RFC 3339 format.
1706	TimeCreated string `json:"timeCreated,omitempty"`
1707
1708	// TimeDeleted: The deletion time of the object in RFC 3339 format. Will
1709	// be returned if and only if this version of the object has been
1710	// deleted.
1711	TimeDeleted string `json:"timeDeleted,omitempty"`
1712
1713	// TimeStorageClassUpdated: The time at which the object's storage class
1714	// was last changed. When the object is initially created, it will be
1715	// set to timeCreated.
1716	TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
1717
1718	// Updated: The modification time of the object metadata in RFC 3339
1719	// format.
1720	Updated string `json:"updated,omitempty"`
1721
1722	// ServerResponse contains the HTTP response code and headers from the
1723	// server.
1724	googleapi.ServerResponse `json:"-"`
1725
1726	// ForceSendFields is a list of field names (e.g. "Acl") to
1727	// unconditionally include in API requests. By default, fields with
1728	// empty values are omitted from API requests. However, any non-pointer,
1729	// non-interface field appearing in ForceSendFields will be sent to the
1730	// server regardless of whether the field is empty or not. This may be
1731	// used to include empty fields in Patch requests.
1732	ForceSendFields []string `json:"-"`
1733
1734	// NullFields is a list of field names (e.g. "Acl") to include in API
1735	// requests with the JSON null value. By default, fields with empty
1736	// values are omitted from API requests. However, any field with an
1737	// empty value appearing in NullFields will be sent to the server as
1738	// null. It is an error if a field in this list has a non-empty value.
1739	// This may be used to include null fields in Patch requests.
1740	NullFields []string `json:"-"`
1741}
1742
1743func (s *Object) MarshalJSON() ([]byte, error) {
1744	type NoMethod Object
1745	raw := NoMethod(*s)
1746	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1747}
1748
1749// ObjectCustomerEncryption: Metadata of customer-supplied encryption
1750// key, if the object is encrypted by such a key.
1751type ObjectCustomerEncryption struct {
1752	// EncryptionAlgorithm: The encryption algorithm.
1753	EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"`
1754
1755	// KeySha256: SHA256 hash value of the encryption key.
1756	KeySha256 string `json:"keySha256,omitempty"`
1757
1758	// ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm")
1759	// to unconditionally include in API requests. By default, fields with
1760	// empty values are omitted from API requests. However, any non-pointer,
1761	// non-interface field appearing in ForceSendFields will be sent to the
1762	// server regardless of whether the field is empty or not. This may be
1763	// used to include empty fields in Patch requests.
1764	ForceSendFields []string `json:"-"`
1765
1766	// NullFields is a list of field names (e.g. "EncryptionAlgorithm") to
1767	// include in API requests with the JSON null value. By default, fields
1768	// with empty values are omitted from API requests. However, any field
1769	// with an empty value appearing in NullFields will be sent to the
1770	// server as null. It is an error if a field in this list has a
1771	// non-empty value. This may be used to include null fields in Patch
1772	// requests.
1773	NullFields []string `json:"-"`
1774}
1775
1776func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
1777	type NoMethod ObjectCustomerEncryption
1778	raw := NoMethod(*s)
1779	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1780}
1781
1782// ObjectOwner: The owner of the object. This will always be the
1783// uploader of the object.
1784type ObjectOwner struct {
1785	// Entity: The entity, in the form user-userId.
1786	Entity string `json:"entity,omitempty"`
1787
1788	// EntityId: The ID for the entity.
1789	EntityId string `json:"entityId,omitempty"`
1790
1791	// ForceSendFields is a list of field names (e.g. "Entity") to
1792	// unconditionally include in API requests. By default, fields with
1793	// empty values are omitted from API requests. However, any non-pointer,
1794	// non-interface field appearing in ForceSendFields will be sent to the
1795	// server regardless of whether the field is empty or not. This may be
1796	// used to include empty fields in Patch requests.
1797	ForceSendFields []string `json:"-"`
1798
1799	// NullFields is a list of field names (e.g. "Entity") to include in API
1800	// requests with the JSON null value. By default, fields with empty
1801	// values are omitted from API requests. However, any field with an
1802	// empty value appearing in NullFields will be sent to the server as
1803	// null. It is an error if a field in this list has a non-empty value.
1804	// This may be used to include null fields in Patch requests.
1805	NullFields []string `json:"-"`
1806}
1807
1808func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
1809	type NoMethod ObjectOwner
1810	raw := NoMethod(*s)
1811	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1812}
1813
1814// ObjectAccessControl: An access-control entry.
1815type ObjectAccessControl struct {
1816	// Bucket: The name of the bucket.
1817	Bucket string `json:"bucket,omitempty"`
1818
1819	// Domain: The domain associated with the entity, if any.
1820	Domain string `json:"domain,omitempty"`
1821
1822	// Email: The email address associated with the entity, if any.
1823	Email string `json:"email,omitempty"`
1824
1825	// Entity: The entity holding the permission, in one of the following
1826	// forms:
1827	// - user-userId
1828	// - user-email
1829	// - group-groupId
1830	// - group-email
1831	// - domain-domain
1832	// - project-team-projectId
1833	// - allUsers
1834	// - allAuthenticatedUsers Examples:
1835	// - The user liz@example.com would be user-liz@example.com.
1836	// - The group example@googlegroups.com would be
1837	// group-example@googlegroups.com.
1838	// - To refer to all members of the Google Apps for Business domain
1839	// example.com, the entity would be domain-example.com.
1840	Entity string `json:"entity,omitempty"`
1841
1842	// EntityId: The ID for the entity, if any.
1843	EntityId string `json:"entityId,omitempty"`
1844
1845	// Etag: HTTP 1.1 Entity tag for the access-control entry.
1846	Etag string `json:"etag,omitempty"`
1847
1848	// Generation: The content generation of the object, if applied to an
1849	// object.
1850	Generation int64 `json:"generation,omitempty,string"`
1851
1852	// Id: The ID of the access-control entry.
1853	Id string `json:"id,omitempty"`
1854
1855	// Kind: The kind of item this is. For object access control entries,
1856	// this is always storage#objectAccessControl.
1857	Kind string `json:"kind,omitempty"`
1858
1859	// Object: The name of the object, if applied to an object.
1860	Object string `json:"object,omitempty"`
1861
1862	// ProjectTeam: The project team associated with the entity, if any.
1863	ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
1864
1865	// Role: The access permission for the entity.
1866	Role string `json:"role,omitempty"`
1867
1868	// SelfLink: The link to this access-control entry.
1869	SelfLink string `json:"selfLink,omitempty"`
1870
1871	// ServerResponse contains the HTTP response code and headers from the
1872	// server.
1873	googleapi.ServerResponse `json:"-"`
1874
1875	// ForceSendFields is a list of field names (e.g. "Bucket") to
1876	// unconditionally include in API requests. By default, fields with
1877	// empty values are omitted from API requests. However, any non-pointer,
1878	// non-interface field appearing in ForceSendFields will be sent to the
1879	// server regardless of whether the field is empty or not. This may be
1880	// used to include empty fields in Patch requests.
1881	ForceSendFields []string `json:"-"`
1882
1883	// NullFields is a list of field names (e.g. "Bucket") to include in API
1884	// requests with the JSON null value. By default, fields with empty
1885	// values are omitted from API requests. However, any field with an
1886	// empty value appearing in NullFields will be sent to the server as
1887	// null. It is an error if a field in this list has a non-empty value.
1888	// This may be used to include null fields in Patch requests.
1889	NullFields []string `json:"-"`
1890}
1891
1892func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
1893	type NoMethod ObjectAccessControl
1894	raw := NoMethod(*s)
1895	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1896}
1897
1898// ObjectAccessControlProjectTeam: The project team associated with the
1899// entity, if any.
1900type ObjectAccessControlProjectTeam struct {
1901	// ProjectNumber: The project number.
1902	ProjectNumber string `json:"projectNumber,omitempty"`
1903
1904	// Team: The team.
1905	Team string `json:"team,omitempty"`
1906
1907	// ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1908	// unconditionally include in API requests. By default, fields with
1909	// empty values are omitted from API requests. However, any non-pointer,
1910	// non-interface field appearing in ForceSendFields will be sent to the
1911	// server regardless of whether the field is empty or not. This may be
1912	// used to include empty fields in Patch requests.
1913	ForceSendFields []string `json:"-"`
1914
1915	// NullFields is a list of field names (e.g. "ProjectNumber") to include
1916	// in API requests with the JSON null value. By default, fields with
1917	// empty values are omitted from API requests. However, any field with
1918	// an empty value appearing in NullFields will be sent to the server as
1919	// null. It is an error if a field in this list has a non-empty value.
1920	// This may be used to include null fields in Patch requests.
1921	NullFields []string `json:"-"`
1922}
1923
1924func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1925	type NoMethod ObjectAccessControlProjectTeam
1926	raw := NoMethod(*s)
1927	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1928}
1929
1930// ObjectAccessControls: An access-control list.
1931type ObjectAccessControls struct {
1932	// Items: The list of items.
1933	Items []*ObjectAccessControl `json:"items,omitempty"`
1934
1935	// Kind: The kind of item this is. For lists of object access control
1936	// entries, this is always storage#objectAccessControls.
1937	Kind string `json:"kind,omitempty"`
1938
1939	// ServerResponse contains the HTTP response code and headers from the
1940	// server.
1941	googleapi.ServerResponse `json:"-"`
1942
1943	// ForceSendFields is a list of field names (e.g. "Items") to
1944	// unconditionally include in API requests. By default, fields with
1945	// empty values are omitted from API requests. However, any non-pointer,
1946	// non-interface field appearing in ForceSendFields will be sent to the
1947	// server regardless of whether the field is empty or not. This may be
1948	// used to include empty fields in Patch requests.
1949	ForceSendFields []string `json:"-"`
1950
1951	// NullFields is a list of field names (e.g. "Items") to include in API
1952	// requests with the JSON null value. By default, fields with empty
1953	// values are omitted from API requests. However, any field with an
1954	// empty value appearing in NullFields will be sent to the server as
1955	// null. It is an error if a field in this list has a non-empty value.
1956	// This may be used to include null fields in Patch requests.
1957	NullFields []string `json:"-"`
1958}
1959
1960func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
1961	type NoMethod ObjectAccessControls
1962	raw := NoMethod(*s)
1963	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1964}
1965
1966// Objects: A list of objects.
1967type Objects struct {
1968	// Items: The list of items.
1969	Items []*Object `json:"items,omitempty"`
1970
1971	// Kind: The kind of item this is. For lists of objects, this is always
1972	// storage#objects.
1973	Kind string `json:"kind,omitempty"`
1974
1975	// NextPageToken: The continuation token, used to page through large
1976	// result sets. Provide this value in a subsequent request to return the
1977	// next page of results.
1978	NextPageToken string `json:"nextPageToken,omitempty"`
1979
1980	// Prefixes: The list of prefixes of objects matching-but-not-listed up
1981	// to and including the requested delimiter.
1982	Prefixes []string `json:"prefixes,omitempty"`
1983
1984	// ServerResponse contains the HTTP response code and headers from the
1985	// server.
1986	googleapi.ServerResponse `json:"-"`
1987
1988	// ForceSendFields is a list of field names (e.g. "Items") to
1989	// unconditionally include in API requests. By default, fields with
1990	// empty values are omitted from API requests. However, any non-pointer,
1991	// non-interface field appearing in ForceSendFields will be sent to the
1992	// server regardless of whether the field is empty or not. This may be
1993	// used to include empty fields in Patch requests.
1994	ForceSendFields []string `json:"-"`
1995
1996	// NullFields is a list of field names (e.g. "Items") to include in API
1997	// requests with the JSON null value. By default, fields with empty
1998	// values are omitted from API requests. However, any field with an
1999	// empty value appearing in NullFields will be sent to the server as
2000	// null. It is an error if a field in this list has a non-empty value.
2001	// This may be used to include null fields in Patch requests.
2002	NullFields []string `json:"-"`
2003}
2004
2005func (s *Objects) MarshalJSON() ([]byte, error) {
2006	type NoMethod Objects
2007	raw := NoMethod(*s)
2008	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2009}
2010
2011// Policy: A bucket/object IAM policy.
2012type Policy struct {
2013	// Bindings: An association between a role, which comes with a set of
2014	// permissions, and members who may assume that role.
2015	Bindings []*PolicyBindings `json:"bindings,omitempty"`
2016
2017	// Etag: HTTP 1.1  Entity tag for the policy.
2018	Etag string `json:"etag,omitempty"`
2019
2020	// Kind: The kind of item this is. For policies, this is always
2021	// storage#policy. This field is ignored on input.
2022	Kind string `json:"kind,omitempty"`
2023
2024	// ResourceId: The ID of the resource to which this policy belongs. Will
2025	// be of the form projects/_/buckets/bucket for buckets, and
2026	// projects/_/buckets/bucket/objects/object for objects. A specific
2027	// generation may be specified by appending #generationNumber to the end
2028	// of the object name, e.g.
2029	// projects/_/buckets/my-bucket/objects/data.txt#17. The current
2030	// generation can be denoted with #0. This field is ignored on input.
2031	ResourceId string `json:"resourceId,omitempty"`
2032
2033	// ServerResponse contains the HTTP response code and headers from the
2034	// server.
2035	googleapi.ServerResponse `json:"-"`
2036
2037	// ForceSendFields is a list of field names (e.g. "Bindings") to
2038	// unconditionally include in API requests. By default, fields with
2039	// empty values are omitted from API requests. However, any non-pointer,
2040	// non-interface field appearing in ForceSendFields will be sent to the
2041	// server regardless of whether the field is empty or not. This may be
2042	// used to include empty fields in Patch requests.
2043	ForceSendFields []string `json:"-"`
2044
2045	// NullFields is a list of field names (e.g. "Bindings") to include in
2046	// API requests with the JSON null value. By default, fields with empty
2047	// values are omitted from API requests. However, any field with an
2048	// empty value appearing in NullFields will be sent to the server as
2049	// null. It is an error if a field in this list has a non-empty value.
2050	// This may be used to include null fields in Patch requests.
2051	NullFields []string `json:"-"`
2052}
2053
2054func (s *Policy) MarshalJSON() ([]byte, error) {
2055	type NoMethod Policy
2056	raw := NoMethod(*s)
2057	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2058}
2059
2060type PolicyBindings struct {
2061	// Condition: The condition that is associated with this binding. NOTE:
2062	// an unsatisfied condition will not allow user access via current
2063	// binding. Different bindings, including their conditions, are examined
2064	// independently.
2065	Condition *Expr `json:"condition,omitempty"`
2066
2067	// Members: A collection of identifiers for members who may assume the
2068	// provided role. Recognized identifiers are as follows:
2069	// - allUsers — A special identifier that represents anyone on the
2070	// internet; with or without a Google account.
2071	// - allAuthenticatedUsers — A special identifier that represents
2072	// anyone who is authenticated with a Google account or a service
2073	// account.
2074	// - user:emailid — An email address that represents a specific
2075	// account. For example, user:alice@gmail.com or user:joe@example.com.
2076	//
2077	// - serviceAccount:emailid — An email address that represents a
2078	// service account. For example,
2079	// serviceAccount:my-other-app@appspot.gserviceaccount.com .
2080	// - group:emailid — An email address that represents a Google group.
2081	// For example, group:admins@example.com.
2082	// - domain:domain — A Google Apps domain name that represents all the
2083	// users of that domain. For example, domain:google.com or
2084	// domain:example.com.
2085	// - projectOwner:projectid — Owners of the given project. For
2086	// example, projectOwner:my-example-project
2087	// - projectEditor:projectid — Editors of the given project. For
2088	// example, projectEditor:my-example-project
2089	// - projectViewer:projectid — Viewers of the given project. For
2090	// example, projectViewer:my-example-project
2091	Members []string `json:"members,omitempty"`
2092
2093	// Role: The role to which members belong. Two types of roles are
2094	// supported: new IAM roles, which grant permissions that do not map
2095	// directly to those provided by ACLs, and legacy IAM roles, which do
2096	// map directly to ACL permissions. All roles are of the format
2097	// roles/storage.specificRole.
2098	// The new IAM roles are:
2099	// - roles/storage.admin — Full control of Google Cloud Storage
2100	// resources.
2101	// - roles/storage.objectViewer — Read-Only access to Google Cloud
2102	// Storage objects.
2103	// - roles/storage.objectCreator — Access to create objects in Google
2104	// Cloud Storage.
2105	// - roles/storage.objectAdmin — Full control of Google Cloud Storage
2106	// objects.   The legacy IAM roles are:
2107	// - roles/storage.legacyObjectReader — Read-only access to objects
2108	// without listing. Equivalent to an ACL entry on an object with the
2109	// READER role.
2110	// - roles/storage.legacyObjectOwnerRead/write access to existing
2111	// objects without listing. Equivalent to an ACL entry on an object with
2112	// the OWNER role.
2113	// - roles/storage.legacyBucketReader — Read access to buckets with
2114	// object listing. Equivalent to an ACL entry on a bucket with the
2115	// READER role.
2116	// - roles/storage.legacyBucketWriter — Read access to buckets with
2117	// object listing/creation/deletion. Equivalent to an ACL entry on a
2118	// bucket with the WRITER role.
2119	// - roles/storage.legacyBucketOwner — Read and write access to
2120	// existing buckets with object listing/creation/deletion. Equivalent to
2121	// an ACL entry on a bucket with the OWNER role.
2122	Role string `json:"role,omitempty"`
2123
2124	// ForceSendFields is a list of field names (e.g. "Condition") to
2125	// unconditionally include in API requests. By default, fields with
2126	// empty values are omitted from API requests. However, any non-pointer,
2127	// non-interface field appearing in ForceSendFields will be sent to the
2128	// server regardless of whether the field is empty or not. This may be
2129	// used to include empty fields in Patch requests.
2130	ForceSendFields []string `json:"-"`
2131
2132	// NullFields is a list of field names (e.g. "Condition") to include in
2133	// API requests with the JSON null value. By default, fields with empty
2134	// values are omitted from API requests. However, any field with an
2135	// empty value appearing in NullFields will be sent to the server as
2136	// null. It is an error if a field in this list has a non-empty value.
2137	// This may be used to include null fields in Patch requests.
2138	NullFields []string `json:"-"`
2139}
2140
2141func (s *PolicyBindings) MarshalJSON() ([]byte, error) {
2142	type NoMethod PolicyBindings
2143	raw := NoMethod(*s)
2144	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2145}
2146
2147// RewriteResponse: A rewrite response.
2148type RewriteResponse struct {
2149	// Done: true if the copy is finished; otherwise, false if the copy is
2150	// in progress. This property is always present in the response.
2151	Done bool `json:"done,omitempty"`
2152
2153	// Kind: The kind of item this is.
2154	Kind string `json:"kind,omitempty"`
2155
2156	// ObjectSize: The total size of the object being copied in bytes. This
2157	// property is always present in the response.
2158	ObjectSize int64 `json:"objectSize,omitempty,string"`
2159
2160	// Resource: A resource containing the metadata for the copied-to
2161	// object. This property is present in the response only when copying
2162	// completes.
2163	Resource *Object `json:"resource,omitempty"`
2164
2165	// RewriteToken: A token to use in subsequent requests to continue
2166	// copying data. This token is present in the response only when there
2167	// is more data to copy.
2168	RewriteToken string `json:"rewriteToken,omitempty"`
2169
2170	// TotalBytesRewritten: The total bytes written so far, which can be
2171	// used to provide a waiting user with a progress indicator. This
2172	// property is always present in the response.
2173	TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
2174
2175	// ServerResponse contains the HTTP response code and headers from the
2176	// server.
2177	googleapi.ServerResponse `json:"-"`
2178
2179	// ForceSendFields is a list of field names (e.g. "Done") to
2180	// unconditionally include in API requests. By default, fields with
2181	// empty values are omitted from API requests. However, any non-pointer,
2182	// non-interface field appearing in ForceSendFields will be sent to the
2183	// server regardless of whether the field is empty or not. This may be
2184	// used to include empty fields in Patch requests.
2185	ForceSendFields []string `json:"-"`
2186
2187	// NullFields is a list of field names (e.g. "Done") to include in API
2188	// requests with the JSON null value. By default, fields with empty
2189	// values are omitted from API requests. However, any field with an
2190	// empty value appearing in NullFields will be sent to the server as
2191	// null. It is an error if a field in this list has a non-empty value.
2192	// This may be used to include null fields in Patch requests.
2193	NullFields []string `json:"-"`
2194}
2195
2196func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
2197	type NoMethod RewriteResponse
2198	raw := NoMethod(*s)
2199	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2200}
2201
2202// ServiceAccount: A subscription to receive Google PubSub
2203// notifications.
2204type ServiceAccount struct {
2205	// EmailAddress: The ID of the notification.
2206	EmailAddress string `json:"email_address,omitempty"`
2207
2208	// Kind: The kind of item this is. For notifications, this is always
2209	// storage#notification.
2210	Kind string `json:"kind,omitempty"`
2211
2212	// ServerResponse contains the HTTP response code and headers from the
2213	// server.
2214	googleapi.ServerResponse `json:"-"`
2215
2216	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
2217	// unconditionally include in API requests. By default, fields with
2218	// empty values are omitted from API requests. However, any non-pointer,
2219	// non-interface field appearing in ForceSendFields will be sent to the
2220	// server regardless of whether the field is empty or not. This may be
2221	// used to include empty fields in Patch requests.
2222	ForceSendFields []string `json:"-"`
2223
2224	// NullFields is a list of field names (e.g. "EmailAddress") to include
2225	// in API requests with the JSON null value. By default, fields with
2226	// empty values are omitted from API requests. However, any field with
2227	// an empty value appearing in NullFields will be sent to the server as
2228	// null. It is an error if a field in this list has a non-empty value.
2229	// This may be used to include null fields in Patch requests.
2230	NullFields []string `json:"-"`
2231}
2232
2233func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
2234	type NoMethod ServiceAccount
2235	raw := NoMethod(*s)
2236	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2237}
2238
2239// TestIamPermissionsResponse: A
2240// storage.(buckets|objects).testIamPermissions response.
2241type TestIamPermissionsResponse struct {
2242	// Kind: The kind of item this is.
2243	Kind string `json:"kind,omitempty"`
2244
2245	// Permissions: The permissions held by the caller. Permissions are
2246	// always of the format storage.resource.capability, where resource is
2247	// one of buckets or objects. The supported permissions are as follows:
2248	//
2249	// - storage.buckets.delete — Delete bucket.
2250	// - storage.buckets.get — Read bucket metadata.
2251	// - storage.buckets.getIamPolicy — Read bucket IAM policy.
2252	// - storage.buckets.create — Create bucket.
2253	// - storage.buckets.list — List buckets.
2254	// - storage.buckets.setIamPolicy — Update bucket IAM policy.
2255	// - storage.buckets.update — Update bucket metadata.
2256	// - storage.objects.delete — Delete object.
2257	// - storage.objects.get — Read object data and metadata.
2258	// - storage.objects.getIamPolicy — Read object IAM policy.
2259	// - storage.objects.create — Create object.
2260	// - storage.objects.list — List objects.
2261	// - storage.objects.setIamPolicy — Update object IAM policy.
2262	// - storage.objects.update — Update object metadata.
2263	Permissions []string `json:"permissions,omitempty"`
2264
2265	// ServerResponse contains the HTTP response code and headers from the
2266	// server.
2267	googleapi.ServerResponse `json:"-"`
2268
2269	// ForceSendFields is a list of field names (e.g. "Kind") to
2270	// unconditionally include in API requests. By default, fields with
2271	// empty values are omitted from API requests. However, any non-pointer,
2272	// non-interface field appearing in ForceSendFields will be sent to the
2273	// server regardless of whether the field is empty or not. This may be
2274	// used to include empty fields in Patch requests.
2275	ForceSendFields []string `json:"-"`
2276
2277	// NullFields is a list of field names (e.g. "Kind") to include in API
2278	// requests with the JSON null value. By default, fields with empty
2279	// values are omitted from API requests. However, any field with an
2280	// empty value appearing in NullFields will be sent to the server as
2281	// null. It is an error if a field in this list has a non-empty value.
2282	// This may be used to include null fields in Patch requests.
2283	NullFields []string `json:"-"`
2284}
2285
2286func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
2287	type NoMethod TestIamPermissionsResponse
2288	raw := NoMethod(*s)
2289	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2290}
2291
2292// method id "storage.bucketAccessControls.delete":
2293
2294type BucketAccessControlsDeleteCall struct {
2295	s          *Service
2296	bucket     string
2297	entity     string
2298	urlParams_ gensupport.URLParams
2299	ctx_       context.Context
2300	header_    http.Header
2301}
2302
2303// Delete: Permanently deletes the ACL entry for the specified entity on
2304// the specified bucket.
2305func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
2306	c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2307	c.bucket = bucket
2308	c.entity = entity
2309	return c
2310}
2311
2312// ProvisionalUserProject sets the optional parameter
2313// "provisionalUserProject": The project to be billed for this request
2314// if the target bucket is requester-pays bucket.
2315func (c *BucketAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsDeleteCall {
2316	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2317	return c
2318}
2319
2320// UserProject sets the optional parameter "userProject": The project to
2321// be billed for this request. Required for Requester Pays buckets.
2322func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
2323	c.urlParams_.Set("userProject", userProject)
2324	return c
2325}
2326
2327// Fields allows partial responses to be retrieved. See
2328// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2329// for more information.
2330func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
2331	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2332	return c
2333}
2334
2335// Context sets the context to be used in this call's Do method. Any
2336// pending HTTP request will be aborted if the provided context is
2337// canceled.
2338func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
2339	c.ctx_ = ctx
2340	return c
2341}
2342
2343// Header returns an http.Header that can be modified by the caller to
2344// add HTTP headers to the request.
2345func (c *BucketAccessControlsDeleteCall) Header() http.Header {
2346	if c.header_ == nil {
2347		c.header_ = make(http.Header)
2348	}
2349	return c.header_
2350}
2351
2352func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
2353	reqHeaders := make(http.Header)
2354	for k, v := range c.header_ {
2355		reqHeaders[k] = v
2356	}
2357	reqHeaders.Set("User-Agent", c.s.userAgent())
2358	var body io.Reader = nil
2359	c.urlParams_.Set("alt", alt)
2360	c.urlParams_.Set("prettyPrint", "false")
2361	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2362	urls += "?" + c.urlParams_.Encode()
2363	req, err := http.NewRequest("DELETE", urls, body)
2364	if err != nil {
2365		return nil, err
2366	}
2367	req.Header = reqHeaders
2368	googleapi.Expand(req.URL, map[string]string{
2369		"bucket": c.bucket,
2370		"entity": c.entity,
2371	})
2372	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2373}
2374
2375// Do executes the "storage.bucketAccessControls.delete" call.
2376func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
2377	gensupport.SetOptions(c.urlParams_, opts...)
2378	res, err := c.doRequest("json")
2379	if err != nil {
2380		return err
2381	}
2382	defer googleapi.CloseBody(res)
2383	if err := googleapi.CheckResponse(res); err != nil {
2384		return err
2385	}
2386	return nil
2387	// {
2388	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
2389	//   "httpMethod": "DELETE",
2390	//   "id": "storage.bucketAccessControls.delete",
2391	//   "parameterOrder": [
2392	//     "bucket",
2393	//     "entity"
2394	//   ],
2395	//   "parameters": {
2396	//     "bucket": {
2397	//       "description": "Name of a bucket.",
2398	//       "location": "path",
2399	//       "required": true,
2400	//       "type": "string"
2401	//     },
2402	//     "entity": {
2403	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2404	//       "location": "path",
2405	//       "required": true,
2406	//       "type": "string"
2407	//     },
2408	//     "provisionalUserProject": {
2409	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2410	//       "location": "query",
2411	//       "type": "string"
2412	//     },
2413	//     "userProject": {
2414	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2415	//       "location": "query",
2416	//       "type": "string"
2417	//     }
2418	//   },
2419	//   "path": "b/{bucket}/acl/{entity}",
2420	//   "scopes": [
2421	//     "https://www.googleapis.com/auth/cloud-platform",
2422	//     "https://www.googleapis.com/auth/devstorage.full_control"
2423	//   ]
2424	// }
2425
2426}
2427
2428// method id "storage.bucketAccessControls.get":
2429
2430type BucketAccessControlsGetCall struct {
2431	s            *Service
2432	bucket       string
2433	entity       string
2434	urlParams_   gensupport.URLParams
2435	ifNoneMatch_ string
2436	ctx_         context.Context
2437	header_      http.Header
2438}
2439
2440// Get: Returns the ACL entry for the specified entity on the specified
2441// bucket.
2442func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
2443	c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2444	c.bucket = bucket
2445	c.entity = entity
2446	return c
2447}
2448
2449// ProvisionalUserProject sets the optional parameter
2450// "provisionalUserProject": The project to be billed for this request
2451// if the target bucket is requester-pays bucket.
2452func (c *BucketAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsGetCall {
2453	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2454	return c
2455}
2456
2457// UserProject sets the optional parameter "userProject": The project to
2458// be billed for this request. Required for Requester Pays buckets.
2459func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
2460	c.urlParams_.Set("userProject", userProject)
2461	return c
2462}
2463
2464// Fields allows partial responses to be retrieved. See
2465// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2466// for more information.
2467func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
2468	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2469	return c
2470}
2471
2472// IfNoneMatch sets the optional parameter which makes the operation
2473// fail if the object's ETag matches the given value. This is useful for
2474// getting updates only after the object has changed since the last
2475// request. Use googleapi.IsNotModified to check whether the response
2476// error from Do is the result of In-None-Match.
2477func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
2478	c.ifNoneMatch_ = entityTag
2479	return c
2480}
2481
2482// Context sets the context to be used in this call's Do method. Any
2483// pending HTTP request will be aborted if the provided context is
2484// canceled.
2485func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
2486	c.ctx_ = ctx
2487	return c
2488}
2489
2490// Header returns an http.Header that can be modified by the caller to
2491// add HTTP headers to the request.
2492func (c *BucketAccessControlsGetCall) Header() http.Header {
2493	if c.header_ == nil {
2494		c.header_ = make(http.Header)
2495	}
2496	return c.header_
2497}
2498
2499func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
2500	reqHeaders := make(http.Header)
2501	for k, v := range c.header_ {
2502		reqHeaders[k] = v
2503	}
2504	reqHeaders.Set("User-Agent", c.s.userAgent())
2505	if c.ifNoneMatch_ != "" {
2506		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2507	}
2508	var body io.Reader = nil
2509	c.urlParams_.Set("alt", alt)
2510	c.urlParams_.Set("prettyPrint", "false")
2511	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2512	urls += "?" + c.urlParams_.Encode()
2513	req, err := http.NewRequest("GET", urls, body)
2514	if err != nil {
2515		return nil, err
2516	}
2517	req.Header = reqHeaders
2518	googleapi.Expand(req.URL, map[string]string{
2519		"bucket": c.bucket,
2520		"entity": c.entity,
2521	})
2522	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2523}
2524
2525// Do executes the "storage.bucketAccessControls.get" call.
2526// Exactly one of *BucketAccessControl or error will be non-nil. Any
2527// non-2xx status code is an error. Response headers are in either
2528// *BucketAccessControl.ServerResponse.Header or (if a response was
2529// returned at all) in error.(*googleapi.Error).Header. Use
2530// googleapi.IsNotModified to check whether the returned error was
2531// because http.StatusNotModified was returned.
2532func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2533	gensupport.SetOptions(c.urlParams_, opts...)
2534	res, err := c.doRequest("json")
2535	if res != nil && res.StatusCode == http.StatusNotModified {
2536		if res.Body != nil {
2537			res.Body.Close()
2538		}
2539		return nil, &googleapi.Error{
2540			Code:   res.StatusCode,
2541			Header: res.Header,
2542		}
2543	}
2544	if err != nil {
2545		return nil, err
2546	}
2547	defer googleapi.CloseBody(res)
2548	if err := googleapi.CheckResponse(res); err != nil {
2549		return nil, err
2550	}
2551	ret := &BucketAccessControl{
2552		ServerResponse: googleapi.ServerResponse{
2553			Header:         res.Header,
2554			HTTPStatusCode: res.StatusCode,
2555		},
2556	}
2557	target := &ret
2558	if err := gensupport.DecodeResponse(target, res); err != nil {
2559		return nil, err
2560	}
2561	return ret, nil
2562	// {
2563	//   "description": "Returns the ACL entry for the specified entity on the specified bucket.",
2564	//   "httpMethod": "GET",
2565	//   "id": "storage.bucketAccessControls.get",
2566	//   "parameterOrder": [
2567	//     "bucket",
2568	//     "entity"
2569	//   ],
2570	//   "parameters": {
2571	//     "bucket": {
2572	//       "description": "Name of a bucket.",
2573	//       "location": "path",
2574	//       "required": true,
2575	//       "type": "string"
2576	//     },
2577	//     "entity": {
2578	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2579	//       "location": "path",
2580	//       "required": true,
2581	//       "type": "string"
2582	//     },
2583	//     "provisionalUserProject": {
2584	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2585	//       "location": "query",
2586	//       "type": "string"
2587	//     },
2588	//     "userProject": {
2589	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2590	//       "location": "query",
2591	//       "type": "string"
2592	//     }
2593	//   },
2594	//   "path": "b/{bucket}/acl/{entity}",
2595	//   "response": {
2596	//     "$ref": "BucketAccessControl"
2597	//   },
2598	//   "scopes": [
2599	//     "https://www.googleapis.com/auth/cloud-platform",
2600	//     "https://www.googleapis.com/auth/devstorage.full_control"
2601	//   ]
2602	// }
2603
2604}
2605
2606// method id "storage.bucketAccessControls.insert":
2607
2608type BucketAccessControlsInsertCall struct {
2609	s                   *Service
2610	bucket              string
2611	bucketaccesscontrol *BucketAccessControl
2612	urlParams_          gensupport.URLParams
2613	ctx_                context.Context
2614	header_             http.Header
2615}
2616
2617// Insert: Creates a new ACL entry on the specified bucket.
2618func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
2619	c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2620	c.bucket = bucket
2621	c.bucketaccesscontrol = bucketaccesscontrol
2622	return c
2623}
2624
2625// ProvisionalUserProject sets the optional parameter
2626// "provisionalUserProject": The project to be billed for this request
2627// if the target bucket is requester-pays bucket.
2628func (c *BucketAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsInsertCall {
2629	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2630	return c
2631}
2632
2633// UserProject sets the optional parameter "userProject": The project to
2634// be billed for this request. Required for Requester Pays buckets.
2635func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
2636	c.urlParams_.Set("userProject", userProject)
2637	return c
2638}
2639
2640// Fields allows partial responses to be retrieved. See
2641// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2642// for more information.
2643func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
2644	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2645	return c
2646}
2647
2648// Context sets the context to be used in this call's Do method. Any
2649// pending HTTP request will be aborted if the provided context is
2650// canceled.
2651func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
2652	c.ctx_ = ctx
2653	return c
2654}
2655
2656// Header returns an http.Header that can be modified by the caller to
2657// add HTTP headers to the request.
2658func (c *BucketAccessControlsInsertCall) Header() http.Header {
2659	if c.header_ == nil {
2660		c.header_ = make(http.Header)
2661	}
2662	return c.header_
2663}
2664
2665func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
2666	reqHeaders := make(http.Header)
2667	for k, v := range c.header_ {
2668		reqHeaders[k] = v
2669	}
2670	reqHeaders.Set("User-Agent", c.s.userAgent())
2671	var body io.Reader = nil
2672	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2673	if err != nil {
2674		return nil, err
2675	}
2676	reqHeaders.Set("Content-Type", "application/json")
2677	c.urlParams_.Set("alt", alt)
2678	c.urlParams_.Set("prettyPrint", "false")
2679	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2680	urls += "?" + c.urlParams_.Encode()
2681	req, err := http.NewRequest("POST", urls, body)
2682	if err != nil {
2683		return nil, err
2684	}
2685	req.Header = reqHeaders
2686	googleapi.Expand(req.URL, map[string]string{
2687		"bucket": c.bucket,
2688	})
2689	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2690}
2691
2692// Do executes the "storage.bucketAccessControls.insert" call.
2693// Exactly one of *BucketAccessControl or error will be non-nil. Any
2694// non-2xx status code is an error. Response headers are in either
2695// *BucketAccessControl.ServerResponse.Header or (if a response was
2696// returned at all) in error.(*googleapi.Error).Header. Use
2697// googleapi.IsNotModified to check whether the returned error was
2698// because http.StatusNotModified was returned.
2699func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2700	gensupport.SetOptions(c.urlParams_, opts...)
2701	res, err := c.doRequest("json")
2702	if res != nil && res.StatusCode == http.StatusNotModified {
2703		if res.Body != nil {
2704			res.Body.Close()
2705		}
2706		return nil, &googleapi.Error{
2707			Code:   res.StatusCode,
2708			Header: res.Header,
2709		}
2710	}
2711	if err != nil {
2712		return nil, err
2713	}
2714	defer googleapi.CloseBody(res)
2715	if err := googleapi.CheckResponse(res); err != nil {
2716		return nil, err
2717	}
2718	ret := &BucketAccessControl{
2719		ServerResponse: googleapi.ServerResponse{
2720			Header:         res.Header,
2721			HTTPStatusCode: res.StatusCode,
2722		},
2723	}
2724	target := &ret
2725	if err := gensupport.DecodeResponse(target, res); err != nil {
2726		return nil, err
2727	}
2728	return ret, nil
2729	// {
2730	//   "description": "Creates a new ACL entry on the specified bucket.",
2731	//   "httpMethod": "POST",
2732	//   "id": "storage.bucketAccessControls.insert",
2733	//   "parameterOrder": [
2734	//     "bucket"
2735	//   ],
2736	//   "parameters": {
2737	//     "bucket": {
2738	//       "description": "Name of a bucket.",
2739	//       "location": "path",
2740	//       "required": true,
2741	//       "type": "string"
2742	//     },
2743	//     "provisionalUserProject": {
2744	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2745	//       "location": "query",
2746	//       "type": "string"
2747	//     },
2748	//     "userProject": {
2749	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2750	//       "location": "query",
2751	//       "type": "string"
2752	//     }
2753	//   },
2754	//   "path": "b/{bucket}/acl",
2755	//   "request": {
2756	//     "$ref": "BucketAccessControl"
2757	//   },
2758	//   "response": {
2759	//     "$ref": "BucketAccessControl"
2760	//   },
2761	//   "scopes": [
2762	//     "https://www.googleapis.com/auth/cloud-platform",
2763	//     "https://www.googleapis.com/auth/devstorage.full_control"
2764	//   ]
2765	// }
2766
2767}
2768
2769// method id "storage.bucketAccessControls.list":
2770
2771type BucketAccessControlsListCall struct {
2772	s            *Service
2773	bucket       string
2774	urlParams_   gensupport.URLParams
2775	ifNoneMatch_ string
2776	ctx_         context.Context
2777	header_      http.Header
2778}
2779
2780// List: Retrieves ACL entries on the specified bucket.
2781func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
2782	c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2783	c.bucket = bucket
2784	return c
2785}
2786
2787// ProvisionalUserProject sets the optional parameter
2788// "provisionalUserProject": The project to be billed for this request
2789// if the target bucket is requester-pays bucket.
2790func (c *BucketAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsListCall {
2791	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2792	return c
2793}
2794
2795// UserProject sets the optional parameter "userProject": The project to
2796// be billed for this request. Required for Requester Pays buckets.
2797func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
2798	c.urlParams_.Set("userProject", userProject)
2799	return c
2800}
2801
2802// Fields allows partial responses to be retrieved. See
2803// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2804// for more information.
2805func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
2806	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2807	return c
2808}
2809
2810// IfNoneMatch sets the optional parameter which makes the operation
2811// fail if the object's ETag matches the given value. This is useful for
2812// getting updates only after the object has changed since the last
2813// request. Use googleapi.IsNotModified to check whether the response
2814// error from Do is the result of In-None-Match.
2815func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
2816	c.ifNoneMatch_ = entityTag
2817	return c
2818}
2819
2820// Context sets the context to be used in this call's Do method. Any
2821// pending HTTP request will be aborted if the provided context is
2822// canceled.
2823func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
2824	c.ctx_ = ctx
2825	return c
2826}
2827
2828// Header returns an http.Header that can be modified by the caller to
2829// add HTTP headers to the request.
2830func (c *BucketAccessControlsListCall) Header() http.Header {
2831	if c.header_ == nil {
2832		c.header_ = make(http.Header)
2833	}
2834	return c.header_
2835}
2836
2837func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
2838	reqHeaders := make(http.Header)
2839	for k, v := range c.header_ {
2840		reqHeaders[k] = v
2841	}
2842	reqHeaders.Set("User-Agent", c.s.userAgent())
2843	if c.ifNoneMatch_ != "" {
2844		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2845	}
2846	var body io.Reader = nil
2847	c.urlParams_.Set("alt", alt)
2848	c.urlParams_.Set("prettyPrint", "false")
2849	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2850	urls += "?" + c.urlParams_.Encode()
2851	req, err := http.NewRequest("GET", urls, body)
2852	if err != nil {
2853		return nil, err
2854	}
2855	req.Header = reqHeaders
2856	googleapi.Expand(req.URL, map[string]string{
2857		"bucket": c.bucket,
2858	})
2859	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2860}
2861
2862// Do executes the "storage.bucketAccessControls.list" call.
2863// Exactly one of *BucketAccessControls or error will be non-nil. Any
2864// non-2xx status code is an error. Response headers are in either
2865// *BucketAccessControls.ServerResponse.Header or (if a response was
2866// returned at all) in error.(*googleapi.Error).Header. Use
2867// googleapi.IsNotModified to check whether the returned error was
2868// because http.StatusNotModified was returned.
2869func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
2870	gensupport.SetOptions(c.urlParams_, opts...)
2871	res, err := c.doRequest("json")
2872	if res != nil && res.StatusCode == http.StatusNotModified {
2873		if res.Body != nil {
2874			res.Body.Close()
2875		}
2876		return nil, &googleapi.Error{
2877			Code:   res.StatusCode,
2878			Header: res.Header,
2879		}
2880	}
2881	if err != nil {
2882		return nil, err
2883	}
2884	defer googleapi.CloseBody(res)
2885	if err := googleapi.CheckResponse(res); err != nil {
2886		return nil, err
2887	}
2888	ret := &BucketAccessControls{
2889		ServerResponse: googleapi.ServerResponse{
2890			Header:         res.Header,
2891			HTTPStatusCode: res.StatusCode,
2892		},
2893	}
2894	target := &ret
2895	if err := gensupport.DecodeResponse(target, res); err != nil {
2896		return nil, err
2897	}
2898	return ret, nil
2899	// {
2900	//   "description": "Retrieves ACL entries on the specified bucket.",
2901	//   "httpMethod": "GET",
2902	//   "id": "storage.bucketAccessControls.list",
2903	//   "parameterOrder": [
2904	//     "bucket"
2905	//   ],
2906	//   "parameters": {
2907	//     "bucket": {
2908	//       "description": "Name of a bucket.",
2909	//       "location": "path",
2910	//       "required": true,
2911	//       "type": "string"
2912	//     },
2913	//     "provisionalUserProject": {
2914	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
2915	//       "location": "query",
2916	//       "type": "string"
2917	//     },
2918	//     "userProject": {
2919	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2920	//       "location": "query",
2921	//       "type": "string"
2922	//     }
2923	//   },
2924	//   "path": "b/{bucket}/acl",
2925	//   "response": {
2926	//     "$ref": "BucketAccessControls"
2927	//   },
2928	//   "scopes": [
2929	//     "https://www.googleapis.com/auth/cloud-platform",
2930	//     "https://www.googleapis.com/auth/devstorage.full_control"
2931	//   ]
2932	// }
2933
2934}
2935
2936// method id "storage.bucketAccessControls.patch":
2937
2938type BucketAccessControlsPatchCall struct {
2939	s                   *Service
2940	bucket              string
2941	entity              string
2942	bucketaccesscontrol *BucketAccessControl
2943	urlParams_          gensupport.URLParams
2944	ctx_                context.Context
2945	header_             http.Header
2946}
2947
2948// Patch: Patches an ACL entry on the specified bucket.
2949func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
2950	c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2951	c.bucket = bucket
2952	c.entity = entity
2953	c.bucketaccesscontrol = bucketaccesscontrol
2954	return c
2955}
2956
2957// ProvisionalUserProject sets the optional parameter
2958// "provisionalUserProject": The project to be billed for this request
2959// if the target bucket is requester-pays bucket.
2960func (c *BucketAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsPatchCall {
2961	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
2962	return c
2963}
2964
2965// UserProject sets the optional parameter "userProject": The project to
2966// be billed for this request. Required for Requester Pays buckets.
2967func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
2968	c.urlParams_.Set("userProject", userProject)
2969	return c
2970}
2971
2972// Fields allows partial responses to be retrieved. See
2973// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2974// for more information.
2975func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
2976	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2977	return c
2978}
2979
2980// Context sets the context to be used in this call's Do method. Any
2981// pending HTTP request will be aborted if the provided context is
2982// canceled.
2983func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
2984	c.ctx_ = ctx
2985	return c
2986}
2987
2988// Header returns an http.Header that can be modified by the caller to
2989// add HTTP headers to the request.
2990func (c *BucketAccessControlsPatchCall) Header() http.Header {
2991	if c.header_ == nil {
2992		c.header_ = make(http.Header)
2993	}
2994	return c.header_
2995}
2996
2997func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
2998	reqHeaders := make(http.Header)
2999	for k, v := range c.header_ {
3000		reqHeaders[k] = v
3001	}
3002	reqHeaders.Set("User-Agent", c.s.userAgent())
3003	var body io.Reader = nil
3004	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
3005	if err != nil {
3006		return nil, err
3007	}
3008	reqHeaders.Set("Content-Type", "application/json")
3009	c.urlParams_.Set("alt", alt)
3010	c.urlParams_.Set("prettyPrint", "false")
3011	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
3012	urls += "?" + c.urlParams_.Encode()
3013	req, err := http.NewRequest("PATCH", urls, body)
3014	if err != nil {
3015		return nil, err
3016	}
3017	req.Header = reqHeaders
3018	googleapi.Expand(req.URL, map[string]string{
3019		"bucket": c.bucket,
3020		"entity": c.entity,
3021	})
3022	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3023}
3024
3025// Do executes the "storage.bucketAccessControls.patch" call.
3026// Exactly one of *BucketAccessControl or error will be non-nil. Any
3027// non-2xx status code is an error. Response headers are in either
3028// *BucketAccessControl.ServerResponse.Header or (if a response was
3029// returned at all) in error.(*googleapi.Error).Header. Use
3030// googleapi.IsNotModified to check whether the returned error was
3031// because http.StatusNotModified was returned.
3032func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
3033	gensupport.SetOptions(c.urlParams_, opts...)
3034	res, err := c.doRequest("json")
3035	if res != nil && res.StatusCode == http.StatusNotModified {
3036		if res.Body != nil {
3037			res.Body.Close()
3038		}
3039		return nil, &googleapi.Error{
3040			Code:   res.StatusCode,
3041			Header: res.Header,
3042		}
3043	}
3044	if err != nil {
3045		return nil, err
3046	}
3047	defer googleapi.CloseBody(res)
3048	if err := googleapi.CheckResponse(res); err != nil {
3049		return nil, err
3050	}
3051	ret := &BucketAccessControl{
3052		ServerResponse: googleapi.ServerResponse{
3053			Header:         res.Header,
3054			HTTPStatusCode: res.StatusCode,
3055		},
3056	}
3057	target := &ret
3058	if err := gensupport.DecodeResponse(target, res); err != nil {
3059		return nil, err
3060	}
3061	return ret, nil
3062	// {
3063	//   "description": "Patches an ACL entry on the specified bucket.",
3064	//   "httpMethod": "PATCH",
3065	//   "id": "storage.bucketAccessControls.patch",
3066	//   "parameterOrder": [
3067	//     "bucket",
3068	//     "entity"
3069	//   ],
3070	//   "parameters": {
3071	//     "bucket": {
3072	//       "description": "Name of a bucket.",
3073	//       "location": "path",
3074	//       "required": true,
3075	//       "type": "string"
3076	//     },
3077	//     "entity": {
3078	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
3079	//       "location": "path",
3080	//       "required": true,
3081	//       "type": "string"
3082	//     },
3083	//     "provisionalUserProject": {
3084	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3085	//       "location": "query",
3086	//       "type": "string"
3087	//     },
3088	//     "userProject": {
3089	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3090	//       "location": "query",
3091	//       "type": "string"
3092	//     }
3093	//   },
3094	//   "path": "b/{bucket}/acl/{entity}",
3095	//   "request": {
3096	//     "$ref": "BucketAccessControl"
3097	//   },
3098	//   "response": {
3099	//     "$ref": "BucketAccessControl"
3100	//   },
3101	//   "scopes": [
3102	//     "https://www.googleapis.com/auth/cloud-platform",
3103	//     "https://www.googleapis.com/auth/devstorage.full_control"
3104	//   ]
3105	// }
3106
3107}
3108
3109// method id "storage.bucketAccessControls.update":
3110
3111type BucketAccessControlsUpdateCall struct {
3112	s                   *Service
3113	bucket              string
3114	entity              string
3115	bucketaccesscontrol *BucketAccessControl
3116	urlParams_          gensupport.URLParams
3117	ctx_                context.Context
3118	header_             http.Header
3119}
3120
3121// Update: Updates an ACL entry on the specified bucket.
3122func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
3123	c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3124	c.bucket = bucket
3125	c.entity = entity
3126	c.bucketaccesscontrol = bucketaccesscontrol
3127	return c
3128}
3129
3130// ProvisionalUserProject sets the optional parameter
3131// "provisionalUserProject": The project to be billed for this request
3132// if the target bucket is requester-pays bucket.
3133func (c *BucketAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketAccessControlsUpdateCall {
3134	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3135	return c
3136}
3137
3138// UserProject sets the optional parameter "userProject": The project to
3139// be billed for this request. Required for Requester Pays buckets.
3140func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
3141	c.urlParams_.Set("userProject", userProject)
3142	return c
3143}
3144
3145// Fields allows partial responses to be retrieved. See
3146// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3147// for more information.
3148func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
3149	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3150	return c
3151}
3152
3153// Context sets the context to be used in this call's Do method. Any
3154// pending HTTP request will be aborted if the provided context is
3155// canceled.
3156func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
3157	c.ctx_ = ctx
3158	return c
3159}
3160
3161// Header returns an http.Header that can be modified by the caller to
3162// add HTTP headers to the request.
3163func (c *BucketAccessControlsUpdateCall) Header() http.Header {
3164	if c.header_ == nil {
3165		c.header_ = make(http.Header)
3166	}
3167	return c.header_
3168}
3169
3170func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
3171	reqHeaders := make(http.Header)
3172	for k, v := range c.header_ {
3173		reqHeaders[k] = v
3174	}
3175	reqHeaders.Set("User-Agent", c.s.userAgent())
3176	var body io.Reader = nil
3177	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
3178	if err != nil {
3179		return nil, err
3180	}
3181	reqHeaders.Set("Content-Type", "application/json")
3182	c.urlParams_.Set("alt", alt)
3183	c.urlParams_.Set("prettyPrint", "false")
3184	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
3185	urls += "?" + c.urlParams_.Encode()
3186	req, err := http.NewRequest("PUT", urls, body)
3187	if err != nil {
3188		return nil, err
3189	}
3190	req.Header = reqHeaders
3191	googleapi.Expand(req.URL, map[string]string{
3192		"bucket": c.bucket,
3193		"entity": c.entity,
3194	})
3195	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3196}
3197
3198// Do executes the "storage.bucketAccessControls.update" call.
3199// Exactly one of *BucketAccessControl or error will be non-nil. Any
3200// non-2xx status code is an error. Response headers are in either
3201// *BucketAccessControl.ServerResponse.Header or (if a response was
3202// returned at all) in error.(*googleapi.Error).Header. Use
3203// googleapi.IsNotModified to check whether the returned error was
3204// because http.StatusNotModified was returned.
3205func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
3206	gensupport.SetOptions(c.urlParams_, opts...)
3207	res, err := c.doRequest("json")
3208	if res != nil && res.StatusCode == http.StatusNotModified {
3209		if res.Body != nil {
3210			res.Body.Close()
3211		}
3212		return nil, &googleapi.Error{
3213			Code:   res.StatusCode,
3214			Header: res.Header,
3215		}
3216	}
3217	if err != nil {
3218		return nil, err
3219	}
3220	defer googleapi.CloseBody(res)
3221	if err := googleapi.CheckResponse(res); err != nil {
3222		return nil, err
3223	}
3224	ret := &BucketAccessControl{
3225		ServerResponse: googleapi.ServerResponse{
3226			Header:         res.Header,
3227			HTTPStatusCode: res.StatusCode,
3228		},
3229	}
3230	target := &ret
3231	if err := gensupport.DecodeResponse(target, res); err != nil {
3232		return nil, err
3233	}
3234	return ret, nil
3235	// {
3236	//   "description": "Updates an ACL entry on the specified bucket.",
3237	//   "httpMethod": "PUT",
3238	//   "id": "storage.bucketAccessControls.update",
3239	//   "parameterOrder": [
3240	//     "bucket",
3241	//     "entity"
3242	//   ],
3243	//   "parameters": {
3244	//     "bucket": {
3245	//       "description": "Name of a bucket.",
3246	//       "location": "path",
3247	//       "required": true,
3248	//       "type": "string"
3249	//     },
3250	//     "entity": {
3251	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
3252	//       "location": "path",
3253	//       "required": true,
3254	//       "type": "string"
3255	//     },
3256	//     "provisionalUserProject": {
3257	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3258	//       "location": "query",
3259	//       "type": "string"
3260	//     },
3261	//     "userProject": {
3262	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3263	//       "location": "query",
3264	//       "type": "string"
3265	//     }
3266	//   },
3267	//   "path": "b/{bucket}/acl/{entity}",
3268	//   "request": {
3269	//     "$ref": "BucketAccessControl"
3270	//   },
3271	//   "response": {
3272	//     "$ref": "BucketAccessControl"
3273	//   },
3274	//   "scopes": [
3275	//     "https://www.googleapis.com/auth/cloud-platform",
3276	//     "https://www.googleapis.com/auth/devstorage.full_control"
3277	//   ]
3278	// }
3279
3280}
3281
3282// method id "storage.buckets.delete":
3283
3284type BucketsDeleteCall struct {
3285	s          *Service
3286	bucket     string
3287	urlParams_ gensupport.URLParams
3288	ctx_       context.Context
3289	header_    http.Header
3290}
3291
3292// Delete: Permanently deletes an empty bucket.
3293func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
3294	c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3295	c.bucket = bucket
3296	return c
3297}
3298
3299// IfMetagenerationMatch sets the optional parameter
3300// "ifMetagenerationMatch": If set, only deletes the bucket if its
3301// metageneration matches this value.
3302func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall {
3303	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3304	return c
3305}
3306
3307// IfMetagenerationNotMatch sets the optional parameter
3308// "ifMetagenerationNotMatch": If set, only deletes the bucket if its
3309// metageneration does not match this value.
3310func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall {
3311	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3312	return c
3313}
3314
3315// ProvisionalUserProject sets the optional parameter
3316// "provisionalUserProject": The project to be billed for this request
3317// if the target bucket is requester-pays bucket.
3318func (c *BucketsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *BucketsDeleteCall {
3319	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3320	return c
3321}
3322
3323// UserProject sets the optional parameter "userProject": The project to
3324// be billed for this request. Required for Requester Pays buckets.
3325func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
3326	c.urlParams_.Set("userProject", userProject)
3327	return c
3328}
3329
3330// Fields allows partial responses to be retrieved. See
3331// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3332// for more information.
3333func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
3334	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3335	return c
3336}
3337
3338// Context sets the context to be used in this call's Do method. Any
3339// pending HTTP request will be aborted if the provided context is
3340// canceled.
3341func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
3342	c.ctx_ = ctx
3343	return c
3344}
3345
3346// Header returns an http.Header that can be modified by the caller to
3347// add HTTP headers to the request.
3348func (c *BucketsDeleteCall) Header() http.Header {
3349	if c.header_ == nil {
3350		c.header_ = make(http.Header)
3351	}
3352	return c.header_
3353}
3354
3355func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
3356	reqHeaders := make(http.Header)
3357	for k, v := range c.header_ {
3358		reqHeaders[k] = v
3359	}
3360	reqHeaders.Set("User-Agent", c.s.userAgent())
3361	var body io.Reader = nil
3362	c.urlParams_.Set("alt", alt)
3363	c.urlParams_.Set("prettyPrint", "false")
3364	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3365	urls += "?" + c.urlParams_.Encode()
3366	req, err := http.NewRequest("DELETE", urls, body)
3367	if err != nil {
3368		return nil, err
3369	}
3370	req.Header = reqHeaders
3371	googleapi.Expand(req.URL, map[string]string{
3372		"bucket": c.bucket,
3373	})
3374	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3375}
3376
3377// Do executes the "storage.buckets.delete" call.
3378func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
3379	gensupport.SetOptions(c.urlParams_, opts...)
3380	res, err := c.doRequest("json")
3381	if err != nil {
3382		return err
3383	}
3384	defer googleapi.CloseBody(res)
3385	if err := googleapi.CheckResponse(res); err != nil {
3386		return err
3387	}
3388	return nil
3389	// {
3390	//   "description": "Permanently deletes an empty bucket.",
3391	//   "httpMethod": "DELETE",
3392	//   "id": "storage.buckets.delete",
3393	//   "parameterOrder": [
3394	//     "bucket"
3395	//   ],
3396	//   "parameters": {
3397	//     "bucket": {
3398	//       "description": "Name of a bucket.",
3399	//       "location": "path",
3400	//       "required": true,
3401	//       "type": "string"
3402	//     },
3403	//     "ifMetagenerationMatch": {
3404	//       "description": "If set, only deletes the bucket if its metageneration matches this value.",
3405	//       "format": "int64",
3406	//       "location": "query",
3407	//       "type": "string"
3408	//     },
3409	//     "ifMetagenerationNotMatch": {
3410	//       "description": "If set, only deletes the bucket if its metageneration does not match this value.",
3411	//       "format": "int64",
3412	//       "location": "query",
3413	//       "type": "string"
3414	//     },
3415	//     "provisionalUserProject": {
3416	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3417	//       "location": "query",
3418	//       "type": "string"
3419	//     },
3420	//     "userProject": {
3421	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3422	//       "location": "query",
3423	//       "type": "string"
3424	//     }
3425	//   },
3426	//   "path": "b/{bucket}",
3427	//   "scopes": [
3428	//     "https://www.googleapis.com/auth/cloud-platform",
3429	//     "https://www.googleapis.com/auth/devstorage.full_control",
3430	//     "https://www.googleapis.com/auth/devstorage.read_write"
3431	//   ]
3432	// }
3433
3434}
3435
3436// method id "storage.buckets.get":
3437
3438type BucketsGetCall struct {
3439	s            *Service
3440	bucket       string
3441	urlParams_   gensupport.URLParams
3442	ifNoneMatch_ string
3443	ctx_         context.Context
3444	header_      http.Header
3445}
3446
3447// Get: Returns metadata for the specified bucket.
3448func (r *BucketsService) Get(bucket string) *BucketsGetCall {
3449	c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3450	c.bucket = bucket
3451	return c
3452}
3453
3454// IfMetagenerationMatch sets the optional parameter
3455// "ifMetagenerationMatch": Makes the return of the bucket metadata
3456// conditional on whether the bucket's current metageneration matches
3457// the given value.
3458func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
3459	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3460	return c
3461}
3462
3463// IfMetagenerationNotMatch sets the optional parameter
3464// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
3465// conditional on whether the bucket's current metageneration does not
3466// match the given value.
3467func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall {
3468	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3469	return c
3470}
3471
3472// Projection sets the optional parameter "projection": Set of
3473// properties to return. Defaults to noAcl.
3474//
3475// Possible values:
3476//   "full" - Include all properties.
3477//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3478func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
3479	c.urlParams_.Set("projection", projection)
3480	return c
3481}
3482
3483// ProvisionalUserProject sets the optional parameter
3484// "provisionalUserProject": The project to be billed for this request
3485// if the target bucket is requester-pays bucket.
3486func (c *BucketsGetCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetCall {
3487	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3488	return c
3489}
3490
3491// UserProject sets the optional parameter "userProject": The project to
3492// be billed for this request. Required for Requester Pays buckets.
3493func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
3494	c.urlParams_.Set("userProject", userProject)
3495	return c
3496}
3497
3498// Fields allows partial responses to be retrieved. See
3499// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3500// for more information.
3501func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
3502	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3503	return c
3504}
3505
3506// IfNoneMatch sets the optional parameter which makes the operation
3507// fail if the object's ETag matches the given value. This is useful for
3508// getting updates only after the object has changed since the last
3509// request. Use googleapi.IsNotModified to check whether the response
3510// error from Do is the result of In-None-Match.
3511func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
3512	c.ifNoneMatch_ = entityTag
3513	return c
3514}
3515
3516// Context sets the context to be used in this call's Do method. Any
3517// pending HTTP request will be aborted if the provided context is
3518// canceled.
3519func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
3520	c.ctx_ = ctx
3521	return c
3522}
3523
3524// Header returns an http.Header that can be modified by the caller to
3525// add HTTP headers to the request.
3526func (c *BucketsGetCall) Header() http.Header {
3527	if c.header_ == nil {
3528		c.header_ = make(http.Header)
3529	}
3530	return c.header_
3531}
3532
3533func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
3534	reqHeaders := make(http.Header)
3535	for k, v := range c.header_ {
3536		reqHeaders[k] = v
3537	}
3538	reqHeaders.Set("User-Agent", c.s.userAgent())
3539	if c.ifNoneMatch_ != "" {
3540		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3541	}
3542	var body io.Reader = nil
3543	c.urlParams_.Set("alt", alt)
3544	c.urlParams_.Set("prettyPrint", "false")
3545	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3546	urls += "?" + c.urlParams_.Encode()
3547	req, err := http.NewRequest("GET", urls, body)
3548	if err != nil {
3549		return nil, err
3550	}
3551	req.Header = reqHeaders
3552	googleapi.Expand(req.URL, map[string]string{
3553		"bucket": c.bucket,
3554	})
3555	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3556}
3557
3558// Do executes the "storage.buckets.get" call.
3559// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3560// code is an error. Response headers are in either
3561// *Bucket.ServerResponse.Header or (if a response was returned at all)
3562// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3563// check whether the returned error was because http.StatusNotModified
3564// was returned.
3565func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3566	gensupport.SetOptions(c.urlParams_, opts...)
3567	res, err := c.doRequest("json")
3568	if res != nil && res.StatusCode == http.StatusNotModified {
3569		if res.Body != nil {
3570			res.Body.Close()
3571		}
3572		return nil, &googleapi.Error{
3573			Code:   res.StatusCode,
3574			Header: res.Header,
3575		}
3576	}
3577	if err != nil {
3578		return nil, err
3579	}
3580	defer googleapi.CloseBody(res)
3581	if err := googleapi.CheckResponse(res); err != nil {
3582		return nil, err
3583	}
3584	ret := &Bucket{
3585		ServerResponse: googleapi.ServerResponse{
3586			Header:         res.Header,
3587			HTTPStatusCode: res.StatusCode,
3588		},
3589	}
3590	target := &ret
3591	if err := gensupport.DecodeResponse(target, res); err != nil {
3592		return nil, err
3593	}
3594	return ret, nil
3595	// {
3596	//   "description": "Returns metadata for the specified bucket.",
3597	//   "httpMethod": "GET",
3598	//   "id": "storage.buckets.get",
3599	//   "parameterOrder": [
3600	//     "bucket"
3601	//   ],
3602	//   "parameters": {
3603	//     "bucket": {
3604	//       "description": "Name of a bucket.",
3605	//       "location": "path",
3606	//       "required": true,
3607	//       "type": "string"
3608	//     },
3609	//     "ifMetagenerationMatch": {
3610	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
3611	//       "format": "int64",
3612	//       "location": "query",
3613	//       "type": "string"
3614	//     },
3615	//     "ifMetagenerationNotMatch": {
3616	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
3617	//       "format": "int64",
3618	//       "location": "query",
3619	//       "type": "string"
3620	//     },
3621	//     "projection": {
3622	//       "description": "Set of properties to return. Defaults to noAcl.",
3623	//       "enum": [
3624	//         "full",
3625	//         "noAcl"
3626	//       ],
3627	//       "enumDescriptions": [
3628	//         "Include all properties.",
3629	//         "Omit owner, acl and defaultObjectAcl properties."
3630	//       ],
3631	//       "location": "query",
3632	//       "type": "string"
3633	//     },
3634	//     "provisionalUserProject": {
3635	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3636	//       "location": "query",
3637	//       "type": "string"
3638	//     },
3639	//     "userProject": {
3640	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3641	//       "location": "query",
3642	//       "type": "string"
3643	//     }
3644	//   },
3645	//   "path": "b/{bucket}",
3646	//   "response": {
3647	//     "$ref": "Bucket"
3648	//   },
3649	//   "scopes": [
3650	//     "https://www.googleapis.com/auth/cloud-platform",
3651	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3652	//     "https://www.googleapis.com/auth/devstorage.full_control",
3653	//     "https://www.googleapis.com/auth/devstorage.read_only",
3654	//     "https://www.googleapis.com/auth/devstorage.read_write"
3655	//   ]
3656	// }
3657
3658}
3659
3660// method id "storage.buckets.getIamPolicy":
3661
3662type BucketsGetIamPolicyCall struct {
3663	s            *Service
3664	bucket       string
3665	urlParams_   gensupport.URLParams
3666	ifNoneMatch_ string
3667	ctx_         context.Context
3668	header_      http.Header
3669}
3670
3671// GetIamPolicy: Returns an IAM policy for the specified bucket.
3672func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
3673	c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3674	c.bucket = bucket
3675	return c
3676}
3677
3678// ProvisionalUserProject sets the optional parameter
3679// "provisionalUserProject": The project to be billed for this request
3680// if the target bucket is requester-pays bucket.
3681func (c *BucketsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsGetIamPolicyCall {
3682	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3683	return c
3684}
3685
3686// UserProject sets the optional parameter "userProject": The project to
3687// be billed for this request. Required for Requester Pays buckets.
3688func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
3689	c.urlParams_.Set("userProject", userProject)
3690	return c
3691}
3692
3693// Fields allows partial responses to be retrieved. See
3694// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3695// for more information.
3696func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall {
3697	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3698	return c
3699}
3700
3701// IfNoneMatch sets the optional parameter which makes the operation
3702// fail if the object's ETag matches the given value. This is useful for
3703// getting updates only after the object has changed since the last
3704// request. Use googleapi.IsNotModified to check whether the response
3705// error from Do is the result of In-None-Match.
3706func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall {
3707	c.ifNoneMatch_ = entityTag
3708	return c
3709}
3710
3711// Context sets the context to be used in this call's Do method. Any
3712// pending HTTP request will be aborted if the provided context is
3713// canceled.
3714func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
3715	c.ctx_ = ctx
3716	return c
3717}
3718
3719// Header returns an http.Header that can be modified by the caller to
3720// add HTTP headers to the request.
3721func (c *BucketsGetIamPolicyCall) Header() http.Header {
3722	if c.header_ == nil {
3723		c.header_ = make(http.Header)
3724	}
3725	return c.header_
3726}
3727
3728func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3729	reqHeaders := make(http.Header)
3730	for k, v := range c.header_ {
3731		reqHeaders[k] = v
3732	}
3733	reqHeaders.Set("User-Agent", c.s.userAgent())
3734	if c.ifNoneMatch_ != "" {
3735		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3736	}
3737	var body io.Reader = nil
3738	c.urlParams_.Set("alt", alt)
3739	c.urlParams_.Set("prettyPrint", "false")
3740	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
3741	urls += "?" + c.urlParams_.Encode()
3742	req, err := http.NewRequest("GET", urls, body)
3743	if err != nil {
3744		return nil, err
3745	}
3746	req.Header = reqHeaders
3747	googleapi.Expand(req.URL, map[string]string{
3748		"bucket": c.bucket,
3749	})
3750	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3751}
3752
3753// Do executes the "storage.buckets.getIamPolicy" call.
3754// Exactly one of *Policy or error will be non-nil. Any non-2xx status
3755// code is an error. Response headers are in either
3756// *Policy.ServerResponse.Header or (if a response was returned at all)
3757// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3758// check whether the returned error was because http.StatusNotModified
3759// was returned.
3760func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3761	gensupport.SetOptions(c.urlParams_, opts...)
3762	res, err := c.doRequest("json")
3763	if res != nil && res.StatusCode == http.StatusNotModified {
3764		if res.Body != nil {
3765			res.Body.Close()
3766		}
3767		return nil, &googleapi.Error{
3768			Code:   res.StatusCode,
3769			Header: res.Header,
3770		}
3771	}
3772	if err != nil {
3773		return nil, err
3774	}
3775	defer googleapi.CloseBody(res)
3776	if err := googleapi.CheckResponse(res); err != nil {
3777		return nil, err
3778	}
3779	ret := &Policy{
3780		ServerResponse: googleapi.ServerResponse{
3781			Header:         res.Header,
3782			HTTPStatusCode: res.StatusCode,
3783		},
3784	}
3785	target := &ret
3786	if err := gensupport.DecodeResponse(target, res); err != nil {
3787		return nil, err
3788	}
3789	return ret, nil
3790	// {
3791	//   "description": "Returns an IAM policy for the specified bucket.",
3792	//   "httpMethod": "GET",
3793	//   "id": "storage.buckets.getIamPolicy",
3794	//   "parameterOrder": [
3795	//     "bucket"
3796	//   ],
3797	//   "parameters": {
3798	//     "bucket": {
3799	//       "description": "Name of a bucket.",
3800	//       "location": "path",
3801	//       "required": true,
3802	//       "type": "string"
3803	//     },
3804	//     "provisionalUserProject": {
3805	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
3806	//       "location": "query",
3807	//       "type": "string"
3808	//     },
3809	//     "userProject": {
3810	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3811	//       "location": "query",
3812	//       "type": "string"
3813	//     }
3814	//   },
3815	//   "path": "b/{bucket}/iam",
3816	//   "response": {
3817	//     "$ref": "Policy"
3818	//   },
3819	//   "scopes": [
3820	//     "https://www.googleapis.com/auth/cloud-platform",
3821	//     "https://www.googleapis.com/auth/devstorage.full_control"
3822	//   ]
3823	// }
3824
3825}
3826
3827// method id "storage.buckets.insert":
3828
3829type BucketsInsertCall struct {
3830	s          *Service
3831	bucket     *Bucket
3832	urlParams_ gensupport.URLParams
3833	ctx_       context.Context
3834	header_    http.Header
3835}
3836
3837// Insert: Creates a new bucket.
3838func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
3839	c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3840	c.urlParams_.Set("project", projectid)
3841	c.bucket = bucket
3842	return c
3843}
3844
3845// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
3846// predefined set of access controls to this bucket.
3847//
3848// Possible values:
3849//   "authenticatedRead" - Project team owners get OWNER access, and
3850// allAuthenticatedUsers get READER access.
3851//   "private" - Project team owners get OWNER access.
3852//   "projectPrivate" - Project team members get access according to
3853// their roles.
3854//   "publicRead" - Project team owners get OWNER access, and allUsers
3855// get READER access.
3856//   "publicReadWrite" - Project team owners get OWNER access, and
3857// allUsers get WRITER access.
3858func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall {
3859	c.urlParams_.Set("predefinedAcl", predefinedAcl)
3860	return c
3861}
3862
3863// PredefinedDefaultObjectAcl sets the optional parameter
3864// "predefinedDefaultObjectAcl": Apply a predefined set of default
3865// object access controls to this bucket.
3866//
3867// Possible values:
3868//   "authenticatedRead" - Object owner gets OWNER access, and
3869// allAuthenticatedUsers get READER access.
3870//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
3871// project team owners get OWNER access.
3872//   "bucketOwnerRead" - Object owner gets OWNER access, and project
3873// team owners get READER access.
3874//   "private" - Object owner gets OWNER access.
3875//   "projectPrivate" - Object owner gets OWNER access, and project team
3876// members get access according to their roles.
3877//   "publicRead" - Object owner gets OWNER access, and allUsers get
3878// READER access.
3879func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
3880	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
3881	return c
3882}
3883
3884// Projection sets the optional parameter "projection": Set of
3885// properties to return. Defaults to noAcl, unless the bucket resource
3886// specifies acl or defaultObjectAcl properties, when it defaults to
3887// full.
3888//
3889// Possible values:
3890//   "full" - Include all properties.
3891//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3892func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
3893	c.urlParams_.Set("projection", projection)
3894	return c
3895}
3896
3897// ProvisionalUserProject sets the optional parameter
3898// "provisionalUserProject": The project to be billed for this request
3899// if the target bucket is requester-pays bucket.
3900func (c *BucketsInsertCall) ProvisionalUserProject(provisionalUserProject string) *BucketsInsertCall {
3901	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
3902	return c
3903}
3904
3905// UserProject sets the optional parameter "userProject": The project to
3906// be billed for this request.
3907func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall {
3908	c.urlParams_.Set("userProject", userProject)
3909	return c
3910}
3911
3912// Fields allows partial responses to be retrieved. See
3913// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3914// for more information.
3915func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
3916	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3917	return c
3918}
3919
3920// Context sets the context to be used in this call's Do method. Any
3921// pending HTTP request will be aborted if the provided context is
3922// canceled.
3923func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
3924	c.ctx_ = ctx
3925	return c
3926}
3927
3928// Header returns an http.Header that can be modified by the caller to
3929// add HTTP headers to the request.
3930func (c *BucketsInsertCall) Header() http.Header {
3931	if c.header_ == nil {
3932		c.header_ = make(http.Header)
3933	}
3934	return c.header_
3935}
3936
3937func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
3938	reqHeaders := make(http.Header)
3939	for k, v := range c.header_ {
3940		reqHeaders[k] = v
3941	}
3942	reqHeaders.Set("User-Agent", c.s.userAgent())
3943	var body io.Reader = nil
3944	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
3945	if err != nil {
3946		return nil, err
3947	}
3948	reqHeaders.Set("Content-Type", "application/json")
3949	c.urlParams_.Set("alt", alt)
3950	c.urlParams_.Set("prettyPrint", "false")
3951	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
3952	urls += "?" + c.urlParams_.Encode()
3953	req, err := http.NewRequest("POST", urls, body)
3954	if err != nil {
3955		return nil, err
3956	}
3957	req.Header = reqHeaders
3958	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3959}
3960
3961// Do executes the "storage.buckets.insert" call.
3962// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3963// code is an error. Response headers are in either
3964// *Bucket.ServerResponse.Header or (if a response was returned at all)
3965// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3966// check whether the returned error was because http.StatusNotModified
3967// was returned.
3968func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3969	gensupport.SetOptions(c.urlParams_, opts...)
3970	res, err := c.doRequest("json")
3971	if res != nil && res.StatusCode == http.StatusNotModified {
3972		if res.Body != nil {
3973			res.Body.Close()
3974		}
3975		return nil, &googleapi.Error{
3976			Code:   res.StatusCode,
3977			Header: res.Header,
3978		}
3979	}
3980	if err != nil {
3981		return nil, err
3982	}
3983	defer googleapi.CloseBody(res)
3984	if err := googleapi.CheckResponse(res); err != nil {
3985		return nil, err
3986	}
3987	ret := &Bucket{
3988		ServerResponse: googleapi.ServerResponse{
3989			Header:         res.Header,
3990			HTTPStatusCode: res.StatusCode,
3991		},
3992	}
3993	target := &ret
3994	if err := gensupport.DecodeResponse(target, res); err != nil {
3995		return nil, err
3996	}
3997	return ret, nil
3998	// {
3999	//   "description": "Creates a new bucket.",
4000	//   "httpMethod": "POST",
4001	//   "id": "storage.buckets.insert",
4002	//   "parameterOrder": [
4003	//     "project"
4004	//   ],
4005	//   "parameters": {
4006	//     "predefinedAcl": {
4007	//       "description": "Apply a predefined set of access controls to this bucket.",
4008	//       "enum": [
4009	//         "authenticatedRead",
4010	//         "private",
4011	//         "projectPrivate",
4012	//         "publicRead",
4013	//         "publicReadWrite"
4014	//       ],
4015	//       "enumDescriptions": [
4016	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4017	//         "Project team owners get OWNER access.",
4018	//         "Project team members get access according to their roles.",
4019	//         "Project team owners get OWNER access, and allUsers get READER access.",
4020	//         "Project team owners get OWNER access, and allUsers get WRITER access."
4021	//       ],
4022	//       "location": "query",
4023	//       "type": "string"
4024	//     },
4025	//     "predefinedDefaultObjectAcl": {
4026	//       "description": "Apply a predefined set of default object access controls to this bucket.",
4027	//       "enum": [
4028	//         "authenticatedRead",
4029	//         "bucketOwnerFullControl",
4030	//         "bucketOwnerRead",
4031	//         "private",
4032	//         "projectPrivate",
4033	//         "publicRead"
4034	//       ],
4035	//       "enumDescriptions": [
4036	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4037	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
4038	//         "Object owner gets OWNER access, and project team owners get READER access.",
4039	//         "Object owner gets OWNER access.",
4040	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
4041	//         "Object owner gets OWNER access, and allUsers get READER access."
4042	//       ],
4043	//       "location": "query",
4044	//       "type": "string"
4045	//     },
4046	//     "project": {
4047	//       "description": "A valid API project identifier.",
4048	//       "location": "query",
4049	//       "required": true,
4050	//       "type": "string"
4051	//     },
4052	//     "projection": {
4053	//       "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
4054	//       "enum": [
4055	//         "full",
4056	//         "noAcl"
4057	//       ],
4058	//       "enumDescriptions": [
4059	//         "Include all properties.",
4060	//         "Omit owner, acl and defaultObjectAcl properties."
4061	//       ],
4062	//       "location": "query",
4063	//       "type": "string"
4064	//     },
4065	//     "provisionalUserProject": {
4066	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4067	//       "location": "query",
4068	//       "type": "string"
4069	//     },
4070	//     "userProject": {
4071	//       "description": "The project to be billed for this request.",
4072	//       "location": "query",
4073	//       "type": "string"
4074	//     }
4075	//   },
4076	//   "path": "b",
4077	//   "request": {
4078	//     "$ref": "Bucket"
4079	//   },
4080	//   "response": {
4081	//     "$ref": "Bucket"
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.list":
4093
4094type BucketsListCall struct {
4095	s            *Service
4096	urlParams_   gensupport.URLParams
4097	ifNoneMatch_ string
4098	ctx_         context.Context
4099	header_      http.Header
4100}
4101
4102// List: Retrieves a list of buckets for a given project.
4103func (r *BucketsService) List(projectid string) *BucketsListCall {
4104	c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4105	c.urlParams_.Set("project", projectid)
4106	return c
4107}
4108
4109// MaxResults sets the optional parameter "maxResults": Maximum number
4110// of buckets to return in a single response. The service will use this
4111// parameter or 1,000 items, whichever is smaller.
4112func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
4113	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4114	return c
4115}
4116
4117// PageToken sets the optional parameter "pageToken": A
4118// previously-returned page token representing part of the larger set of
4119// results to view.
4120func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
4121	c.urlParams_.Set("pageToken", pageToken)
4122	return c
4123}
4124
4125// Prefix sets the optional parameter "prefix": Filter results to
4126// buckets whose names begin with this prefix.
4127func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall {
4128	c.urlParams_.Set("prefix", prefix)
4129	return c
4130}
4131
4132// Projection sets the optional parameter "projection": Set of
4133// properties to return. Defaults to noAcl.
4134//
4135// Possible values:
4136//   "full" - Include all properties.
4137//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4138func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
4139	c.urlParams_.Set("projection", projection)
4140	return c
4141}
4142
4143// ProvisionalUserProject sets the optional parameter
4144// "provisionalUserProject": The project to be billed for this request
4145// if the target bucket is requester-pays bucket.
4146func (c *BucketsListCall) ProvisionalUserProject(provisionalUserProject string) *BucketsListCall {
4147	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4148	return c
4149}
4150
4151// UserProject sets the optional parameter "userProject": The project to
4152// be billed for this request.
4153func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall {
4154	c.urlParams_.Set("userProject", userProject)
4155	return c
4156}
4157
4158// Fields allows partial responses to be retrieved. See
4159// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4160// for more information.
4161func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
4162	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4163	return c
4164}
4165
4166// IfNoneMatch sets the optional parameter which makes the operation
4167// fail if the object's ETag matches the given value. This is useful for
4168// getting updates only after the object has changed since the last
4169// request. Use googleapi.IsNotModified to check whether the response
4170// error from Do is the result of In-None-Match.
4171func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
4172	c.ifNoneMatch_ = entityTag
4173	return c
4174}
4175
4176// Context sets the context to be used in this call's Do method. Any
4177// pending HTTP request will be aborted if the provided context is
4178// canceled.
4179func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
4180	c.ctx_ = ctx
4181	return c
4182}
4183
4184// Header returns an http.Header that can be modified by the caller to
4185// add HTTP headers to the request.
4186func (c *BucketsListCall) Header() http.Header {
4187	if c.header_ == nil {
4188		c.header_ = make(http.Header)
4189	}
4190	return c.header_
4191}
4192
4193func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
4194	reqHeaders := make(http.Header)
4195	for k, v := range c.header_ {
4196		reqHeaders[k] = v
4197	}
4198	reqHeaders.Set("User-Agent", c.s.userAgent())
4199	if c.ifNoneMatch_ != "" {
4200		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4201	}
4202	var body io.Reader = nil
4203	c.urlParams_.Set("alt", alt)
4204	c.urlParams_.Set("prettyPrint", "false")
4205	urls := googleapi.ResolveRelative(c.s.BasePath, "b")
4206	urls += "?" + c.urlParams_.Encode()
4207	req, err := http.NewRequest("GET", urls, body)
4208	if err != nil {
4209		return nil, err
4210	}
4211	req.Header = reqHeaders
4212	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4213}
4214
4215// Do executes the "storage.buckets.list" call.
4216// Exactly one of *Buckets or error will be non-nil. Any non-2xx status
4217// code is an error. Response headers are in either
4218// *Buckets.ServerResponse.Header or (if a response was returned at all)
4219// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4220// check whether the returned error was because http.StatusNotModified
4221// was returned.
4222func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
4223	gensupport.SetOptions(c.urlParams_, opts...)
4224	res, err := c.doRequest("json")
4225	if res != nil && res.StatusCode == http.StatusNotModified {
4226		if res.Body != nil {
4227			res.Body.Close()
4228		}
4229		return nil, &googleapi.Error{
4230			Code:   res.StatusCode,
4231			Header: res.Header,
4232		}
4233	}
4234	if err != nil {
4235		return nil, err
4236	}
4237	defer googleapi.CloseBody(res)
4238	if err := googleapi.CheckResponse(res); err != nil {
4239		return nil, err
4240	}
4241	ret := &Buckets{
4242		ServerResponse: googleapi.ServerResponse{
4243			Header:         res.Header,
4244			HTTPStatusCode: res.StatusCode,
4245		},
4246	}
4247	target := &ret
4248	if err := gensupport.DecodeResponse(target, res); err != nil {
4249		return nil, err
4250	}
4251	return ret, nil
4252	// {
4253	//   "description": "Retrieves a list of buckets for a given project.",
4254	//   "httpMethod": "GET",
4255	//   "id": "storage.buckets.list",
4256	//   "parameterOrder": [
4257	//     "project"
4258	//   ],
4259	//   "parameters": {
4260	//     "maxResults": {
4261	//       "default": "1000",
4262	//       "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
4263	//       "format": "uint32",
4264	//       "location": "query",
4265	//       "minimum": "0",
4266	//       "type": "integer"
4267	//     },
4268	//     "pageToken": {
4269	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
4270	//       "location": "query",
4271	//       "type": "string"
4272	//     },
4273	//     "prefix": {
4274	//       "description": "Filter results to buckets whose names begin with this prefix.",
4275	//       "location": "query",
4276	//       "type": "string"
4277	//     },
4278	//     "project": {
4279	//       "description": "A valid API project identifier.",
4280	//       "location": "query",
4281	//       "required": true,
4282	//       "type": "string"
4283	//     },
4284	//     "projection": {
4285	//       "description": "Set of properties to return. Defaults to noAcl.",
4286	//       "enum": [
4287	//         "full",
4288	//         "noAcl"
4289	//       ],
4290	//       "enumDescriptions": [
4291	//         "Include all properties.",
4292	//         "Omit owner, acl and defaultObjectAcl properties."
4293	//       ],
4294	//       "location": "query",
4295	//       "type": "string"
4296	//     },
4297	//     "provisionalUserProject": {
4298	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4299	//       "location": "query",
4300	//       "type": "string"
4301	//     },
4302	//     "userProject": {
4303	//       "description": "The project to be billed for this request.",
4304	//       "location": "query",
4305	//       "type": "string"
4306	//     }
4307	//   },
4308	//   "path": "b",
4309	//   "response": {
4310	//     "$ref": "Buckets"
4311	//   },
4312	//   "scopes": [
4313	//     "https://www.googleapis.com/auth/cloud-platform",
4314	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4315	//     "https://www.googleapis.com/auth/devstorage.full_control",
4316	//     "https://www.googleapis.com/auth/devstorage.read_only",
4317	//     "https://www.googleapis.com/auth/devstorage.read_write"
4318	//   ]
4319	// }
4320
4321}
4322
4323// Pages invokes f for each page of results.
4324// A non-nil error returned from f will halt the iteration.
4325// The provided context supersedes any context provided to the Context method.
4326func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
4327	c.ctx_ = ctx
4328	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4329	for {
4330		x, err := c.Do()
4331		if err != nil {
4332			return err
4333		}
4334		if err := f(x); err != nil {
4335			return err
4336		}
4337		if x.NextPageToken == "" {
4338			return nil
4339		}
4340		c.PageToken(x.NextPageToken)
4341	}
4342}
4343
4344// method id "storage.buckets.lockRetentionPolicy":
4345
4346type BucketsLockRetentionPolicyCall struct {
4347	s          *Service
4348	bucket     string
4349	urlParams_ gensupport.URLParams
4350	ctx_       context.Context
4351	header_    http.Header
4352}
4353
4354// LockRetentionPolicy: Locks retention policy on a bucket.
4355func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall {
4356	c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4357	c.bucket = bucket
4358	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4359	return c
4360}
4361
4362// ProvisionalUserProject sets the optional parameter
4363// "provisionalUserProject": The project to be billed for this request
4364// if the target bucket is requester-pays bucket.
4365func (c *BucketsLockRetentionPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsLockRetentionPolicyCall {
4366	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4367	return c
4368}
4369
4370// UserProject sets the optional parameter "userProject": The project to
4371// be billed for this request. Required for Requester Pays buckets.
4372func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall {
4373	c.urlParams_.Set("userProject", userProject)
4374	return c
4375}
4376
4377// Fields allows partial responses to be retrieved. See
4378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4379// for more information.
4380func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall {
4381	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4382	return c
4383}
4384
4385// Context sets the context to be used in this call's Do method. Any
4386// pending HTTP request will be aborted if the provided context is
4387// canceled.
4388func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall {
4389	c.ctx_ = ctx
4390	return c
4391}
4392
4393// Header returns an http.Header that can be modified by the caller to
4394// add HTTP headers to the request.
4395func (c *BucketsLockRetentionPolicyCall) Header() http.Header {
4396	if c.header_ == nil {
4397		c.header_ = make(http.Header)
4398	}
4399	return c.header_
4400}
4401
4402func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
4403	reqHeaders := make(http.Header)
4404	for k, v := range c.header_ {
4405		reqHeaders[k] = v
4406	}
4407	reqHeaders.Set("User-Agent", c.s.userAgent())
4408	var body io.Reader = nil
4409	c.urlParams_.Set("alt", alt)
4410	c.urlParams_.Set("prettyPrint", "false")
4411	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy")
4412	urls += "?" + c.urlParams_.Encode()
4413	req, err := http.NewRequest("POST", urls, body)
4414	if err != nil {
4415		return nil, err
4416	}
4417	req.Header = reqHeaders
4418	googleapi.Expand(req.URL, map[string]string{
4419		"bucket": c.bucket,
4420	})
4421	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4422}
4423
4424// Do executes the "storage.buckets.lockRetentionPolicy" call.
4425// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4426// code is an error. Response headers are in either
4427// *Bucket.ServerResponse.Header or (if a response was returned at all)
4428// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4429// check whether the returned error was because http.StatusNotModified
4430// was returned.
4431func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4432	gensupport.SetOptions(c.urlParams_, opts...)
4433	res, err := c.doRequest("json")
4434	if res != nil && res.StatusCode == http.StatusNotModified {
4435		if res.Body != nil {
4436			res.Body.Close()
4437		}
4438		return nil, &googleapi.Error{
4439			Code:   res.StatusCode,
4440			Header: res.Header,
4441		}
4442	}
4443	if err != nil {
4444		return nil, err
4445	}
4446	defer googleapi.CloseBody(res)
4447	if err := googleapi.CheckResponse(res); err != nil {
4448		return nil, err
4449	}
4450	ret := &Bucket{
4451		ServerResponse: googleapi.ServerResponse{
4452			Header:         res.Header,
4453			HTTPStatusCode: res.StatusCode,
4454		},
4455	}
4456	target := &ret
4457	if err := gensupport.DecodeResponse(target, res); err != nil {
4458		return nil, err
4459	}
4460	return ret, nil
4461	// {
4462	//   "description": "Locks retention policy on a bucket.",
4463	//   "httpMethod": "POST",
4464	//   "id": "storage.buckets.lockRetentionPolicy",
4465	//   "parameterOrder": [
4466	//     "bucket",
4467	//     "ifMetagenerationMatch"
4468	//   ],
4469	//   "parameters": {
4470	//     "bucket": {
4471	//       "description": "Name of a bucket.",
4472	//       "location": "path",
4473	//       "required": true,
4474	//       "type": "string"
4475	//     },
4476	//     "ifMetagenerationMatch": {
4477	//       "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
4478	//       "format": "int64",
4479	//       "location": "query",
4480	//       "required": true,
4481	//       "type": "string"
4482	//     },
4483	//     "provisionalUserProject": {
4484	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4485	//       "location": "query",
4486	//       "type": "string"
4487	//     },
4488	//     "userProject": {
4489	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4490	//       "location": "query",
4491	//       "type": "string"
4492	//     }
4493	//   },
4494	//   "path": "b/{bucket}/lockRetentionPolicy",
4495	//   "response": {
4496	//     "$ref": "Bucket"
4497	//   },
4498	//   "scopes": [
4499	//     "https://www.googleapis.com/auth/cloud-platform",
4500	//     "https://www.googleapis.com/auth/devstorage.full_control",
4501	//     "https://www.googleapis.com/auth/devstorage.read_write"
4502	//   ]
4503	// }
4504
4505}
4506
4507// method id "storage.buckets.patch":
4508
4509type BucketsPatchCall struct {
4510	s          *Service
4511	bucket     string
4512	bucket2    *Bucket
4513	urlParams_ gensupport.URLParams
4514	ctx_       context.Context
4515	header_    http.Header
4516}
4517
4518// Patch: Patches a bucket. Changes to the bucket will be readable
4519// immediately after writing, but configuration changes may take time to
4520// propagate.
4521func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
4522	c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4523	c.bucket = bucket
4524	c.bucket2 = bucket2
4525	return c
4526}
4527
4528// IfMetagenerationMatch sets the optional parameter
4529// "ifMetagenerationMatch": Makes the return of the bucket metadata
4530// conditional on whether the bucket's current metageneration matches
4531// the given value.
4532func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
4533	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4534	return c
4535}
4536
4537// IfMetagenerationNotMatch sets the optional parameter
4538// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
4539// conditional on whether the bucket's current metageneration does not
4540// match the given value.
4541func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall {
4542	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
4543	return c
4544}
4545
4546// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4547// predefined set of access controls to this bucket.
4548//
4549// Possible values:
4550//   "authenticatedRead" - Project team owners get OWNER access, and
4551// allAuthenticatedUsers get READER access.
4552//   "private" - Project team owners get OWNER access.
4553//   "projectPrivate" - Project team members get access according to
4554// their roles.
4555//   "publicRead" - Project team owners get OWNER access, and allUsers
4556// get READER access.
4557//   "publicReadWrite" - Project team owners get OWNER access, and
4558// allUsers get WRITER access.
4559func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall {
4560	c.urlParams_.Set("predefinedAcl", predefinedAcl)
4561	return c
4562}
4563
4564// PredefinedDefaultObjectAcl sets the optional parameter
4565// "predefinedDefaultObjectAcl": Apply a predefined set of default
4566// object access controls to this bucket.
4567//
4568// Possible values:
4569//   "authenticatedRead" - Object owner gets OWNER access, and
4570// allAuthenticatedUsers get READER access.
4571//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
4572// project team owners get OWNER access.
4573//   "bucketOwnerRead" - Object owner gets OWNER access, and project
4574// team owners get READER access.
4575//   "private" - Object owner gets OWNER access.
4576//   "projectPrivate" - Object owner gets OWNER access, and project team
4577// members get access according to their roles.
4578//   "publicRead" - Object owner gets OWNER access, and allUsers get
4579// READER access.
4580func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
4581	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4582	return c
4583}
4584
4585// Projection sets the optional parameter "projection": Set of
4586// properties to return. Defaults to full.
4587//
4588// Possible values:
4589//   "full" - Include all properties.
4590//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4591func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
4592	c.urlParams_.Set("projection", projection)
4593	return c
4594}
4595
4596// ProvisionalUserProject sets the optional parameter
4597// "provisionalUserProject": The project to be billed for this request
4598// if the target bucket is requester-pays bucket.
4599func (c *BucketsPatchCall) ProvisionalUserProject(provisionalUserProject string) *BucketsPatchCall {
4600	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4601	return c
4602}
4603
4604// UserProject sets the optional parameter "userProject": The project to
4605// be billed for this request. Required for Requester Pays buckets.
4606func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
4607	c.urlParams_.Set("userProject", userProject)
4608	return c
4609}
4610
4611// Fields allows partial responses to be retrieved. See
4612// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4613// for more information.
4614func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
4615	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4616	return c
4617}
4618
4619// Context sets the context to be used in this call's Do method. Any
4620// pending HTTP request will be aborted if the provided context is
4621// canceled.
4622func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
4623	c.ctx_ = ctx
4624	return c
4625}
4626
4627// Header returns an http.Header that can be modified by the caller to
4628// add HTTP headers to the request.
4629func (c *BucketsPatchCall) Header() http.Header {
4630	if c.header_ == nil {
4631		c.header_ = make(http.Header)
4632	}
4633	return c.header_
4634}
4635
4636func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
4637	reqHeaders := make(http.Header)
4638	for k, v := range c.header_ {
4639		reqHeaders[k] = v
4640	}
4641	reqHeaders.Set("User-Agent", c.s.userAgent())
4642	var body io.Reader = nil
4643	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
4644	if err != nil {
4645		return nil, err
4646	}
4647	reqHeaders.Set("Content-Type", "application/json")
4648	c.urlParams_.Set("alt", alt)
4649	c.urlParams_.Set("prettyPrint", "false")
4650	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
4651	urls += "?" + c.urlParams_.Encode()
4652	req, err := http.NewRequest("PATCH", urls, body)
4653	if err != nil {
4654		return nil, err
4655	}
4656	req.Header = reqHeaders
4657	googleapi.Expand(req.URL, map[string]string{
4658		"bucket": c.bucket,
4659	})
4660	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4661}
4662
4663// Do executes the "storage.buckets.patch" call.
4664// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4665// code is an error. Response headers are in either
4666// *Bucket.ServerResponse.Header or (if a response was returned at all)
4667// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4668// check whether the returned error was because http.StatusNotModified
4669// was returned.
4670func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4671	gensupport.SetOptions(c.urlParams_, opts...)
4672	res, err := c.doRequest("json")
4673	if res != nil && res.StatusCode == http.StatusNotModified {
4674		if res.Body != nil {
4675			res.Body.Close()
4676		}
4677		return nil, &googleapi.Error{
4678			Code:   res.StatusCode,
4679			Header: res.Header,
4680		}
4681	}
4682	if err != nil {
4683		return nil, err
4684	}
4685	defer googleapi.CloseBody(res)
4686	if err := googleapi.CheckResponse(res); err != nil {
4687		return nil, err
4688	}
4689	ret := &Bucket{
4690		ServerResponse: googleapi.ServerResponse{
4691			Header:         res.Header,
4692			HTTPStatusCode: res.StatusCode,
4693		},
4694	}
4695	target := &ret
4696	if err := gensupport.DecodeResponse(target, res); err != nil {
4697		return nil, err
4698	}
4699	return ret, nil
4700	// {
4701	//   "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
4702	//   "httpMethod": "PATCH",
4703	//   "id": "storage.buckets.patch",
4704	//   "parameterOrder": [
4705	//     "bucket"
4706	//   ],
4707	//   "parameters": {
4708	//     "bucket": {
4709	//       "description": "Name of a bucket.",
4710	//       "location": "path",
4711	//       "required": true,
4712	//       "type": "string"
4713	//     },
4714	//     "ifMetagenerationMatch": {
4715	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
4716	//       "format": "int64",
4717	//       "location": "query",
4718	//       "type": "string"
4719	//     },
4720	//     "ifMetagenerationNotMatch": {
4721	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
4722	//       "format": "int64",
4723	//       "location": "query",
4724	//       "type": "string"
4725	//     },
4726	//     "predefinedAcl": {
4727	//       "description": "Apply a predefined set of access controls to this bucket.",
4728	//       "enum": [
4729	//         "authenticatedRead",
4730	//         "private",
4731	//         "projectPrivate",
4732	//         "publicRead",
4733	//         "publicReadWrite"
4734	//       ],
4735	//       "enumDescriptions": [
4736	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4737	//         "Project team owners get OWNER access.",
4738	//         "Project team members get access according to their roles.",
4739	//         "Project team owners get OWNER access, and allUsers get READER access.",
4740	//         "Project team owners get OWNER access, and allUsers get WRITER access."
4741	//       ],
4742	//       "location": "query",
4743	//       "type": "string"
4744	//     },
4745	//     "predefinedDefaultObjectAcl": {
4746	//       "description": "Apply a predefined set of default object access controls to this bucket.",
4747	//       "enum": [
4748	//         "authenticatedRead",
4749	//         "bucketOwnerFullControl",
4750	//         "bucketOwnerRead",
4751	//         "private",
4752	//         "projectPrivate",
4753	//         "publicRead"
4754	//       ],
4755	//       "enumDescriptions": [
4756	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4757	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
4758	//         "Object owner gets OWNER access, and project team owners get READER access.",
4759	//         "Object owner gets OWNER access.",
4760	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
4761	//         "Object owner gets OWNER access, and allUsers get READER access."
4762	//       ],
4763	//       "location": "query",
4764	//       "type": "string"
4765	//     },
4766	//     "projection": {
4767	//       "description": "Set of properties to return. Defaults to full.",
4768	//       "enum": [
4769	//         "full",
4770	//         "noAcl"
4771	//       ],
4772	//       "enumDescriptions": [
4773	//         "Include all properties.",
4774	//         "Omit owner, acl and defaultObjectAcl properties."
4775	//       ],
4776	//       "location": "query",
4777	//       "type": "string"
4778	//     },
4779	//     "provisionalUserProject": {
4780	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4781	//       "location": "query",
4782	//       "type": "string"
4783	//     },
4784	//     "userProject": {
4785	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4786	//       "location": "query",
4787	//       "type": "string"
4788	//     }
4789	//   },
4790	//   "path": "b/{bucket}",
4791	//   "request": {
4792	//     "$ref": "Bucket"
4793	//   },
4794	//   "response": {
4795	//     "$ref": "Bucket"
4796	//   },
4797	//   "scopes": [
4798	//     "https://www.googleapis.com/auth/cloud-platform",
4799	//     "https://www.googleapis.com/auth/devstorage.full_control"
4800	//   ]
4801	// }
4802
4803}
4804
4805// method id "storage.buckets.setIamPolicy":
4806
4807type BucketsSetIamPolicyCall struct {
4808	s          *Service
4809	bucket     string
4810	policy     *Policy
4811	urlParams_ gensupport.URLParams
4812	ctx_       context.Context
4813	header_    http.Header
4814}
4815
4816// SetIamPolicy: Updates an IAM policy for the specified bucket.
4817func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall {
4818	c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4819	c.bucket = bucket
4820	c.policy = policy
4821	return c
4822}
4823
4824// ProvisionalUserProject sets the optional parameter
4825// "provisionalUserProject": The project to be billed for this request
4826// if the target bucket is requester-pays bucket.
4827func (c *BucketsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *BucketsSetIamPolicyCall {
4828	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4829	return c
4830}
4831
4832// UserProject sets the optional parameter "userProject": The project to
4833// be billed for this request. Required for Requester Pays buckets.
4834func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
4835	c.urlParams_.Set("userProject", userProject)
4836	return c
4837}
4838
4839// Fields allows partial responses to be retrieved. See
4840// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4841// for more information.
4842func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall {
4843	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4844	return c
4845}
4846
4847// Context sets the context to be used in this call's Do method. Any
4848// pending HTTP request will be aborted if the provided context is
4849// canceled.
4850func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
4851	c.ctx_ = ctx
4852	return c
4853}
4854
4855// Header returns an http.Header that can be modified by the caller to
4856// add HTTP headers to the request.
4857func (c *BucketsSetIamPolicyCall) Header() http.Header {
4858	if c.header_ == nil {
4859		c.header_ = make(http.Header)
4860	}
4861	return c.header_
4862}
4863
4864func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4865	reqHeaders := make(http.Header)
4866	for k, v := range c.header_ {
4867		reqHeaders[k] = v
4868	}
4869	reqHeaders.Set("User-Agent", c.s.userAgent())
4870	var body io.Reader = nil
4871	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
4872	if err != nil {
4873		return nil, err
4874	}
4875	reqHeaders.Set("Content-Type", "application/json")
4876	c.urlParams_.Set("alt", alt)
4877	c.urlParams_.Set("prettyPrint", "false")
4878	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
4879	urls += "?" + c.urlParams_.Encode()
4880	req, err := http.NewRequest("PUT", urls, body)
4881	if err != nil {
4882		return nil, err
4883	}
4884	req.Header = reqHeaders
4885	googleapi.Expand(req.URL, map[string]string{
4886		"bucket": c.bucket,
4887	})
4888	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4889}
4890
4891// Do executes the "storage.buckets.setIamPolicy" call.
4892// Exactly one of *Policy or error will be non-nil. Any non-2xx status
4893// code is an error. Response headers are in either
4894// *Policy.ServerResponse.Header or (if a response was returned at all)
4895// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4896// check whether the returned error was because http.StatusNotModified
4897// was returned.
4898func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4899	gensupport.SetOptions(c.urlParams_, opts...)
4900	res, err := c.doRequest("json")
4901	if res != nil && res.StatusCode == http.StatusNotModified {
4902		if res.Body != nil {
4903			res.Body.Close()
4904		}
4905		return nil, &googleapi.Error{
4906			Code:   res.StatusCode,
4907			Header: res.Header,
4908		}
4909	}
4910	if err != nil {
4911		return nil, err
4912	}
4913	defer googleapi.CloseBody(res)
4914	if err := googleapi.CheckResponse(res); err != nil {
4915		return nil, err
4916	}
4917	ret := &Policy{
4918		ServerResponse: googleapi.ServerResponse{
4919			Header:         res.Header,
4920			HTTPStatusCode: res.StatusCode,
4921		},
4922	}
4923	target := &ret
4924	if err := gensupport.DecodeResponse(target, res); err != nil {
4925		return nil, err
4926	}
4927	return ret, nil
4928	// {
4929	//   "description": "Updates an IAM policy for the specified bucket.",
4930	//   "httpMethod": "PUT",
4931	//   "id": "storage.buckets.setIamPolicy",
4932	//   "parameterOrder": [
4933	//     "bucket"
4934	//   ],
4935	//   "parameters": {
4936	//     "bucket": {
4937	//       "description": "Name of a bucket.",
4938	//       "location": "path",
4939	//       "required": true,
4940	//       "type": "string"
4941	//     },
4942	//     "provisionalUserProject": {
4943	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
4944	//       "location": "query",
4945	//       "type": "string"
4946	//     },
4947	//     "userProject": {
4948	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4949	//       "location": "query",
4950	//       "type": "string"
4951	//     }
4952	//   },
4953	//   "path": "b/{bucket}/iam",
4954	//   "request": {
4955	//     "$ref": "Policy"
4956	//   },
4957	//   "response": {
4958	//     "$ref": "Policy"
4959	//   },
4960	//   "scopes": [
4961	//     "https://www.googleapis.com/auth/cloud-platform",
4962	//     "https://www.googleapis.com/auth/devstorage.full_control"
4963	//   ]
4964	// }
4965
4966}
4967
4968// method id "storage.buckets.testIamPermissions":
4969
4970type BucketsTestIamPermissionsCall struct {
4971	s            *Service
4972	bucket       string
4973	urlParams_   gensupport.URLParams
4974	ifNoneMatch_ string
4975	ctx_         context.Context
4976	header_      http.Header
4977}
4978
4979// TestIamPermissions: Tests a set of permissions on the given bucket to
4980// see which, if any, are held by the caller.
4981func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall {
4982	c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4983	c.bucket = bucket
4984	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
4985	return c
4986}
4987
4988// ProvisionalUserProject sets the optional parameter
4989// "provisionalUserProject": The project to be billed for this request
4990// if the target bucket is requester-pays bucket.
4991func (c *BucketsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *BucketsTestIamPermissionsCall {
4992	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
4993	return c
4994}
4995
4996// UserProject sets the optional parameter "userProject": The project to
4997// be billed for this request. Required for Requester Pays buckets.
4998func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
4999	c.urlParams_.Set("userProject", userProject)
5000	return c
5001}
5002
5003// Fields allows partial responses to be retrieved. See
5004// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5005// for more information.
5006func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall {
5007	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5008	return c
5009}
5010
5011// IfNoneMatch sets the optional parameter which makes the operation
5012// fail if the object's ETag matches the given value. This is useful for
5013// getting updates only after the object has changed since the last
5014// request. Use googleapi.IsNotModified to check whether the response
5015// error from Do is the result of In-None-Match.
5016func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall {
5017	c.ifNoneMatch_ = entityTag
5018	return c
5019}
5020
5021// Context sets the context to be used in this call's Do method. Any
5022// pending HTTP request will be aborted if the provided context is
5023// canceled.
5024func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
5025	c.ctx_ = ctx
5026	return c
5027}
5028
5029// Header returns an http.Header that can be modified by the caller to
5030// add HTTP headers to the request.
5031func (c *BucketsTestIamPermissionsCall) Header() http.Header {
5032	if c.header_ == nil {
5033		c.header_ = make(http.Header)
5034	}
5035	return c.header_
5036}
5037
5038func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5039	reqHeaders := make(http.Header)
5040	for k, v := range c.header_ {
5041		reqHeaders[k] = v
5042	}
5043	reqHeaders.Set("User-Agent", c.s.userAgent())
5044	if c.ifNoneMatch_ != "" {
5045		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5046	}
5047	var body io.Reader = nil
5048	c.urlParams_.Set("alt", alt)
5049	c.urlParams_.Set("prettyPrint", "false")
5050	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions")
5051	urls += "?" + c.urlParams_.Encode()
5052	req, err := http.NewRequest("GET", urls, body)
5053	if err != nil {
5054		return nil, err
5055	}
5056	req.Header = reqHeaders
5057	googleapi.Expand(req.URL, map[string]string{
5058		"bucket": c.bucket,
5059	})
5060	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5061}
5062
5063// Do executes the "storage.buckets.testIamPermissions" call.
5064// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
5065// Any non-2xx status code is an error. Response headers are in either
5066// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
5067// was returned at all) in error.(*googleapi.Error).Header. Use
5068// googleapi.IsNotModified to check whether the returned error was
5069// because http.StatusNotModified was returned.
5070func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
5071	gensupport.SetOptions(c.urlParams_, opts...)
5072	res, err := c.doRequest("json")
5073	if res != nil && res.StatusCode == http.StatusNotModified {
5074		if res.Body != nil {
5075			res.Body.Close()
5076		}
5077		return nil, &googleapi.Error{
5078			Code:   res.StatusCode,
5079			Header: res.Header,
5080		}
5081	}
5082	if err != nil {
5083		return nil, err
5084	}
5085	defer googleapi.CloseBody(res)
5086	if err := googleapi.CheckResponse(res); err != nil {
5087		return nil, err
5088	}
5089	ret := &TestIamPermissionsResponse{
5090		ServerResponse: googleapi.ServerResponse{
5091			Header:         res.Header,
5092			HTTPStatusCode: res.StatusCode,
5093		},
5094	}
5095	target := &ret
5096	if err := gensupport.DecodeResponse(target, res); err != nil {
5097		return nil, err
5098	}
5099	return ret, nil
5100	// {
5101	//   "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
5102	//   "httpMethod": "GET",
5103	//   "id": "storage.buckets.testIamPermissions",
5104	//   "parameterOrder": [
5105	//     "bucket",
5106	//     "permissions"
5107	//   ],
5108	//   "parameters": {
5109	//     "bucket": {
5110	//       "description": "Name of a bucket.",
5111	//       "location": "path",
5112	//       "required": true,
5113	//       "type": "string"
5114	//     },
5115	//     "permissions": {
5116	//       "description": "Permissions to test.",
5117	//       "location": "query",
5118	//       "repeated": true,
5119	//       "required": true,
5120	//       "type": "string"
5121	//     },
5122	//     "provisionalUserProject": {
5123	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5124	//       "location": "query",
5125	//       "type": "string"
5126	//     },
5127	//     "userProject": {
5128	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5129	//       "location": "query",
5130	//       "type": "string"
5131	//     }
5132	//   },
5133	//   "path": "b/{bucket}/iam/testPermissions",
5134	//   "response": {
5135	//     "$ref": "TestIamPermissionsResponse"
5136	//   },
5137	//   "scopes": [
5138	//     "https://www.googleapis.com/auth/cloud-platform",
5139	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5140	//     "https://www.googleapis.com/auth/devstorage.full_control",
5141	//     "https://www.googleapis.com/auth/devstorage.read_only",
5142	//     "https://www.googleapis.com/auth/devstorage.read_write"
5143	//   ]
5144	// }
5145
5146}
5147
5148// method id "storage.buckets.update":
5149
5150type BucketsUpdateCall struct {
5151	s          *Service
5152	bucket     string
5153	bucket2    *Bucket
5154	urlParams_ gensupport.URLParams
5155	ctx_       context.Context
5156	header_    http.Header
5157}
5158
5159// Update: Updates a bucket. Changes to the bucket will be readable
5160// immediately after writing, but configuration changes may take time to
5161// propagate.
5162func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
5163	c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5164	c.bucket = bucket
5165	c.bucket2 = bucket2
5166	return c
5167}
5168
5169// IfMetagenerationMatch sets the optional parameter
5170// "ifMetagenerationMatch": Makes the return of the bucket metadata
5171// conditional on whether the bucket's current metageneration matches
5172// the given value.
5173func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
5174	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5175	return c
5176}
5177
5178// IfMetagenerationNotMatch sets the optional parameter
5179// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
5180// conditional on whether the bucket's current metageneration does not
5181// match the given value.
5182func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall {
5183	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5184	return c
5185}
5186
5187// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
5188// predefined set of access controls to this bucket.
5189//
5190// Possible values:
5191//   "authenticatedRead" - Project team owners get OWNER access, and
5192// allAuthenticatedUsers get READER access.
5193//   "private" - Project team owners get OWNER access.
5194//   "projectPrivate" - Project team members get access according to
5195// their roles.
5196//   "publicRead" - Project team owners get OWNER access, and allUsers
5197// get READER access.
5198//   "publicReadWrite" - Project team owners get OWNER access, and
5199// allUsers get WRITER access.
5200func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall {
5201	c.urlParams_.Set("predefinedAcl", predefinedAcl)
5202	return c
5203}
5204
5205// PredefinedDefaultObjectAcl sets the optional parameter
5206// "predefinedDefaultObjectAcl": Apply a predefined set of default
5207// object access controls to this bucket.
5208//
5209// Possible values:
5210//   "authenticatedRead" - Object owner gets OWNER access, and
5211// allAuthenticatedUsers get READER access.
5212//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
5213// project team owners get OWNER access.
5214//   "bucketOwnerRead" - Object owner gets OWNER access, and project
5215// team owners get READER access.
5216//   "private" - Object owner gets OWNER access.
5217//   "projectPrivate" - Object owner gets OWNER access, and project team
5218// members get access according to their roles.
5219//   "publicRead" - Object owner gets OWNER access, and allUsers get
5220// READER access.
5221func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
5222	c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
5223	return c
5224}
5225
5226// Projection sets the optional parameter "projection": Set of
5227// properties to return. Defaults to full.
5228//
5229// Possible values:
5230//   "full" - Include all properties.
5231//   "noAcl" - Omit owner, acl and defaultObjectAcl properties.
5232func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
5233	c.urlParams_.Set("projection", projection)
5234	return c
5235}
5236
5237// ProvisionalUserProject sets the optional parameter
5238// "provisionalUserProject": The project to be billed for this request
5239// if the target bucket is requester-pays bucket.
5240func (c *BucketsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *BucketsUpdateCall {
5241	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5242	return c
5243}
5244
5245// UserProject sets the optional parameter "userProject": The project to
5246// be billed for this request. Required for Requester Pays buckets.
5247func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
5248	c.urlParams_.Set("userProject", userProject)
5249	return c
5250}
5251
5252// Fields allows partial responses to be retrieved. See
5253// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5254// for more information.
5255func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
5256	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5257	return c
5258}
5259
5260// Context sets the context to be used in this call's Do method. Any
5261// pending HTTP request will be aborted if the provided context is
5262// canceled.
5263func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
5264	c.ctx_ = ctx
5265	return c
5266}
5267
5268// Header returns an http.Header that can be modified by the caller to
5269// add HTTP headers to the request.
5270func (c *BucketsUpdateCall) Header() http.Header {
5271	if c.header_ == nil {
5272		c.header_ = make(http.Header)
5273	}
5274	return c.header_
5275}
5276
5277func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
5278	reqHeaders := make(http.Header)
5279	for k, v := range c.header_ {
5280		reqHeaders[k] = v
5281	}
5282	reqHeaders.Set("User-Agent", c.s.userAgent())
5283	var body io.Reader = nil
5284	body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
5285	if err != nil {
5286		return nil, err
5287	}
5288	reqHeaders.Set("Content-Type", "application/json")
5289	c.urlParams_.Set("alt", alt)
5290	c.urlParams_.Set("prettyPrint", "false")
5291	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
5292	urls += "?" + c.urlParams_.Encode()
5293	req, err := http.NewRequest("PUT", urls, body)
5294	if err != nil {
5295		return nil, err
5296	}
5297	req.Header = reqHeaders
5298	googleapi.Expand(req.URL, map[string]string{
5299		"bucket": c.bucket,
5300	})
5301	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5302}
5303
5304// Do executes the "storage.buckets.update" call.
5305// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
5306// code is an error. Response headers are in either
5307// *Bucket.ServerResponse.Header or (if a response was returned at all)
5308// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5309// check whether the returned error was because http.StatusNotModified
5310// was returned.
5311func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
5312	gensupport.SetOptions(c.urlParams_, opts...)
5313	res, err := c.doRequest("json")
5314	if res != nil && res.StatusCode == http.StatusNotModified {
5315		if res.Body != nil {
5316			res.Body.Close()
5317		}
5318		return nil, &googleapi.Error{
5319			Code:   res.StatusCode,
5320			Header: res.Header,
5321		}
5322	}
5323	if err != nil {
5324		return nil, err
5325	}
5326	defer googleapi.CloseBody(res)
5327	if err := googleapi.CheckResponse(res); err != nil {
5328		return nil, err
5329	}
5330	ret := &Bucket{
5331		ServerResponse: googleapi.ServerResponse{
5332			Header:         res.Header,
5333			HTTPStatusCode: res.StatusCode,
5334		},
5335	}
5336	target := &ret
5337	if err := gensupport.DecodeResponse(target, res); err != nil {
5338		return nil, err
5339	}
5340	return ret, nil
5341	// {
5342	//   "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
5343	//   "httpMethod": "PUT",
5344	//   "id": "storage.buckets.update",
5345	//   "parameterOrder": [
5346	//     "bucket"
5347	//   ],
5348	//   "parameters": {
5349	//     "bucket": {
5350	//       "description": "Name of a bucket.",
5351	//       "location": "path",
5352	//       "required": true,
5353	//       "type": "string"
5354	//     },
5355	//     "ifMetagenerationMatch": {
5356	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
5357	//       "format": "int64",
5358	//       "location": "query",
5359	//       "type": "string"
5360	//     },
5361	//     "ifMetagenerationNotMatch": {
5362	//       "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
5363	//       "format": "int64",
5364	//       "location": "query",
5365	//       "type": "string"
5366	//     },
5367	//     "predefinedAcl": {
5368	//       "description": "Apply a predefined set of access controls to this bucket.",
5369	//       "enum": [
5370	//         "authenticatedRead",
5371	//         "private",
5372	//         "projectPrivate",
5373	//         "publicRead",
5374	//         "publicReadWrite"
5375	//       ],
5376	//       "enumDescriptions": [
5377	//         "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
5378	//         "Project team owners get OWNER access.",
5379	//         "Project team members get access according to their roles.",
5380	//         "Project team owners get OWNER access, and allUsers get READER access.",
5381	//         "Project team owners get OWNER access, and allUsers get WRITER access."
5382	//       ],
5383	//       "location": "query",
5384	//       "type": "string"
5385	//     },
5386	//     "predefinedDefaultObjectAcl": {
5387	//       "description": "Apply a predefined set of default object access controls to this bucket.",
5388	//       "enum": [
5389	//         "authenticatedRead",
5390	//         "bucketOwnerFullControl",
5391	//         "bucketOwnerRead",
5392	//         "private",
5393	//         "projectPrivate",
5394	//         "publicRead"
5395	//       ],
5396	//       "enumDescriptions": [
5397	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
5398	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
5399	//         "Object owner gets OWNER access, and project team owners get READER access.",
5400	//         "Object owner gets OWNER access.",
5401	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
5402	//         "Object owner gets OWNER access, and allUsers get READER access."
5403	//       ],
5404	//       "location": "query",
5405	//       "type": "string"
5406	//     },
5407	//     "projection": {
5408	//       "description": "Set of properties to return. Defaults to full.",
5409	//       "enum": [
5410	//         "full",
5411	//         "noAcl"
5412	//       ],
5413	//       "enumDescriptions": [
5414	//         "Include all properties.",
5415	//         "Omit owner, acl and defaultObjectAcl properties."
5416	//       ],
5417	//       "location": "query",
5418	//       "type": "string"
5419	//     },
5420	//     "provisionalUserProject": {
5421	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5422	//       "location": "query",
5423	//       "type": "string"
5424	//     },
5425	//     "userProject": {
5426	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5427	//       "location": "query",
5428	//       "type": "string"
5429	//     }
5430	//   },
5431	//   "path": "b/{bucket}",
5432	//   "request": {
5433	//     "$ref": "Bucket"
5434	//   },
5435	//   "response": {
5436	//     "$ref": "Bucket"
5437	//   },
5438	//   "scopes": [
5439	//     "https://www.googleapis.com/auth/cloud-platform",
5440	//     "https://www.googleapis.com/auth/devstorage.full_control"
5441	//   ]
5442	// }
5443
5444}
5445
5446// method id "storage.channels.stop":
5447
5448type ChannelsStopCall struct {
5449	s          *Service
5450	channel    *Channel
5451	urlParams_ gensupport.URLParams
5452	ctx_       context.Context
5453	header_    http.Header
5454}
5455
5456// Stop: Stop watching resources through this channel
5457func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
5458	c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5459	c.channel = channel
5460	return c
5461}
5462
5463// Fields allows partial responses to be retrieved. See
5464// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5465// for more information.
5466func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
5467	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5468	return c
5469}
5470
5471// Context sets the context to be used in this call's Do method. Any
5472// pending HTTP request will be aborted if the provided context is
5473// canceled.
5474func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
5475	c.ctx_ = ctx
5476	return c
5477}
5478
5479// Header returns an http.Header that can be modified by the caller to
5480// add HTTP headers to the request.
5481func (c *ChannelsStopCall) Header() http.Header {
5482	if c.header_ == nil {
5483		c.header_ = make(http.Header)
5484	}
5485	return c.header_
5486}
5487
5488func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
5489	reqHeaders := make(http.Header)
5490	for k, v := range c.header_ {
5491		reqHeaders[k] = v
5492	}
5493	reqHeaders.Set("User-Agent", c.s.userAgent())
5494	var body io.Reader = nil
5495	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
5496	if err != nil {
5497		return nil, err
5498	}
5499	reqHeaders.Set("Content-Type", "application/json")
5500	c.urlParams_.Set("alt", alt)
5501	c.urlParams_.Set("prettyPrint", "false")
5502	urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
5503	urls += "?" + c.urlParams_.Encode()
5504	req, err := http.NewRequest("POST", urls, body)
5505	if err != nil {
5506		return nil, err
5507	}
5508	req.Header = reqHeaders
5509	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5510}
5511
5512// Do executes the "storage.channels.stop" call.
5513func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
5514	gensupport.SetOptions(c.urlParams_, opts...)
5515	res, err := c.doRequest("json")
5516	if err != nil {
5517		return err
5518	}
5519	defer googleapi.CloseBody(res)
5520	if err := googleapi.CheckResponse(res); err != nil {
5521		return err
5522	}
5523	return nil
5524	// {
5525	//   "description": "Stop watching resources through this channel",
5526	//   "httpMethod": "POST",
5527	//   "id": "storage.channels.stop",
5528	//   "path": "channels/stop",
5529	//   "request": {
5530	//     "$ref": "Channel",
5531	//     "parameterName": "resource"
5532	//   },
5533	//   "scopes": [
5534	//     "https://www.googleapis.com/auth/cloud-platform",
5535	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5536	//     "https://www.googleapis.com/auth/devstorage.full_control",
5537	//     "https://www.googleapis.com/auth/devstorage.read_only",
5538	//     "https://www.googleapis.com/auth/devstorage.read_write"
5539	//   ]
5540	// }
5541
5542}
5543
5544// method id "storage.defaultObjectAccessControls.delete":
5545
5546type DefaultObjectAccessControlsDeleteCall struct {
5547	s          *Service
5548	bucket     string
5549	entity     string
5550	urlParams_ gensupport.URLParams
5551	ctx_       context.Context
5552	header_    http.Header
5553}
5554
5555// Delete: Permanently deletes the default object ACL entry for the
5556// specified entity on the specified bucket.
5557func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
5558	c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5559	c.bucket = bucket
5560	c.entity = entity
5561	return c
5562}
5563
5564// ProvisionalUserProject sets the optional parameter
5565// "provisionalUserProject": The project to be billed for this request
5566// if the target bucket is requester-pays bucket.
5567func (c *DefaultObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsDeleteCall {
5568	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5569	return c
5570}
5571
5572// UserProject sets the optional parameter "userProject": The project to
5573// be billed for this request. Required for Requester Pays buckets.
5574func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
5575	c.urlParams_.Set("userProject", userProject)
5576	return c
5577}
5578
5579// Fields allows partial responses to be retrieved. See
5580// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5581// for more information.
5582func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
5583	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5584	return c
5585}
5586
5587// Context sets the context to be used in this call's Do method. Any
5588// pending HTTP request will be aborted if the provided context is
5589// canceled.
5590func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
5591	c.ctx_ = ctx
5592	return c
5593}
5594
5595// Header returns an http.Header that can be modified by the caller to
5596// add HTTP headers to the request.
5597func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
5598	if c.header_ == nil {
5599		c.header_ = make(http.Header)
5600	}
5601	return c.header_
5602}
5603
5604func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
5605	reqHeaders := make(http.Header)
5606	for k, v := range c.header_ {
5607		reqHeaders[k] = v
5608	}
5609	reqHeaders.Set("User-Agent", c.s.userAgent())
5610	var body io.Reader = nil
5611	c.urlParams_.Set("alt", alt)
5612	c.urlParams_.Set("prettyPrint", "false")
5613	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5614	urls += "?" + c.urlParams_.Encode()
5615	req, err := http.NewRequest("DELETE", urls, body)
5616	if err != nil {
5617		return nil, err
5618	}
5619	req.Header = reqHeaders
5620	googleapi.Expand(req.URL, map[string]string{
5621		"bucket": c.bucket,
5622		"entity": c.entity,
5623	})
5624	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5625}
5626
5627// Do executes the "storage.defaultObjectAccessControls.delete" call.
5628func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
5629	gensupport.SetOptions(c.urlParams_, opts...)
5630	res, err := c.doRequest("json")
5631	if err != nil {
5632		return err
5633	}
5634	defer googleapi.CloseBody(res)
5635	if err := googleapi.CheckResponse(res); err != nil {
5636		return err
5637	}
5638	return nil
5639	// {
5640	//   "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
5641	//   "httpMethod": "DELETE",
5642	//   "id": "storage.defaultObjectAccessControls.delete",
5643	//   "parameterOrder": [
5644	//     "bucket",
5645	//     "entity"
5646	//   ],
5647	//   "parameters": {
5648	//     "bucket": {
5649	//       "description": "Name of a bucket.",
5650	//       "location": "path",
5651	//       "required": true,
5652	//       "type": "string"
5653	//     },
5654	//     "entity": {
5655	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5656	//       "location": "path",
5657	//       "required": true,
5658	//       "type": "string"
5659	//     },
5660	//     "provisionalUserProject": {
5661	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5662	//       "location": "query",
5663	//       "type": "string"
5664	//     },
5665	//     "userProject": {
5666	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5667	//       "location": "query",
5668	//       "type": "string"
5669	//     }
5670	//   },
5671	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5672	//   "scopes": [
5673	//     "https://www.googleapis.com/auth/cloud-platform",
5674	//     "https://www.googleapis.com/auth/devstorage.full_control"
5675	//   ]
5676	// }
5677
5678}
5679
5680// method id "storage.defaultObjectAccessControls.get":
5681
5682type DefaultObjectAccessControlsGetCall struct {
5683	s            *Service
5684	bucket       string
5685	entity       string
5686	urlParams_   gensupport.URLParams
5687	ifNoneMatch_ string
5688	ctx_         context.Context
5689	header_      http.Header
5690}
5691
5692// Get: Returns the default object ACL entry for the specified entity on
5693// the specified bucket.
5694func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
5695	c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5696	c.bucket = bucket
5697	c.entity = entity
5698	return c
5699}
5700
5701// ProvisionalUserProject sets the optional parameter
5702// "provisionalUserProject": The project to be billed for this request
5703// if the target bucket is requester-pays bucket.
5704func (c *DefaultObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsGetCall {
5705	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5706	return c
5707}
5708
5709// UserProject sets the optional parameter "userProject": The project to
5710// be billed for this request. Required for Requester Pays buckets.
5711func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
5712	c.urlParams_.Set("userProject", userProject)
5713	return c
5714}
5715
5716// Fields allows partial responses to be retrieved. See
5717// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5718// for more information.
5719func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
5720	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5721	return c
5722}
5723
5724// IfNoneMatch sets the optional parameter which makes the operation
5725// fail if the object's ETag matches the given value. This is useful for
5726// getting updates only after the object has changed since the last
5727// request. Use googleapi.IsNotModified to check whether the response
5728// error from Do is the result of In-None-Match.
5729func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
5730	c.ifNoneMatch_ = entityTag
5731	return c
5732}
5733
5734// Context sets the context to be used in this call's Do method. Any
5735// pending HTTP request will be aborted if the provided context is
5736// canceled.
5737func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
5738	c.ctx_ = ctx
5739	return c
5740}
5741
5742// Header returns an http.Header that can be modified by the caller to
5743// add HTTP headers to the request.
5744func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
5745	if c.header_ == nil {
5746		c.header_ = make(http.Header)
5747	}
5748	return c.header_
5749}
5750
5751func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
5752	reqHeaders := make(http.Header)
5753	for k, v := range c.header_ {
5754		reqHeaders[k] = v
5755	}
5756	reqHeaders.Set("User-Agent", c.s.userAgent())
5757	if c.ifNoneMatch_ != "" {
5758		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5759	}
5760	var body io.Reader = nil
5761	c.urlParams_.Set("alt", alt)
5762	c.urlParams_.Set("prettyPrint", "false")
5763	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5764	urls += "?" + c.urlParams_.Encode()
5765	req, err := http.NewRequest("GET", urls, body)
5766	if err != nil {
5767		return nil, err
5768	}
5769	req.Header = reqHeaders
5770	googleapi.Expand(req.URL, map[string]string{
5771		"bucket": c.bucket,
5772		"entity": c.entity,
5773	})
5774	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5775}
5776
5777// Do executes the "storage.defaultObjectAccessControls.get" call.
5778// Exactly one of *ObjectAccessControl or error will be non-nil. Any
5779// non-2xx status code is an error. Response headers are in either
5780// *ObjectAccessControl.ServerResponse.Header or (if a response was
5781// returned at all) in error.(*googleapi.Error).Header. Use
5782// googleapi.IsNotModified to check whether the returned error was
5783// because http.StatusNotModified was returned.
5784func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5785	gensupport.SetOptions(c.urlParams_, opts...)
5786	res, err := c.doRequest("json")
5787	if res != nil && res.StatusCode == http.StatusNotModified {
5788		if res.Body != nil {
5789			res.Body.Close()
5790		}
5791		return nil, &googleapi.Error{
5792			Code:   res.StatusCode,
5793			Header: res.Header,
5794		}
5795	}
5796	if err != nil {
5797		return nil, err
5798	}
5799	defer googleapi.CloseBody(res)
5800	if err := googleapi.CheckResponse(res); err != nil {
5801		return nil, err
5802	}
5803	ret := &ObjectAccessControl{
5804		ServerResponse: googleapi.ServerResponse{
5805			Header:         res.Header,
5806			HTTPStatusCode: res.StatusCode,
5807		},
5808	}
5809	target := &ret
5810	if err := gensupport.DecodeResponse(target, res); err != nil {
5811		return nil, err
5812	}
5813	return ret, nil
5814	// {
5815	//   "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
5816	//   "httpMethod": "GET",
5817	//   "id": "storage.defaultObjectAccessControls.get",
5818	//   "parameterOrder": [
5819	//     "bucket",
5820	//     "entity"
5821	//   ],
5822	//   "parameters": {
5823	//     "bucket": {
5824	//       "description": "Name of a bucket.",
5825	//       "location": "path",
5826	//       "required": true,
5827	//       "type": "string"
5828	//     },
5829	//     "entity": {
5830	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5831	//       "location": "path",
5832	//       "required": true,
5833	//       "type": "string"
5834	//     },
5835	//     "provisionalUserProject": {
5836	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5837	//       "location": "query",
5838	//       "type": "string"
5839	//     },
5840	//     "userProject": {
5841	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5842	//       "location": "query",
5843	//       "type": "string"
5844	//     }
5845	//   },
5846	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
5847	//   "response": {
5848	//     "$ref": "ObjectAccessControl"
5849	//   },
5850	//   "scopes": [
5851	//     "https://www.googleapis.com/auth/cloud-platform",
5852	//     "https://www.googleapis.com/auth/devstorage.full_control"
5853	//   ]
5854	// }
5855
5856}
5857
5858// method id "storage.defaultObjectAccessControls.insert":
5859
5860type DefaultObjectAccessControlsInsertCall struct {
5861	s                   *Service
5862	bucket              string
5863	objectaccesscontrol *ObjectAccessControl
5864	urlParams_          gensupport.URLParams
5865	ctx_                context.Context
5866	header_             http.Header
5867}
5868
5869// Insert: Creates a new default object ACL entry on the specified
5870// bucket.
5871func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
5872	c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5873	c.bucket = bucket
5874	c.objectaccesscontrol = objectaccesscontrol
5875	return c
5876}
5877
5878// ProvisionalUserProject sets the optional parameter
5879// "provisionalUserProject": The project to be billed for this request
5880// if the target bucket is requester-pays bucket.
5881func (c *DefaultObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsInsertCall {
5882	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
5883	return c
5884}
5885
5886// UserProject sets the optional parameter "userProject": The project to
5887// be billed for this request. Required for Requester Pays buckets.
5888func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
5889	c.urlParams_.Set("userProject", userProject)
5890	return c
5891}
5892
5893// Fields allows partial responses to be retrieved. See
5894// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5895// for more information.
5896func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
5897	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5898	return c
5899}
5900
5901// Context sets the context to be used in this call's Do method. Any
5902// pending HTTP request will be aborted if the provided context is
5903// canceled.
5904func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
5905	c.ctx_ = ctx
5906	return c
5907}
5908
5909// Header returns an http.Header that can be modified by the caller to
5910// add HTTP headers to the request.
5911func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
5912	if c.header_ == nil {
5913		c.header_ = make(http.Header)
5914	}
5915	return c.header_
5916}
5917
5918func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
5919	reqHeaders := make(http.Header)
5920	for k, v := range c.header_ {
5921		reqHeaders[k] = v
5922	}
5923	reqHeaders.Set("User-Agent", c.s.userAgent())
5924	var body io.Reader = nil
5925	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
5926	if err != nil {
5927		return nil, err
5928	}
5929	reqHeaders.Set("Content-Type", "application/json")
5930	c.urlParams_.Set("alt", alt)
5931	c.urlParams_.Set("prettyPrint", "false")
5932	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
5933	urls += "?" + c.urlParams_.Encode()
5934	req, err := http.NewRequest("POST", urls, body)
5935	if err != nil {
5936		return nil, err
5937	}
5938	req.Header = reqHeaders
5939	googleapi.Expand(req.URL, map[string]string{
5940		"bucket": c.bucket,
5941	})
5942	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5943}
5944
5945// Do executes the "storage.defaultObjectAccessControls.insert" call.
5946// Exactly one of *ObjectAccessControl or error will be non-nil. Any
5947// non-2xx status code is an error. Response headers are in either
5948// *ObjectAccessControl.ServerResponse.Header or (if a response was
5949// returned at all) in error.(*googleapi.Error).Header. Use
5950// googleapi.IsNotModified to check whether the returned error was
5951// because http.StatusNotModified was returned.
5952func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5953	gensupport.SetOptions(c.urlParams_, opts...)
5954	res, err := c.doRequest("json")
5955	if res != nil && res.StatusCode == http.StatusNotModified {
5956		if res.Body != nil {
5957			res.Body.Close()
5958		}
5959		return nil, &googleapi.Error{
5960			Code:   res.StatusCode,
5961			Header: res.Header,
5962		}
5963	}
5964	if err != nil {
5965		return nil, err
5966	}
5967	defer googleapi.CloseBody(res)
5968	if err := googleapi.CheckResponse(res); err != nil {
5969		return nil, err
5970	}
5971	ret := &ObjectAccessControl{
5972		ServerResponse: googleapi.ServerResponse{
5973			Header:         res.Header,
5974			HTTPStatusCode: res.StatusCode,
5975		},
5976	}
5977	target := &ret
5978	if err := gensupport.DecodeResponse(target, res); err != nil {
5979		return nil, err
5980	}
5981	return ret, nil
5982	// {
5983	//   "description": "Creates a new default object ACL entry on the specified bucket.",
5984	//   "httpMethod": "POST",
5985	//   "id": "storage.defaultObjectAccessControls.insert",
5986	//   "parameterOrder": [
5987	//     "bucket"
5988	//   ],
5989	//   "parameters": {
5990	//     "bucket": {
5991	//       "description": "Name of a bucket.",
5992	//       "location": "path",
5993	//       "required": true,
5994	//       "type": "string"
5995	//     },
5996	//     "provisionalUserProject": {
5997	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
5998	//       "location": "query",
5999	//       "type": "string"
6000	//     },
6001	//     "userProject": {
6002	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6003	//       "location": "query",
6004	//       "type": "string"
6005	//     }
6006	//   },
6007	//   "path": "b/{bucket}/defaultObjectAcl",
6008	//   "request": {
6009	//     "$ref": "ObjectAccessControl"
6010	//   },
6011	//   "response": {
6012	//     "$ref": "ObjectAccessControl"
6013	//   },
6014	//   "scopes": [
6015	//     "https://www.googleapis.com/auth/cloud-platform",
6016	//     "https://www.googleapis.com/auth/devstorage.full_control"
6017	//   ]
6018	// }
6019
6020}
6021
6022// method id "storage.defaultObjectAccessControls.list":
6023
6024type DefaultObjectAccessControlsListCall struct {
6025	s            *Service
6026	bucket       string
6027	urlParams_   gensupport.URLParams
6028	ifNoneMatch_ string
6029	ctx_         context.Context
6030	header_      http.Header
6031}
6032
6033// List: Retrieves default object ACL entries on the specified bucket.
6034func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
6035	c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6036	c.bucket = bucket
6037	return c
6038}
6039
6040// IfMetagenerationMatch sets the optional parameter
6041// "ifMetagenerationMatch": If present, only return default ACL listing
6042// if the bucket's current metageneration matches this value.
6043func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
6044	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
6045	return c
6046}
6047
6048// IfMetagenerationNotMatch sets the optional parameter
6049// "ifMetagenerationNotMatch": If present, only return default ACL
6050// listing if the bucket's current metageneration does not match the
6051// given value.
6052func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
6053	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
6054	return c
6055}
6056
6057// ProvisionalUserProject sets the optional parameter
6058// "provisionalUserProject": The project to be billed for this request
6059// if the target bucket is requester-pays bucket.
6060func (c *DefaultObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsListCall {
6061	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6062	return c
6063}
6064
6065// UserProject sets the optional parameter "userProject": The project to
6066// be billed for this request. Required for Requester Pays buckets.
6067func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
6068	c.urlParams_.Set("userProject", userProject)
6069	return c
6070}
6071
6072// Fields allows partial responses to be retrieved. See
6073// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6074// for more information.
6075func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
6076	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6077	return c
6078}
6079
6080// IfNoneMatch sets the optional parameter which makes the operation
6081// fail if the object's ETag matches the given value. This is useful for
6082// getting updates only after the object has changed since the last
6083// request. Use googleapi.IsNotModified to check whether the response
6084// error from Do is the result of In-None-Match.
6085func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
6086	c.ifNoneMatch_ = entityTag
6087	return c
6088}
6089
6090// Context sets the context to be used in this call's Do method. Any
6091// pending HTTP request will be aborted if the provided context is
6092// canceled.
6093func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
6094	c.ctx_ = ctx
6095	return c
6096}
6097
6098// Header returns an http.Header that can be modified by the caller to
6099// add HTTP headers to the request.
6100func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
6101	if c.header_ == nil {
6102		c.header_ = make(http.Header)
6103	}
6104	return c.header_
6105}
6106
6107func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
6108	reqHeaders := make(http.Header)
6109	for k, v := range c.header_ {
6110		reqHeaders[k] = v
6111	}
6112	reqHeaders.Set("User-Agent", c.s.userAgent())
6113	if c.ifNoneMatch_ != "" {
6114		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6115	}
6116	var body io.Reader = nil
6117	c.urlParams_.Set("alt", alt)
6118	c.urlParams_.Set("prettyPrint", "false")
6119	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
6120	urls += "?" + c.urlParams_.Encode()
6121	req, err := http.NewRequest("GET", urls, body)
6122	if err != nil {
6123		return nil, err
6124	}
6125	req.Header = reqHeaders
6126	googleapi.Expand(req.URL, map[string]string{
6127		"bucket": c.bucket,
6128	})
6129	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6130}
6131
6132// Do executes the "storage.defaultObjectAccessControls.list" call.
6133// Exactly one of *ObjectAccessControls or error will be non-nil. Any
6134// non-2xx status code is an error. Response headers are in either
6135// *ObjectAccessControls.ServerResponse.Header or (if a response was
6136// returned at all) in error.(*googleapi.Error).Header. Use
6137// googleapi.IsNotModified to check whether the returned error was
6138// because http.StatusNotModified was returned.
6139func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
6140	gensupport.SetOptions(c.urlParams_, opts...)
6141	res, err := c.doRequest("json")
6142	if res != nil && res.StatusCode == http.StatusNotModified {
6143		if res.Body != nil {
6144			res.Body.Close()
6145		}
6146		return nil, &googleapi.Error{
6147			Code:   res.StatusCode,
6148			Header: res.Header,
6149		}
6150	}
6151	if err != nil {
6152		return nil, err
6153	}
6154	defer googleapi.CloseBody(res)
6155	if err := googleapi.CheckResponse(res); err != nil {
6156		return nil, err
6157	}
6158	ret := &ObjectAccessControls{
6159		ServerResponse: googleapi.ServerResponse{
6160			Header:         res.Header,
6161			HTTPStatusCode: res.StatusCode,
6162		},
6163	}
6164	target := &ret
6165	if err := gensupport.DecodeResponse(target, res); err != nil {
6166		return nil, err
6167	}
6168	return ret, nil
6169	// {
6170	//   "description": "Retrieves default object ACL entries on the specified bucket.",
6171	//   "httpMethod": "GET",
6172	//   "id": "storage.defaultObjectAccessControls.list",
6173	//   "parameterOrder": [
6174	//     "bucket"
6175	//   ],
6176	//   "parameters": {
6177	//     "bucket": {
6178	//       "description": "Name of a bucket.",
6179	//       "location": "path",
6180	//       "required": true,
6181	//       "type": "string"
6182	//     },
6183	//     "ifMetagenerationMatch": {
6184	//       "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
6185	//       "format": "int64",
6186	//       "location": "query",
6187	//       "type": "string"
6188	//     },
6189	//     "ifMetagenerationNotMatch": {
6190	//       "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
6191	//       "format": "int64",
6192	//       "location": "query",
6193	//       "type": "string"
6194	//     },
6195	//     "provisionalUserProject": {
6196	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6197	//       "location": "query",
6198	//       "type": "string"
6199	//     },
6200	//     "userProject": {
6201	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6202	//       "location": "query",
6203	//       "type": "string"
6204	//     }
6205	//   },
6206	//   "path": "b/{bucket}/defaultObjectAcl",
6207	//   "response": {
6208	//     "$ref": "ObjectAccessControls"
6209	//   },
6210	//   "scopes": [
6211	//     "https://www.googleapis.com/auth/cloud-platform",
6212	//     "https://www.googleapis.com/auth/devstorage.full_control"
6213	//   ]
6214	// }
6215
6216}
6217
6218// method id "storage.defaultObjectAccessControls.patch":
6219
6220type DefaultObjectAccessControlsPatchCall struct {
6221	s                   *Service
6222	bucket              string
6223	entity              string
6224	objectaccesscontrol *ObjectAccessControl
6225	urlParams_          gensupport.URLParams
6226	ctx_                context.Context
6227	header_             http.Header
6228}
6229
6230// Patch: Patches a default object ACL entry on the specified bucket.
6231func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
6232	c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6233	c.bucket = bucket
6234	c.entity = entity
6235	c.objectaccesscontrol = objectaccesscontrol
6236	return c
6237}
6238
6239// ProvisionalUserProject sets the optional parameter
6240// "provisionalUserProject": The project to be billed for this request
6241// if the target bucket is requester-pays bucket.
6242func (c *DefaultObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsPatchCall {
6243	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6244	return c
6245}
6246
6247// UserProject sets the optional parameter "userProject": The project to
6248// be billed for this request. Required for Requester Pays buckets.
6249func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
6250	c.urlParams_.Set("userProject", userProject)
6251	return c
6252}
6253
6254// Fields allows partial responses to be retrieved. See
6255// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6256// for more information.
6257func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
6258	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6259	return c
6260}
6261
6262// Context sets the context to be used in this call's Do method. Any
6263// pending HTTP request will be aborted if the provided context is
6264// canceled.
6265func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
6266	c.ctx_ = ctx
6267	return c
6268}
6269
6270// Header returns an http.Header that can be modified by the caller to
6271// add HTTP headers to the request.
6272func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
6273	if c.header_ == nil {
6274		c.header_ = make(http.Header)
6275	}
6276	return c.header_
6277}
6278
6279func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
6280	reqHeaders := make(http.Header)
6281	for k, v := range c.header_ {
6282		reqHeaders[k] = v
6283	}
6284	reqHeaders.Set("User-Agent", c.s.userAgent())
6285	var body io.Reader = nil
6286	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6287	if err != nil {
6288		return nil, err
6289	}
6290	reqHeaders.Set("Content-Type", "application/json")
6291	c.urlParams_.Set("alt", alt)
6292	c.urlParams_.Set("prettyPrint", "false")
6293	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
6294	urls += "?" + c.urlParams_.Encode()
6295	req, err := http.NewRequest("PATCH", urls, body)
6296	if err != nil {
6297		return nil, err
6298	}
6299	req.Header = reqHeaders
6300	googleapi.Expand(req.URL, map[string]string{
6301		"bucket": c.bucket,
6302		"entity": c.entity,
6303	})
6304	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6305}
6306
6307// Do executes the "storage.defaultObjectAccessControls.patch" call.
6308// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6309// non-2xx status code is an error. Response headers are in either
6310// *ObjectAccessControl.ServerResponse.Header or (if a response was
6311// returned at all) in error.(*googleapi.Error).Header. Use
6312// googleapi.IsNotModified to check whether the returned error was
6313// because http.StatusNotModified was returned.
6314func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6315	gensupport.SetOptions(c.urlParams_, opts...)
6316	res, err := c.doRequest("json")
6317	if res != nil && res.StatusCode == http.StatusNotModified {
6318		if res.Body != nil {
6319			res.Body.Close()
6320		}
6321		return nil, &googleapi.Error{
6322			Code:   res.StatusCode,
6323			Header: res.Header,
6324		}
6325	}
6326	if err != nil {
6327		return nil, err
6328	}
6329	defer googleapi.CloseBody(res)
6330	if err := googleapi.CheckResponse(res); err != nil {
6331		return nil, err
6332	}
6333	ret := &ObjectAccessControl{
6334		ServerResponse: googleapi.ServerResponse{
6335			Header:         res.Header,
6336			HTTPStatusCode: res.StatusCode,
6337		},
6338	}
6339	target := &ret
6340	if err := gensupport.DecodeResponse(target, res); err != nil {
6341		return nil, err
6342	}
6343	return ret, nil
6344	// {
6345	//   "description": "Patches a default object ACL entry on the specified bucket.",
6346	//   "httpMethod": "PATCH",
6347	//   "id": "storage.defaultObjectAccessControls.patch",
6348	//   "parameterOrder": [
6349	//     "bucket",
6350	//     "entity"
6351	//   ],
6352	//   "parameters": {
6353	//     "bucket": {
6354	//       "description": "Name of a bucket.",
6355	//       "location": "path",
6356	//       "required": true,
6357	//       "type": "string"
6358	//     },
6359	//     "entity": {
6360	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6361	//       "location": "path",
6362	//       "required": true,
6363	//       "type": "string"
6364	//     },
6365	//     "provisionalUserProject": {
6366	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6367	//       "location": "query",
6368	//       "type": "string"
6369	//     },
6370	//     "userProject": {
6371	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6372	//       "location": "query",
6373	//       "type": "string"
6374	//     }
6375	//   },
6376	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
6377	//   "request": {
6378	//     "$ref": "ObjectAccessControl"
6379	//   },
6380	//   "response": {
6381	//     "$ref": "ObjectAccessControl"
6382	//   },
6383	//   "scopes": [
6384	//     "https://www.googleapis.com/auth/cloud-platform",
6385	//     "https://www.googleapis.com/auth/devstorage.full_control"
6386	//   ]
6387	// }
6388
6389}
6390
6391// method id "storage.defaultObjectAccessControls.update":
6392
6393type DefaultObjectAccessControlsUpdateCall struct {
6394	s                   *Service
6395	bucket              string
6396	entity              string
6397	objectaccesscontrol *ObjectAccessControl
6398	urlParams_          gensupport.URLParams
6399	ctx_                context.Context
6400	header_             http.Header
6401}
6402
6403// Update: Updates a default object ACL entry on the specified bucket.
6404func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
6405	c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6406	c.bucket = bucket
6407	c.entity = entity
6408	c.objectaccesscontrol = objectaccesscontrol
6409	return c
6410}
6411
6412// ProvisionalUserProject sets the optional parameter
6413// "provisionalUserProject": The project to be billed for this request
6414// if the target bucket is requester-pays bucket.
6415func (c *DefaultObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *DefaultObjectAccessControlsUpdateCall {
6416	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6417	return c
6418}
6419
6420// UserProject sets the optional parameter "userProject": The project to
6421// be billed for this request. Required for Requester Pays buckets.
6422func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
6423	c.urlParams_.Set("userProject", userProject)
6424	return c
6425}
6426
6427// Fields allows partial responses to be retrieved. See
6428// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6429// for more information.
6430func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
6431	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6432	return c
6433}
6434
6435// Context sets the context to be used in this call's Do method. Any
6436// pending HTTP request will be aborted if the provided context is
6437// canceled.
6438func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
6439	c.ctx_ = ctx
6440	return c
6441}
6442
6443// Header returns an http.Header that can be modified by the caller to
6444// add HTTP headers to the request.
6445func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
6446	if c.header_ == nil {
6447		c.header_ = make(http.Header)
6448	}
6449	return c.header_
6450}
6451
6452func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
6453	reqHeaders := make(http.Header)
6454	for k, v := range c.header_ {
6455		reqHeaders[k] = v
6456	}
6457	reqHeaders.Set("User-Agent", c.s.userAgent())
6458	var body io.Reader = nil
6459	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
6460	if err != nil {
6461		return nil, err
6462	}
6463	reqHeaders.Set("Content-Type", "application/json")
6464	c.urlParams_.Set("alt", alt)
6465	c.urlParams_.Set("prettyPrint", "false")
6466	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
6467	urls += "?" + c.urlParams_.Encode()
6468	req, err := http.NewRequest("PUT", urls, body)
6469	if err != nil {
6470		return nil, err
6471	}
6472	req.Header = reqHeaders
6473	googleapi.Expand(req.URL, map[string]string{
6474		"bucket": c.bucket,
6475		"entity": c.entity,
6476	})
6477	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6478}
6479
6480// Do executes the "storage.defaultObjectAccessControls.update" call.
6481// Exactly one of *ObjectAccessControl or error will be non-nil. Any
6482// non-2xx status code is an error. Response headers are in either
6483// *ObjectAccessControl.ServerResponse.Header or (if a response was
6484// returned at all) in error.(*googleapi.Error).Header. Use
6485// googleapi.IsNotModified to check whether the returned error was
6486// because http.StatusNotModified was returned.
6487func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6488	gensupport.SetOptions(c.urlParams_, opts...)
6489	res, err := c.doRequest("json")
6490	if res != nil && res.StatusCode == http.StatusNotModified {
6491		if res.Body != nil {
6492			res.Body.Close()
6493		}
6494		return nil, &googleapi.Error{
6495			Code:   res.StatusCode,
6496			Header: res.Header,
6497		}
6498	}
6499	if err != nil {
6500		return nil, err
6501	}
6502	defer googleapi.CloseBody(res)
6503	if err := googleapi.CheckResponse(res); err != nil {
6504		return nil, err
6505	}
6506	ret := &ObjectAccessControl{
6507		ServerResponse: googleapi.ServerResponse{
6508			Header:         res.Header,
6509			HTTPStatusCode: res.StatusCode,
6510		},
6511	}
6512	target := &ret
6513	if err := gensupport.DecodeResponse(target, res); err != nil {
6514		return nil, err
6515	}
6516	return ret, nil
6517	// {
6518	//   "description": "Updates a default object ACL entry on the specified bucket.",
6519	//   "httpMethod": "PUT",
6520	//   "id": "storage.defaultObjectAccessControls.update",
6521	//   "parameterOrder": [
6522	//     "bucket",
6523	//     "entity"
6524	//   ],
6525	//   "parameters": {
6526	//     "bucket": {
6527	//       "description": "Name of a bucket.",
6528	//       "location": "path",
6529	//       "required": true,
6530	//       "type": "string"
6531	//     },
6532	//     "entity": {
6533	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6534	//       "location": "path",
6535	//       "required": true,
6536	//       "type": "string"
6537	//     },
6538	//     "provisionalUserProject": {
6539	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6540	//       "location": "query",
6541	//       "type": "string"
6542	//     },
6543	//     "userProject": {
6544	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6545	//       "location": "query",
6546	//       "type": "string"
6547	//     }
6548	//   },
6549	//   "path": "b/{bucket}/defaultObjectAcl/{entity}",
6550	//   "request": {
6551	//     "$ref": "ObjectAccessControl"
6552	//   },
6553	//   "response": {
6554	//     "$ref": "ObjectAccessControl"
6555	//   },
6556	//   "scopes": [
6557	//     "https://www.googleapis.com/auth/cloud-platform",
6558	//     "https://www.googleapis.com/auth/devstorage.full_control"
6559	//   ]
6560	// }
6561
6562}
6563
6564// method id "storage.notifications.delete":
6565
6566type NotificationsDeleteCall struct {
6567	s            *Service
6568	bucket       string
6569	notification string
6570	urlParams_   gensupport.URLParams
6571	ctx_         context.Context
6572	header_      http.Header
6573}
6574
6575// Delete: Permanently deletes a notification subscription.
6576func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
6577	c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6578	c.bucket = bucket
6579	c.notification = notification
6580	return c
6581}
6582
6583// ProvisionalUserProject sets the optional parameter
6584// "provisionalUserProject": The project to be billed for this request
6585// if the target bucket is requester-pays bucket.
6586func (c *NotificationsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsDeleteCall {
6587	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6588	return c
6589}
6590
6591// UserProject sets the optional parameter "userProject": The project to
6592// be billed for this request. Required for Requester Pays buckets.
6593func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
6594	c.urlParams_.Set("userProject", userProject)
6595	return c
6596}
6597
6598// Fields allows partial responses to be retrieved. See
6599// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6600// for more information.
6601func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
6602	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6603	return c
6604}
6605
6606// Context sets the context to be used in this call's Do method. Any
6607// pending HTTP request will be aborted if the provided context is
6608// canceled.
6609func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
6610	c.ctx_ = ctx
6611	return c
6612}
6613
6614// Header returns an http.Header that can be modified by the caller to
6615// add HTTP headers to the request.
6616func (c *NotificationsDeleteCall) Header() http.Header {
6617	if c.header_ == nil {
6618		c.header_ = make(http.Header)
6619	}
6620	return c.header_
6621}
6622
6623func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
6624	reqHeaders := make(http.Header)
6625	for k, v := range c.header_ {
6626		reqHeaders[k] = v
6627	}
6628	reqHeaders.Set("User-Agent", c.s.userAgent())
6629	var body io.Reader = nil
6630	c.urlParams_.Set("alt", alt)
6631	c.urlParams_.Set("prettyPrint", "false")
6632	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6633	urls += "?" + c.urlParams_.Encode()
6634	req, err := http.NewRequest("DELETE", urls, body)
6635	if err != nil {
6636		return nil, err
6637	}
6638	req.Header = reqHeaders
6639	googleapi.Expand(req.URL, map[string]string{
6640		"bucket":       c.bucket,
6641		"notification": c.notification,
6642	})
6643	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6644}
6645
6646// Do executes the "storage.notifications.delete" call.
6647func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
6648	gensupport.SetOptions(c.urlParams_, opts...)
6649	res, err := c.doRequest("json")
6650	if err != nil {
6651		return err
6652	}
6653	defer googleapi.CloseBody(res)
6654	if err := googleapi.CheckResponse(res); err != nil {
6655		return err
6656	}
6657	return nil
6658	// {
6659	//   "description": "Permanently deletes a notification subscription.",
6660	//   "httpMethod": "DELETE",
6661	//   "id": "storage.notifications.delete",
6662	//   "parameterOrder": [
6663	//     "bucket",
6664	//     "notification"
6665	//   ],
6666	//   "parameters": {
6667	//     "bucket": {
6668	//       "description": "The parent bucket of the notification.",
6669	//       "location": "path",
6670	//       "required": true,
6671	//       "type": "string"
6672	//     },
6673	//     "notification": {
6674	//       "description": "ID of the notification to delete.",
6675	//       "location": "path",
6676	//       "required": true,
6677	//       "type": "string"
6678	//     },
6679	//     "provisionalUserProject": {
6680	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6681	//       "location": "query",
6682	//       "type": "string"
6683	//     },
6684	//     "userProject": {
6685	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6686	//       "location": "query",
6687	//       "type": "string"
6688	//     }
6689	//   },
6690	//   "path": "b/{bucket}/notificationConfigs/{notification}",
6691	//   "scopes": [
6692	//     "https://www.googleapis.com/auth/cloud-platform",
6693	//     "https://www.googleapis.com/auth/devstorage.full_control",
6694	//     "https://www.googleapis.com/auth/devstorage.read_write"
6695	//   ]
6696	// }
6697
6698}
6699
6700// method id "storage.notifications.get":
6701
6702type NotificationsGetCall struct {
6703	s            *Service
6704	bucket       string
6705	notification string
6706	urlParams_   gensupport.URLParams
6707	ifNoneMatch_ string
6708	ctx_         context.Context
6709	header_      http.Header
6710}
6711
6712// Get: View a notification configuration.
6713func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
6714	c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6715	c.bucket = bucket
6716	c.notification = notification
6717	return c
6718}
6719
6720// ProvisionalUserProject sets the optional parameter
6721// "provisionalUserProject": The project to be billed for this request
6722// if the target bucket is requester-pays bucket.
6723func (c *NotificationsGetCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsGetCall {
6724	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6725	return c
6726}
6727
6728// UserProject sets the optional parameter "userProject": The project to
6729// be billed for this request. Required for Requester Pays buckets.
6730func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
6731	c.urlParams_.Set("userProject", userProject)
6732	return c
6733}
6734
6735// Fields allows partial responses to be retrieved. See
6736// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6737// for more information.
6738func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
6739	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6740	return c
6741}
6742
6743// IfNoneMatch sets the optional parameter which makes the operation
6744// fail if the object's ETag matches the given value. This is useful for
6745// getting updates only after the object has changed since the last
6746// request. Use googleapi.IsNotModified to check whether the response
6747// error from Do is the result of In-None-Match.
6748func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
6749	c.ifNoneMatch_ = entityTag
6750	return c
6751}
6752
6753// Context sets the context to be used in this call's Do method. Any
6754// pending HTTP request will be aborted if the provided context is
6755// canceled.
6756func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
6757	c.ctx_ = ctx
6758	return c
6759}
6760
6761// Header returns an http.Header that can be modified by the caller to
6762// add HTTP headers to the request.
6763func (c *NotificationsGetCall) Header() http.Header {
6764	if c.header_ == nil {
6765		c.header_ = make(http.Header)
6766	}
6767	return c.header_
6768}
6769
6770func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
6771	reqHeaders := make(http.Header)
6772	for k, v := range c.header_ {
6773		reqHeaders[k] = v
6774	}
6775	reqHeaders.Set("User-Agent", c.s.userAgent())
6776	if c.ifNoneMatch_ != "" {
6777		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6778	}
6779	var body io.Reader = nil
6780	c.urlParams_.Set("alt", alt)
6781	c.urlParams_.Set("prettyPrint", "false")
6782	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6783	urls += "?" + c.urlParams_.Encode()
6784	req, err := http.NewRequest("GET", urls, body)
6785	if err != nil {
6786		return nil, err
6787	}
6788	req.Header = reqHeaders
6789	googleapi.Expand(req.URL, map[string]string{
6790		"bucket":       c.bucket,
6791		"notification": c.notification,
6792	})
6793	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6794}
6795
6796// Do executes the "storage.notifications.get" call.
6797// Exactly one of *Notification or error will be non-nil. Any non-2xx
6798// status code is an error. Response headers are in either
6799// *Notification.ServerResponse.Header or (if a response was returned at
6800// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6801// to check whether the returned error was because
6802// http.StatusNotModified was returned.
6803func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
6804	gensupport.SetOptions(c.urlParams_, opts...)
6805	res, err := c.doRequest("json")
6806	if res != nil && res.StatusCode == http.StatusNotModified {
6807		if res.Body != nil {
6808			res.Body.Close()
6809		}
6810		return nil, &googleapi.Error{
6811			Code:   res.StatusCode,
6812			Header: res.Header,
6813		}
6814	}
6815	if err != nil {
6816		return nil, err
6817	}
6818	defer googleapi.CloseBody(res)
6819	if err := googleapi.CheckResponse(res); err != nil {
6820		return nil, err
6821	}
6822	ret := &Notification{
6823		ServerResponse: googleapi.ServerResponse{
6824			Header:         res.Header,
6825			HTTPStatusCode: res.StatusCode,
6826		},
6827	}
6828	target := &ret
6829	if err := gensupport.DecodeResponse(target, res); err != nil {
6830		return nil, err
6831	}
6832	return ret, nil
6833	// {
6834	//   "description": "View a notification configuration.",
6835	//   "httpMethod": "GET",
6836	//   "id": "storage.notifications.get",
6837	//   "parameterOrder": [
6838	//     "bucket",
6839	//     "notification"
6840	//   ],
6841	//   "parameters": {
6842	//     "bucket": {
6843	//       "description": "The parent bucket of the notification.",
6844	//       "location": "path",
6845	//       "required": true,
6846	//       "type": "string"
6847	//     },
6848	//     "notification": {
6849	//       "description": "Notification ID",
6850	//       "location": "path",
6851	//       "required": true,
6852	//       "type": "string"
6853	//     },
6854	//     "provisionalUserProject": {
6855	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
6856	//       "location": "query",
6857	//       "type": "string"
6858	//     },
6859	//     "userProject": {
6860	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6861	//       "location": "query",
6862	//       "type": "string"
6863	//     }
6864	//   },
6865	//   "path": "b/{bucket}/notificationConfigs/{notification}",
6866	//   "response": {
6867	//     "$ref": "Notification"
6868	//   },
6869	//   "scopes": [
6870	//     "https://www.googleapis.com/auth/cloud-platform",
6871	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6872	//     "https://www.googleapis.com/auth/devstorage.full_control",
6873	//     "https://www.googleapis.com/auth/devstorage.read_only",
6874	//     "https://www.googleapis.com/auth/devstorage.read_write"
6875	//   ]
6876	// }
6877
6878}
6879
6880// method id "storage.notifications.insert":
6881
6882type NotificationsInsertCall struct {
6883	s            *Service
6884	bucket       string
6885	notification *Notification
6886	urlParams_   gensupport.URLParams
6887	ctx_         context.Context
6888	header_      http.Header
6889}
6890
6891// Insert: Creates a notification subscription for a given bucket.
6892func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
6893	c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6894	c.bucket = bucket
6895	c.notification = notification
6896	return c
6897}
6898
6899// ProvisionalUserProject sets the optional parameter
6900// "provisionalUserProject": The project to be billed for this request
6901// if the target bucket is requester-pays bucket.
6902func (c *NotificationsInsertCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsInsertCall {
6903	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
6904	return c
6905}
6906
6907// UserProject sets the optional parameter "userProject": The project to
6908// be billed for this request. Required for Requester Pays buckets.
6909func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
6910	c.urlParams_.Set("userProject", userProject)
6911	return c
6912}
6913
6914// Fields allows partial responses to be retrieved. See
6915// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6916// for more information.
6917func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
6918	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6919	return c
6920}
6921
6922// Context sets the context to be used in this call's Do method. Any
6923// pending HTTP request will be aborted if the provided context is
6924// canceled.
6925func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
6926	c.ctx_ = ctx
6927	return c
6928}
6929
6930// Header returns an http.Header that can be modified by the caller to
6931// add HTTP headers to the request.
6932func (c *NotificationsInsertCall) Header() http.Header {
6933	if c.header_ == nil {
6934		c.header_ = make(http.Header)
6935	}
6936	return c.header_
6937}
6938
6939func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
6940	reqHeaders := make(http.Header)
6941	for k, v := range c.header_ {
6942		reqHeaders[k] = v
6943	}
6944	reqHeaders.Set("User-Agent", c.s.userAgent())
6945	var body io.Reader = nil
6946	body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
6947	if err != nil {
6948		return nil, err
6949	}
6950	reqHeaders.Set("Content-Type", "application/json")
6951	c.urlParams_.Set("alt", alt)
6952	c.urlParams_.Set("prettyPrint", "false")
6953	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
6954	urls += "?" + c.urlParams_.Encode()
6955	req, err := http.NewRequest("POST", urls, body)
6956	if err != nil {
6957		return nil, err
6958	}
6959	req.Header = reqHeaders
6960	googleapi.Expand(req.URL, map[string]string{
6961		"bucket": c.bucket,
6962	})
6963	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6964}
6965
6966// Do executes the "storage.notifications.insert" call.
6967// Exactly one of *Notification or error will be non-nil. Any non-2xx
6968// status code is an error. Response headers are in either
6969// *Notification.ServerResponse.Header or (if a response was returned at
6970// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6971// to check whether the returned error was because
6972// http.StatusNotModified was returned.
6973func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
6974	gensupport.SetOptions(c.urlParams_, opts...)
6975	res, err := c.doRequest("json")
6976	if res != nil && res.StatusCode == http.StatusNotModified {
6977		if res.Body != nil {
6978			res.Body.Close()
6979		}
6980		return nil, &googleapi.Error{
6981			Code:   res.StatusCode,
6982			Header: res.Header,
6983		}
6984	}
6985	if err != nil {
6986		return nil, err
6987	}
6988	defer googleapi.CloseBody(res)
6989	if err := googleapi.CheckResponse(res); err != nil {
6990		return nil, err
6991	}
6992	ret := &Notification{
6993		ServerResponse: googleapi.ServerResponse{
6994			Header:         res.Header,
6995			HTTPStatusCode: res.StatusCode,
6996		},
6997	}
6998	target := &ret
6999	if err := gensupport.DecodeResponse(target, res); err != nil {
7000		return nil, err
7001	}
7002	return ret, nil
7003	// {
7004	//   "description": "Creates a notification subscription for a given bucket.",
7005	//   "httpMethod": "POST",
7006	//   "id": "storage.notifications.insert",
7007	//   "parameterOrder": [
7008	//     "bucket"
7009	//   ],
7010	//   "parameters": {
7011	//     "bucket": {
7012	//       "description": "The parent bucket of the notification.",
7013	//       "location": "path",
7014	//       "required": true,
7015	//       "type": "string"
7016	//     },
7017	//     "provisionalUserProject": {
7018	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7019	//       "location": "query",
7020	//       "type": "string"
7021	//     },
7022	//     "userProject": {
7023	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7024	//       "location": "query",
7025	//       "type": "string"
7026	//     }
7027	//   },
7028	//   "path": "b/{bucket}/notificationConfigs",
7029	//   "request": {
7030	//     "$ref": "Notification"
7031	//   },
7032	//   "response": {
7033	//     "$ref": "Notification"
7034	//   },
7035	//   "scopes": [
7036	//     "https://www.googleapis.com/auth/cloud-platform",
7037	//     "https://www.googleapis.com/auth/devstorage.full_control",
7038	//     "https://www.googleapis.com/auth/devstorage.read_write"
7039	//   ]
7040	// }
7041
7042}
7043
7044// method id "storage.notifications.list":
7045
7046type NotificationsListCall struct {
7047	s            *Service
7048	bucket       string
7049	urlParams_   gensupport.URLParams
7050	ifNoneMatch_ string
7051	ctx_         context.Context
7052	header_      http.Header
7053}
7054
7055// List: Retrieves a list of notification subscriptions for a given
7056// bucket.
7057func (r *NotificationsService) List(bucket string) *NotificationsListCall {
7058	c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7059	c.bucket = bucket
7060	return c
7061}
7062
7063// ProvisionalUserProject sets the optional parameter
7064// "provisionalUserProject": The project to be billed for this request
7065// if the target bucket is requester-pays bucket.
7066func (c *NotificationsListCall) ProvisionalUserProject(provisionalUserProject string) *NotificationsListCall {
7067	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7068	return c
7069}
7070
7071// UserProject sets the optional parameter "userProject": The project to
7072// be billed for this request. Required for Requester Pays buckets.
7073func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
7074	c.urlParams_.Set("userProject", userProject)
7075	return c
7076}
7077
7078// Fields allows partial responses to be retrieved. See
7079// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7080// for more information.
7081func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
7082	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7083	return c
7084}
7085
7086// IfNoneMatch sets the optional parameter which makes the operation
7087// fail if the object's ETag matches the given value. This is useful for
7088// getting updates only after the object has changed since the last
7089// request. Use googleapi.IsNotModified to check whether the response
7090// error from Do is the result of In-None-Match.
7091func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
7092	c.ifNoneMatch_ = entityTag
7093	return c
7094}
7095
7096// Context sets the context to be used in this call's Do method. Any
7097// pending HTTP request will be aborted if the provided context is
7098// canceled.
7099func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
7100	c.ctx_ = ctx
7101	return c
7102}
7103
7104// Header returns an http.Header that can be modified by the caller to
7105// add HTTP headers to the request.
7106func (c *NotificationsListCall) Header() http.Header {
7107	if c.header_ == nil {
7108		c.header_ = make(http.Header)
7109	}
7110	return c.header_
7111}
7112
7113func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
7114	reqHeaders := make(http.Header)
7115	for k, v := range c.header_ {
7116		reqHeaders[k] = v
7117	}
7118	reqHeaders.Set("User-Agent", c.s.userAgent())
7119	if c.ifNoneMatch_ != "" {
7120		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7121	}
7122	var body io.Reader = nil
7123	c.urlParams_.Set("alt", alt)
7124	c.urlParams_.Set("prettyPrint", "false")
7125	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
7126	urls += "?" + c.urlParams_.Encode()
7127	req, err := http.NewRequest("GET", urls, body)
7128	if err != nil {
7129		return nil, err
7130	}
7131	req.Header = reqHeaders
7132	googleapi.Expand(req.URL, map[string]string{
7133		"bucket": c.bucket,
7134	})
7135	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7136}
7137
7138// Do executes the "storage.notifications.list" call.
7139// Exactly one of *Notifications or error will be non-nil. Any non-2xx
7140// status code is an error. Response headers are in either
7141// *Notifications.ServerResponse.Header or (if a response was returned
7142// at all) in error.(*googleapi.Error).Header. Use
7143// googleapi.IsNotModified to check whether the returned error was
7144// because http.StatusNotModified was returned.
7145func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
7146	gensupport.SetOptions(c.urlParams_, opts...)
7147	res, err := c.doRequest("json")
7148	if res != nil && res.StatusCode == http.StatusNotModified {
7149		if res.Body != nil {
7150			res.Body.Close()
7151		}
7152		return nil, &googleapi.Error{
7153			Code:   res.StatusCode,
7154			Header: res.Header,
7155		}
7156	}
7157	if err != nil {
7158		return nil, err
7159	}
7160	defer googleapi.CloseBody(res)
7161	if err := googleapi.CheckResponse(res); err != nil {
7162		return nil, err
7163	}
7164	ret := &Notifications{
7165		ServerResponse: googleapi.ServerResponse{
7166			Header:         res.Header,
7167			HTTPStatusCode: res.StatusCode,
7168		},
7169	}
7170	target := &ret
7171	if err := gensupport.DecodeResponse(target, res); err != nil {
7172		return nil, err
7173	}
7174	return ret, nil
7175	// {
7176	//   "description": "Retrieves a list of notification subscriptions for a given bucket.",
7177	//   "httpMethod": "GET",
7178	//   "id": "storage.notifications.list",
7179	//   "parameterOrder": [
7180	//     "bucket"
7181	//   ],
7182	//   "parameters": {
7183	//     "bucket": {
7184	//       "description": "Name of a Google Cloud Storage bucket.",
7185	//       "location": "path",
7186	//       "required": true,
7187	//       "type": "string"
7188	//     },
7189	//     "provisionalUserProject": {
7190	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7191	//       "location": "query",
7192	//       "type": "string"
7193	//     },
7194	//     "userProject": {
7195	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7196	//       "location": "query",
7197	//       "type": "string"
7198	//     }
7199	//   },
7200	//   "path": "b/{bucket}/notificationConfigs",
7201	//   "response": {
7202	//     "$ref": "Notifications"
7203	//   },
7204	//   "scopes": [
7205	//     "https://www.googleapis.com/auth/cloud-platform",
7206	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7207	//     "https://www.googleapis.com/auth/devstorage.full_control",
7208	//     "https://www.googleapis.com/auth/devstorage.read_only",
7209	//     "https://www.googleapis.com/auth/devstorage.read_write"
7210	//   ]
7211	// }
7212
7213}
7214
7215// method id "storage.objectAccessControls.delete":
7216
7217type ObjectAccessControlsDeleteCall struct {
7218	s          *Service
7219	bucket     string
7220	object     string
7221	entity     string
7222	urlParams_ gensupport.URLParams
7223	ctx_       context.Context
7224	header_    http.Header
7225}
7226
7227// Delete: Permanently deletes the ACL entry for the specified entity on
7228// the specified object.
7229func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
7230	c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7231	c.bucket = bucket
7232	c.object = object
7233	c.entity = entity
7234	return c
7235}
7236
7237// Generation sets the optional parameter "generation": If present,
7238// selects a specific revision of this object (as opposed to the latest
7239// version, the default).
7240func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall {
7241	c.urlParams_.Set("generation", fmt.Sprint(generation))
7242	return c
7243}
7244
7245// ProvisionalUserProject sets the optional parameter
7246// "provisionalUserProject": The project to be billed for this request
7247// if the target bucket is requester-pays bucket.
7248func (c *ObjectAccessControlsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsDeleteCall {
7249	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7250	return c
7251}
7252
7253// UserProject sets the optional parameter "userProject": The project to
7254// be billed for this request. Required for Requester Pays buckets.
7255func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
7256	c.urlParams_.Set("userProject", userProject)
7257	return c
7258}
7259
7260// Fields allows partial responses to be retrieved. See
7261// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7262// for more information.
7263func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
7264	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7265	return c
7266}
7267
7268// Context sets the context to be used in this call's Do method. Any
7269// pending HTTP request will be aborted if the provided context is
7270// canceled.
7271func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
7272	c.ctx_ = ctx
7273	return c
7274}
7275
7276// Header returns an http.Header that can be modified by the caller to
7277// add HTTP headers to the request.
7278func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
7279	if c.header_ == nil {
7280		c.header_ = make(http.Header)
7281	}
7282	return c.header_
7283}
7284
7285func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
7286	reqHeaders := make(http.Header)
7287	for k, v := range c.header_ {
7288		reqHeaders[k] = v
7289	}
7290	reqHeaders.Set("User-Agent", c.s.userAgent())
7291	var body io.Reader = nil
7292	c.urlParams_.Set("alt", alt)
7293	c.urlParams_.Set("prettyPrint", "false")
7294	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7295	urls += "?" + c.urlParams_.Encode()
7296	req, err := http.NewRequest("DELETE", urls, body)
7297	if err != nil {
7298		return nil, err
7299	}
7300	req.Header = reqHeaders
7301	googleapi.Expand(req.URL, map[string]string{
7302		"bucket": c.bucket,
7303		"object": c.object,
7304		"entity": c.entity,
7305	})
7306	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7307}
7308
7309// Do executes the "storage.objectAccessControls.delete" call.
7310func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
7311	gensupport.SetOptions(c.urlParams_, opts...)
7312	res, err := c.doRequest("json")
7313	if err != nil {
7314		return err
7315	}
7316	defer googleapi.CloseBody(res)
7317	if err := googleapi.CheckResponse(res); err != nil {
7318		return err
7319	}
7320	return nil
7321	// {
7322	//   "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
7323	//   "httpMethod": "DELETE",
7324	//   "id": "storage.objectAccessControls.delete",
7325	//   "parameterOrder": [
7326	//     "bucket",
7327	//     "object",
7328	//     "entity"
7329	//   ],
7330	//   "parameters": {
7331	//     "bucket": {
7332	//       "description": "Name of a bucket.",
7333	//       "location": "path",
7334	//       "required": true,
7335	//       "type": "string"
7336	//     },
7337	//     "entity": {
7338	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7339	//       "location": "path",
7340	//       "required": true,
7341	//       "type": "string"
7342	//     },
7343	//     "generation": {
7344	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7345	//       "format": "int64",
7346	//       "location": "query",
7347	//       "type": "string"
7348	//     },
7349	//     "object": {
7350	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7351	//       "location": "path",
7352	//       "required": true,
7353	//       "type": "string"
7354	//     },
7355	//     "provisionalUserProject": {
7356	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7357	//       "location": "query",
7358	//       "type": "string"
7359	//     },
7360	//     "userProject": {
7361	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7362	//       "location": "query",
7363	//       "type": "string"
7364	//     }
7365	//   },
7366	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
7367	//   "scopes": [
7368	//     "https://www.googleapis.com/auth/cloud-platform",
7369	//     "https://www.googleapis.com/auth/devstorage.full_control"
7370	//   ]
7371	// }
7372
7373}
7374
7375// method id "storage.objectAccessControls.get":
7376
7377type ObjectAccessControlsGetCall struct {
7378	s            *Service
7379	bucket       string
7380	object       string
7381	entity       string
7382	urlParams_   gensupport.URLParams
7383	ifNoneMatch_ string
7384	ctx_         context.Context
7385	header_      http.Header
7386}
7387
7388// Get: Returns the ACL entry for the specified entity on the specified
7389// object.
7390func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
7391	c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7392	c.bucket = bucket
7393	c.object = object
7394	c.entity = entity
7395	return c
7396}
7397
7398// Generation sets the optional parameter "generation": If present,
7399// selects a specific revision of this object (as opposed to the latest
7400// version, the default).
7401func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall {
7402	c.urlParams_.Set("generation", fmt.Sprint(generation))
7403	return c
7404}
7405
7406// ProvisionalUserProject sets the optional parameter
7407// "provisionalUserProject": The project to be billed for this request
7408// if the target bucket is requester-pays bucket.
7409func (c *ObjectAccessControlsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsGetCall {
7410	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7411	return c
7412}
7413
7414// UserProject sets the optional parameter "userProject": The project to
7415// be billed for this request. Required for Requester Pays buckets.
7416func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
7417	c.urlParams_.Set("userProject", userProject)
7418	return c
7419}
7420
7421// Fields allows partial responses to be retrieved. See
7422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7423// for more information.
7424func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
7425	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7426	return c
7427}
7428
7429// IfNoneMatch sets the optional parameter which makes the operation
7430// fail if the object's ETag matches the given value. This is useful for
7431// getting updates only after the object has changed since the last
7432// request. Use googleapi.IsNotModified to check whether the response
7433// error from Do is the result of In-None-Match.
7434func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
7435	c.ifNoneMatch_ = entityTag
7436	return c
7437}
7438
7439// Context sets the context to be used in this call's Do method. Any
7440// pending HTTP request will be aborted if the provided context is
7441// canceled.
7442func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
7443	c.ctx_ = ctx
7444	return c
7445}
7446
7447// Header returns an http.Header that can be modified by the caller to
7448// add HTTP headers to the request.
7449func (c *ObjectAccessControlsGetCall) Header() http.Header {
7450	if c.header_ == nil {
7451		c.header_ = make(http.Header)
7452	}
7453	return c.header_
7454}
7455
7456func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
7457	reqHeaders := make(http.Header)
7458	for k, v := range c.header_ {
7459		reqHeaders[k] = v
7460	}
7461	reqHeaders.Set("User-Agent", c.s.userAgent())
7462	if c.ifNoneMatch_ != "" {
7463		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7464	}
7465	var body io.Reader = nil
7466	c.urlParams_.Set("alt", alt)
7467	c.urlParams_.Set("prettyPrint", "false")
7468	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7469	urls += "?" + c.urlParams_.Encode()
7470	req, err := http.NewRequest("GET", urls, body)
7471	if err != nil {
7472		return nil, err
7473	}
7474	req.Header = reqHeaders
7475	googleapi.Expand(req.URL, map[string]string{
7476		"bucket": c.bucket,
7477		"object": c.object,
7478		"entity": c.entity,
7479	})
7480	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7481}
7482
7483// Do executes the "storage.objectAccessControls.get" call.
7484// Exactly one of *ObjectAccessControl or error will be non-nil. Any
7485// non-2xx status code is an error. Response headers are in either
7486// *ObjectAccessControl.ServerResponse.Header or (if a response was
7487// returned at all) in error.(*googleapi.Error).Header. Use
7488// googleapi.IsNotModified to check whether the returned error was
7489// because http.StatusNotModified was returned.
7490func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7491	gensupport.SetOptions(c.urlParams_, opts...)
7492	res, err := c.doRequest("json")
7493	if res != nil && res.StatusCode == http.StatusNotModified {
7494		if res.Body != nil {
7495			res.Body.Close()
7496		}
7497		return nil, &googleapi.Error{
7498			Code:   res.StatusCode,
7499			Header: res.Header,
7500		}
7501	}
7502	if err != nil {
7503		return nil, err
7504	}
7505	defer googleapi.CloseBody(res)
7506	if err := googleapi.CheckResponse(res); err != nil {
7507		return nil, err
7508	}
7509	ret := &ObjectAccessControl{
7510		ServerResponse: googleapi.ServerResponse{
7511			Header:         res.Header,
7512			HTTPStatusCode: res.StatusCode,
7513		},
7514	}
7515	target := &ret
7516	if err := gensupport.DecodeResponse(target, res); err != nil {
7517		return nil, err
7518	}
7519	return ret, nil
7520	// {
7521	//   "description": "Returns the ACL entry for the specified entity on the specified object.",
7522	//   "httpMethod": "GET",
7523	//   "id": "storage.objectAccessControls.get",
7524	//   "parameterOrder": [
7525	//     "bucket",
7526	//     "object",
7527	//     "entity"
7528	//   ],
7529	//   "parameters": {
7530	//     "bucket": {
7531	//       "description": "Name of a bucket.",
7532	//       "location": "path",
7533	//       "required": true,
7534	//       "type": "string"
7535	//     },
7536	//     "entity": {
7537	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7538	//       "location": "path",
7539	//       "required": true,
7540	//       "type": "string"
7541	//     },
7542	//     "generation": {
7543	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7544	//       "format": "int64",
7545	//       "location": "query",
7546	//       "type": "string"
7547	//     },
7548	//     "object": {
7549	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7550	//       "location": "path",
7551	//       "required": true,
7552	//       "type": "string"
7553	//     },
7554	//     "provisionalUserProject": {
7555	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7556	//       "location": "query",
7557	//       "type": "string"
7558	//     },
7559	//     "userProject": {
7560	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7561	//       "location": "query",
7562	//       "type": "string"
7563	//     }
7564	//   },
7565	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
7566	//   "response": {
7567	//     "$ref": "ObjectAccessControl"
7568	//   },
7569	//   "scopes": [
7570	//     "https://www.googleapis.com/auth/cloud-platform",
7571	//     "https://www.googleapis.com/auth/devstorage.full_control"
7572	//   ]
7573	// }
7574
7575}
7576
7577// method id "storage.objectAccessControls.insert":
7578
7579type ObjectAccessControlsInsertCall struct {
7580	s                   *Service
7581	bucket              string
7582	object              string
7583	objectaccesscontrol *ObjectAccessControl
7584	urlParams_          gensupport.URLParams
7585	ctx_                context.Context
7586	header_             http.Header
7587}
7588
7589// Insert: Creates a new ACL entry on the specified object.
7590func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
7591	c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7592	c.bucket = bucket
7593	c.object = object
7594	c.objectaccesscontrol = objectaccesscontrol
7595	return c
7596}
7597
7598// Generation sets the optional parameter "generation": If present,
7599// selects a specific revision of this object (as opposed to the latest
7600// version, the default).
7601func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall {
7602	c.urlParams_.Set("generation", fmt.Sprint(generation))
7603	return c
7604}
7605
7606// ProvisionalUserProject sets the optional parameter
7607// "provisionalUserProject": The project to be billed for this request
7608// if the target bucket is requester-pays bucket.
7609func (c *ObjectAccessControlsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsInsertCall {
7610	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7611	return c
7612}
7613
7614// UserProject sets the optional parameter "userProject": The project to
7615// be billed for this request. Required for Requester Pays buckets.
7616func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
7617	c.urlParams_.Set("userProject", userProject)
7618	return c
7619}
7620
7621// Fields allows partial responses to be retrieved. See
7622// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7623// for more information.
7624func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
7625	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7626	return c
7627}
7628
7629// Context sets the context to be used in this call's Do method. Any
7630// pending HTTP request will be aborted if the provided context is
7631// canceled.
7632func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
7633	c.ctx_ = ctx
7634	return c
7635}
7636
7637// Header returns an http.Header that can be modified by the caller to
7638// add HTTP headers to the request.
7639func (c *ObjectAccessControlsInsertCall) Header() http.Header {
7640	if c.header_ == nil {
7641		c.header_ = make(http.Header)
7642	}
7643	return c.header_
7644}
7645
7646func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
7647	reqHeaders := make(http.Header)
7648	for k, v := range c.header_ {
7649		reqHeaders[k] = v
7650	}
7651	reqHeaders.Set("User-Agent", c.s.userAgent())
7652	var body io.Reader = nil
7653	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
7654	if err != nil {
7655		return nil, err
7656	}
7657	reqHeaders.Set("Content-Type", "application/json")
7658	c.urlParams_.Set("alt", alt)
7659	c.urlParams_.Set("prettyPrint", "false")
7660	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7661	urls += "?" + c.urlParams_.Encode()
7662	req, err := http.NewRequest("POST", urls, body)
7663	if err != nil {
7664		return nil, err
7665	}
7666	req.Header = reqHeaders
7667	googleapi.Expand(req.URL, map[string]string{
7668		"bucket": c.bucket,
7669		"object": c.object,
7670	})
7671	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7672}
7673
7674// Do executes the "storage.objectAccessControls.insert" call.
7675// Exactly one of *ObjectAccessControl or error will be non-nil. Any
7676// non-2xx status code is an error. Response headers are in either
7677// *ObjectAccessControl.ServerResponse.Header or (if a response was
7678// returned at all) in error.(*googleapi.Error).Header. Use
7679// googleapi.IsNotModified to check whether the returned error was
7680// because http.StatusNotModified was returned.
7681func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7682	gensupport.SetOptions(c.urlParams_, opts...)
7683	res, err := c.doRequest("json")
7684	if res != nil && res.StatusCode == http.StatusNotModified {
7685		if res.Body != nil {
7686			res.Body.Close()
7687		}
7688		return nil, &googleapi.Error{
7689			Code:   res.StatusCode,
7690			Header: res.Header,
7691		}
7692	}
7693	if err != nil {
7694		return nil, err
7695	}
7696	defer googleapi.CloseBody(res)
7697	if err := googleapi.CheckResponse(res); err != nil {
7698		return nil, err
7699	}
7700	ret := &ObjectAccessControl{
7701		ServerResponse: googleapi.ServerResponse{
7702			Header:         res.Header,
7703			HTTPStatusCode: res.StatusCode,
7704		},
7705	}
7706	target := &ret
7707	if err := gensupport.DecodeResponse(target, res); err != nil {
7708		return nil, err
7709	}
7710	return ret, nil
7711	// {
7712	//   "description": "Creates a new ACL entry on the specified object.",
7713	//   "httpMethod": "POST",
7714	//   "id": "storage.objectAccessControls.insert",
7715	//   "parameterOrder": [
7716	//     "bucket",
7717	//     "object"
7718	//   ],
7719	//   "parameters": {
7720	//     "bucket": {
7721	//       "description": "Name of a bucket.",
7722	//       "location": "path",
7723	//       "required": true,
7724	//       "type": "string"
7725	//     },
7726	//     "generation": {
7727	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7728	//       "format": "int64",
7729	//       "location": "query",
7730	//       "type": "string"
7731	//     },
7732	//     "object": {
7733	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7734	//       "location": "path",
7735	//       "required": true,
7736	//       "type": "string"
7737	//     },
7738	//     "provisionalUserProject": {
7739	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7740	//       "location": "query",
7741	//       "type": "string"
7742	//     },
7743	//     "userProject": {
7744	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7745	//       "location": "query",
7746	//       "type": "string"
7747	//     }
7748	//   },
7749	//   "path": "b/{bucket}/o/{object}/acl",
7750	//   "request": {
7751	//     "$ref": "ObjectAccessControl"
7752	//   },
7753	//   "response": {
7754	//     "$ref": "ObjectAccessControl"
7755	//   },
7756	//   "scopes": [
7757	//     "https://www.googleapis.com/auth/cloud-platform",
7758	//     "https://www.googleapis.com/auth/devstorage.full_control"
7759	//   ]
7760	// }
7761
7762}
7763
7764// method id "storage.objectAccessControls.list":
7765
7766type ObjectAccessControlsListCall struct {
7767	s            *Service
7768	bucket       string
7769	object       string
7770	urlParams_   gensupport.URLParams
7771	ifNoneMatch_ string
7772	ctx_         context.Context
7773	header_      http.Header
7774}
7775
7776// List: Retrieves ACL entries on the specified object.
7777func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
7778	c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7779	c.bucket = bucket
7780	c.object = object
7781	return c
7782}
7783
7784// Generation sets the optional parameter "generation": If present,
7785// selects a specific revision of this object (as opposed to the latest
7786// version, the default).
7787func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall {
7788	c.urlParams_.Set("generation", fmt.Sprint(generation))
7789	return c
7790}
7791
7792// ProvisionalUserProject sets the optional parameter
7793// "provisionalUserProject": The project to be billed for this request
7794// if the target bucket is requester-pays bucket.
7795func (c *ObjectAccessControlsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsListCall {
7796	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7797	return c
7798}
7799
7800// UserProject sets the optional parameter "userProject": The project to
7801// be billed for this request. Required for Requester Pays buckets.
7802func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
7803	c.urlParams_.Set("userProject", userProject)
7804	return c
7805}
7806
7807// Fields allows partial responses to be retrieved. See
7808// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7809// for more information.
7810func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
7811	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7812	return c
7813}
7814
7815// IfNoneMatch sets the optional parameter which makes the operation
7816// fail if the object's ETag matches the given value. This is useful for
7817// getting updates only after the object has changed since the last
7818// request. Use googleapi.IsNotModified to check whether the response
7819// error from Do is the result of In-None-Match.
7820func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
7821	c.ifNoneMatch_ = entityTag
7822	return c
7823}
7824
7825// Context sets the context to be used in this call's Do method. Any
7826// pending HTTP request will be aborted if the provided context is
7827// canceled.
7828func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
7829	c.ctx_ = ctx
7830	return c
7831}
7832
7833// Header returns an http.Header that can be modified by the caller to
7834// add HTTP headers to the request.
7835func (c *ObjectAccessControlsListCall) Header() http.Header {
7836	if c.header_ == nil {
7837		c.header_ = make(http.Header)
7838	}
7839	return c.header_
7840}
7841
7842func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
7843	reqHeaders := make(http.Header)
7844	for k, v := range c.header_ {
7845		reqHeaders[k] = v
7846	}
7847	reqHeaders.Set("User-Agent", c.s.userAgent())
7848	if c.ifNoneMatch_ != "" {
7849		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7850	}
7851	var body io.Reader = nil
7852	c.urlParams_.Set("alt", alt)
7853	c.urlParams_.Set("prettyPrint", "false")
7854	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7855	urls += "?" + c.urlParams_.Encode()
7856	req, err := http.NewRequest("GET", urls, body)
7857	if err != nil {
7858		return nil, err
7859	}
7860	req.Header = reqHeaders
7861	googleapi.Expand(req.URL, map[string]string{
7862		"bucket": c.bucket,
7863		"object": c.object,
7864	})
7865	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7866}
7867
7868// Do executes the "storage.objectAccessControls.list" call.
7869// Exactly one of *ObjectAccessControls or error will be non-nil. Any
7870// non-2xx status code is an error. Response headers are in either
7871// *ObjectAccessControls.ServerResponse.Header or (if a response was
7872// returned at all) in error.(*googleapi.Error).Header. Use
7873// googleapi.IsNotModified to check whether the returned error was
7874// because http.StatusNotModified was returned.
7875func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
7876	gensupport.SetOptions(c.urlParams_, opts...)
7877	res, err := c.doRequest("json")
7878	if res != nil && res.StatusCode == http.StatusNotModified {
7879		if res.Body != nil {
7880			res.Body.Close()
7881		}
7882		return nil, &googleapi.Error{
7883			Code:   res.StatusCode,
7884			Header: res.Header,
7885		}
7886	}
7887	if err != nil {
7888		return nil, err
7889	}
7890	defer googleapi.CloseBody(res)
7891	if err := googleapi.CheckResponse(res); err != nil {
7892		return nil, err
7893	}
7894	ret := &ObjectAccessControls{
7895		ServerResponse: googleapi.ServerResponse{
7896			Header:         res.Header,
7897			HTTPStatusCode: res.StatusCode,
7898		},
7899	}
7900	target := &ret
7901	if err := gensupport.DecodeResponse(target, res); err != nil {
7902		return nil, err
7903	}
7904	return ret, nil
7905	// {
7906	//   "description": "Retrieves ACL entries on the specified object.",
7907	//   "httpMethod": "GET",
7908	//   "id": "storage.objectAccessControls.list",
7909	//   "parameterOrder": [
7910	//     "bucket",
7911	//     "object"
7912	//   ],
7913	//   "parameters": {
7914	//     "bucket": {
7915	//       "description": "Name of a bucket.",
7916	//       "location": "path",
7917	//       "required": true,
7918	//       "type": "string"
7919	//     },
7920	//     "generation": {
7921	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7922	//       "format": "int64",
7923	//       "location": "query",
7924	//       "type": "string"
7925	//     },
7926	//     "object": {
7927	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7928	//       "location": "path",
7929	//       "required": true,
7930	//       "type": "string"
7931	//     },
7932	//     "provisionalUserProject": {
7933	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
7934	//       "location": "query",
7935	//       "type": "string"
7936	//     },
7937	//     "userProject": {
7938	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7939	//       "location": "query",
7940	//       "type": "string"
7941	//     }
7942	//   },
7943	//   "path": "b/{bucket}/o/{object}/acl",
7944	//   "response": {
7945	//     "$ref": "ObjectAccessControls"
7946	//   },
7947	//   "scopes": [
7948	//     "https://www.googleapis.com/auth/cloud-platform",
7949	//     "https://www.googleapis.com/auth/devstorage.full_control"
7950	//   ]
7951	// }
7952
7953}
7954
7955// method id "storage.objectAccessControls.patch":
7956
7957type ObjectAccessControlsPatchCall struct {
7958	s                   *Service
7959	bucket              string
7960	object              string
7961	entity              string
7962	objectaccesscontrol *ObjectAccessControl
7963	urlParams_          gensupport.URLParams
7964	ctx_                context.Context
7965	header_             http.Header
7966}
7967
7968// Patch: Patches an ACL entry on the specified object.
7969func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
7970	c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7971	c.bucket = bucket
7972	c.object = object
7973	c.entity = entity
7974	c.objectaccesscontrol = objectaccesscontrol
7975	return c
7976}
7977
7978// Generation sets the optional parameter "generation": If present,
7979// selects a specific revision of this object (as opposed to the latest
7980// version, the default).
7981func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall {
7982	c.urlParams_.Set("generation", fmt.Sprint(generation))
7983	return c
7984}
7985
7986// ProvisionalUserProject sets the optional parameter
7987// "provisionalUserProject": The project to be billed for this request
7988// if the target bucket is requester-pays bucket.
7989func (c *ObjectAccessControlsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsPatchCall {
7990	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
7991	return c
7992}
7993
7994// UserProject sets the optional parameter "userProject": The project to
7995// be billed for this request. Required for Requester Pays buckets.
7996func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
7997	c.urlParams_.Set("userProject", userProject)
7998	return c
7999}
8000
8001// Fields allows partial responses to be retrieved. See
8002// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8003// for more information.
8004func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
8005	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8006	return c
8007}
8008
8009// Context sets the context to be used in this call's Do method. Any
8010// pending HTTP request will be aborted if the provided context is
8011// canceled.
8012func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
8013	c.ctx_ = ctx
8014	return c
8015}
8016
8017// Header returns an http.Header that can be modified by the caller to
8018// add HTTP headers to the request.
8019func (c *ObjectAccessControlsPatchCall) Header() http.Header {
8020	if c.header_ == nil {
8021		c.header_ = make(http.Header)
8022	}
8023	return c.header_
8024}
8025
8026func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
8027	reqHeaders := make(http.Header)
8028	for k, v := range c.header_ {
8029		reqHeaders[k] = v
8030	}
8031	reqHeaders.Set("User-Agent", c.s.userAgent())
8032	var body io.Reader = nil
8033	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
8034	if err != nil {
8035		return nil, err
8036	}
8037	reqHeaders.Set("Content-Type", "application/json")
8038	c.urlParams_.Set("alt", alt)
8039	c.urlParams_.Set("prettyPrint", "false")
8040	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
8041	urls += "?" + c.urlParams_.Encode()
8042	req, err := http.NewRequest("PATCH", urls, body)
8043	if err != nil {
8044		return nil, err
8045	}
8046	req.Header = reqHeaders
8047	googleapi.Expand(req.URL, map[string]string{
8048		"bucket": c.bucket,
8049		"object": c.object,
8050		"entity": c.entity,
8051	})
8052	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8053}
8054
8055// Do executes the "storage.objectAccessControls.patch" call.
8056// Exactly one of *ObjectAccessControl or error will be non-nil. Any
8057// non-2xx status code is an error. Response headers are in either
8058// *ObjectAccessControl.ServerResponse.Header or (if a response was
8059// returned at all) in error.(*googleapi.Error).Header. Use
8060// googleapi.IsNotModified to check whether the returned error was
8061// because http.StatusNotModified was returned.
8062func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
8063	gensupport.SetOptions(c.urlParams_, opts...)
8064	res, err := c.doRequest("json")
8065	if res != nil && res.StatusCode == http.StatusNotModified {
8066		if res.Body != nil {
8067			res.Body.Close()
8068		}
8069		return nil, &googleapi.Error{
8070			Code:   res.StatusCode,
8071			Header: res.Header,
8072		}
8073	}
8074	if err != nil {
8075		return nil, err
8076	}
8077	defer googleapi.CloseBody(res)
8078	if err := googleapi.CheckResponse(res); err != nil {
8079		return nil, err
8080	}
8081	ret := &ObjectAccessControl{
8082		ServerResponse: googleapi.ServerResponse{
8083			Header:         res.Header,
8084			HTTPStatusCode: res.StatusCode,
8085		},
8086	}
8087	target := &ret
8088	if err := gensupport.DecodeResponse(target, res); err != nil {
8089		return nil, err
8090	}
8091	return ret, nil
8092	// {
8093	//   "description": "Patches an ACL entry on the specified object.",
8094	//   "httpMethod": "PATCH",
8095	//   "id": "storage.objectAccessControls.patch",
8096	//   "parameterOrder": [
8097	//     "bucket",
8098	//     "object",
8099	//     "entity"
8100	//   ],
8101	//   "parameters": {
8102	//     "bucket": {
8103	//       "description": "Name of a bucket.",
8104	//       "location": "path",
8105	//       "required": true,
8106	//       "type": "string"
8107	//     },
8108	//     "entity": {
8109	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
8110	//       "location": "path",
8111	//       "required": true,
8112	//       "type": "string"
8113	//     },
8114	//     "generation": {
8115	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8116	//       "format": "int64",
8117	//       "location": "query",
8118	//       "type": "string"
8119	//     },
8120	//     "object": {
8121	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8122	//       "location": "path",
8123	//       "required": true,
8124	//       "type": "string"
8125	//     },
8126	//     "provisionalUserProject": {
8127	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8128	//       "location": "query",
8129	//       "type": "string"
8130	//     },
8131	//     "userProject": {
8132	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8133	//       "location": "query",
8134	//       "type": "string"
8135	//     }
8136	//   },
8137	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
8138	//   "request": {
8139	//     "$ref": "ObjectAccessControl"
8140	//   },
8141	//   "response": {
8142	//     "$ref": "ObjectAccessControl"
8143	//   },
8144	//   "scopes": [
8145	//     "https://www.googleapis.com/auth/cloud-platform",
8146	//     "https://www.googleapis.com/auth/devstorage.full_control"
8147	//   ]
8148	// }
8149
8150}
8151
8152// method id "storage.objectAccessControls.update":
8153
8154type ObjectAccessControlsUpdateCall struct {
8155	s                   *Service
8156	bucket              string
8157	object              string
8158	entity              string
8159	objectaccesscontrol *ObjectAccessControl
8160	urlParams_          gensupport.URLParams
8161	ctx_                context.Context
8162	header_             http.Header
8163}
8164
8165// Update: Updates an ACL entry on the specified object.
8166func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
8167	c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8168	c.bucket = bucket
8169	c.object = object
8170	c.entity = entity
8171	c.objectaccesscontrol = objectaccesscontrol
8172	return c
8173}
8174
8175// Generation sets the optional parameter "generation": If present,
8176// selects a specific revision of this object (as opposed to the latest
8177// version, the default).
8178func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall {
8179	c.urlParams_.Set("generation", fmt.Sprint(generation))
8180	return c
8181}
8182
8183// ProvisionalUserProject sets the optional parameter
8184// "provisionalUserProject": The project to be billed for this request
8185// if the target bucket is requester-pays bucket.
8186func (c *ObjectAccessControlsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectAccessControlsUpdateCall {
8187	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8188	return c
8189}
8190
8191// UserProject sets the optional parameter "userProject": The project to
8192// be billed for this request. Required for Requester Pays buckets.
8193func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
8194	c.urlParams_.Set("userProject", userProject)
8195	return c
8196}
8197
8198// Fields allows partial responses to be retrieved. See
8199// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8200// for more information.
8201func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
8202	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8203	return c
8204}
8205
8206// Context sets the context to be used in this call's Do method. Any
8207// pending HTTP request will be aborted if the provided context is
8208// canceled.
8209func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
8210	c.ctx_ = ctx
8211	return c
8212}
8213
8214// Header returns an http.Header that can be modified by the caller to
8215// add HTTP headers to the request.
8216func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
8217	if c.header_ == nil {
8218		c.header_ = make(http.Header)
8219	}
8220	return c.header_
8221}
8222
8223func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
8224	reqHeaders := make(http.Header)
8225	for k, v := range c.header_ {
8226		reqHeaders[k] = v
8227	}
8228	reqHeaders.Set("User-Agent", c.s.userAgent())
8229	var body io.Reader = nil
8230	body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
8231	if err != nil {
8232		return nil, err
8233	}
8234	reqHeaders.Set("Content-Type", "application/json")
8235	c.urlParams_.Set("alt", alt)
8236	c.urlParams_.Set("prettyPrint", "false")
8237	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
8238	urls += "?" + c.urlParams_.Encode()
8239	req, err := http.NewRequest("PUT", urls, body)
8240	if err != nil {
8241		return nil, err
8242	}
8243	req.Header = reqHeaders
8244	googleapi.Expand(req.URL, map[string]string{
8245		"bucket": c.bucket,
8246		"object": c.object,
8247		"entity": c.entity,
8248	})
8249	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8250}
8251
8252// Do executes the "storage.objectAccessControls.update" call.
8253// Exactly one of *ObjectAccessControl or error will be non-nil. Any
8254// non-2xx status code is an error. Response headers are in either
8255// *ObjectAccessControl.ServerResponse.Header or (if a response was
8256// returned at all) in error.(*googleapi.Error).Header. Use
8257// googleapi.IsNotModified to check whether the returned error was
8258// because http.StatusNotModified was returned.
8259func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
8260	gensupport.SetOptions(c.urlParams_, opts...)
8261	res, err := c.doRequest("json")
8262	if res != nil && res.StatusCode == http.StatusNotModified {
8263		if res.Body != nil {
8264			res.Body.Close()
8265		}
8266		return nil, &googleapi.Error{
8267			Code:   res.StatusCode,
8268			Header: res.Header,
8269		}
8270	}
8271	if err != nil {
8272		return nil, err
8273	}
8274	defer googleapi.CloseBody(res)
8275	if err := googleapi.CheckResponse(res); err != nil {
8276		return nil, err
8277	}
8278	ret := &ObjectAccessControl{
8279		ServerResponse: googleapi.ServerResponse{
8280			Header:         res.Header,
8281			HTTPStatusCode: res.StatusCode,
8282		},
8283	}
8284	target := &ret
8285	if err := gensupport.DecodeResponse(target, res); err != nil {
8286		return nil, err
8287	}
8288	return ret, nil
8289	// {
8290	//   "description": "Updates an ACL entry on the specified object.",
8291	//   "httpMethod": "PUT",
8292	//   "id": "storage.objectAccessControls.update",
8293	//   "parameterOrder": [
8294	//     "bucket",
8295	//     "object",
8296	//     "entity"
8297	//   ],
8298	//   "parameters": {
8299	//     "bucket": {
8300	//       "description": "Name of a bucket.",
8301	//       "location": "path",
8302	//       "required": true,
8303	//       "type": "string"
8304	//     },
8305	//     "entity": {
8306	//       "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
8307	//       "location": "path",
8308	//       "required": true,
8309	//       "type": "string"
8310	//     },
8311	//     "generation": {
8312	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8313	//       "format": "int64",
8314	//       "location": "query",
8315	//       "type": "string"
8316	//     },
8317	//     "object": {
8318	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8319	//       "location": "path",
8320	//       "required": true,
8321	//       "type": "string"
8322	//     },
8323	//     "provisionalUserProject": {
8324	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8325	//       "location": "query",
8326	//       "type": "string"
8327	//     },
8328	//     "userProject": {
8329	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8330	//       "location": "query",
8331	//       "type": "string"
8332	//     }
8333	//   },
8334	//   "path": "b/{bucket}/o/{object}/acl/{entity}",
8335	//   "request": {
8336	//     "$ref": "ObjectAccessControl"
8337	//   },
8338	//   "response": {
8339	//     "$ref": "ObjectAccessControl"
8340	//   },
8341	//   "scopes": [
8342	//     "https://www.googleapis.com/auth/cloud-platform",
8343	//     "https://www.googleapis.com/auth/devstorage.full_control"
8344	//   ]
8345	// }
8346
8347}
8348
8349// method id "storage.objects.compose":
8350
8351type ObjectsComposeCall struct {
8352	s                 *Service
8353	destinationBucket string
8354	destinationObject string
8355	composerequest    *ComposeRequest
8356	urlParams_        gensupport.URLParams
8357	ctx_              context.Context
8358	header_           http.Header
8359}
8360
8361// Compose: Concatenates a list of existing objects into a new object in
8362// the same bucket.
8363func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
8364	c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8365	c.destinationBucket = destinationBucket
8366	c.destinationObject = destinationObject
8367	c.composerequest = composerequest
8368	return c
8369}
8370
8371// DestinationPredefinedAcl sets the optional parameter
8372// "destinationPredefinedAcl": Apply a predefined set of access controls
8373// to the destination object.
8374//
8375// Possible values:
8376//   "authenticatedRead" - Object owner gets OWNER access, and
8377// allAuthenticatedUsers get READER access.
8378//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
8379// project team owners get OWNER access.
8380//   "bucketOwnerRead" - Object owner gets OWNER access, and project
8381// team owners get READER access.
8382//   "private" - Object owner gets OWNER access.
8383//   "projectPrivate" - Object owner gets OWNER access, and project team
8384// members get access according to their roles.
8385//   "publicRead" - Object owner gets OWNER access, and allUsers get
8386// READER access.
8387func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
8388	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
8389	return c
8390}
8391
8392// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8393// Makes the operation conditional on whether the object's current
8394// generation matches the given value. Setting to 0 makes the operation
8395// succeed only if there are no live versions of the object.
8396func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
8397	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8398	return c
8399}
8400
8401// IfMetagenerationMatch sets the optional parameter
8402// "ifMetagenerationMatch": Makes the operation conditional on whether
8403// the object's current metageneration matches the given value.
8404func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall {
8405	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8406	return c
8407}
8408
8409// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
8410// the Cloud KMS key, of the form
8411// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
8412//  that will be used to encrypt the object. Overrides the object
8413// metadata's kms_key_name value, if any.
8414func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall {
8415	c.urlParams_.Set("kmsKeyName", kmsKeyName)
8416	return c
8417}
8418
8419// ProvisionalUserProject sets the optional parameter
8420// "provisionalUserProject": The project to be billed for this request
8421// if the target bucket is requester-pays bucket.
8422func (c *ObjectsComposeCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsComposeCall {
8423	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8424	return c
8425}
8426
8427// UserProject sets the optional parameter "userProject": The project to
8428// be billed for this request. Required for Requester Pays buckets.
8429func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
8430	c.urlParams_.Set("userProject", userProject)
8431	return c
8432}
8433
8434// Fields allows partial responses to be retrieved. See
8435// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8436// for more information.
8437func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
8438	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8439	return c
8440}
8441
8442// Context sets the context to be used in this call's Do method. Any
8443// pending HTTP request will be aborted if the provided context is
8444// canceled.
8445func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
8446	c.ctx_ = ctx
8447	return c
8448}
8449
8450// Header returns an http.Header that can be modified by the caller to
8451// add HTTP headers to the request.
8452func (c *ObjectsComposeCall) Header() http.Header {
8453	if c.header_ == nil {
8454		c.header_ = make(http.Header)
8455	}
8456	return c.header_
8457}
8458
8459func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
8460	reqHeaders := make(http.Header)
8461	for k, v := range c.header_ {
8462		reqHeaders[k] = v
8463	}
8464	reqHeaders.Set("User-Agent", c.s.userAgent())
8465	var body io.Reader = nil
8466	body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
8467	if err != nil {
8468		return nil, err
8469	}
8470	reqHeaders.Set("Content-Type", "application/json")
8471	c.urlParams_.Set("alt", alt)
8472	c.urlParams_.Set("prettyPrint", "false")
8473	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
8474	urls += "?" + c.urlParams_.Encode()
8475	req, err := http.NewRequest("POST", urls, body)
8476	if err != nil {
8477		return nil, err
8478	}
8479	req.Header = reqHeaders
8480	googleapi.Expand(req.URL, map[string]string{
8481		"destinationBucket": c.destinationBucket,
8482		"destinationObject": c.destinationObject,
8483	})
8484	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8485}
8486
8487// Do executes the "storage.objects.compose" call.
8488// Exactly one of *Object or error will be non-nil. Any non-2xx status
8489// code is an error. Response headers are in either
8490// *Object.ServerResponse.Header or (if a response was returned at all)
8491// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8492// check whether the returned error was because http.StatusNotModified
8493// was returned.
8494func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8495	gensupport.SetOptions(c.urlParams_, opts...)
8496	res, err := c.doRequest("json")
8497	if res != nil && res.StatusCode == http.StatusNotModified {
8498		if res.Body != nil {
8499			res.Body.Close()
8500		}
8501		return nil, &googleapi.Error{
8502			Code:   res.StatusCode,
8503			Header: res.Header,
8504		}
8505	}
8506	if err != nil {
8507		return nil, err
8508	}
8509	defer googleapi.CloseBody(res)
8510	if err := googleapi.CheckResponse(res); err != nil {
8511		return nil, err
8512	}
8513	ret := &Object{
8514		ServerResponse: googleapi.ServerResponse{
8515			Header:         res.Header,
8516			HTTPStatusCode: res.StatusCode,
8517		},
8518	}
8519	target := &ret
8520	if err := gensupport.DecodeResponse(target, res); err != nil {
8521		return nil, err
8522	}
8523	return ret, nil
8524	// {
8525	//   "description": "Concatenates a list of existing objects into a new object in the same bucket.",
8526	//   "httpMethod": "POST",
8527	//   "id": "storage.objects.compose",
8528	//   "parameterOrder": [
8529	//     "destinationBucket",
8530	//     "destinationObject"
8531	//   ],
8532	//   "parameters": {
8533	//     "destinationBucket": {
8534	//       "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
8535	//       "location": "path",
8536	//       "required": true,
8537	//       "type": "string"
8538	//     },
8539	//     "destinationObject": {
8540	//       "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8541	//       "location": "path",
8542	//       "required": true,
8543	//       "type": "string"
8544	//     },
8545	//     "destinationPredefinedAcl": {
8546	//       "description": "Apply a predefined set of access controls to the destination object.",
8547	//       "enum": [
8548	//         "authenticatedRead",
8549	//         "bucketOwnerFullControl",
8550	//         "bucketOwnerRead",
8551	//         "private",
8552	//         "projectPrivate",
8553	//         "publicRead"
8554	//       ],
8555	//       "enumDescriptions": [
8556	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8557	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
8558	//         "Object owner gets OWNER access, and project team owners get READER access.",
8559	//         "Object owner gets OWNER access.",
8560	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
8561	//         "Object owner gets OWNER access, and allUsers get READER access."
8562	//       ],
8563	//       "location": "query",
8564	//       "type": "string"
8565	//     },
8566	//     "ifGenerationMatch": {
8567	//       "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.",
8568	//       "format": "int64",
8569	//       "location": "query",
8570	//       "type": "string"
8571	//     },
8572	//     "ifMetagenerationMatch": {
8573	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
8574	//       "format": "int64",
8575	//       "location": "query",
8576	//       "type": "string"
8577	//     },
8578	//     "kmsKeyName": {
8579	//       "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.",
8580	//       "location": "query",
8581	//       "type": "string"
8582	//     },
8583	//     "provisionalUserProject": {
8584	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8585	//       "location": "query",
8586	//       "type": "string"
8587	//     },
8588	//     "userProject": {
8589	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8590	//       "location": "query",
8591	//       "type": "string"
8592	//     }
8593	//   },
8594	//   "path": "b/{destinationBucket}/o/{destinationObject}/compose",
8595	//   "request": {
8596	//     "$ref": "ComposeRequest"
8597	//   },
8598	//   "response": {
8599	//     "$ref": "Object"
8600	//   },
8601	//   "scopes": [
8602	//     "https://www.googleapis.com/auth/cloud-platform",
8603	//     "https://www.googleapis.com/auth/devstorage.full_control",
8604	//     "https://www.googleapis.com/auth/devstorage.read_write"
8605	//   ]
8606	// }
8607
8608}
8609
8610// method id "storage.objects.copy":
8611
8612type ObjectsCopyCall struct {
8613	s                 *Service
8614	sourceBucket      string
8615	sourceObject      string
8616	destinationBucket string
8617	destinationObject string
8618	object            *Object
8619	urlParams_        gensupport.URLParams
8620	ctx_              context.Context
8621	header_           http.Header
8622}
8623
8624// Copy: Copies a source object to a destination object. Optionally
8625// overrides metadata.
8626func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
8627	c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8628	c.sourceBucket = sourceBucket
8629	c.sourceObject = sourceObject
8630	c.destinationBucket = destinationBucket
8631	c.destinationObject = destinationObject
8632	c.object = object
8633	return c
8634}
8635
8636// DestinationPredefinedAcl sets the optional parameter
8637// "destinationPredefinedAcl": Apply a predefined set of access controls
8638// to the destination object.
8639//
8640// Possible values:
8641//   "authenticatedRead" - Object owner gets OWNER access, and
8642// allAuthenticatedUsers get READER access.
8643//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
8644// project team owners get OWNER access.
8645//   "bucketOwnerRead" - Object owner gets OWNER access, and project
8646// team owners get READER access.
8647//   "private" - Object owner gets OWNER access.
8648//   "projectPrivate" - Object owner gets OWNER access, and project team
8649// members get access according to their roles.
8650//   "publicRead" - Object owner gets OWNER access, and allUsers get
8651// READER access.
8652func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
8653	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
8654	return c
8655}
8656
8657// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8658// Makes the operation conditional on whether the destination object's
8659// current generation matches the given value. Setting to 0 makes the
8660// operation succeed only if there are no live versions of the object.
8661func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
8662	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8663	return c
8664}
8665
8666// IfGenerationNotMatch sets the optional parameter
8667// "ifGenerationNotMatch": Makes the operation conditional on whether
8668// the destination object's current generation does not match the given
8669// value. If no live object exists, the precondition fails. Setting to 0
8670// makes the operation succeed only if there is a live version of the
8671// object.
8672func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
8673	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
8674	return c
8675}
8676
8677// IfMetagenerationMatch sets the optional parameter
8678// "ifMetagenerationMatch": Makes the operation conditional on whether
8679// the destination object's current metageneration matches the given
8680// value.
8681func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
8682	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8683	return c
8684}
8685
8686// IfMetagenerationNotMatch sets the optional parameter
8687// "ifMetagenerationNotMatch": Makes the operation conditional on
8688// whether the destination object's current metageneration does not
8689// match the given value.
8690func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall {
8691	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8692	return c
8693}
8694
8695// IfSourceGenerationMatch sets the optional parameter
8696// "ifSourceGenerationMatch": Makes the operation conditional on whether
8697// the source object's current generation matches the given value.
8698func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
8699	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
8700	return c
8701}
8702
8703// IfSourceGenerationNotMatch sets the optional parameter
8704// "ifSourceGenerationNotMatch": Makes the operation conditional on
8705// whether the source object's current generation does not match the
8706// given value.
8707func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
8708	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
8709	return c
8710}
8711
8712// IfSourceMetagenerationMatch sets the optional parameter
8713// "ifSourceMetagenerationMatch": Makes the operation conditional on
8714// whether the source object's current metageneration matches the given
8715// value.
8716func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
8717	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
8718	return c
8719}
8720
8721// IfSourceMetagenerationNotMatch sets the optional parameter
8722// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
8723// whether the source object's current metageneration does not match the
8724// given value.
8725func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
8726	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
8727	return c
8728}
8729
8730// Projection sets the optional parameter "projection": Set of
8731// properties to return. Defaults to noAcl, unless the object resource
8732// specifies the acl property, when it defaults to full.
8733//
8734// Possible values:
8735//   "full" - Include all properties.
8736//   "noAcl" - Omit the owner, acl property.
8737func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
8738	c.urlParams_.Set("projection", projection)
8739	return c
8740}
8741
8742// ProvisionalUserProject sets the optional parameter
8743// "provisionalUserProject": The project to be billed for this request
8744// if the target bucket is requester-pays bucket.
8745func (c *ObjectsCopyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsCopyCall {
8746	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
8747	return c
8748}
8749
8750// SourceGeneration sets the optional parameter "sourceGeneration": If
8751// present, selects a specific revision of the source object (as opposed
8752// to the latest version, the default).
8753func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall {
8754	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
8755	return c
8756}
8757
8758// UserProject sets the optional parameter "userProject": The project to
8759// be billed for this request. Required for Requester Pays buckets.
8760func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
8761	c.urlParams_.Set("userProject", userProject)
8762	return c
8763}
8764
8765// Fields allows partial responses to be retrieved. See
8766// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8767// for more information.
8768func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
8769	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8770	return c
8771}
8772
8773// Context sets the context to be used in this call's Do method. Any
8774// pending HTTP request will be aborted if the provided context is
8775// canceled.
8776func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
8777	c.ctx_ = ctx
8778	return c
8779}
8780
8781// Header returns an http.Header that can be modified by the caller to
8782// add HTTP headers to the request.
8783func (c *ObjectsCopyCall) Header() http.Header {
8784	if c.header_ == nil {
8785		c.header_ = make(http.Header)
8786	}
8787	return c.header_
8788}
8789
8790func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
8791	reqHeaders := make(http.Header)
8792	for k, v := range c.header_ {
8793		reqHeaders[k] = v
8794	}
8795	reqHeaders.Set("User-Agent", c.s.userAgent())
8796	var body io.Reader = nil
8797	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
8798	if err != nil {
8799		return nil, err
8800	}
8801	reqHeaders.Set("Content-Type", "application/json")
8802	c.urlParams_.Set("alt", alt)
8803	c.urlParams_.Set("prettyPrint", "false")
8804	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
8805	urls += "?" + c.urlParams_.Encode()
8806	req, err := http.NewRequest("POST", urls, body)
8807	if err != nil {
8808		return nil, err
8809	}
8810	req.Header = reqHeaders
8811	googleapi.Expand(req.URL, map[string]string{
8812		"sourceBucket":      c.sourceBucket,
8813		"sourceObject":      c.sourceObject,
8814		"destinationBucket": c.destinationBucket,
8815		"destinationObject": c.destinationObject,
8816	})
8817	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8818}
8819
8820// Do executes the "storage.objects.copy" call.
8821// Exactly one of *Object or error will be non-nil. Any non-2xx status
8822// code is an error. Response headers are in either
8823// *Object.ServerResponse.Header or (if a response was returned at all)
8824// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8825// check whether the returned error was because http.StatusNotModified
8826// was returned.
8827func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8828	gensupport.SetOptions(c.urlParams_, opts...)
8829	res, err := c.doRequest("json")
8830	if res != nil && res.StatusCode == http.StatusNotModified {
8831		if res.Body != nil {
8832			res.Body.Close()
8833		}
8834		return nil, &googleapi.Error{
8835			Code:   res.StatusCode,
8836			Header: res.Header,
8837		}
8838	}
8839	if err != nil {
8840		return nil, err
8841	}
8842	defer googleapi.CloseBody(res)
8843	if err := googleapi.CheckResponse(res); err != nil {
8844		return nil, err
8845	}
8846	ret := &Object{
8847		ServerResponse: googleapi.ServerResponse{
8848			Header:         res.Header,
8849			HTTPStatusCode: res.StatusCode,
8850		},
8851	}
8852	target := &ret
8853	if err := gensupport.DecodeResponse(target, res); err != nil {
8854		return nil, err
8855	}
8856	return ret, nil
8857	// {
8858	//   "description": "Copies a source object to a destination object. Optionally overrides metadata.",
8859	//   "httpMethod": "POST",
8860	//   "id": "storage.objects.copy",
8861	//   "parameterOrder": [
8862	//     "sourceBucket",
8863	//     "sourceObject",
8864	//     "destinationBucket",
8865	//     "destinationObject"
8866	//   ],
8867	//   "parameters": {
8868	//     "destinationBucket": {
8869	//       "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.",
8870	//       "location": "path",
8871	//       "required": true,
8872	//       "type": "string"
8873	//     },
8874	//     "destinationObject": {
8875	//       "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
8876	//       "location": "path",
8877	//       "required": true,
8878	//       "type": "string"
8879	//     },
8880	//     "destinationPredefinedAcl": {
8881	//       "description": "Apply a predefined set of access controls to the destination object.",
8882	//       "enum": [
8883	//         "authenticatedRead",
8884	//         "bucketOwnerFullControl",
8885	//         "bucketOwnerRead",
8886	//         "private",
8887	//         "projectPrivate",
8888	//         "publicRead"
8889	//       ],
8890	//       "enumDescriptions": [
8891	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8892	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
8893	//         "Object owner gets OWNER access, and project team owners get READER access.",
8894	//         "Object owner gets OWNER access.",
8895	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
8896	//         "Object owner gets OWNER access, and allUsers get READER access."
8897	//       ],
8898	//       "location": "query",
8899	//       "type": "string"
8900	//     },
8901	//     "ifGenerationMatch": {
8902	//       "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.",
8903	//       "format": "int64",
8904	//       "location": "query",
8905	//       "type": "string"
8906	//     },
8907	//     "ifGenerationNotMatch": {
8908	//       "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.",
8909	//       "format": "int64",
8910	//       "location": "query",
8911	//       "type": "string"
8912	//     },
8913	//     "ifMetagenerationMatch": {
8914	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
8915	//       "format": "int64",
8916	//       "location": "query",
8917	//       "type": "string"
8918	//     },
8919	//     "ifMetagenerationNotMatch": {
8920	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
8921	//       "format": "int64",
8922	//       "location": "query",
8923	//       "type": "string"
8924	//     },
8925	//     "ifSourceGenerationMatch": {
8926	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
8927	//       "format": "int64",
8928	//       "location": "query",
8929	//       "type": "string"
8930	//     },
8931	//     "ifSourceGenerationNotMatch": {
8932	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
8933	//       "format": "int64",
8934	//       "location": "query",
8935	//       "type": "string"
8936	//     },
8937	//     "ifSourceMetagenerationMatch": {
8938	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
8939	//       "format": "int64",
8940	//       "location": "query",
8941	//       "type": "string"
8942	//     },
8943	//     "ifSourceMetagenerationNotMatch": {
8944	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
8945	//       "format": "int64",
8946	//       "location": "query",
8947	//       "type": "string"
8948	//     },
8949	//     "projection": {
8950	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
8951	//       "enum": [
8952	//         "full",
8953	//         "noAcl"
8954	//       ],
8955	//       "enumDescriptions": [
8956	//         "Include all properties.",
8957	//         "Omit the owner, acl property."
8958	//       ],
8959	//       "location": "query",
8960	//       "type": "string"
8961	//     },
8962	//     "provisionalUserProject": {
8963	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
8964	//       "location": "query",
8965	//       "type": "string"
8966	//     },
8967	//     "sourceBucket": {
8968	//       "description": "Name of the bucket in which to find the source object.",
8969	//       "location": "path",
8970	//       "required": true,
8971	//       "type": "string"
8972	//     },
8973	//     "sourceGeneration": {
8974	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
8975	//       "format": "int64",
8976	//       "location": "query",
8977	//       "type": "string"
8978	//     },
8979	//     "sourceObject": {
8980	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8981	//       "location": "path",
8982	//       "required": true,
8983	//       "type": "string"
8984	//     },
8985	//     "userProject": {
8986	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8987	//       "location": "query",
8988	//       "type": "string"
8989	//     }
8990	//   },
8991	//   "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
8992	//   "request": {
8993	//     "$ref": "Object"
8994	//   },
8995	//   "response": {
8996	//     "$ref": "Object"
8997	//   },
8998	//   "scopes": [
8999	//     "https://www.googleapis.com/auth/cloud-platform",
9000	//     "https://www.googleapis.com/auth/devstorage.full_control",
9001	//     "https://www.googleapis.com/auth/devstorage.read_write"
9002	//   ]
9003	// }
9004
9005}
9006
9007// method id "storage.objects.delete":
9008
9009type ObjectsDeleteCall struct {
9010	s          *Service
9011	bucket     string
9012	object     string
9013	urlParams_ gensupport.URLParams
9014	ctx_       context.Context
9015	header_    http.Header
9016}
9017
9018// Delete: Deletes an object and its metadata. Deletions are permanent
9019// if versioning is not enabled for the bucket, or if the generation
9020// parameter is used.
9021func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
9022	c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9023	c.bucket = bucket
9024	c.object = object
9025	return c
9026}
9027
9028// Generation sets the optional parameter "generation": If present,
9029// permanently deletes a specific revision of this object (as opposed to
9030// the latest version, the default).
9031func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
9032	c.urlParams_.Set("generation", fmt.Sprint(generation))
9033	return c
9034}
9035
9036// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9037// Makes the operation conditional on whether the object's current
9038// generation matches the given value. Setting to 0 makes the operation
9039// succeed only if there are no live versions of the object.
9040func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
9041	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9042	return c
9043}
9044
9045// IfGenerationNotMatch sets the optional parameter
9046// "ifGenerationNotMatch": Makes the operation conditional on whether
9047// the object's current generation does not match the given value. If no
9048// live object exists, the precondition fails. Setting to 0 makes the
9049// operation succeed only if there is a live version of the object.
9050func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
9051	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9052	return c
9053}
9054
9055// IfMetagenerationMatch sets the optional parameter
9056// "ifMetagenerationMatch": Makes the operation conditional on whether
9057// the object's current metageneration matches the given value.
9058func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall {
9059	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9060	return c
9061}
9062
9063// IfMetagenerationNotMatch sets the optional parameter
9064// "ifMetagenerationNotMatch": Makes the operation conditional on
9065// whether the object's current metageneration does not match the given
9066// value.
9067func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
9068	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9069	return c
9070}
9071
9072// ProvisionalUserProject sets the optional parameter
9073// "provisionalUserProject": The project to be billed for this request
9074// if the target bucket is requester-pays bucket.
9075func (c *ObjectsDeleteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsDeleteCall {
9076	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9077	return c
9078}
9079
9080// UserProject sets the optional parameter "userProject": The project to
9081// be billed for this request. Required for Requester Pays buckets.
9082func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
9083	c.urlParams_.Set("userProject", userProject)
9084	return c
9085}
9086
9087// Fields allows partial responses to be retrieved. See
9088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9089// for more information.
9090func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
9091	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9092	return c
9093}
9094
9095// Context sets the context to be used in this call's Do method. Any
9096// pending HTTP request will be aborted if the provided context is
9097// canceled.
9098func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
9099	c.ctx_ = ctx
9100	return c
9101}
9102
9103// Header returns an http.Header that can be modified by the caller to
9104// add HTTP headers to the request.
9105func (c *ObjectsDeleteCall) Header() http.Header {
9106	if c.header_ == nil {
9107		c.header_ = make(http.Header)
9108	}
9109	return c.header_
9110}
9111
9112func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
9113	reqHeaders := make(http.Header)
9114	for k, v := range c.header_ {
9115		reqHeaders[k] = v
9116	}
9117	reqHeaders.Set("User-Agent", c.s.userAgent())
9118	var body io.Reader = nil
9119	c.urlParams_.Set("alt", alt)
9120	c.urlParams_.Set("prettyPrint", "false")
9121	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9122	urls += "?" + c.urlParams_.Encode()
9123	req, err := http.NewRequest("DELETE", urls, body)
9124	if err != nil {
9125		return nil, err
9126	}
9127	req.Header = reqHeaders
9128	googleapi.Expand(req.URL, map[string]string{
9129		"bucket": c.bucket,
9130		"object": c.object,
9131	})
9132	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9133}
9134
9135// Do executes the "storage.objects.delete" call.
9136func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
9137	gensupport.SetOptions(c.urlParams_, opts...)
9138	res, err := c.doRequest("json")
9139	if err != nil {
9140		return err
9141	}
9142	defer googleapi.CloseBody(res)
9143	if err := googleapi.CheckResponse(res); err != nil {
9144		return err
9145	}
9146	return nil
9147	// {
9148	//   "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.",
9149	//   "httpMethod": "DELETE",
9150	//   "id": "storage.objects.delete",
9151	//   "parameterOrder": [
9152	//     "bucket",
9153	//     "object"
9154	//   ],
9155	//   "parameters": {
9156	//     "bucket": {
9157	//       "description": "Name of the bucket in which the object resides.",
9158	//       "location": "path",
9159	//       "required": true,
9160	//       "type": "string"
9161	//     },
9162	//     "generation": {
9163	//       "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
9164	//       "format": "int64",
9165	//       "location": "query",
9166	//       "type": "string"
9167	//     },
9168	//     "ifGenerationMatch": {
9169	//       "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.",
9170	//       "format": "int64",
9171	//       "location": "query",
9172	//       "type": "string"
9173	//     },
9174	//     "ifGenerationNotMatch": {
9175	//       "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.",
9176	//       "format": "int64",
9177	//       "location": "query",
9178	//       "type": "string"
9179	//     },
9180	//     "ifMetagenerationMatch": {
9181	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9182	//       "format": "int64",
9183	//       "location": "query",
9184	//       "type": "string"
9185	//     },
9186	//     "ifMetagenerationNotMatch": {
9187	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9188	//       "format": "int64",
9189	//       "location": "query",
9190	//       "type": "string"
9191	//     },
9192	//     "object": {
9193	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9194	//       "location": "path",
9195	//       "required": true,
9196	//       "type": "string"
9197	//     },
9198	//     "provisionalUserProject": {
9199	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9200	//       "location": "query",
9201	//       "type": "string"
9202	//     },
9203	//     "userProject": {
9204	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9205	//       "location": "query",
9206	//       "type": "string"
9207	//     }
9208	//   },
9209	//   "path": "b/{bucket}/o/{object}",
9210	//   "scopes": [
9211	//     "https://www.googleapis.com/auth/cloud-platform",
9212	//     "https://www.googleapis.com/auth/devstorage.full_control",
9213	//     "https://www.googleapis.com/auth/devstorage.read_write"
9214	//   ]
9215	// }
9216
9217}
9218
9219// method id "storage.objects.get":
9220
9221type ObjectsGetCall struct {
9222	s            *Service
9223	bucket       string
9224	object       string
9225	urlParams_   gensupport.URLParams
9226	ifNoneMatch_ string
9227	ctx_         context.Context
9228	header_      http.Header
9229}
9230
9231// Get: Retrieves an object or its metadata.
9232func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
9233	c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9234	c.bucket = bucket
9235	c.object = object
9236	return c
9237}
9238
9239// Generation sets the optional parameter "generation": If present,
9240// selects a specific revision of this object (as opposed to the latest
9241// version, the default).
9242func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
9243	c.urlParams_.Set("generation", fmt.Sprint(generation))
9244	return c
9245}
9246
9247// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9248// Makes the operation conditional on whether the object's current
9249// generation matches the given value. Setting to 0 makes the operation
9250// succeed only if there are no live versions of the object.
9251func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
9252	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9253	return c
9254}
9255
9256// IfGenerationNotMatch sets the optional parameter
9257// "ifGenerationNotMatch": Makes the operation conditional on whether
9258// the object's current generation does not match the given value. If no
9259// live object exists, the precondition fails. Setting to 0 makes the
9260// operation succeed only if there is a live version of the object.
9261func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
9262	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9263	return c
9264}
9265
9266// IfMetagenerationMatch sets the optional parameter
9267// "ifMetagenerationMatch": Makes the operation conditional on whether
9268// the object's current metageneration matches the given value.
9269func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall {
9270	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9271	return c
9272}
9273
9274// IfMetagenerationNotMatch sets the optional parameter
9275// "ifMetagenerationNotMatch": Makes the operation conditional on
9276// whether the object's current metageneration does not match the given
9277// value.
9278func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
9279	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9280	return c
9281}
9282
9283// Projection sets the optional parameter "projection": Set of
9284// properties to return. Defaults to noAcl.
9285//
9286// Possible values:
9287//   "full" - Include all properties.
9288//   "noAcl" - Omit the owner, acl property.
9289func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
9290	c.urlParams_.Set("projection", projection)
9291	return c
9292}
9293
9294// ProvisionalUserProject sets the optional parameter
9295// "provisionalUserProject": The project to be billed for this request
9296// if the target bucket is requester-pays bucket.
9297func (c *ObjectsGetCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetCall {
9298	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9299	return c
9300}
9301
9302// UserProject sets the optional parameter "userProject": The project to
9303// be billed for this request. Required for Requester Pays buckets.
9304func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
9305	c.urlParams_.Set("userProject", userProject)
9306	return c
9307}
9308
9309// Fields allows partial responses to be retrieved. See
9310// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9311// for more information.
9312func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
9313	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9314	return c
9315}
9316
9317// IfNoneMatch sets the optional parameter which makes the operation
9318// fail if the object's ETag matches the given value. This is useful for
9319// getting updates only after the object has changed since the last
9320// request. Use googleapi.IsNotModified to check whether the response
9321// error from Do is the result of In-None-Match.
9322func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
9323	c.ifNoneMatch_ = entityTag
9324	return c
9325}
9326
9327// Context sets the context to be used in this call's Do and Download
9328// methods. Any pending HTTP request will be aborted if the provided
9329// context is canceled.
9330func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
9331	c.ctx_ = ctx
9332	return c
9333}
9334
9335// Header returns an http.Header that can be modified by the caller to
9336// add HTTP headers to the request.
9337func (c *ObjectsGetCall) Header() http.Header {
9338	if c.header_ == nil {
9339		c.header_ = make(http.Header)
9340	}
9341	return c.header_
9342}
9343
9344func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
9345	reqHeaders := make(http.Header)
9346	for k, v := range c.header_ {
9347		reqHeaders[k] = v
9348	}
9349	reqHeaders.Set("User-Agent", c.s.userAgent())
9350	if c.ifNoneMatch_ != "" {
9351		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9352	}
9353	var body io.Reader = nil
9354	c.urlParams_.Set("alt", alt)
9355	c.urlParams_.Set("prettyPrint", "false")
9356	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9357	urls += "?" + c.urlParams_.Encode()
9358	req, err := http.NewRequest("GET", urls, body)
9359	if err != nil {
9360		return nil, err
9361	}
9362	req.Header = reqHeaders
9363	googleapi.Expand(req.URL, map[string]string{
9364		"bucket": c.bucket,
9365		"object": c.object,
9366	})
9367	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9368}
9369
9370// Download fetches the API endpoint's "media" value, instead of the normal
9371// API response value. If the returned error is nil, the Response is guaranteed to
9372// have a 2xx status code. Callers must close the Response.Body as usual.
9373func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
9374	gensupport.SetOptions(c.urlParams_, opts...)
9375	res, err := c.doRequest("media")
9376	if err != nil {
9377		return nil, err
9378	}
9379	if err := googleapi.CheckMediaResponse(res); err != nil {
9380		res.Body.Close()
9381		return nil, err
9382	}
9383	return res, nil
9384}
9385
9386// Do executes the "storage.objects.get" call.
9387// Exactly one of *Object or error will be non-nil. Any non-2xx status
9388// code is an error. Response headers are in either
9389// *Object.ServerResponse.Header or (if a response was returned at all)
9390// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9391// check whether the returned error was because http.StatusNotModified
9392// was returned.
9393func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
9394	gensupport.SetOptions(c.urlParams_, opts...)
9395	res, err := c.doRequest("json")
9396	if res != nil && res.StatusCode == http.StatusNotModified {
9397		if res.Body != nil {
9398			res.Body.Close()
9399		}
9400		return nil, &googleapi.Error{
9401			Code:   res.StatusCode,
9402			Header: res.Header,
9403		}
9404	}
9405	if err != nil {
9406		return nil, err
9407	}
9408	defer googleapi.CloseBody(res)
9409	if err := googleapi.CheckResponse(res); err != nil {
9410		return nil, err
9411	}
9412	ret := &Object{
9413		ServerResponse: googleapi.ServerResponse{
9414			Header:         res.Header,
9415			HTTPStatusCode: res.StatusCode,
9416		},
9417	}
9418	target := &ret
9419	if err := gensupport.DecodeResponse(target, res); err != nil {
9420		return nil, err
9421	}
9422	return ret, nil
9423	// {
9424	//   "description": "Retrieves an object or its metadata.",
9425	//   "httpMethod": "GET",
9426	//   "id": "storage.objects.get",
9427	//   "parameterOrder": [
9428	//     "bucket",
9429	//     "object"
9430	//   ],
9431	//   "parameters": {
9432	//     "bucket": {
9433	//       "description": "Name of the bucket in which the object resides.",
9434	//       "location": "path",
9435	//       "required": true,
9436	//       "type": "string"
9437	//     },
9438	//     "generation": {
9439	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9440	//       "format": "int64",
9441	//       "location": "query",
9442	//       "type": "string"
9443	//     },
9444	//     "ifGenerationMatch": {
9445	//       "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.",
9446	//       "format": "int64",
9447	//       "location": "query",
9448	//       "type": "string"
9449	//     },
9450	//     "ifGenerationNotMatch": {
9451	//       "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.",
9452	//       "format": "int64",
9453	//       "location": "query",
9454	//       "type": "string"
9455	//     },
9456	//     "ifMetagenerationMatch": {
9457	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9458	//       "format": "int64",
9459	//       "location": "query",
9460	//       "type": "string"
9461	//     },
9462	//     "ifMetagenerationNotMatch": {
9463	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9464	//       "format": "int64",
9465	//       "location": "query",
9466	//       "type": "string"
9467	//     },
9468	//     "object": {
9469	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9470	//       "location": "path",
9471	//       "required": true,
9472	//       "type": "string"
9473	//     },
9474	//     "projection": {
9475	//       "description": "Set of properties to return. Defaults to noAcl.",
9476	//       "enum": [
9477	//         "full",
9478	//         "noAcl"
9479	//       ],
9480	//       "enumDescriptions": [
9481	//         "Include all properties.",
9482	//         "Omit the owner, acl property."
9483	//       ],
9484	//       "location": "query",
9485	//       "type": "string"
9486	//     },
9487	//     "provisionalUserProject": {
9488	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9489	//       "location": "query",
9490	//       "type": "string"
9491	//     },
9492	//     "userProject": {
9493	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9494	//       "location": "query",
9495	//       "type": "string"
9496	//     }
9497	//   },
9498	//   "path": "b/{bucket}/o/{object}",
9499	//   "response": {
9500	//     "$ref": "Object"
9501	//   },
9502	//   "scopes": [
9503	//     "https://www.googleapis.com/auth/cloud-platform",
9504	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9505	//     "https://www.googleapis.com/auth/devstorage.full_control",
9506	//     "https://www.googleapis.com/auth/devstorage.read_only",
9507	//     "https://www.googleapis.com/auth/devstorage.read_write"
9508	//   ],
9509	//   "supportsMediaDownload": true,
9510	//   "useMediaDownloadService": true
9511	// }
9512
9513}
9514
9515// method id "storage.objects.getIamPolicy":
9516
9517type ObjectsGetIamPolicyCall struct {
9518	s            *Service
9519	bucket       string
9520	object       string
9521	urlParams_   gensupport.URLParams
9522	ifNoneMatch_ string
9523	ctx_         context.Context
9524	header_      http.Header
9525}
9526
9527// GetIamPolicy: Returns an IAM policy for the specified object.
9528func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall {
9529	c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9530	c.bucket = bucket
9531	c.object = object
9532	return c
9533}
9534
9535// Generation sets the optional parameter "generation": If present,
9536// selects a specific revision of this object (as opposed to the latest
9537// version, the default).
9538func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall {
9539	c.urlParams_.Set("generation", fmt.Sprint(generation))
9540	return c
9541}
9542
9543// ProvisionalUserProject sets the optional parameter
9544// "provisionalUserProject": The project to be billed for this request
9545// if the target bucket is requester-pays bucket.
9546func (c *ObjectsGetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsGetIamPolicyCall {
9547	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9548	return c
9549}
9550
9551// UserProject sets the optional parameter "userProject": The project to
9552// be billed for this request. Required for Requester Pays buckets.
9553func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
9554	c.urlParams_.Set("userProject", userProject)
9555	return c
9556}
9557
9558// Fields allows partial responses to be retrieved. See
9559// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9560// for more information.
9561func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall {
9562	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9563	return c
9564}
9565
9566// IfNoneMatch sets the optional parameter which makes the operation
9567// fail if the object's ETag matches the given value. This is useful for
9568// getting updates only after the object has changed since the last
9569// request. Use googleapi.IsNotModified to check whether the response
9570// error from Do is the result of In-None-Match.
9571func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall {
9572	c.ifNoneMatch_ = entityTag
9573	return c
9574}
9575
9576// Context sets the context to be used in this call's Do method. Any
9577// pending HTTP request will be aborted if the provided context is
9578// canceled.
9579func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
9580	c.ctx_ = ctx
9581	return c
9582}
9583
9584// Header returns an http.Header that can be modified by the caller to
9585// add HTTP headers to the request.
9586func (c *ObjectsGetIamPolicyCall) Header() http.Header {
9587	if c.header_ == nil {
9588		c.header_ = make(http.Header)
9589	}
9590	return c.header_
9591}
9592
9593func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9594	reqHeaders := make(http.Header)
9595	for k, v := range c.header_ {
9596		reqHeaders[k] = v
9597	}
9598	reqHeaders.Set("User-Agent", c.s.userAgent())
9599	if c.ifNoneMatch_ != "" {
9600		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9601	}
9602	var body io.Reader = nil
9603	c.urlParams_.Set("alt", alt)
9604	c.urlParams_.Set("prettyPrint", "false")
9605	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
9606	urls += "?" + c.urlParams_.Encode()
9607	req, err := http.NewRequest("GET", urls, body)
9608	if err != nil {
9609		return nil, err
9610	}
9611	req.Header = reqHeaders
9612	googleapi.Expand(req.URL, map[string]string{
9613		"bucket": c.bucket,
9614		"object": c.object,
9615	})
9616	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9617}
9618
9619// Do executes the "storage.objects.getIamPolicy" call.
9620// Exactly one of *Policy or error will be non-nil. Any non-2xx status
9621// code is an error. Response headers are in either
9622// *Policy.ServerResponse.Header or (if a response was returned at all)
9623// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9624// check whether the returned error was because http.StatusNotModified
9625// was returned.
9626func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9627	gensupport.SetOptions(c.urlParams_, opts...)
9628	res, err := c.doRequest("json")
9629	if res != nil && res.StatusCode == http.StatusNotModified {
9630		if res.Body != nil {
9631			res.Body.Close()
9632		}
9633		return nil, &googleapi.Error{
9634			Code:   res.StatusCode,
9635			Header: res.Header,
9636		}
9637	}
9638	if err != nil {
9639		return nil, err
9640	}
9641	defer googleapi.CloseBody(res)
9642	if err := googleapi.CheckResponse(res); err != nil {
9643		return nil, err
9644	}
9645	ret := &Policy{
9646		ServerResponse: googleapi.ServerResponse{
9647			Header:         res.Header,
9648			HTTPStatusCode: res.StatusCode,
9649		},
9650	}
9651	target := &ret
9652	if err := gensupport.DecodeResponse(target, res); err != nil {
9653		return nil, err
9654	}
9655	return ret, nil
9656	// {
9657	//   "description": "Returns an IAM policy for the specified object.",
9658	//   "httpMethod": "GET",
9659	//   "id": "storage.objects.getIamPolicy",
9660	//   "parameterOrder": [
9661	//     "bucket",
9662	//     "object"
9663	//   ],
9664	//   "parameters": {
9665	//     "bucket": {
9666	//       "description": "Name of the bucket in which the object resides.",
9667	//       "location": "path",
9668	//       "required": true,
9669	//       "type": "string"
9670	//     },
9671	//     "generation": {
9672	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9673	//       "format": "int64",
9674	//       "location": "query",
9675	//       "type": "string"
9676	//     },
9677	//     "object": {
9678	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9679	//       "location": "path",
9680	//       "required": true,
9681	//       "type": "string"
9682	//     },
9683	//     "provisionalUserProject": {
9684	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
9685	//       "location": "query",
9686	//       "type": "string"
9687	//     },
9688	//     "userProject": {
9689	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9690	//       "location": "query",
9691	//       "type": "string"
9692	//     }
9693	//   },
9694	//   "path": "b/{bucket}/o/{object}/iam",
9695	//   "response": {
9696	//     "$ref": "Policy"
9697	//   },
9698	//   "scopes": [
9699	//     "https://www.googleapis.com/auth/cloud-platform",
9700	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9701	//     "https://www.googleapis.com/auth/devstorage.full_control",
9702	//     "https://www.googleapis.com/auth/devstorage.read_only",
9703	//     "https://www.googleapis.com/auth/devstorage.read_write"
9704	//   ]
9705	// }
9706
9707}
9708
9709// method id "storage.objects.insert":
9710
9711type ObjectsInsertCall struct {
9712	s          *Service
9713	bucket     string
9714	object     *Object
9715	urlParams_ gensupport.URLParams
9716	mediaInfo_ *gensupport.MediaInfo
9717	ctx_       context.Context
9718	header_    http.Header
9719}
9720
9721// Insert: Stores a new object and metadata.
9722func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
9723	c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9724	c.bucket = bucket
9725	c.object = object
9726	return c
9727}
9728
9729// ContentEncoding sets the optional parameter "contentEncoding": If
9730// set, sets the contentEncoding property of the final object to this
9731// value. Setting this parameter is equivalent to setting the
9732// contentEncoding metadata property. This can be useful when uploading
9733// an object with uploadType=media to indicate the encoding of the
9734// content being uploaded.
9735func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall {
9736	c.urlParams_.Set("contentEncoding", contentEncoding)
9737	return c
9738}
9739
9740// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9741// Makes the operation conditional on whether the object's current
9742// generation matches the given value. Setting to 0 makes the operation
9743// succeed only if there are no live versions of the object.
9744func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
9745	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9746	return c
9747}
9748
9749// IfGenerationNotMatch sets the optional parameter
9750// "ifGenerationNotMatch": Makes the operation conditional on whether
9751// the object's current generation does not match the given value. If no
9752// live object exists, the precondition fails. Setting to 0 makes the
9753// operation succeed only if there is a live version of the object.
9754func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
9755	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9756	return c
9757}
9758
9759// IfMetagenerationMatch sets the optional parameter
9760// "ifMetagenerationMatch": Makes the operation conditional on whether
9761// the object's current metageneration matches the given value.
9762func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall {
9763	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9764	return c
9765}
9766
9767// IfMetagenerationNotMatch sets the optional parameter
9768// "ifMetagenerationNotMatch": Makes the operation conditional on
9769// whether the object's current metageneration does not match the given
9770// value.
9771func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
9772	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9773	return c
9774}
9775
9776// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
9777// the Cloud KMS key, of the form
9778// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
9779//  that will be used to encrypt the object. Overrides the object
9780// metadata's kms_key_name value, if any.
9781func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall {
9782	c.urlParams_.Set("kmsKeyName", kmsKeyName)
9783	return c
9784}
9785
9786// Name sets the optional parameter "name": Name of the object. Required
9787// when the object metadata is not otherwise provided. Overrides the
9788// object metadata's name value, if any. For information about how to
9789// URL encode object names to be path safe, see Encoding URI Path Parts.
9790func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
9791	c.urlParams_.Set("name", name)
9792	return c
9793}
9794
9795// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9796// predefined set of access controls to this object.
9797//
9798// Possible values:
9799//   "authenticatedRead" - Object owner gets OWNER access, and
9800// allAuthenticatedUsers get READER access.
9801//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
9802// project team owners get OWNER access.
9803//   "bucketOwnerRead" - Object owner gets OWNER access, and project
9804// team owners get READER access.
9805//   "private" - Object owner gets OWNER access.
9806//   "projectPrivate" - Object owner gets OWNER access, and project team
9807// members get access according to their roles.
9808//   "publicRead" - Object owner gets OWNER access, and allUsers get
9809// READER access.
9810func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
9811	c.urlParams_.Set("predefinedAcl", predefinedAcl)
9812	return c
9813}
9814
9815// Projection sets the optional parameter "projection": Set of
9816// properties to return. Defaults to noAcl, unless the object resource
9817// specifies the acl property, when it defaults to full.
9818//
9819// Possible values:
9820//   "full" - Include all properties.
9821//   "noAcl" - Omit the owner, acl property.
9822func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
9823	c.urlParams_.Set("projection", projection)
9824	return c
9825}
9826
9827// ProvisionalUserProject sets the optional parameter
9828// "provisionalUserProject": The project to be billed for this request
9829// if the target bucket is requester-pays bucket.
9830func (c *ObjectsInsertCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsInsertCall {
9831	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
9832	return c
9833}
9834
9835// UserProject sets the optional parameter "userProject": The project to
9836// be billed for this request. Required for Requester Pays buckets.
9837func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
9838	c.urlParams_.Set("userProject", userProject)
9839	return c
9840}
9841
9842// Media specifies the media to upload in one or more chunks. The chunk
9843// size may be controlled by supplying a MediaOption generated by
9844// googleapi.ChunkSize. The chunk size defaults to
9845// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
9846// upload request will be determined by sniffing the contents of r,
9847// unless a MediaOption generated by googleapi.ContentType is
9848// supplied.
9849// At most one of Media and ResumableMedia may be set.
9850func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
9851	if ct := c.object.ContentType; ct != "" {
9852		options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
9853	}
9854	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9855	return c
9856}
9857
9858// ResumableMedia specifies the media to upload in chunks and can be
9859// canceled with ctx.
9860//
9861// Deprecated: use Media instead.
9862//
9863// At most one of Media and ResumableMedia may be set. mediaType
9864// identifies the MIME media type of the upload, such as "image/png". If
9865// mediaType is "", it will be auto-detected. The provided ctx will
9866// supersede any context previously provided to the Context method.
9867func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
9868	c.ctx_ = ctx
9869	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
9870	return c
9871}
9872
9873// ProgressUpdater provides a callback function that will be called
9874// after every chunk. It should be a low-latency function in order to
9875// not slow down the upload operation. This should only be called when
9876// using ResumableMedia (as opposed to Media).
9877func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
9878	c.mediaInfo_.SetProgressUpdater(pu)
9879	return c
9880}
9881
9882// Fields allows partial responses to be retrieved. See
9883// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9884// for more information.
9885func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
9886	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9887	return c
9888}
9889
9890// Context sets the context to be used in this call's Do method. Any
9891// pending HTTP request will be aborted if the provided context is
9892// canceled.
9893// This context will supersede any context previously provided to the
9894// ResumableMedia method.
9895func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
9896	c.ctx_ = ctx
9897	return c
9898}
9899
9900// Header returns an http.Header that can be modified by the caller to
9901// add HTTP headers to the request.
9902func (c *ObjectsInsertCall) Header() http.Header {
9903	if c.header_ == nil {
9904		c.header_ = make(http.Header)
9905	}
9906	return c.header_
9907}
9908
9909func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
9910	reqHeaders := make(http.Header)
9911	for k, v := range c.header_ {
9912		reqHeaders[k] = v
9913	}
9914	reqHeaders.Set("User-Agent", c.s.userAgent())
9915	var body io.Reader = nil
9916	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
9917	if err != nil {
9918		return nil, err
9919	}
9920	reqHeaders.Set("Content-Type", "application/json")
9921	c.urlParams_.Set("alt", alt)
9922	c.urlParams_.Set("prettyPrint", "false")
9923	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
9924	if c.mediaInfo_ != nil {
9925		urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
9926		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
9927	}
9928	if body == nil {
9929		body = new(bytes.Buffer)
9930		reqHeaders.Set("Content-Type", "application/json")
9931	}
9932	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
9933	defer cleanup()
9934	urls += "?" + c.urlParams_.Encode()
9935	req, err := http.NewRequest("POST", urls, body)
9936	if err != nil {
9937		return nil, err
9938	}
9939	req.Header = reqHeaders
9940	req.GetBody = getBody
9941	googleapi.Expand(req.URL, map[string]string{
9942		"bucket": c.bucket,
9943	})
9944	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9945}
9946
9947// Do executes the "storage.objects.insert" call.
9948// Exactly one of *Object or error will be non-nil. Any non-2xx status
9949// code is an error. Response headers are in either
9950// *Object.ServerResponse.Header or (if a response was returned at all)
9951// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9952// check whether the returned error was because http.StatusNotModified
9953// was returned.
9954func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
9955	gensupport.SetOptions(c.urlParams_, opts...)
9956	res, err := c.doRequest("json")
9957	if res != nil && res.StatusCode == http.StatusNotModified {
9958		if res.Body != nil {
9959			res.Body.Close()
9960		}
9961		return nil, &googleapi.Error{
9962			Code:   res.StatusCode,
9963			Header: res.Header,
9964		}
9965	}
9966	if err != nil {
9967		return nil, err
9968	}
9969	defer googleapi.CloseBody(res)
9970	if err := googleapi.CheckResponse(res); err != nil {
9971		return nil, err
9972	}
9973	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
9974	if rx != nil {
9975		rx.Client = c.s.client
9976		rx.UserAgent = c.s.userAgent()
9977		ctx := c.ctx_
9978		if ctx == nil {
9979			ctx = context.TODO()
9980		}
9981		res, err = rx.Upload(ctx)
9982		if err != nil {
9983			return nil, err
9984		}
9985		defer res.Body.Close()
9986		if err := googleapi.CheckResponse(res); err != nil {
9987			return nil, err
9988		}
9989	}
9990	ret := &Object{
9991		ServerResponse: googleapi.ServerResponse{
9992			Header:         res.Header,
9993			HTTPStatusCode: res.StatusCode,
9994		},
9995	}
9996	target := &ret
9997	if err := gensupport.DecodeResponse(target, res); err != nil {
9998		return nil, err
9999	}
10000	return ret, nil
10001	// {
10002	//   "description": "Stores a new object and metadata.",
10003	//   "httpMethod": "POST",
10004	//   "id": "storage.objects.insert",
10005	//   "mediaUpload": {
10006	//     "accept": [
10007	//       "*/*"
10008	//     ],
10009	//     "protocols": {
10010	//       "resumable": {
10011	//         "multipart": true,
10012	//         "path": "/resumable/upload/storage/v1/b/{bucket}/o"
10013	//       },
10014	//       "simple": {
10015	//         "multipart": true,
10016	//         "path": "/upload/storage/v1/b/{bucket}/o"
10017	//       }
10018	//     }
10019	//   },
10020	//   "parameterOrder": [
10021	//     "bucket"
10022	//   ],
10023	//   "parameters": {
10024	//     "bucket": {
10025	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
10026	//       "location": "path",
10027	//       "required": true,
10028	//       "type": "string"
10029	//     },
10030	//     "contentEncoding": {
10031	//       "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.",
10032	//       "location": "query",
10033	//       "type": "string"
10034	//     },
10035	//     "ifGenerationMatch": {
10036	//       "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.",
10037	//       "format": "int64",
10038	//       "location": "query",
10039	//       "type": "string"
10040	//     },
10041	//     "ifGenerationNotMatch": {
10042	//       "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.",
10043	//       "format": "int64",
10044	//       "location": "query",
10045	//       "type": "string"
10046	//     },
10047	//     "ifMetagenerationMatch": {
10048	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10049	//       "format": "int64",
10050	//       "location": "query",
10051	//       "type": "string"
10052	//     },
10053	//     "ifMetagenerationNotMatch": {
10054	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10055	//       "format": "int64",
10056	//       "location": "query",
10057	//       "type": "string"
10058	//     },
10059	//     "kmsKeyName": {
10060	//       "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.",
10061	//       "location": "query",
10062	//       "type": "string"
10063	//     },
10064	//     "name": {
10065	//       "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.",
10066	//       "location": "query",
10067	//       "type": "string"
10068	//     },
10069	//     "predefinedAcl": {
10070	//       "description": "Apply a predefined set of access controls to this object.",
10071	//       "enum": [
10072	//         "authenticatedRead",
10073	//         "bucketOwnerFullControl",
10074	//         "bucketOwnerRead",
10075	//         "private",
10076	//         "projectPrivate",
10077	//         "publicRead"
10078	//       ],
10079	//       "enumDescriptions": [
10080	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10081	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
10082	//         "Object owner gets OWNER access, and project team owners get READER access.",
10083	//         "Object owner gets OWNER access.",
10084	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
10085	//         "Object owner gets OWNER access, and allUsers get READER access."
10086	//       ],
10087	//       "location": "query",
10088	//       "type": "string"
10089	//     },
10090	//     "projection": {
10091	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
10092	//       "enum": [
10093	//         "full",
10094	//         "noAcl"
10095	//       ],
10096	//       "enumDescriptions": [
10097	//         "Include all properties.",
10098	//         "Omit the owner, acl property."
10099	//       ],
10100	//       "location": "query",
10101	//       "type": "string"
10102	//     },
10103	//     "provisionalUserProject": {
10104	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10105	//       "location": "query",
10106	//       "type": "string"
10107	//     },
10108	//     "userProject": {
10109	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10110	//       "location": "query",
10111	//       "type": "string"
10112	//     }
10113	//   },
10114	//   "path": "b/{bucket}/o",
10115	//   "request": {
10116	//     "$ref": "Object"
10117	//   },
10118	//   "response": {
10119	//     "$ref": "Object"
10120	//   },
10121	//   "scopes": [
10122	//     "https://www.googleapis.com/auth/cloud-platform",
10123	//     "https://www.googleapis.com/auth/devstorage.full_control",
10124	//     "https://www.googleapis.com/auth/devstorage.read_write"
10125	//   ],
10126	//   "supportsMediaUpload": true
10127	// }
10128
10129}
10130
10131// method id "storage.objects.list":
10132
10133type ObjectsListCall struct {
10134	s            *Service
10135	bucket       string
10136	urlParams_   gensupport.URLParams
10137	ifNoneMatch_ string
10138	ctx_         context.Context
10139	header_      http.Header
10140}
10141
10142// List: Retrieves a list of objects matching the criteria.
10143func (r *ObjectsService) List(bucket string) *ObjectsListCall {
10144	c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10145	c.bucket = bucket
10146	return c
10147}
10148
10149// Delimiter sets the optional parameter "delimiter": Returns results in
10150// a directory-like mode. items will contain only objects whose names,
10151// aside from the prefix, do not contain delimiter. Objects whose names,
10152// aside from the prefix, contain delimiter will have their name,
10153// truncated after the delimiter, returned in prefixes. Duplicate
10154// prefixes are omitted.
10155func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
10156	c.urlParams_.Set("delimiter", delimiter)
10157	return c
10158}
10159
10160// IncludeTrailingDelimiter sets the optional parameter
10161// "includeTrailingDelimiter": If true, objects that end in exactly one
10162// instance of delimiter will have their metadata included in items in
10163// addition to prefixes.
10164func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall {
10165	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
10166	return c
10167}
10168
10169// MaxResults sets the optional parameter "maxResults": Maximum number
10170// of items plus prefixes to return in a single page of responses. As
10171// duplicate prefixes are omitted, fewer total results may be returned
10172// than requested. The service will use this parameter or 1,000 items,
10173// whichever is smaller.
10174func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
10175	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
10176	return c
10177}
10178
10179// PageToken sets the optional parameter "pageToken": A
10180// previously-returned page token representing part of the larger set of
10181// results to view.
10182func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
10183	c.urlParams_.Set("pageToken", pageToken)
10184	return c
10185}
10186
10187// Prefix sets the optional parameter "prefix": Filter results to
10188// objects whose names begin with this prefix.
10189func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
10190	c.urlParams_.Set("prefix", prefix)
10191	return c
10192}
10193
10194// Projection sets the optional parameter "projection": Set of
10195// properties to return. Defaults to noAcl.
10196//
10197// Possible values:
10198//   "full" - Include all properties.
10199//   "noAcl" - Omit the owner, acl property.
10200func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
10201	c.urlParams_.Set("projection", projection)
10202	return c
10203}
10204
10205// ProvisionalUserProject sets the optional parameter
10206// "provisionalUserProject": The project to be billed for this request
10207// if the target bucket is requester-pays bucket.
10208func (c *ObjectsListCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsListCall {
10209	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
10210	return c
10211}
10212
10213// UserProject sets the optional parameter "userProject": The project to
10214// be billed for this request. Required for Requester Pays buckets.
10215func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
10216	c.urlParams_.Set("userProject", userProject)
10217	return c
10218}
10219
10220// Versions sets the optional parameter "versions": If true, lists all
10221// versions of an object as distinct results. The default is false. For
10222// more information, see Object Versioning.
10223func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
10224	c.urlParams_.Set("versions", fmt.Sprint(versions))
10225	return c
10226}
10227
10228// Fields allows partial responses to be retrieved. See
10229// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10230// for more information.
10231func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
10232	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10233	return c
10234}
10235
10236// IfNoneMatch sets the optional parameter which makes the operation
10237// fail if the object's ETag matches the given value. This is useful for
10238// getting updates only after the object has changed since the last
10239// request. Use googleapi.IsNotModified to check whether the response
10240// error from Do is the result of In-None-Match.
10241func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
10242	c.ifNoneMatch_ = entityTag
10243	return c
10244}
10245
10246// Context sets the context to be used in this call's Do method. Any
10247// pending HTTP request will be aborted if the provided context is
10248// canceled.
10249func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
10250	c.ctx_ = ctx
10251	return c
10252}
10253
10254// Header returns an http.Header that can be modified by the caller to
10255// add HTTP headers to the request.
10256func (c *ObjectsListCall) Header() http.Header {
10257	if c.header_ == nil {
10258		c.header_ = make(http.Header)
10259	}
10260	return c.header_
10261}
10262
10263func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
10264	reqHeaders := make(http.Header)
10265	for k, v := range c.header_ {
10266		reqHeaders[k] = v
10267	}
10268	reqHeaders.Set("User-Agent", c.s.userAgent())
10269	if c.ifNoneMatch_ != "" {
10270		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10271	}
10272	var body io.Reader = nil
10273	c.urlParams_.Set("alt", alt)
10274	c.urlParams_.Set("prettyPrint", "false")
10275	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
10276	urls += "?" + c.urlParams_.Encode()
10277	req, err := http.NewRequest("GET", urls, body)
10278	if err != nil {
10279		return nil, err
10280	}
10281	req.Header = reqHeaders
10282	googleapi.Expand(req.URL, map[string]string{
10283		"bucket": c.bucket,
10284	})
10285	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10286}
10287
10288// Do executes the "storage.objects.list" call.
10289// Exactly one of *Objects or error will be non-nil. Any non-2xx status
10290// code is an error. Response headers are in either
10291// *Objects.ServerResponse.Header or (if a response was returned at all)
10292// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10293// check whether the returned error was because http.StatusNotModified
10294// was returned.
10295func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
10296	gensupport.SetOptions(c.urlParams_, opts...)
10297	res, err := c.doRequest("json")
10298	if res != nil && res.StatusCode == http.StatusNotModified {
10299		if res.Body != nil {
10300			res.Body.Close()
10301		}
10302		return nil, &googleapi.Error{
10303			Code:   res.StatusCode,
10304			Header: res.Header,
10305		}
10306	}
10307	if err != nil {
10308		return nil, err
10309	}
10310	defer googleapi.CloseBody(res)
10311	if err := googleapi.CheckResponse(res); err != nil {
10312		return nil, err
10313	}
10314	ret := &Objects{
10315		ServerResponse: googleapi.ServerResponse{
10316			Header:         res.Header,
10317			HTTPStatusCode: res.StatusCode,
10318		},
10319	}
10320	target := &ret
10321	if err := gensupport.DecodeResponse(target, res); err != nil {
10322		return nil, err
10323	}
10324	return ret, nil
10325	// {
10326	//   "description": "Retrieves a list of objects matching the criteria.",
10327	//   "httpMethod": "GET",
10328	//   "id": "storage.objects.list",
10329	//   "parameterOrder": [
10330	//     "bucket"
10331	//   ],
10332	//   "parameters": {
10333	//     "bucket": {
10334	//       "description": "Name of the bucket in which to look for objects.",
10335	//       "location": "path",
10336	//       "required": true,
10337	//       "type": "string"
10338	//     },
10339	//     "delimiter": {
10340	//       "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.",
10341	//       "location": "query",
10342	//       "type": "string"
10343	//     },
10344	//     "includeTrailingDelimiter": {
10345	//       "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
10346	//       "location": "query",
10347	//       "type": "boolean"
10348	//     },
10349	//     "maxResults": {
10350	//       "default": "1000",
10351	//       "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.",
10352	//       "format": "uint32",
10353	//       "location": "query",
10354	//       "minimum": "0",
10355	//       "type": "integer"
10356	//     },
10357	//     "pageToken": {
10358	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
10359	//       "location": "query",
10360	//       "type": "string"
10361	//     },
10362	//     "prefix": {
10363	//       "description": "Filter results to objects whose names begin with this prefix.",
10364	//       "location": "query",
10365	//       "type": "string"
10366	//     },
10367	//     "projection": {
10368	//       "description": "Set of properties to return. Defaults to noAcl.",
10369	//       "enum": [
10370	//         "full",
10371	//         "noAcl"
10372	//       ],
10373	//       "enumDescriptions": [
10374	//         "Include all properties.",
10375	//         "Omit the owner, acl property."
10376	//       ],
10377	//       "location": "query",
10378	//       "type": "string"
10379	//     },
10380	//     "provisionalUserProject": {
10381	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10382	//       "location": "query",
10383	//       "type": "string"
10384	//     },
10385	//     "userProject": {
10386	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10387	//       "location": "query",
10388	//       "type": "string"
10389	//     },
10390	//     "versions": {
10391	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
10392	//       "location": "query",
10393	//       "type": "boolean"
10394	//     }
10395	//   },
10396	//   "path": "b/{bucket}/o",
10397	//   "response": {
10398	//     "$ref": "Objects"
10399	//   },
10400	//   "scopes": [
10401	//     "https://www.googleapis.com/auth/cloud-platform",
10402	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10403	//     "https://www.googleapis.com/auth/devstorage.full_control",
10404	//     "https://www.googleapis.com/auth/devstorage.read_only",
10405	//     "https://www.googleapis.com/auth/devstorage.read_write"
10406	//   ],
10407	//   "supportsSubscription": true
10408	// }
10409
10410}
10411
10412// Pages invokes f for each page of results.
10413// A non-nil error returned from f will halt the iteration.
10414// The provided context supersedes any context provided to the Context method.
10415func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
10416	c.ctx_ = ctx
10417	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
10418	for {
10419		x, err := c.Do()
10420		if err != nil {
10421			return err
10422		}
10423		if err := f(x); err != nil {
10424			return err
10425		}
10426		if x.NextPageToken == "" {
10427			return nil
10428		}
10429		c.PageToken(x.NextPageToken)
10430	}
10431}
10432
10433// method id "storage.objects.patch":
10434
10435type ObjectsPatchCall struct {
10436	s          *Service
10437	bucket     string
10438	object     string
10439	object2    *Object
10440	urlParams_ gensupport.URLParams
10441	ctx_       context.Context
10442	header_    http.Header
10443}
10444
10445// Patch: Patches an object's metadata.
10446func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
10447	c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10448	c.bucket = bucket
10449	c.object = object
10450	c.object2 = object2
10451	return c
10452}
10453
10454// Generation sets the optional parameter "generation": If present,
10455// selects a specific revision of this object (as opposed to the latest
10456// version, the default).
10457func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
10458	c.urlParams_.Set("generation", fmt.Sprint(generation))
10459	return c
10460}
10461
10462// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10463// Makes the operation conditional on whether the object's current
10464// generation matches the given value. Setting to 0 makes the operation
10465// succeed only if there are no live versions of the object.
10466func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
10467	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10468	return c
10469}
10470
10471// IfGenerationNotMatch sets the optional parameter
10472// "ifGenerationNotMatch": Makes the operation conditional on whether
10473// the object's current generation does not match the given value. If no
10474// live object exists, the precondition fails. Setting to 0 makes the
10475// operation succeed only if there is a live version of the object.
10476func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
10477	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10478	return c
10479}
10480
10481// IfMetagenerationMatch sets the optional parameter
10482// "ifMetagenerationMatch": Makes the operation conditional on whether
10483// the object's current metageneration matches the given value.
10484func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall {
10485	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10486	return c
10487}
10488
10489// IfMetagenerationNotMatch sets the optional parameter
10490// "ifMetagenerationNotMatch": Makes the operation conditional on
10491// whether the object's current metageneration does not match the given
10492// value.
10493func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
10494	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10495	return c
10496}
10497
10498// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
10499// predefined set of access controls to this object.
10500//
10501// Possible values:
10502//   "authenticatedRead" - Object owner gets OWNER access, and
10503// allAuthenticatedUsers get READER access.
10504//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
10505// project team owners get OWNER access.
10506//   "bucketOwnerRead" - Object owner gets OWNER access, and project
10507// team owners get READER access.
10508//   "private" - Object owner gets OWNER access.
10509//   "projectPrivate" - Object owner gets OWNER access, and project team
10510// members get access according to their roles.
10511//   "publicRead" - Object owner gets OWNER access, and allUsers get
10512// READER access.
10513func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
10514	c.urlParams_.Set("predefinedAcl", predefinedAcl)
10515	return c
10516}
10517
10518// Projection sets the optional parameter "projection": Set of
10519// properties to return. Defaults to full.
10520//
10521// Possible values:
10522//   "full" - Include all properties.
10523//   "noAcl" - Omit the owner, acl property.
10524func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
10525	c.urlParams_.Set("projection", projection)
10526	return c
10527}
10528
10529// ProvisionalUserProject sets the optional parameter
10530// "provisionalUserProject": The project to be billed for this request
10531// if the target bucket is requester-pays bucket.
10532func (c *ObjectsPatchCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsPatchCall {
10533	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
10534	return c
10535}
10536
10537// UserProject sets the optional parameter "userProject": The project to
10538// be billed for this request, for Requester Pays buckets.
10539func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
10540	c.urlParams_.Set("userProject", userProject)
10541	return c
10542}
10543
10544// Fields allows partial responses to be retrieved. See
10545// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10546// for more information.
10547func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
10548	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10549	return c
10550}
10551
10552// Context sets the context to be used in this call's Do method. Any
10553// pending HTTP request will be aborted if the provided context is
10554// canceled.
10555func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
10556	c.ctx_ = ctx
10557	return c
10558}
10559
10560// Header returns an http.Header that can be modified by the caller to
10561// add HTTP headers to the request.
10562func (c *ObjectsPatchCall) Header() http.Header {
10563	if c.header_ == nil {
10564		c.header_ = make(http.Header)
10565	}
10566	return c.header_
10567}
10568
10569func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
10570	reqHeaders := make(http.Header)
10571	for k, v := range c.header_ {
10572		reqHeaders[k] = v
10573	}
10574	reqHeaders.Set("User-Agent", c.s.userAgent())
10575	var body io.Reader = nil
10576	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
10577	if err != nil {
10578		return nil, err
10579	}
10580	reqHeaders.Set("Content-Type", "application/json")
10581	c.urlParams_.Set("alt", alt)
10582	c.urlParams_.Set("prettyPrint", "false")
10583	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
10584	urls += "?" + c.urlParams_.Encode()
10585	req, err := http.NewRequest("PATCH", urls, body)
10586	if err != nil {
10587		return nil, err
10588	}
10589	req.Header = reqHeaders
10590	googleapi.Expand(req.URL, map[string]string{
10591		"bucket": c.bucket,
10592		"object": c.object,
10593	})
10594	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10595}
10596
10597// Do executes the "storage.objects.patch" call.
10598// Exactly one of *Object or error will be non-nil. Any non-2xx status
10599// code is an error. Response headers are in either
10600// *Object.ServerResponse.Header or (if a response was returned at all)
10601// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10602// check whether the returned error was because http.StatusNotModified
10603// was returned.
10604func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
10605	gensupport.SetOptions(c.urlParams_, opts...)
10606	res, err := c.doRequest("json")
10607	if res != nil && res.StatusCode == http.StatusNotModified {
10608		if res.Body != nil {
10609			res.Body.Close()
10610		}
10611		return nil, &googleapi.Error{
10612			Code:   res.StatusCode,
10613			Header: res.Header,
10614		}
10615	}
10616	if err != nil {
10617		return nil, err
10618	}
10619	defer googleapi.CloseBody(res)
10620	if err := googleapi.CheckResponse(res); err != nil {
10621		return nil, err
10622	}
10623	ret := &Object{
10624		ServerResponse: googleapi.ServerResponse{
10625			Header:         res.Header,
10626			HTTPStatusCode: res.StatusCode,
10627		},
10628	}
10629	target := &ret
10630	if err := gensupport.DecodeResponse(target, res); err != nil {
10631		return nil, err
10632	}
10633	return ret, nil
10634	// {
10635	//   "description": "Patches an object's metadata.",
10636	//   "httpMethod": "PATCH",
10637	//   "id": "storage.objects.patch",
10638	//   "parameterOrder": [
10639	//     "bucket",
10640	//     "object"
10641	//   ],
10642	//   "parameters": {
10643	//     "bucket": {
10644	//       "description": "Name of the bucket in which the object resides.",
10645	//       "location": "path",
10646	//       "required": true,
10647	//       "type": "string"
10648	//     },
10649	//     "generation": {
10650	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10651	//       "format": "int64",
10652	//       "location": "query",
10653	//       "type": "string"
10654	//     },
10655	//     "ifGenerationMatch": {
10656	//       "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.",
10657	//       "format": "int64",
10658	//       "location": "query",
10659	//       "type": "string"
10660	//     },
10661	//     "ifGenerationNotMatch": {
10662	//       "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.",
10663	//       "format": "int64",
10664	//       "location": "query",
10665	//       "type": "string"
10666	//     },
10667	//     "ifMetagenerationMatch": {
10668	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10669	//       "format": "int64",
10670	//       "location": "query",
10671	//       "type": "string"
10672	//     },
10673	//     "ifMetagenerationNotMatch": {
10674	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10675	//       "format": "int64",
10676	//       "location": "query",
10677	//       "type": "string"
10678	//     },
10679	//     "object": {
10680	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10681	//       "location": "path",
10682	//       "required": true,
10683	//       "type": "string"
10684	//     },
10685	//     "predefinedAcl": {
10686	//       "description": "Apply a predefined set of access controls to this object.",
10687	//       "enum": [
10688	//         "authenticatedRead",
10689	//         "bucketOwnerFullControl",
10690	//         "bucketOwnerRead",
10691	//         "private",
10692	//         "projectPrivate",
10693	//         "publicRead"
10694	//       ],
10695	//       "enumDescriptions": [
10696	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10697	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
10698	//         "Object owner gets OWNER access, and project team owners get READER access.",
10699	//         "Object owner gets OWNER access.",
10700	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
10701	//         "Object owner gets OWNER access, and allUsers get READER access."
10702	//       ],
10703	//       "location": "query",
10704	//       "type": "string"
10705	//     },
10706	//     "projection": {
10707	//       "description": "Set of properties to return. Defaults to full.",
10708	//       "enum": [
10709	//         "full",
10710	//         "noAcl"
10711	//       ],
10712	//       "enumDescriptions": [
10713	//         "Include all properties.",
10714	//         "Omit the owner, acl property."
10715	//       ],
10716	//       "location": "query",
10717	//       "type": "string"
10718	//     },
10719	//     "provisionalUserProject": {
10720	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
10721	//       "location": "query",
10722	//       "type": "string"
10723	//     },
10724	//     "userProject": {
10725	//       "description": "The project to be billed for this request, for Requester Pays buckets.",
10726	//       "location": "query",
10727	//       "type": "string"
10728	//     }
10729	//   },
10730	//   "path": "b/{bucket}/o/{object}",
10731	//   "request": {
10732	//     "$ref": "Object"
10733	//   },
10734	//   "response": {
10735	//     "$ref": "Object"
10736	//   },
10737	//   "scopes": [
10738	//     "https://www.googleapis.com/auth/cloud-platform",
10739	//     "https://www.googleapis.com/auth/devstorage.full_control"
10740	//   ]
10741	// }
10742
10743}
10744
10745// method id "storage.objects.rewrite":
10746
10747type ObjectsRewriteCall struct {
10748	s                 *Service
10749	sourceBucket      string
10750	sourceObject      string
10751	destinationBucket string
10752	destinationObject string
10753	object            *Object
10754	urlParams_        gensupport.URLParams
10755	ctx_              context.Context
10756	header_           http.Header
10757}
10758
10759// Rewrite: Rewrites a source object to a destination object. Optionally
10760// overrides metadata.
10761func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall {
10762	c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10763	c.sourceBucket = sourceBucket
10764	c.sourceObject = sourceObject
10765	c.destinationBucket = destinationBucket
10766	c.destinationObject = destinationObject
10767	c.object = object
10768	return c
10769}
10770
10771// DestinationKmsKeyName sets the optional parameter
10772// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the
10773// form
10774// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
10775//  that will be used to encrypt the object. Overrides the object
10776// metadata's kms_key_name value, if any.
10777func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall {
10778	c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
10779	return c
10780}
10781
10782// DestinationPredefinedAcl sets the optional parameter
10783// "destinationPredefinedAcl": Apply a predefined set of access controls
10784// to the destination object.
10785//
10786// Possible values:
10787//   "authenticatedRead" - Object owner gets OWNER access, and
10788// allAuthenticatedUsers get READER access.
10789//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
10790// project team owners get OWNER access.
10791//   "bucketOwnerRead" - Object owner gets OWNER access, and project
10792// team owners get READER access.
10793//   "private" - Object owner gets OWNER access.
10794//   "projectPrivate" - Object owner gets OWNER access, and project team
10795// members get access according to their roles.
10796//   "publicRead" - Object owner gets OWNER access, and allUsers get
10797// READER access.
10798func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
10799	c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
10800	return c
10801}
10802
10803// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10804// Makes the operation conditional on whether the object's current
10805// generation matches the given value. Setting to 0 makes the operation
10806// succeed only if there are no live versions of the object.
10807func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
10808	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10809	return c
10810}
10811
10812// IfGenerationNotMatch sets the optional parameter
10813// "ifGenerationNotMatch": Makes the operation conditional on whether
10814// the object's current generation does not match the given value. If no
10815// live object exists, the precondition fails. Setting to 0 makes the
10816// operation succeed only if there is a live version of the object.
10817func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
10818	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10819	return c
10820}
10821
10822// IfMetagenerationMatch sets the optional parameter
10823// "ifMetagenerationMatch": Makes the operation conditional on whether
10824// the destination object's current metageneration matches the given
10825// value.
10826func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
10827	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10828	return c
10829}
10830
10831// IfMetagenerationNotMatch sets the optional parameter
10832// "ifMetagenerationNotMatch": Makes the operation conditional on
10833// whether the destination object's current metageneration does not
10834// match the given value.
10835func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall {
10836	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10837	return c
10838}
10839
10840// IfSourceGenerationMatch sets the optional parameter
10841// "ifSourceGenerationMatch": Makes the operation conditional on whether
10842// the source object's current generation matches the given value.
10843func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
10844	c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
10845	return c
10846}
10847
10848// IfSourceGenerationNotMatch sets the optional parameter
10849// "ifSourceGenerationNotMatch": Makes the operation conditional on
10850// whether the source object's current generation does not match the
10851// given value.
10852func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
10853	c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
10854	return c
10855}
10856
10857// IfSourceMetagenerationMatch sets the optional parameter
10858// "ifSourceMetagenerationMatch": Makes the operation conditional on
10859// whether the source object's current metageneration matches the given
10860// value.
10861func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
10862	c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
10863	return c
10864}
10865
10866// IfSourceMetagenerationNotMatch sets the optional parameter
10867// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
10868// whether the source object's current metageneration does not match the
10869// given value.
10870func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
10871	c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
10872	return c
10873}
10874
10875// MaxBytesRewrittenPerCall sets the optional parameter
10876// "maxBytesRewrittenPerCall": The maximum number of bytes that will be
10877// rewritten per rewrite request. Most callers shouldn't need to specify
10878// this parameter - it is primarily in place to support testing. If
10879// specified the value must be an integral multiple of 1 MiB (1048576).
10880// Also, this only applies to requests where the source and destination
10881// span locations and/or storage classes. Finally, this value must not
10882// change across rewrite calls else you'll get an error that the
10883// rewriteToken is invalid.
10884func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall {
10885	c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall))
10886	return c
10887}
10888
10889// Projection sets the optional parameter "projection": Set of
10890// properties to return. Defaults to noAcl, unless the object resource
10891// specifies the acl property, when it defaults to full.
10892//
10893// Possible values:
10894//   "full" - Include all properties.
10895//   "noAcl" - Omit the owner, acl property.
10896func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall {
10897	c.urlParams_.Set("projection", projection)
10898	return c
10899}
10900
10901// ProvisionalUserProject sets the optional parameter
10902// "provisionalUserProject": The project to be billed for this request
10903// if the target bucket is requester-pays bucket.
10904func (c *ObjectsRewriteCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsRewriteCall {
10905	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
10906	return c
10907}
10908
10909// RewriteToken sets the optional parameter "rewriteToken": Include this
10910// field (from the previous rewrite response) on each rewrite request
10911// after the first one, until the rewrite response 'done' flag is true.
10912// Calls that provide a rewriteToken can omit all other request fields,
10913// but if included those fields must match the values provided in the
10914// first rewrite request.
10915func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall {
10916	c.urlParams_.Set("rewriteToken", rewriteToken)
10917	return c
10918}
10919
10920// SourceGeneration sets the optional parameter "sourceGeneration": If
10921// present, selects a specific revision of the source object (as opposed
10922// to the latest version, the default).
10923func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall {
10924	c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
10925	return c
10926}
10927
10928// UserProject sets the optional parameter "userProject": The project to
10929// be billed for this request. Required for Requester Pays buckets.
10930func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
10931	c.urlParams_.Set("userProject", userProject)
10932	return c
10933}
10934
10935// Fields allows partial responses to be retrieved. See
10936// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10937// for more information.
10938func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall {
10939	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10940	return c
10941}
10942
10943// Context sets the context to be used in this call's Do method. Any
10944// pending HTTP request will be aborted if the provided context is
10945// canceled.
10946func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
10947	c.ctx_ = ctx
10948	return c
10949}
10950
10951// Header returns an http.Header that can be modified by the caller to
10952// add HTTP headers to the request.
10953func (c *ObjectsRewriteCall) Header() http.Header {
10954	if c.header_ == nil {
10955		c.header_ = make(http.Header)
10956	}
10957	return c.header_
10958}
10959
10960func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
10961	reqHeaders := make(http.Header)
10962	for k, v := range c.header_ {
10963		reqHeaders[k] = v
10964	}
10965	reqHeaders.Set("User-Agent", c.s.userAgent())
10966	var body io.Reader = nil
10967	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
10968	if err != nil {
10969		return nil, err
10970	}
10971	reqHeaders.Set("Content-Type", "application/json")
10972	c.urlParams_.Set("alt", alt)
10973	c.urlParams_.Set("prettyPrint", "false")
10974	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}")
10975	urls += "?" + c.urlParams_.Encode()
10976	req, err := http.NewRequest("POST", urls, body)
10977	if err != nil {
10978		return nil, err
10979	}
10980	req.Header = reqHeaders
10981	googleapi.Expand(req.URL, map[string]string{
10982		"sourceBucket":      c.sourceBucket,
10983		"sourceObject":      c.sourceObject,
10984		"destinationBucket": c.destinationBucket,
10985		"destinationObject": c.destinationObject,
10986	})
10987	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10988}
10989
10990// Do executes the "storage.objects.rewrite" call.
10991// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx
10992// status code is an error. Response headers are in either
10993// *RewriteResponse.ServerResponse.Header or (if a response was returned
10994// at all) in error.(*googleapi.Error).Header. Use
10995// googleapi.IsNotModified to check whether the returned error was
10996// because http.StatusNotModified was returned.
10997func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) {
10998	gensupport.SetOptions(c.urlParams_, opts...)
10999	res, err := c.doRequest("json")
11000	if res != nil && res.StatusCode == http.StatusNotModified {
11001		if res.Body != nil {
11002			res.Body.Close()
11003		}
11004		return nil, &googleapi.Error{
11005			Code:   res.StatusCode,
11006			Header: res.Header,
11007		}
11008	}
11009	if err != nil {
11010		return nil, err
11011	}
11012	defer googleapi.CloseBody(res)
11013	if err := googleapi.CheckResponse(res); err != nil {
11014		return nil, err
11015	}
11016	ret := &RewriteResponse{
11017		ServerResponse: googleapi.ServerResponse{
11018			Header:         res.Header,
11019			HTTPStatusCode: res.StatusCode,
11020		},
11021	}
11022	target := &ret
11023	if err := gensupport.DecodeResponse(target, res); err != nil {
11024		return nil, err
11025	}
11026	return ret, nil
11027	// {
11028	//   "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
11029	//   "httpMethod": "POST",
11030	//   "id": "storage.objects.rewrite",
11031	//   "parameterOrder": [
11032	//     "sourceBucket",
11033	//     "sourceObject",
11034	//     "destinationBucket",
11035	//     "destinationObject"
11036	//   ],
11037	//   "parameters": {
11038	//     "destinationBucket": {
11039	//       "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
11040	//       "location": "path",
11041	//       "required": true,
11042	//       "type": "string"
11043	//     },
11044	//     "destinationKmsKeyName": {
11045	//       "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.",
11046	//       "location": "query",
11047	//       "type": "string"
11048	//     },
11049	//     "destinationObject": {
11050	//       "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.",
11051	//       "location": "path",
11052	//       "required": true,
11053	//       "type": "string"
11054	//     },
11055	//     "destinationPredefinedAcl": {
11056	//       "description": "Apply a predefined set of access controls to the destination object.",
11057	//       "enum": [
11058	//         "authenticatedRead",
11059	//         "bucketOwnerFullControl",
11060	//         "bucketOwnerRead",
11061	//         "private",
11062	//         "projectPrivate",
11063	//         "publicRead"
11064	//       ],
11065	//       "enumDescriptions": [
11066	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
11067	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
11068	//         "Object owner gets OWNER access, and project team owners get READER access.",
11069	//         "Object owner gets OWNER access.",
11070	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
11071	//         "Object owner gets OWNER access, and allUsers get READER access."
11072	//       ],
11073	//       "location": "query",
11074	//       "type": "string"
11075	//     },
11076	//     "ifGenerationMatch": {
11077	//       "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.",
11078	//       "format": "int64",
11079	//       "location": "query",
11080	//       "type": "string"
11081	//     },
11082	//     "ifGenerationNotMatch": {
11083	//       "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.",
11084	//       "format": "int64",
11085	//       "location": "query",
11086	//       "type": "string"
11087	//     },
11088	//     "ifMetagenerationMatch": {
11089	//       "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
11090	//       "format": "int64",
11091	//       "location": "query",
11092	//       "type": "string"
11093	//     },
11094	//     "ifMetagenerationNotMatch": {
11095	//       "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
11096	//       "format": "int64",
11097	//       "location": "query",
11098	//       "type": "string"
11099	//     },
11100	//     "ifSourceGenerationMatch": {
11101	//       "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
11102	//       "format": "int64",
11103	//       "location": "query",
11104	//       "type": "string"
11105	//     },
11106	//     "ifSourceGenerationNotMatch": {
11107	//       "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
11108	//       "format": "int64",
11109	//       "location": "query",
11110	//       "type": "string"
11111	//     },
11112	//     "ifSourceMetagenerationMatch": {
11113	//       "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
11114	//       "format": "int64",
11115	//       "location": "query",
11116	//       "type": "string"
11117	//     },
11118	//     "ifSourceMetagenerationNotMatch": {
11119	//       "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
11120	//       "format": "int64",
11121	//       "location": "query",
11122	//       "type": "string"
11123	//     },
11124	//     "maxBytesRewrittenPerCall": {
11125	//       "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.",
11126	//       "format": "int64",
11127	//       "location": "query",
11128	//       "type": "string"
11129	//     },
11130	//     "projection": {
11131	//       "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
11132	//       "enum": [
11133	//         "full",
11134	//         "noAcl"
11135	//       ],
11136	//       "enumDescriptions": [
11137	//         "Include all properties.",
11138	//         "Omit the owner, acl property."
11139	//       ],
11140	//       "location": "query",
11141	//       "type": "string"
11142	//     },
11143	//     "provisionalUserProject": {
11144	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11145	//       "location": "query",
11146	//       "type": "string"
11147	//     },
11148	//     "rewriteToken": {
11149	//       "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.",
11150	//       "location": "query",
11151	//       "type": "string"
11152	//     },
11153	//     "sourceBucket": {
11154	//       "description": "Name of the bucket in which to find the source object.",
11155	//       "location": "path",
11156	//       "required": true,
11157	//       "type": "string"
11158	//     },
11159	//     "sourceGeneration": {
11160	//       "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
11161	//       "format": "int64",
11162	//       "location": "query",
11163	//       "type": "string"
11164	//     },
11165	//     "sourceObject": {
11166	//       "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11167	//       "location": "path",
11168	//       "required": true,
11169	//       "type": "string"
11170	//     },
11171	//     "userProject": {
11172	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11173	//       "location": "query",
11174	//       "type": "string"
11175	//     }
11176	//   },
11177	//   "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
11178	//   "request": {
11179	//     "$ref": "Object"
11180	//   },
11181	//   "response": {
11182	//     "$ref": "RewriteResponse"
11183	//   },
11184	//   "scopes": [
11185	//     "https://www.googleapis.com/auth/cloud-platform",
11186	//     "https://www.googleapis.com/auth/devstorage.full_control",
11187	//     "https://www.googleapis.com/auth/devstorage.read_write"
11188	//   ]
11189	// }
11190
11191}
11192
11193// method id "storage.objects.setIamPolicy":
11194
11195type ObjectsSetIamPolicyCall struct {
11196	s          *Service
11197	bucket     string
11198	object     string
11199	policy     *Policy
11200	urlParams_ gensupport.URLParams
11201	ctx_       context.Context
11202	header_    http.Header
11203}
11204
11205// SetIamPolicy: Updates an IAM policy for the specified object.
11206func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall {
11207	c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11208	c.bucket = bucket
11209	c.object = object
11210	c.policy = policy
11211	return c
11212}
11213
11214// Generation sets the optional parameter "generation": If present,
11215// selects a specific revision of this object (as opposed to the latest
11216// version, the default).
11217func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall {
11218	c.urlParams_.Set("generation", fmt.Sprint(generation))
11219	return c
11220}
11221
11222// ProvisionalUserProject sets the optional parameter
11223// "provisionalUserProject": The project to be billed for this request
11224// if the target bucket is requester-pays bucket.
11225func (c *ObjectsSetIamPolicyCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsSetIamPolicyCall {
11226	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11227	return c
11228}
11229
11230// UserProject sets the optional parameter "userProject": The project to
11231// be billed for this request. Required for Requester Pays buckets.
11232func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
11233	c.urlParams_.Set("userProject", userProject)
11234	return c
11235}
11236
11237// Fields allows partial responses to be retrieved. See
11238// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11239// for more information.
11240func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall {
11241	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11242	return c
11243}
11244
11245// Context sets the context to be used in this call's Do method. Any
11246// pending HTTP request will be aborted if the provided context is
11247// canceled.
11248func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
11249	c.ctx_ = ctx
11250	return c
11251}
11252
11253// Header returns an http.Header that can be modified by the caller to
11254// add HTTP headers to the request.
11255func (c *ObjectsSetIamPolicyCall) Header() http.Header {
11256	if c.header_ == nil {
11257		c.header_ = make(http.Header)
11258	}
11259	return c.header_
11260}
11261
11262func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11263	reqHeaders := make(http.Header)
11264	for k, v := range c.header_ {
11265		reqHeaders[k] = v
11266	}
11267	reqHeaders.Set("User-Agent", c.s.userAgent())
11268	var body io.Reader = nil
11269	body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
11270	if err != nil {
11271		return nil, err
11272	}
11273	reqHeaders.Set("Content-Type", "application/json")
11274	c.urlParams_.Set("alt", alt)
11275	c.urlParams_.Set("prettyPrint", "false")
11276	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
11277	urls += "?" + c.urlParams_.Encode()
11278	req, err := http.NewRequest("PUT", urls, body)
11279	if err != nil {
11280		return nil, err
11281	}
11282	req.Header = reqHeaders
11283	googleapi.Expand(req.URL, map[string]string{
11284		"bucket": c.bucket,
11285		"object": c.object,
11286	})
11287	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11288}
11289
11290// Do executes the "storage.objects.setIamPolicy" call.
11291// Exactly one of *Policy or error will be non-nil. Any non-2xx status
11292// code is an error. Response headers are in either
11293// *Policy.ServerResponse.Header or (if a response was returned at all)
11294// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11295// check whether the returned error was because http.StatusNotModified
11296// was returned.
11297func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11298	gensupport.SetOptions(c.urlParams_, opts...)
11299	res, err := c.doRequest("json")
11300	if res != nil && res.StatusCode == http.StatusNotModified {
11301		if res.Body != nil {
11302			res.Body.Close()
11303		}
11304		return nil, &googleapi.Error{
11305			Code:   res.StatusCode,
11306			Header: res.Header,
11307		}
11308	}
11309	if err != nil {
11310		return nil, err
11311	}
11312	defer googleapi.CloseBody(res)
11313	if err := googleapi.CheckResponse(res); err != nil {
11314		return nil, err
11315	}
11316	ret := &Policy{
11317		ServerResponse: googleapi.ServerResponse{
11318			Header:         res.Header,
11319			HTTPStatusCode: res.StatusCode,
11320		},
11321	}
11322	target := &ret
11323	if err := gensupport.DecodeResponse(target, res); err != nil {
11324		return nil, err
11325	}
11326	return ret, nil
11327	// {
11328	//   "description": "Updates an IAM policy for the specified object.",
11329	//   "httpMethod": "PUT",
11330	//   "id": "storage.objects.setIamPolicy",
11331	//   "parameterOrder": [
11332	//     "bucket",
11333	//     "object"
11334	//   ],
11335	//   "parameters": {
11336	//     "bucket": {
11337	//       "description": "Name of the bucket in which the object resides.",
11338	//       "location": "path",
11339	//       "required": true,
11340	//       "type": "string"
11341	//     },
11342	//     "generation": {
11343	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11344	//       "format": "int64",
11345	//       "location": "query",
11346	//       "type": "string"
11347	//     },
11348	//     "object": {
11349	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11350	//       "location": "path",
11351	//       "required": true,
11352	//       "type": "string"
11353	//     },
11354	//     "provisionalUserProject": {
11355	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11356	//       "location": "query",
11357	//       "type": "string"
11358	//     },
11359	//     "userProject": {
11360	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11361	//       "location": "query",
11362	//       "type": "string"
11363	//     }
11364	//   },
11365	//   "path": "b/{bucket}/o/{object}/iam",
11366	//   "request": {
11367	//     "$ref": "Policy"
11368	//   },
11369	//   "response": {
11370	//     "$ref": "Policy"
11371	//   },
11372	//   "scopes": [
11373	//     "https://www.googleapis.com/auth/cloud-platform",
11374	//     "https://www.googleapis.com/auth/devstorage.full_control",
11375	//     "https://www.googleapis.com/auth/devstorage.read_write"
11376	//   ]
11377	// }
11378
11379}
11380
11381// method id "storage.objects.testIamPermissions":
11382
11383type ObjectsTestIamPermissionsCall struct {
11384	s            *Service
11385	bucket       string
11386	object       string
11387	urlParams_   gensupport.URLParams
11388	ifNoneMatch_ string
11389	ctx_         context.Context
11390	header_      http.Header
11391}
11392
11393// TestIamPermissions: Tests a set of permissions on the given object to
11394// see which, if any, are held by the caller.
11395func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall {
11396	c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11397	c.bucket = bucket
11398	c.object = object
11399	c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
11400	return c
11401}
11402
11403// Generation sets the optional parameter "generation": If present,
11404// selects a specific revision of this object (as opposed to the latest
11405// version, the default).
11406func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall {
11407	c.urlParams_.Set("generation", fmt.Sprint(generation))
11408	return c
11409}
11410
11411// ProvisionalUserProject sets the optional parameter
11412// "provisionalUserProject": The project to be billed for this request
11413// if the target bucket is requester-pays bucket.
11414func (c *ObjectsTestIamPermissionsCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsTestIamPermissionsCall {
11415	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11416	return c
11417}
11418
11419// UserProject sets the optional parameter "userProject": The project to
11420// be billed for this request. Required for Requester Pays buckets.
11421func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
11422	c.urlParams_.Set("userProject", userProject)
11423	return c
11424}
11425
11426// Fields allows partial responses to be retrieved. See
11427// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11428// for more information.
11429func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall {
11430	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11431	return c
11432}
11433
11434// IfNoneMatch sets the optional parameter which makes the operation
11435// fail if the object's ETag matches the given value. This is useful for
11436// getting updates only after the object has changed since the last
11437// request. Use googleapi.IsNotModified to check whether the response
11438// error from Do is the result of In-None-Match.
11439func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall {
11440	c.ifNoneMatch_ = entityTag
11441	return c
11442}
11443
11444// Context sets the context to be used in this call's Do method. Any
11445// pending HTTP request will be aborted if the provided context is
11446// canceled.
11447func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
11448	c.ctx_ = ctx
11449	return c
11450}
11451
11452// Header returns an http.Header that can be modified by the caller to
11453// add HTTP headers to the request.
11454func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
11455	if c.header_ == nil {
11456		c.header_ = make(http.Header)
11457	}
11458	return c.header_
11459}
11460
11461func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
11462	reqHeaders := make(http.Header)
11463	for k, v := range c.header_ {
11464		reqHeaders[k] = v
11465	}
11466	reqHeaders.Set("User-Agent", c.s.userAgent())
11467	if c.ifNoneMatch_ != "" {
11468		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11469	}
11470	var body io.Reader = nil
11471	c.urlParams_.Set("alt", alt)
11472	c.urlParams_.Set("prettyPrint", "false")
11473	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions")
11474	urls += "?" + c.urlParams_.Encode()
11475	req, err := http.NewRequest("GET", urls, body)
11476	if err != nil {
11477		return nil, err
11478	}
11479	req.Header = reqHeaders
11480	googleapi.Expand(req.URL, map[string]string{
11481		"bucket": c.bucket,
11482		"object": c.object,
11483	})
11484	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11485}
11486
11487// Do executes the "storage.objects.testIamPermissions" call.
11488// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
11489// Any non-2xx status code is an error. Response headers are in either
11490// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
11491// was returned at all) in error.(*googleapi.Error).Header. Use
11492// googleapi.IsNotModified to check whether the returned error was
11493// because http.StatusNotModified was returned.
11494func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
11495	gensupport.SetOptions(c.urlParams_, opts...)
11496	res, err := c.doRequest("json")
11497	if res != nil && res.StatusCode == http.StatusNotModified {
11498		if res.Body != nil {
11499			res.Body.Close()
11500		}
11501		return nil, &googleapi.Error{
11502			Code:   res.StatusCode,
11503			Header: res.Header,
11504		}
11505	}
11506	if err != nil {
11507		return nil, err
11508	}
11509	defer googleapi.CloseBody(res)
11510	if err := googleapi.CheckResponse(res); err != nil {
11511		return nil, err
11512	}
11513	ret := &TestIamPermissionsResponse{
11514		ServerResponse: googleapi.ServerResponse{
11515			Header:         res.Header,
11516			HTTPStatusCode: res.StatusCode,
11517		},
11518	}
11519	target := &ret
11520	if err := gensupport.DecodeResponse(target, res); err != nil {
11521		return nil, err
11522	}
11523	return ret, nil
11524	// {
11525	//   "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
11526	//   "httpMethod": "GET",
11527	//   "id": "storage.objects.testIamPermissions",
11528	//   "parameterOrder": [
11529	//     "bucket",
11530	//     "object",
11531	//     "permissions"
11532	//   ],
11533	//   "parameters": {
11534	//     "bucket": {
11535	//       "description": "Name of the bucket in which the object resides.",
11536	//       "location": "path",
11537	//       "required": true,
11538	//       "type": "string"
11539	//     },
11540	//     "generation": {
11541	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11542	//       "format": "int64",
11543	//       "location": "query",
11544	//       "type": "string"
11545	//     },
11546	//     "object": {
11547	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11548	//       "location": "path",
11549	//       "required": true,
11550	//       "type": "string"
11551	//     },
11552	//     "permissions": {
11553	//       "description": "Permissions to test.",
11554	//       "location": "query",
11555	//       "repeated": true,
11556	//       "required": true,
11557	//       "type": "string"
11558	//     },
11559	//     "provisionalUserProject": {
11560	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11561	//       "location": "query",
11562	//       "type": "string"
11563	//     },
11564	//     "userProject": {
11565	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11566	//       "location": "query",
11567	//       "type": "string"
11568	//     }
11569	//   },
11570	//   "path": "b/{bucket}/o/{object}/iam/testPermissions",
11571	//   "response": {
11572	//     "$ref": "TestIamPermissionsResponse"
11573	//   },
11574	//   "scopes": [
11575	//     "https://www.googleapis.com/auth/cloud-platform",
11576	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11577	//     "https://www.googleapis.com/auth/devstorage.full_control",
11578	//     "https://www.googleapis.com/auth/devstorage.read_only",
11579	//     "https://www.googleapis.com/auth/devstorage.read_write"
11580	//   ]
11581	// }
11582
11583}
11584
11585// method id "storage.objects.update":
11586
11587type ObjectsUpdateCall struct {
11588	s          *Service
11589	bucket     string
11590	object     string
11591	object2    *Object
11592	urlParams_ gensupport.URLParams
11593	ctx_       context.Context
11594	header_    http.Header
11595}
11596
11597// Update: Updates an object's metadata.
11598func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
11599	c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11600	c.bucket = bucket
11601	c.object = object
11602	c.object2 = object2
11603	return c
11604}
11605
11606// Generation sets the optional parameter "generation": If present,
11607// selects a specific revision of this object (as opposed to the latest
11608// version, the default).
11609func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
11610	c.urlParams_.Set("generation", fmt.Sprint(generation))
11611	return c
11612}
11613
11614// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
11615// Makes the operation conditional on whether the object's current
11616// generation matches the given value. Setting to 0 makes the operation
11617// succeed only if there are no live versions of the object.
11618func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
11619	c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
11620	return c
11621}
11622
11623// IfGenerationNotMatch sets the optional parameter
11624// "ifGenerationNotMatch": Makes the operation conditional on whether
11625// the object's current generation does not match the given value. If no
11626// live object exists, the precondition fails. Setting to 0 makes the
11627// operation succeed only if there is a live version of the object.
11628func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
11629	c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
11630	return c
11631}
11632
11633// IfMetagenerationMatch sets the optional parameter
11634// "ifMetagenerationMatch": Makes the operation conditional on whether
11635// the object's current metageneration matches the given value.
11636func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall {
11637	c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
11638	return c
11639}
11640
11641// IfMetagenerationNotMatch sets the optional parameter
11642// "ifMetagenerationNotMatch": Makes the operation conditional on
11643// whether the object's current metageneration does not match the given
11644// value.
11645func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
11646	c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
11647	return c
11648}
11649
11650// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
11651// predefined set of access controls to this object.
11652//
11653// Possible values:
11654//   "authenticatedRead" - Object owner gets OWNER access, and
11655// allAuthenticatedUsers get READER access.
11656//   "bucketOwnerFullControl" - Object owner gets OWNER access, and
11657// project team owners get OWNER access.
11658//   "bucketOwnerRead" - Object owner gets OWNER access, and project
11659// team owners get READER access.
11660//   "private" - Object owner gets OWNER access.
11661//   "projectPrivate" - Object owner gets OWNER access, and project team
11662// members get access according to their roles.
11663//   "publicRead" - Object owner gets OWNER access, and allUsers get
11664// READER access.
11665func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
11666	c.urlParams_.Set("predefinedAcl", predefinedAcl)
11667	return c
11668}
11669
11670// Projection sets the optional parameter "projection": Set of
11671// properties to return. Defaults to full.
11672//
11673// Possible values:
11674//   "full" - Include all properties.
11675//   "noAcl" - Omit the owner, acl property.
11676func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
11677	c.urlParams_.Set("projection", projection)
11678	return c
11679}
11680
11681// ProvisionalUserProject sets the optional parameter
11682// "provisionalUserProject": The project to be billed for this request
11683// if the target bucket is requester-pays bucket.
11684func (c *ObjectsUpdateCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsUpdateCall {
11685	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11686	return c
11687}
11688
11689// UserProject sets the optional parameter "userProject": The project to
11690// be billed for this request. Required for Requester Pays buckets.
11691func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
11692	c.urlParams_.Set("userProject", userProject)
11693	return c
11694}
11695
11696// Fields allows partial responses to be retrieved. See
11697// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11698// for more information.
11699func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
11700	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11701	return c
11702}
11703
11704// Context sets the context to be used in this call's Do method. Any
11705// pending HTTP request will be aborted if the provided context is
11706// canceled.
11707func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
11708	c.ctx_ = ctx
11709	return c
11710}
11711
11712// Header returns an http.Header that can be modified by the caller to
11713// add HTTP headers to the request.
11714func (c *ObjectsUpdateCall) Header() http.Header {
11715	if c.header_ == nil {
11716		c.header_ = make(http.Header)
11717	}
11718	return c.header_
11719}
11720
11721func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
11722	reqHeaders := make(http.Header)
11723	for k, v := range c.header_ {
11724		reqHeaders[k] = v
11725	}
11726	reqHeaders.Set("User-Agent", c.s.userAgent())
11727	var body io.Reader = nil
11728	body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
11729	if err != nil {
11730		return nil, err
11731	}
11732	reqHeaders.Set("Content-Type", "application/json")
11733	c.urlParams_.Set("alt", alt)
11734	c.urlParams_.Set("prettyPrint", "false")
11735	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
11736	urls += "?" + c.urlParams_.Encode()
11737	req, err := http.NewRequest("PUT", urls, body)
11738	if err != nil {
11739		return nil, err
11740	}
11741	req.Header = reqHeaders
11742	googleapi.Expand(req.URL, map[string]string{
11743		"bucket": c.bucket,
11744		"object": c.object,
11745	})
11746	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11747}
11748
11749// Do executes the "storage.objects.update" call.
11750// Exactly one of *Object or error will be non-nil. Any non-2xx status
11751// code is an error. Response headers are in either
11752// *Object.ServerResponse.Header or (if a response was returned at all)
11753// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11754// check whether the returned error was because http.StatusNotModified
11755// was returned.
11756func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
11757	gensupport.SetOptions(c.urlParams_, opts...)
11758	res, err := c.doRequest("json")
11759	if res != nil && res.StatusCode == http.StatusNotModified {
11760		if res.Body != nil {
11761			res.Body.Close()
11762		}
11763		return nil, &googleapi.Error{
11764			Code:   res.StatusCode,
11765			Header: res.Header,
11766		}
11767	}
11768	if err != nil {
11769		return nil, err
11770	}
11771	defer googleapi.CloseBody(res)
11772	if err := googleapi.CheckResponse(res); err != nil {
11773		return nil, err
11774	}
11775	ret := &Object{
11776		ServerResponse: googleapi.ServerResponse{
11777			Header:         res.Header,
11778			HTTPStatusCode: res.StatusCode,
11779		},
11780	}
11781	target := &ret
11782	if err := gensupport.DecodeResponse(target, res); err != nil {
11783		return nil, err
11784	}
11785	return ret, nil
11786	// {
11787	//   "description": "Updates an object's metadata.",
11788	//   "httpMethod": "PUT",
11789	//   "id": "storage.objects.update",
11790	//   "parameterOrder": [
11791	//     "bucket",
11792	//     "object"
11793	//   ],
11794	//   "parameters": {
11795	//     "bucket": {
11796	//       "description": "Name of the bucket in which the object resides.",
11797	//       "location": "path",
11798	//       "required": true,
11799	//       "type": "string"
11800	//     },
11801	//     "generation": {
11802	//       "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
11803	//       "format": "int64",
11804	//       "location": "query",
11805	//       "type": "string"
11806	//     },
11807	//     "ifGenerationMatch": {
11808	//       "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.",
11809	//       "format": "int64",
11810	//       "location": "query",
11811	//       "type": "string"
11812	//     },
11813	//     "ifGenerationNotMatch": {
11814	//       "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.",
11815	//       "format": "int64",
11816	//       "location": "query",
11817	//       "type": "string"
11818	//     },
11819	//     "ifMetagenerationMatch": {
11820	//       "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
11821	//       "format": "int64",
11822	//       "location": "query",
11823	//       "type": "string"
11824	//     },
11825	//     "ifMetagenerationNotMatch": {
11826	//       "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
11827	//       "format": "int64",
11828	//       "location": "query",
11829	//       "type": "string"
11830	//     },
11831	//     "object": {
11832	//       "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
11833	//       "location": "path",
11834	//       "required": true,
11835	//       "type": "string"
11836	//     },
11837	//     "predefinedAcl": {
11838	//       "description": "Apply a predefined set of access controls to this object.",
11839	//       "enum": [
11840	//         "authenticatedRead",
11841	//         "bucketOwnerFullControl",
11842	//         "bucketOwnerRead",
11843	//         "private",
11844	//         "projectPrivate",
11845	//         "publicRead"
11846	//       ],
11847	//       "enumDescriptions": [
11848	//         "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
11849	//         "Object owner gets OWNER access, and project team owners get OWNER access.",
11850	//         "Object owner gets OWNER access, and project team owners get READER access.",
11851	//         "Object owner gets OWNER access.",
11852	//         "Object owner gets OWNER access, and project team members get access according to their roles.",
11853	//         "Object owner gets OWNER access, and allUsers get READER access."
11854	//       ],
11855	//       "location": "query",
11856	//       "type": "string"
11857	//     },
11858	//     "projection": {
11859	//       "description": "Set of properties to return. Defaults to full.",
11860	//       "enum": [
11861	//         "full",
11862	//         "noAcl"
11863	//       ],
11864	//       "enumDescriptions": [
11865	//         "Include all properties.",
11866	//         "Omit the owner, acl property."
11867	//       ],
11868	//       "location": "query",
11869	//       "type": "string"
11870	//     },
11871	//     "provisionalUserProject": {
11872	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
11873	//       "location": "query",
11874	//       "type": "string"
11875	//     },
11876	//     "userProject": {
11877	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11878	//       "location": "query",
11879	//       "type": "string"
11880	//     }
11881	//   },
11882	//   "path": "b/{bucket}/o/{object}",
11883	//   "request": {
11884	//     "$ref": "Object"
11885	//   },
11886	//   "response": {
11887	//     "$ref": "Object"
11888	//   },
11889	//   "scopes": [
11890	//     "https://www.googleapis.com/auth/cloud-platform",
11891	//     "https://www.googleapis.com/auth/devstorage.full_control"
11892	//   ]
11893	// }
11894
11895}
11896
11897// method id "storage.objects.watchAll":
11898
11899type ObjectsWatchAllCall struct {
11900	s          *Service
11901	bucket     string
11902	channel    *Channel
11903	urlParams_ gensupport.URLParams
11904	ctx_       context.Context
11905	header_    http.Header
11906}
11907
11908// WatchAll: Watch for changes on all objects in a bucket.
11909func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
11910	c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11911	c.bucket = bucket
11912	c.channel = channel
11913	return c
11914}
11915
11916// Delimiter sets the optional parameter "delimiter": Returns results in
11917// a directory-like mode. items will contain only objects whose names,
11918// aside from the prefix, do not contain delimiter. Objects whose names,
11919// aside from the prefix, contain delimiter will have their name,
11920// truncated after the delimiter, returned in prefixes. Duplicate
11921// prefixes are omitted.
11922func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
11923	c.urlParams_.Set("delimiter", delimiter)
11924	return c
11925}
11926
11927// IncludeTrailingDelimiter sets the optional parameter
11928// "includeTrailingDelimiter": If true, objects that end in exactly one
11929// instance of delimiter will have their metadata included in items in
11930// addition to prefixes.
11931func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall {
11932	c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
11933	return c
11934}
11935
11936// MaxResults sets the optional parameter "maxResults": Maximum number
11937// of items plus prefixes to return in a single page of responses. As
11938// duplicate prefixes are omitted, fewer total results may be returned
11939// than requested. The service will use this parameter or 1,000 items,
11940// whichever is smaller.
11941func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
11942	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
11943	return c
11944}
11945
11946// PageToken sets the optional parameter "pageToken": A
11947// previously-returned page token representing part of the larger set of
11948// results to view.
11949func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
11950	c.urlParams_.Set("pageToken", pageToken)
11951	return c
11952}
11953
11954// Prefix sets the optional parameter "prefix": Filter results to
11955// objects whose names begin with this prefix.
11956func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
11957	c.urlParams_.Set("prefix", prefix)
11958	return c
11959}
11960
11961// Projection sets the optional parameter "projection": Set of
11962// properties to return. Defaults to noAcl.
11963//
11964// Possible values:
11965//   "full" - Include all properties.
11966//   "noAcl" - Omit the owner, acl property.
11967func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
11968	c.urlParams_.Set("projection", projection)
11969	return c
11970}
11971
11972// ProvisionalUserProject sets the optional parameter
11973// "provisionalUserProject": The project to be billed for this request
11974// if the target bucket is requester-pays bucket.
11975func (c *ObjectsWatchAllCall) ProvisionalUserProject(provisionalUserProject string) *ObjectsWatchAllCall {
11976	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
11977	return c
11978}
11979
11980// UserProject sets the optional parameter "userProject": The project to
11981// be billed for this request. Required for Requester Pays buckets.
11982func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
11983	c.urlParams_.Set("userProject", userProject)
11984	return c
11985}
11986
11987// Versions sets the optional parameter "versions": If true, lists all
11988// versions of an object as distinct results. The default is false. For
11989// more information, see Object Versioning.
11990func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
11991	c.urlParams_.Set("versions", fmt.Sprint(versions))
11992	return c
11993}
11994
11995// Fields allows partial responses to be retrieved. See
11996// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11997// for more information.
11998func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
11999	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12000	return c
12001}
12002
12003// Context sets the context to be used in this call's Do method. Any
12004// pending HTTP request will be aborted if the provided context is
12005// canceled.
12006func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
12007	c.ctx_ = ctx
12008	return c
12009}
12010
12011// Header returns an http.Header that can be modified by the caller to
12012// add HTTP headers to the request.
12013func (c *ObjectsWatchAllCall) Header() http.Header {
12014	if c.header_ == nil {
12015		c.header_ = make(http.Header)
12016	}
12017	return c.header_
12018}
12019
12020func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
12021	reqHeaders := make(http.Header)
12022	for k, v := range c.header_ {
12023		reqHeaders[k] = v
12024	}
12025	reqHeaders.Set("User-Agent", c.s.userAgent())
12026	var body io.Reader = nil
12027	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
12028	if err != nil {
12029		return nil, err
12030	}
12031	reqHeaders.Set("Content-Type", "application/json")
12032	c.urlParams_.Set("alt", alt)
12033	c.urlParams_.Set("prettyPrint", "false")
12034	urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
12035	urls += "?" + c.urlParams_.Encode()
12036	req, err := http.NewRequest("POST", urls, body)
12037	if err != nil {
12038		return nil, err
12039	}
12040	req.Header = reqHeaders
12041	googleapi.Expand(req.URL, map[string]string{
12042		"bucket": c.bucket,
12043	})
12044	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12045}
12046
12047// Do executes the "storage.objects.watchAll" call.
12048// Exactly one of *Channel or error will be non-nil. Any non-2xx status
12049// code is an error. Response headers are in either
12050// *Channel.ServerResponse.Header or (if a response was returned at all)
12051// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12052// check whether the returned error was because http.StatusNotModified
12053// was returned.
12054func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
12055	gensupport.SetOptions(c.urlParams_, opts...)
12056	res, err := c.doRequest("json")
12057	if res != nil && res.StatusCode == http.StatusNotModified {
12058		if res.Body != nil {
12059			res.Body.Close()
12060		}
12061		return nil, &googleapi.Error{
12062			Code:   res.StatusCode,
12063			Header: res.Header,
12064		}
12065	}
12066	if err != nil {
12067		return nil, err
12068	}
12069	defer googleapi.CloseBody(res)
12070	if err := googleapi.CheckResponse(res); err != nil {
12071		return nil, err
12072	}
12073	ret := &Channel{
12074		ServerResponse: googleapi.ServerResponse{
12075			Header:         res.Header,
12076			HTTPStatusCode: res.StatusCode,
12077		},
12078	}
12079	target := &ret
12080	if err := gensupport.DecodeResponse(target, res); err != nil {
12081		return nil, err
12082	}
12083	return ret, nil
12084	// {
12085	//   "description": "Watch for changes on all objects in a bucket.",
12086	//   "httpMethod": "POST",
12087	//   "id": "storage.objects.watchAll",
12088	//   "parameterOrder": [
12089	//     "bucket"
12090	//   ],
12091	//   "parameters": {
12092	//     "bucket": {
12093	//       "description": "Name of the bucket in which to look for objects.",
12094	//       "location": "path",
12095	//       "required": true,
12096	//       "type": "string"
12097	//     },
12098	//     "delimiter": {
12099	//       "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.",
12100	//       "location": "query",
12101	//       "type": "string"
12102	//     },
12103	//     "includeTrailingDelimiter": {
12104	//       "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
12105	//       "location": "query",
12106	//       "type": "boolean"
12107	//     },
12108	//     "maxResults": {
12109	//       "default": "1000",
12110	//       "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.",
12111	//       "format": "uint32",
12112	//       "location": "query",
12113	//       "minimum": "0",
12114	//       "type": "integer"
12115	//     },
12116	//     "pageToken": {
12117	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
12118	//       "location": "query",
12119	//       "type": "string"
12120	//     },
12121	//     "prefix": {
12122	//       "description": "Filter results to objects whose names begin with this prefix.",
12123	//       "location": "query",
12124	//       "type": "string"
12125	//     },
12126	//     "projection": {
12127	//       "description": "Set of properties to return. Defaults to noAcl.",
12128	//       "enum": [
12129	//         "full",
12130	//         "noAcl"
12131	//       ],
12132	//       "enumDescriptions": [
12133	//         "Include all properties.",
12134	//         "Omit the owner, acl property."
12135	//       ],
12136	//       "location": "query",
12137	//       "type": "string"
12138	//     },
12139	//     "provisionalUserProject": {
12140	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
12141	//       "location": "query",
12142	//       "type": "string"
12143	//     },
12144	//     "userProject": {
12145	//       "description": "The project to be billed for this request. Required for Requester Pays buckets.",
12146	//       "location": "query",
12147	//       "type": "string"
12148	//     },
12149	//     "versions": {
12150	//       "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
12151	//       "location": "query",
12152	//       "type": "boolean"
12153	//     }
12154	//   },
12155	//   "path": "b/{bucket}/o/watch",
12156	//   "request": {
12157	//     "$ref": "Channel",
12158	//     "parameterName": "resource"
12159	//   },
12160	//   "response": {
12161	//     "$ref": "Channel"
12162	//   },
12163	//   "scopes": [
12164	//     "https://www.googleapis.com/auth/cloud-platform",
12165	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12166	//     "https://www.googleapis.com/auth/devstorage.full_control",
12167	//     "https://www.googleapis.com/auth/devstorage.read_only",
12168	//     "https://www.googleapis.com/auth/devstorage.read_write"
12169	//   ],
12170	//   "supportsSubscription": true
12171	// }
12172
12173}
12174
12175// method id "storage.projects.hmacKeys.create":
12176
12177type ProjectsHmacKeysCreateCall struct {
12178	s          *Service
12179	projectId  string
12180	urlParams_ gensupport.URLParams
12181	ctx_       context.Context
12182	header_    http.Header
12183}
12184
12185// Create: Creates a new HMAC key for the specified service account.
12186func (r *ProjectsHmacKeysService) Create(projectId string, serviceAccountEmail string) *ProjectsHmacKeysCreateCall {
12187	c := &ProjectsHmacKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12188	c.projectId = projectId
12189	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
12190	return c
12191}
12192
12193// UserProject sets the optional parameter "userProject": The project to
12194// be billed for this request.
12195func (c *ProjectsHmacKeysCreateCall) UserProject(userProject string) *ProjectsHmacKeysCreateCall {
12196	c.urlParams_.Set("userProject", userProject)
12197	return c
12198}
12199
12200// Fields allows partial responses to be retrieved. See
12201// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12202// for more information.
12203func (c *ProjectsHmacKeysCreateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysCreateCall {
12204	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12205	return c
12206}
12207
12208// Context sets the context to be used in this call's Do method. Any
12209// pending HTTP request will be aborted if the provided context is
12210// canceled.
12211func (c *ProjectsHmacKeysCreateCall) Context(ctx context.Context) *ProjectsHmacKeysCreateCall {
12212	c.ctx_ = ctx
12213	return c
12214}
12215
12216// Header returns an http.Header that can be modified by the caller to
12217// add HTTP headers to the request.
12218func (c *ProjectsHmacKeysCreateCall) Header() http.Header {
12219	if c.header_ == nil {
12220		c.header_ = make(http.Header)
12221	}
12222	return c.header_
12223}
12224
12225func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) {
12226	reqHeaders := make(http.Header)
12227	for k, v := range c.header_ {
12228		reqHeaders[k] = v
12229	}
12230	reqHeaders.Set("User-Agent", c.s.userAgent())
12231	var body io.Reader = nil
12232	c.urlParams_.Set("alt", alt)
12233	c.urlParams_.Set("prettyPrint", "false")
12234	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
12235	urls += "?" + c.urlParams_.Encode()
12236	req, err := http.NewRequest("POST", urls, body)
12237	if err != nil {
12238		return nil, err
12239	}
12240	req.Header = reqHeaders
12241	googleapi.Expand(req.URL, map[string]string{
12242		"projectId": c.projectId,
12243	})
12244	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12245}
12246
12247// Do executes the "storage.projects.hmacKeys.create" call.
12248// Exactly one of *HmacKey or error will be non-nil. Any non-2xx status
12249// code is an error. Response headers are in either
12250// *HmacKey.ServerResponse.Header or (if a response was returned at all)
12251// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12252// check whether the returned error was because http.StatusNotModified
12253// was returned.
12254func (c *ProjectsHmacKeysCreateCall) Do(opts ...googleapi.CallOption) (*HmacKey, error) {
12255	gensupport.SetOptions(c.urlParams_, opts...)
12256	res, err := c.doRequest("json")
12257	if res != nil && res.StatusCode == http.StatusNotModified {
12258		if res.Body != nil {
12259			res.Body.Close()
12260		}
12261		return nil, &googleapi.Error{
12262			Code:   res.StatusCode,
12263			Header: res.Header,
12264		}
12265	}
12266	if err != nil {
12267		return nil, err
12268	}
12269	defer googleapi.CloseBody(res)
12270	if err := googleapi.CheckResponse(res); err != nil {
12271		return nil, err
12272	}
12273	ret := &HmacKey{
12274		ServerResponse: googleapi.ServerResponse{
12275			Header:         res.Header,
12276			HTTPStatusCode: res.StatusCode,
12277		},
12278	}
12279	target := &ret
12280	if err := gensupport.DecodeResponse(target, res); err != nil {
12281		return nil, err
12282	}
12283	return ret, nil
12284	// {
12285	//   "description": "Creates a new HMAC key for the specified service account.",
12286	//   "httpMethod": "POST",
12287	//   "id": "storage.projects.hmacKeys.create",
12288	//   "parameterOrder": [
12289	//     "projectId",
12290	//     "serviceAccountEmail"
12291	//   ],
12292	//   "parameters": {
12293	//     "projectId": {
12294	//       "description": "Project ID owning the service account.",
12295	//       "location": "path",
12296	//       "required": true,
12297	//       "type": "string"
12298	//     },
12299	//     "serviceAccountEmail": {
12300	//       "description": "Email address of the service account.",
12301	//       "location": "query",
12302	//       "required": true,
12303	//       "type": "string"
12304	//     },
12305	//     "userProject": {
12306	//       "description": "The project to be billed for this request.",
12307	//       "location": "query",
12308	//       "type": "string"
12309	//     }
12310	//   },
12311	//   "path": "projects/{projectId}/hmacKeys",
12312	//   "response": {
12313	//     "$ref": "HmacKey"
12314	//   },
12315	//   "scopes": [
12316	//     "https://www.googleapis.com/auth/cloud-platform",
12317	//     "https://www.googleapis.com/auth/devstorage.full_control"
12318	//   ]
12319	// }
12320
12321}
12322
12323// method id "storage.projects.hmacKeys.delete":
12324
12325type ProjectsHmacKeysDeleteCall struct {
12326	s          *Service
12327	projectId  string
12328	accessId   string
12329	urlParams_ gensupport.URLParams
12330	ctx_       context.Context
12331	header_    http.Header
12332}
12333
12334// Delete: Deletes an HMAC key.
12335func (r *ProjectsHmacKeysService) Delete(projectId string, accessId string) *ProjectsHmacKeysDeleteCall {
12336	c := &ProjectsHmacKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12337	c.projectId = projectId
12338	c.accessId = accessId
12339	return c
12340}
12341
12342// UserProject sets the optional parameter "userProject": The project to
12343// be billed for this request.
12344func (c *ProjectsHmacKeysDeleteCall) UserProject(userProject string) *ProjectsHmacKeysDeleteCall {
12345	c.urlParams_.Set("userProject", userProject)
12346	return c
12347}
12348
12349// Fields allows partial responses to be retrieved. See
12350// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12351// for more information.
12352func (c *ProjectsHmacKeysDeleteCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysDeleteCall {
12353	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12354	return c
12355}
12356
12357// Context sets the context to be used in this call's Do method. Any
12358// pending HTTP request will be aborted if the provided context is
12359// canceled.
12360func (c *ProjectsHmacKeysDeleteCall) Context(ctx context.Context) *ProjectsHmacKeysDeleteCall {
12361	c.ctx_ = ctx
12362	return c
12363}
12364
12365// Header returns an http.Header that can be modified by the caller to
12366// add HTTP headers to the request.
12367func (c *ProjectsHmacKeysDeleteCall) Header() http.Header {
12368	if c.header_ == nil {
12369		c.header_ = make(http.Header)
12370	}
12371	return c.header_
12372}
12373
12374func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
12375	reqHeaders := make(http.Header)
12376	for k, v := range c.header_ {
12377		reqHeaders[k] = v
12378	}
12379	reqHeaders.Set("User-Agent", c.s.userAgent())
12380	var body io.Reader = nil
12381	c.urlParams_.Set("alt", alt)
12382	c.urlParams_.Set("prettyPrint", "false")
12383	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
12384	urls += "?" + c.urlParams_.Encode()
12385	req, err := http.NewRequest("DELETE", urls, body)
12386	if err != nil {
12387		return nil, err
12388	}
12389	req.Header = reqHeaders
12390	googleapi.Expand(req.URL, map[string]string{
12391		"projectId": c.projectId,
12392		"accessId":  c.accessId,
12393	})
12394	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12395}
12396
12397// Do executes the "storage.projects.hmacKeys.delete" call.
12398func (c *ProjectsHmacKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
12399	gensupport.SetOptions(c.urlParams_, opts...)
12400	res, err := c.doRequest("json")
12401	if err != nil {
12402		return err
12403	}
12404	defer googleapi.CloseBody(res)
12405	if err := googleapi.CheckResponse(res); err != nil {
12406		return err
12407	}
12408	return nil
12409	// {
12410	//   "description": "Deletes an HMAC key.",
12411	//   "httpMethod": "DELETE",
12412	//   "id": "storage.projects.hmacKeys.delete",
12413	//   "parameterOrder": [
12414	//     "projectId",
12415	//     "accessId"
12416	//   ],
12417	//   "parameters": {
12418	//     "accessId": {
12419	//       "description": "Name of the HMAC key to be deleted.",
12420	//       "location": "path",
12421	//       "required": true,
12422	//       "type": "string"
12423	//     },
12424	//     "projectId": {
12425	//       "description": "Project ID owning the requested key",
12426	//       "location": "path",
12427	//       "required": true,
12428	//       "type": "string"
12429	//     },
12430	//     "userProject": {
12431	//       "description": "The project to be billed for this request.",
12432	//       "location": "query",
12433	//       "type": "string"
12434	//     }
12435	//   },
12436	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
12437	//   "scopes": [
12438	//     "https://www.googleapis.com/auth/cloud-platform",
12439	//     "https://www.googleapis.com/auth/devstorage.full_control",
12440	//     "https://www.googleapis.com/auth/devstorage.read_write"
12441	//   ]
12442	// }
12443
12444}
12445
12446// method id "storage.projects.hmacKeys.get":
12447
12448type ProjectsHmacKeysGetCall struct {
12449	s            *Service
12450	projectId    string
12451	accessId     string
12452	urlParams_   gensupport.URLParams
12453	ifNoneMatch_ string
12454	ctx_         context.Context
12455	header_      http.Header
12456}
12457
12458// Get: Retrieves an HMAC key's metadata
12459func (r *ProjectsHmacKeysService) Get(projectId string, accessId string) *ProjectsHmacKeysGetCall {
12460	c := &ProjectsHmacKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12461	c.projectId = projectId
12462	c.accessId = accessId
12463	return c
12464}
12465
12466// UserProject sets the optional parameter "userProject": The project to
12467// be billed for this request.
12468func (c *ProjectsHmacKeysGetCall) UserProject(userProject string) *ProjectsHmacKeysGetCall {
12469	c.urlParams_.Set("userProject", userProject)
12470	return c
12471}
12472
12473// Fields allows partial responses to be retrieved. See
12474// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12475// for more information.
12476func (c *ProjectsHmacKeysGetCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysGetCall {
12477	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12478	return c
12479}
12480
12481// IfNoneMatch sets the optional parameter which makes the operation
12482// fail if the object's ETag matches the given value. This is useful for
12483// getting updates only after the object has changed since the last
12484// request. Use googleapi.IsNotModified to check whether the response
12485// error from Do is the result of In-None-Match.
12486func (c *ProjectsHmacKeysGetCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysGetCall {
12487	c.ifNoneMatch_ = entityTag
12488	return c
12489}
12490
12491// Context sets the context to be used in this call's Do method. Any
12492// pending HTTP request will be aborted if the provided context is
12493// canceled.
12494func (c *ProjectsHmacKeysGetCall) Context(ctx context.Context) *ProjectsHmacKeysGetCall {
12495	c.ctx_ = ctx
12496	return c
12497}
12498
12499// Header returns an http.Header that can be modified by the caller to
12500// add HTTP headers to the request.
12501func (c *ProjectsHmacKeysGetCall) Header() http.Header {
12502	if c.header_ == nil {
12503		c.header_ = make(http.Header)
12504	}
12505	return c.header_
12506}
12507
12508func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) {
12509	reqHeaders := make(http.Header)
12510	for k, v := range c.header_ {
12511		reqHeaders[k] = v
12512	}
12513	reqHeaders.Set("User-Agent", c.s.userAgent())
12514	if c.ifNoneMatch_ != "" {
12515		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12516	}
12517	var body io.Reader = nil
12518	c.urlParams_.Set("alt", alt)
12519	c.urlParams_.Set("prettyPrint", "false")
12520	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
12521	urls += "?" + c.urlParams_.Encode()
12522	req, err := http.NewRequest("GET", urls, body)
12523	if err != nil {
12524		return nil, err
12525	}
12526	req.Header = reqHeaders
12527	googleapi.Expand(req.URL, map[string]string{
12528		"projectId": c.projectId,
12529		"accessId":  c.accessId,
12530	})
12531	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12532}
12533
12534// Do executes the "storage.projects.hmacKeys.get" call.
12535// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
12536// status code is an error. Response headers are in either
12537// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
12538// at all) in error.(*googleapi.Error).Header. Use
12539// googleapi.IsNotModified to check whether the returned error was
12540// because http.StatusNotModified was returned.
12541func (c *ProjectsHmacKeysGetCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
12542	gensupport.SetOptions(c.urlParams_, opts...)
12543	res, err := c.doRequest("json")
12544	if res != nil && res.StatusCode == http.StatusNotModified {
12545		if res.Body != nil {
12546			res.Body.Close()
12547		}
12548		return nil, &googleapi.Error{
12549			Code:   res.StatusCode,
12550			Header: res.Header,
12551		}
12552	}
12553	if err != nil {
12554		return nil, err
12555	}
12556	defer googleapi.CloseBody(res)
12557	if err := googleapi.CheckResponse(res); err != nil {
12558		return nil, err
12559	}
12560	ret := &HmacKeyMetadata{
12561		ServerResponse: googleapi.ServerResponse{
12562			Header:         res.Header,
12563			HTTPStatusCode: res.StatusCode,
12564		},
12565	}
12566	target := &ret
12567	if err := gensupport.DecodeResponse(target, res); err != nil {
12568		return nil, err
12569	}
12570	return ret, nil
12571	// {
12572	//   "description": "Retrieves an HMAC key's metadata",
12573	//   "httpMethod": "GET",
12574	//   "id": "storage.projects.hmacKeys.get",
12575	//   "parameterOrder": [
12576	//     "projectId",
12577	//     "accessId"
12578	//   ],
12579	//   "parameters": {
12580	//     "accessId": {
12581	//       "description": "Name of the HMAC key.",
12582	//       "location": "path",
12583	//       "required": true,
12584	//       "type": "string"
12585	//     },
12586	//     "projectId": {
12587	//       "description": "Project ID owning the service account of the requested key.",
12588	//       "location": "path",
12589	//       "required": true,
12590	//       "type": "string"
12591	//     },
12592	//     "userProject": {
12593	//       "description": "The project to be billed for this request.",
12594	//       "location": "query",
12595	//       "type": "string"
12596	//     }
12597	//   },
12598	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
12599	//   "response": {
12600	//     "$ref": "HmacKeyMetadata"
12601	//   },
12602	//   "scopes": [
12603	//     "https://www.googleapis.com/auth/cloud-platform",
12604	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12605	//     "https://www.googleapis.com/auth/devstorage.read_only"
12606	//   ]
12607	// }
12608
12609}
12610
12611// method id "storage.projects.hmacKeys.list":
12612
12613type ProjectsHmacKeysListCall struct {
12614	s            *Service
12615	projectId    string
12616	urlParams_   gensupport.URLParams
12617	ifNoneMatch_ string
12618	ctx_         context.Context
12619	header_      http.Header
12620}
12621
12622// List: Retrieves a list of HMAC keys matching the criteria.
12623func (r *ProjectsHmacKeysService) List(projectId string) *ProjectsHmacKeysListCall {
12624	c := &ProjectsHmacKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12625	c.projectId = projectId
12626	return c
12627}
12628
12629// MaxResults sets the optional parameter "maxResults": Maximum number
12630// of items to return in a single page of responses. The service uses
12631// this parameter or 250 items, whichever is smaller. The max number of
12632// items per page will also be limited by the number of distinct service
12633// accounts in the response. If the number of service accounts in a
12634// single response is too high, the page will truncated and a next page
12635// token will be returned.
12636func (c *ProjectsHmacKeysListCall) MaxResults(maxResults int64) *ProjectsHmacKeysListCall {
12637	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12638	return c
12639}
12640
12641// PageToken sets the optional parameter "pageToken": A
12642// previously-returned page token representing part of the larger set of
12643// results to view.
12644func (c *ProjectsHmacKeysListCall) PageToken(pageToken string) *ProjectsHmacKeysListCall {
12645	c.urlParams_.Set("pageToken", pageToken)
12646	return c
12647}
12648
12649// ServiceAccountEmail sets the optional parameter
12650// "serviceAccountEmail": If present, only keys for the given service
12651// account are returned.
12652func (c *ProjectsHmacKeysListCall) ServiceAccountEmail(serviceAccountEmail string) *ProjectsHmacKeysListCall {
12653	c.urlParams_.Set("serviceAccountEmail", serviceAccountEmail)
12654	return c
12655}
12656
12657// ShowDeletedKeys sets the optional parameter "showDeletedKeys":
12658// Whether or not to show keys in the DELETED state.
12659func (c *ProjectsHmacKeysListCall) ShowDeletedKeys(showDeletedKeys bool) *ProjectsHmacKeysListCall {
12660	c.urlParams_.Set("showDeletedKeys", fmt.Sprint(showDeletedKeys))
12661	return c
12662}
12663
12664// UserProject sets the optional parameter "userProject": The project to
12665// be billed for this request.
12666func (c *ProjectsHmacKeysListCall) UserProject(userProject string) *ProjectsHmacKeysListCall {
12667	c.urlParams_.Set("userProject", userProject)
12668	return c
12669}
12670
12671// Fields allows partial responses to be retrieved. See
12672// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12673// for more information.
12674func (c *ProjectsHmacKeysListCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysListCall {
12675	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12676	return c
12677}
12678
12679// IfNoneMatch sets the optional parameter which makes the operation
12680// fail if the object's ETag matches the given value. This is useful for
12681// getting updates only after the object has changed since the last
12682// request. Use googleapi.IsNotModified to check whether the response
12683// error from Do is the result of In-None-Match.
12684func (c *ProjectsHmacKeysListCall) IfNoneMatch(entityTag string) *ProjectsHmacKeysListCall {
12685	c.ifNoneMatch_ = entityTag
12686	return c
12687}
12688
12689// Context sets the context to be used in this call's Do method. Any
12690// pending HTTP request will be aborted if the provided context is
12691// canceled.
12692func (c *ProjectsHmacKeysListCall) Context(ctx context.Context) *ProjectsHmacKeysListCall {
12693	c.ctx_ = ctx
12694	return c
12695}
12696
12697// Header returns an http.Header that can be modified by the caller to
12698// add HTTP headers to the request.
12699func (c *ProjectsHmacKeysListCall) Header() http.Header {
12700	if c.header_ == nil {
12701		c.header_ = make(http.Header)
12702	}
12703	return c.header_
12704}
12705
12706func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) {
12707	reqHeaders := make(http.Header)
12708	for k, v := range c.header_ {
12709		reqHeaders[k] = v
12710	}
12711	reqHeaders.Set("User-Agent", c.s.userAgent())
12712	if c.ifNoneMatch_ != "" {
12713		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12714	}
12715	var body io.Reader = nil
12716	c.urlParams_.Set("alt", alt)
12717	c.urlParams_.Set("prettyPrint", "false")
12718	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys")
12719	urls += "?" + c.urlParams_.Encode()
12720	req, err := http.NewRequest("GET", urls, body)
12721	if err != nil {
12722		return nil, err
12723	}
12724	req.Header = reqHeaders
12725	googleapi.Expand(req.URL, map[string]string{
12726		"projectId": c.projectId,
12727	})
12728	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12729}
12730
12731// Do executes the "storage.projects.hmacKeys.list" call.
12732// Exactly one of *HmacKeysMetadata or error will be non-nil. Any
12733// non-2xx status code is an error. Response headers are in either
12734// *HmacKeysMetadata.ServerResponse.Header or (if a response was
12735// returned at all) in error.(*googleapi.Error).Header. Use
12736// googleapi.IsNotModified to check whether the returned error was
12737// because http.StatusNotModified was returned.
12738func (c *ProjectsHmacKeysListCall) Do(opts ...googleapi.CallOption) (*HmacKeysMetadata, error) {
12739	gensupport.SetOptions(c.urlParams_, opts...)
12740	res, err := c.doRequest("json")
12741	if res != nil && res.StatusCode == http.StatusNotModified {
12742		if res.Body != nil {
12743			res.Body.Close()
12744		}
12745		return nil, &googleapi.Error{
12746			Code:   res.StatusCode,
12747			Header: res.Header,
12748		}
12749	}
12750	if err != nil {
12751		return nil, err
12752	}
12753	defer googleapi.CloseBody(res)
12754	if err := googleapi.CheckResponse(res); err != nil {
12755		return nil, err
12756	}
12757	ret := &HmacKeysMetadata{
12758		ServerResponse: googleapi.ServerResponse{
12759			Header:         res.Header,
12760			HTTPStatusCode: res.StatusCode,
12761		},
12762	}
12763	target := &ret
12764	if err := gensupport.DecodeResponse(target, res); err != nil {
12765		return nil, err
12766	}
12767	return ret, nil
12768	// {
12769	//   "description": "Retrieves a list of HMAC keys matching the criteria.",
12770	//   "httpMethod": "GET",
12771	//   "id": "storage.projects.hmacKeys.list",
12772	//   "parameterOrder": [
12773	//     "projectId"
12774	//   ],
12775	//   "parameters": {
12776	//     "maxResults": {
12777	//       "default": "250",
12778	//       "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.",
12779	//       "format": "uint32",
12780	//       "location": "query",
12781	//       "minimum": "0",
12782	//       "type": "integer"
12783	//     },
12784	//     "pageToken": {
12785	//       "description": "A previously-returned page token representing part of the larger set of results to view.",
12786	//       "location": "query",
12787	//       "type": "string"
12788	//     },
12789	//     "projectId": {
12790	//       "description": "Name of the project in which to look for HMAC keys.",
12791	//       "location": "path",
12792	//       "required": true,
12793	//       "type": "string"
12794	//     },
12795	//     "serviceAccountEmail": {
12796	//       "description": "If present, only keys for the given service account are returned.",
12797	//       "location": "query",
12798	//       "type": "string"
12799	//     },
12800	//     "showDeletedKeys": {
12801	//       "description": "Whether or not to show keys in the DELETED state.",
12802	//       "location": "query",
12803	//       "type": "boolean"
12804	//     },
12805	//     "userProject": {
12806	//       "description": "The project to be billed for this request.",
12807	//       "location": "query",
12808	//       "type": "string"
12809	//     }
12810	//   },
12811	//   "path": "projects/{projectId}/hmacKeys",
12812	//   "response": {
12813	//     "$ref": "HmacKeysMetadata"
12814	//   },
12815	//   "scopes": [
12816	//     "https://www.googleapis.com/auth/cloud-platform",
12817	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12818	//     "https://www.googleapis.com/auth/devstorage.full_control",
12819	//     "https://www.googleapis.com/auth/devstorage.read_only"
12820	//   ]
12821	// }
12822
12823}
12824
12825// Pages invokes f for each page of results.
12826// A non-nil error returned from f will halt the iteration.
12827// The provided context supersedes any context provided to the Context method.
12828func (c *ProjectsHmacKeysListCall) Pages(ctx context.Context, f func(*HmacKeysMetadata) error) error {
12829	c.ctx_ = ctx
12830	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12831	for {
12832		x, err := c.Do()
12833		if err != nil {
12834			return err
12835		}
12836		if err := f(x); err != nil {
12837			return err
12838		}
12839		if x.NextPageToken == "" {
12840			return nil
12841		}
12842		c.PageToken(x.NextPageToken)
12843	}
12844}
12845
12846// method id "storage.projects.hmacKeys.update":
12847
12848type ProjectsHmacKeysUpdateCall struct {
12849	s               *Service
12850	projectId       string
12851	accessId        string
12852	hmackeymetadata *HmacKeyMetadata
12853	urlParams_      gensupport.URLParams
12854	ctx_            context.Context
12855	header_         http.Header
12856}
12857
12858// Update: Updates the state of an HMAC key. See the HMAC Key resource
12859// descriptor for valid states.
12860func (r *ProjectsHmacKeysService) Update(projectId string, accessId string, hmackeymetadata *HmacKeyMetadata) *ProjectsHmacKeysUpdateCall {
12861	c := &ProjectsHmacKeysUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12862	c.projectId = projectId
12863	c.accessId = accessId
12864	c.hmackeymetadata = hmackeymetadata
12865	return c
12866}
12867
12868// UserProject sets the optional parameter "userProject": The project to
12869// be billed for this request.
12870func (c *ProjectsHmacKeysUpdateCall) UserProject(userProject string) *ProjectsHmacKeysUpdateCall {
12871	c.urlParams_.Set("userProject", userProject)
12872	return c
12873}
12874
12875// Fields allows partial responses to be retrieved. See
12876// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12877// for more information.
12878func (c *ProjectsHmacKeysUpdateCall) Fields(s ...googleapi.Field) *ProjectsHmacKeysUpdateCall {
12879	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12880	return c
12881}
12882
12883// Context sets the context to be used in this call's Do method. Any
12884// pending HTTP request will be aborted if the provided context is
12885// canceled.
12886func (c *ProjectsHmacKeysUpdateCall) Context(ctx context.Context) *ProjectsHmacKeysUpdateCall {
12887	c.ctx_ = ctx
12888	return c
12889}
12890
12891// Header returns an http.Header that can be modified by the caller to
12892// add HTTP headers to the request.
12893func (c *ProjectsHmacKeysUpdateCall) Header() http.Header {
12894	if c.header_ == nil {
12895		c.header_ = make(http.Header)
12896	}
12897	return c.header_
12898}
12899
12900func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) {
12901	reqHeaders := make(http.Header)
12902	for k, v := range c.header_ {
12903		reqHeaders[k] = v
12904	}
12905	reqHeaders.Set("User-Agent", c.s.userAgent())
12906	var body io.Reader = nil
12907	body, err := googleapi.WithoutDataWrapper.JSONReader(c.hmackeymetadata)
12908	if err != nil {
12909		return nil, err
12910	}
12911	reqHeaders.Set("Content-Type", "application/json")
12912	c.urlParams_.Set("alt", alt)
12913	c.urlParams_.Set("prettyPrint", "false")
12914	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/hmacKeys/{accessId}")
12915	urls += "?" + c.urlParams_.Encode()
12916	req, err := http.NewRequest("PUT", urls, body)
12917	if err != nil {
12918		return nil, err
12919	}
12920	req.Header = reqHeaders
12921	googleapi.Expand(req.URL, map[string]string{
12922		"projectId": c.projectId,
12923		"accessId":  c.accessId,
12924	})
12925	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12926}
12927
12928// Do executes the "storage.projects.hmacKeys.update" call.
12929// Exactly one of *HmacKeyMetadata or error will be non-nil. Any non-2xx
12930// status code is an error. Response headers are in either
12931// *HmacKeyMetadata.ServerResponse.Header or (if a response was returned
12932// at all) in error.(*googleapi.Error).Header. Use
12933// googleapi.IsNotModified to check whether the returned error was
12934// because http.StatusNotModified was returned.
12935func (c *ProjectsHmacKeysUpdateCall) Do(opts ...googleapi.CallOption) (*HmacKeyMetadata, error) {
12936	gensupport.SetOptions(c.urlParams_, opts...)
12937	res, err := c.doRequest("json")
12938	if res != nil && res.StatusCode == http.StatusNotModified {
12939		if res.Body != nil {
12940			res.Body.Close()
12941		}
12942		return nil, &googleapi.Error{
12943			Code:   res.StatusCode,
12944			Header: res.Header,
12945		}
12946	}
12947	if err != nil {
12948		return nil, err
12949	}
12950	defer googleapi.CloseBody(res)
12951	if err := googleapi.CheckResponse(res); err != nil {
12952		return nil, err
12953	}
12954	ret := &HmacKeyMetadata{
12955		ServerResponse: googleapi.ServerResponse{
12956			Header:         res.Header,
12957			HTTPStatusCode: res.StatusCode,
12958		},
12959	}
12960	target := &ret
12961	if err := gensupport.DecodeResponse(target, res); err != nil {
12962		return nil, err
12963	}
12964	return ret, nil
12965	// {
12966	//   "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
12967	//   "httpMethod": "PUT",
12968	//   "id": "storage.projects.hmacKeys.update",
12969	//   "parameterOrder": [
12970	//     "projectId",
12971	//     "accessId"
12972	//   ],
12973	//   "parameters": {
12974	//     "accessId": {
12975	//       "description": "Name of the HMAC key being updated.",
12976	//       "location": "path",
12977	//       "required": true,
12978	//       "type": "string"
12979	//     },
12980	//     "projectId": {
12981	//       "description": "Project ID owning the service account of the updated key.",
12982	//       "location": "path",
12983	//       "required": true,
12984	//       "type": "string"
12985	//     },
12986	//     "userProject": {
12987	//       "description": "The project to be billed for this request.",
12988	//       "location": "query",
12989	//       "type": "string"
12990	//     }
12991	//   },
12992	//   "path": "projects/{projectId}/hmacKeys/{accessId}",
12993	//   "request": {
12994	//     "$ref": "HmacKeyMetadata"
12995	//   },
12996	//   "response": {
12997	//     "$ref": "HmacKeyMetadata"
12998	//   },
12999	//   "scopes": [
13000	//     "https://www.googleapis.com/auth/cloud-platform",
13001	//     "https://www.googleapis.com/auth/devstorage.full_control"
13002	//   ]
13003	// }
13004
13005}
13006
13007// method id "storage.projects.serviceAccount.get":
13008
13009type ProjectsServiceAccountGetCall struct {
13010	s            *Service
13011	projectId    string
13012	urlParams_   gensupport.URLParams
13013	ifNoneMatch_ string
13014	ctx_         context.Context
13015	header_      http.Header
13016}
13017
13018// Get: Get the email address of this project's Google Cloud Storage
13019// service account.
13020func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
13021	c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13022	c.projectId = projectId
13023	return c
13024}
13025
13026// ProvisionalUserProject sets the optional parameter
13027// "provisionalUserProject": The project to be billed for this request
13028// if the target bucket is requester-pays bucket.
13029func (c *ProjectsServiceAccountGetCall) ProvisionalUserProject(provisionalUserProject string) *ProjectsServiceAccountGetCall {
13030	c.urlParams_.Set("provisionalUserProject", provisionalUserProject)
13031	return c
13032}
13033
13034// UserProject sets the optional parameter "userProject": The project to
13035// be billed for this request.
13036func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall {
13037	c.urlParams_.Set("userProject", userProject)
13038	return c
13039}
13040
13041// Fields allows partial responses to be retrieved. See
13042// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13043// for more information.
13044func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
13045	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13046	return c
13047}
13048
13049// IfNoneMatch sets the optional parameter which makes the operation
13050// fail if the object's ETag matches the given value. This is useful for
13051// getting updates only after the object has changed since the last
13052// request. Use googleapi.IsNotModified to check whether the response
13053// error from Do is the result of In-None-Match.
13054func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
13055	c.ifNoneMatch_ = entityTag
13056	return c
13057}
13058
13059// Context sets the context to be used in this call's Do method. Any
13060// pending HTTP request will be aborted if the provided context is
13061// canceled.
13062func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
13063	c.ctx_ = ctx
13064	return c
13065}
13066
13067// Header returns an http.Header that can be modified by the caller to
13068// add HTTP headers to the request.
13069func (c *ProjectsServiceAccountGetCall) Header() http.Header {
13070	if c.header_ == nil {
13071		c.header_ = make(http.Header)
13072	}
13073	return c.header_
13074}
13075
13076func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
13077	reqHeaders := make(http.Header)
13078	for k, v := range c.header_ {
13079		reqHeaders[k] = v
13080	}
13081	reqHeaders.Set("User-Agent", c.s.userAgent())
13082	if c.ifNoneMatch_ != "" {
13083		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13084	}
13085	var body io.Reader = nil
13086	c.urlParams_.Set("alt", alt)
13087	c.urlParams_.Set("prettyPrint", "false")
13088	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
13089	urls += "?" + c.urlParams_.Encode()
13090	req, err := http.NewRequest("GET", urls, body)
13091	if err != nil {
13092		return nil, err
13093	}
13094	req.Header = reqHeaders
13095	googleapi.Expand(req.URL, map[string]string{
13096		"projectId": c.projectId,
13097	})
13098	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13099}
13100
13101// Do executes the "storage.projects.serviceAccount.get" call.
13102// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
13103// status code is an error. Response headers are in either
13104// *ServiceAccount.ServerResponse.Header or (if a response was returned
13105// at all) in error.(*googleapi.Error).Header. Use
13106// googleapi.IsNotModified to check whether the returned error was
13107// because http.StatusNotModified was returned.
13108func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
13109	gensupport.SetOptions(c.urlParams_, opts...)
13110	res, err := c.doRequest("json")
13111	if res != nil && res.StatusCode == http.StatusNotModified {
13112		if res.Body != nil {
13113			res.Body.Close()
13114		}
13115		return nil, &googleapi.Error{
13116			Code:   res.StatusCode,
13117			Header: res.Header,
13118		}
13119	}
13120	if err != nil {
13121		return nil, err
13122	}
13123	defer googleapi.CloseBody(res)
13124	if err := googleapi.CheckResponse(res); err != nil {
13125		return nil, err
13126	}
13127	ret := &ServiceAccount{
13128		ServerResponse: googleapi.ServerResponse{
13129			Header:         res.Header,
13130			HTTPStatusCode: res.StatusCode,
13131		},
13132	}
13133	target := &ret
13134	if err := gensupport.DecodeResponse(target, res); err != nil {
13135		return nil, err
13136	}
13137	return ret, nil
13138	// {
13139	//   "description": "Get the email address of this project's Google Cloud Storage service account.",
13140	//   "httpMethod": "GET",
13141	//   "id": "storage.projects.serviceAccount.get",
13142	//   "parameterOrder": [
13143	//     "projectId"
13144	//   ],
13145	//   "parameters": {
13146	//     "projectId": {
13147	//       "description": "Project ID",
13148	//       "location": "path",
13149	//       "required": true,
13150	//       "type": "string"
13151	//     },
13152	//     "provisionalUserProject": {
13153	//       "description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
13154	//       "location": "query",
13155	//       "type": "string"
13156	//     },
13157	//     "userProject": {
13158	//       "description": "The project to be billed for this request.",
13159	//       "location": "query",
13160	//       "type": "string"
13161	//     }
13162	//   },
13163	//   "path": "projects/{projectId}/serviceAccount",
13164	//   "response": {
13165	//     "$ref": "ServiceAccount"
13166	//   },
13167	//   "scopes": [
13168	//     "https://www.googleapis.com/auth/cloud-platform",
13169	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13170	//     "https://www.googleapis.com/auth/devstorage.full_control",
13171	//     "https://www.googleapis.com/auth/devstorage.read_only",
13172	//     "https://www.googleapis.com/auth/devstorage.read_write"
13173	//   ]
13174	// }
13175
13176}
13177