]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/google.golang.org/api/storage/v1/storage-gen.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / google.golang.org / api / storage / v1 / storage-gen.go
1 // Copyright 2018 Google Inc. All rights reserved.
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 // See https://developers.google.com/storage/docs/json_api/
12 //
13 // Usage example:
14 //
15 // import "google.golang.org/api/storage/v1"
16 // ...
17 // storageService, err := storage.New(oauthHttpClient)
18 package storage // import "google.golang.org/api/storage/v1"
19
20 import (
21 "bytes"
22 "context"
23 "encoding/json"
24 "errors"
25 "fmt"
26 "io"
27 "net/http"
28 "net/url"
29 "strconv"
30 "strings"
31
32 gensupport "google.golang.org/api/gensupport"
33 googleapi "google.golang.org/api/googleapi"
34 )
35
36 // Always reference these packages, just in case the auto-generated code
37 // below doesn't.
38 var _ = bytes.NewBuffer
39 var _ = strconv.Itoa
40 var _ = fmt.Sprintf
41 var _ = json.NewDecoder
42 var _ = io.Copy
43 var _ = url.Parse
44 var _ = gensupport.MarshalJSON
45 var _ = googleapi.Version
46 var _ = errors.New
47 var _ = strings.Replace
48 var _ = context.Canceled
49
50 const apiId = "storage:v1"
51 const apiName = "storage"
52 const apiVersion = "v1"
53 const basePath = "https://www.googleapis.com/storage/v1/"
54
55 // OAuth2 scopes used by this API.
56 const (
57 // View and manage your data across Google Cloud Platform services
58 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
59
60 // View your data across Google Cloud Platform services
61 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
62
63 // Manage your data and permissions in Google Cloud Storage
64 DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
65
66 // View your data in Google Cloud Storage
67 DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
68
69 // Manage your data in Google Cloud Storage
70 DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
71 )
72
73 func New(client *http.Client) (*Service, error) {
74 if client == nil {
75 return nil, errors.New("client is nil")
76 }
77 s := &Service{client: client, BasePath: basePath}
78 s.BucketAccessControls = NewBucketAccessControlsService(s)
79 s.Buckets = NewBucketsService(s)
80 s.Channels = NewChannelsService(s)
81 s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
82 s.Notifications = NewNotificationsService(s)
83 s.ObjectAccessControls = NewObjectAccessControlsService(s)
84 s.Objects = NewObjectsService(s)
85 s.Projects = NewProjectsService(s)
86 return s, nil
87 }
88
89 type Service struct {
90 client *http.Client
91 BasePath string // API endpoint base URL
92 UserAgent string // optional additional User-Agent fragment
93
94 BucketAccessControls *BucketAccessControlsService
95
96 Buckets *BucketsService
97
98 Channels *ChannelsService
99
100 DefaultObjectAccessControls *DefaultObjectAccessControlsService
101
102 Notifications *NotificationsService
103
104 ObjectAccessControls *ObjectAccessControlsService
105
106 Objects *ObjectsService
107
108 Projects *ProjectsService
109 }
110
111 func (s *Service) userAgent() string {
112 if s.UserAgent == "" {
113 return googleapi.UserAgent
114 }
115 return googleapi.UserAgent + " " + s.UserAgent
116 }
117
118 func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
119 rs := &BucketAccessControlsService{s: s}
120 return rs
121 }
122
123 type BucketAccessControlsService struct {
124 s *Service
125 }
126
127 func NewBucketsService(s *Service) *BucketsService {
128 rs := &BucketsService{s: s}
129 return rs
130 }
131
132 type BucketsService struct {
133 s *Service
134 }
135
136 func NewChannelsService(s *Service) *ChannelsService {
137 rs := &ChannelsService{s: s}
138 return rs
139 }
140
141 type ChannelsService struct {
142 s *Service
143 }
144
145 func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
146 rs := &DefaultObjectAccessControlsService{s: s}
147 return rs
148 }
149
150 type DefaultObjectAccessControlsService struct {
151 s *Service
152 }
153
154 func NewNotificationsService(s *Service) *NotificationsService {
155 rs := &NotificationsService{s: s}
156 return rs
157 }
158
159 type NotificationsService struct {
160 s *Service
161 }
162
163 func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
164 rs := &ObjectAccessControlsService{s: s}
165 return rs
166 }
167
168 type ObjectAccessControlsService struct {
169 s *Service
170 }
171
172 func NewObjectsService(s *Service) *ObjectsService {
173 rs := &ObjectsService{s: s}
174 return rs
175 }
176
177 type ObjectsService struct {
178 s *Service
179 }
180
181 func NewProjectsService(s *Service) *ProjectsService {
182 rs := &ProjectsService{s: s}
183 rs.ServiceAccount = NewProjectsServiceAccountService(s)
184 return rs
185 }
186
187 type ProjectsService struct {
188 s *Service
189
190 ServiceAccount *ProjectsServiceAccountService
191 }
192
193 func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
194 rs := &ProjectsServiceAccountService{s: s}
195 return rs
196 }
197
198 type ProjectsServiceAccountService struct {
199 s *Service
200 }
201
202 // Bucket: A bucket.
203 type Bucket struct {
204 // Acl: Access controls on the bucket.
205 Acl []*BucketAccessControl `json:"acl,omitempty"`
206
207 // Billing: The bucket's billing configuration.
208 Billing *BucketBilling `json:"billing,omitempty"`
209
210 // Cors: The bucket's Cross-Origin Resource Sharing (CORS)
211 // configuration.
212 Cors []*BucketCors `json:"cors,omitempty"`
213
214 // DefaultEventBasedHold: The default value for event-based hold on
215 // newly created objects in this bucket. Event-based hold is a way to
216 // retain objects indefinitely until an event occurs, signified by the
217 // hold's release. After being released, such objects will be subject to
218 // bucket-level retention (if any). One sample use case of this flag is
219 // for banks to hold loan documents for at least 3 years after loan is
220 // paid in full. Here, bucket-level retention is 3 years and the event
221 // is loan being paid in full. In this example, these objects will be
222 // held intact for any number of years until the event has occurred
223 // (event-based hold on the object is released) and then 3 more years
224 // after that. That means retention duration of the objects begins from
225 // the moment event-based hold transitioned from true to false. Objects
226 // under event-based hold cannot be deleted, overwritten or archived
227 // until the hold is removed.
228 DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
229
230 // DefaultObjectAcl: Default access controls to apply to new objects
231 // when no ACL is provided.
232 DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
233
234 // Encryption: Encryption configuration for a bucket.
235 Encryption *BucketEncryption `json:"encryption,omitempty"`
236
237 // Etag: HTTP 1.1 Entity tag for the bucket.
238 Etag string `json:"etag,omitempty"`
239
240 // IamConfiguration: The bucket's IAM configuration.
241 IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"`
242
243 // Id: The ID of the bucket. For buckets, the id and name properties are
244 // the same.
245 Id string `json:"id,omitempty"`
246
247 // Kind: The kind of item this is. For buckets, this is always
248 // storage#bucket.
249 Kind string `json:"kind,omitempty"`
250
251 // Labels: User-provided labels, in key/value pairs.
252 Labels map[string]string `json:"labels,omitempty"`
253
254 // Lifecycle: The bucket's lifecycle configuration. See lifecycle
255 // management for more information.
256 Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
257
258 // Location: The location of the bucket. Object data for objects in the
259 // bucket resides in physical storage within this region. Defaults to
260 // US. See the developer's guide for the authoritative list.
261 Location string `json:"location,omitempty"`
262
263 // Logging: The bucket's logging configuration, which defines the
264 // destination bucket and optional name prefix for the current bucket's
265 // logs.
266 Logging *BucketLogging `json:"logging,omitempty"`
267
268 // Metageneration: The metadata generation of this bucket.
269 Metageneration int64 `json:"metageneration,omitempty,string"`
270
271 // Name: The name of the bucket.
272 Name string `json:"name,omitempty"`
273
274 // Owner: The owner of the bucket. This is always the project team's
275 // owner group.
276 Owner *BucketOwner `json:"owner,omitempty"`
277
278 // ProjectNumber: The project number of the project the bucket belongs
279 // to.
280 ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
281
282 // RetentionPolicy: The bucket's retention policy. The retention policy
283 // enforces a minimum retention time for all objects contained in the
284 // bucket, based on their creation time. Any attempt to overwrite or
285 // delete objects younger than the retention period will result in a
286 // PERMISSION_DENIED error. An unlocked retention policy can be modified
287 // or removed from the bucket via a storage.buckets.update operation. A
288 // locked retention policy cannot be removed or shortened in duration
289 // for the lifetime of the bucket. Attempting to remove or decrease
290 // period of a locked retention policy will result in a
291 // PERMISSION_DENIED error.
292 RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"`
293
294 // SelfLink: The URI of this bucket.
295 SelfLink string `json:"selfLink,omitempty"`
296
297 // StorageClass: The bucket's default storage class, used whenever no
298 // storageClass is specified for a newly-created object. This defines
299 // how objects in the bucket are stored and determines the SLA and the
300 // cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD,
301 // NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value
302 // is not specified when the bucket is created, it will default to
303 // STANDARD. For more information, see storage classes.
304 StorageClass string `json:"storageClass,omitempty"`
305
306 // TimeCreated: The creation time of the bucket in RFC 3339 format.
307 TimeCreated string `json:"timeCreated,omitempty"`
308
309 // Updated: The modification time of the bucket in RFC 3339 format.
310 Updated string `json:"updated,omitempty"`
311
312 // Versioning: The bucket's versioning configuration.
313 Versioning *BucketVersioning `json:"versioning,omitempty"`
314
315 // Website: The bucket's website configuration, controlling how the
316 // service behaves when accessing bucket contents as a web site. See the
317 // Static Website Examples for more information.
318 Website *BucketWebsite `json:"website,omitempty"`
319
320 // ServerResponse contains the HTTP response code and headers from the
321 // server.
322 googleapi.ServerResponse `json:"-"`
323
324 // ForceSendFields is a list of field names (e.g. "Acl") to
325 // unconditionally include in API requests. By default, fields with
326 // empty values are omitted from API requests. However, any non-pointer,
327 // non-interface field appearing in ForceSendFields will be sent to the
328 // server regardless of whether the field is empty or not. This may be
329 // used to include empty fields in Patch requests.
330 ForceSendFields []string `json:"-"`
331
332 // NullFields is a list of field names (e.g. "Acl") to include in API
333 // requests with the JSON null value. By default, fields with empty
334 // values are omitted from API requests. However, any field with an
335 // empty value appearing in NullFields will be sent to the server as
336 // null. It is an error if a field in this list has a non-empty value.
337 // This may be used to include null fields in Patch requests.
338 NullFields []string `json:"-"`
339 }
340
341 func (s *Bucket) MarshalJSON() ([]byte, error) {
342 type NoMethod Bucket
343 raw := NoMethod(*s)
344 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
345 }
346
347 // BucketBilling: The bucket's billing configuration.
348 type BucketBilling struct {
349 // RequesterPays: When set to true, Requester Pays is enabled for this
350 // bucket.
351 RequesterPays bool `json:"requesterPays,omitempty"`
352
353 // ForceSendFields is a list of field names (e.g. "RequesterPays") to
354 // unconditionally include in API requests. By default, fields with
355 // empty values are omitted from API requests. However, any non-pointer,
356 // non-interface field appearing in ForceSendFields will be sent to the
357 // server regardless of whether the field is empty or not. This may be
358 // used to include empty fields in Patch requests.
359 ForceSendFields []string `json:"-"`
360
361 // NullFields is a list of field names (e.g. "RequesterPays") to include
362 // in API requests with the JSON null value. By default, fields with
363 // empty values are omitted from API requests. However, any field with
364 // an empty value appearing in NullFields will be sent to the server as
365 // null. It is an error if a field in this list has a non-empty value.
366 // This may be used to include null fields in Patch requests.
367 NullFields []string `json:"-"`
368 }
369
370 func (s *BucketBilling) MarshalJSON() ([]byte, error) {
371 type NoMethod BucketBilling
372 raw := NoMethod(*s)
373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
374 }
375
376 type BucketCors struct {
377 // MaxAgeSeconds: The value, in seconds, to return in the
378 // Access-Control-Max-Age header used in preflight responses.
379 MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
380
381 // Method: The list of HTTP methods on which to include CORS response
382 // headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list
383 // of methods, and means "any method".
384 Method []string `json:"method,omitempty"`
385
386 // Origin: The list of Origins eligible to receive CORS response
387 // headers. Note: "*" is permitted in the list of origins, and means
388 // "any Origin".
389 Origin []string `json:"origin,omitempty"`
390
391 // ResponseHeader: The list of HTTP headers other than the simple
392 // response headers to give permission for the user-agent to share
393 // across domains.
394 ResponseHeader []string `json:"responseHeader,omitempty"`
395
396 // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
397 // unconditionally include in API requests. By default, fields with
398 // empty values are omitted from API requests. However, any non-pointer,
399 // non-interface field appearing in ForceSendFields will be sent to the
400 // server regardless of whether the field is empty or not. This may be
401 // used to include empty fields in Patch requests.
402 ForceSendFields []string `json:"-"`
403
404 // NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
405 // in API requests with the JSON null value. By default, fields with
406 // empty values are omitted from API requests. However, any field with
407 // an empty value appearing in NullFields will be sent to the server as
408 // null. It is an error if a field in this list has a non-empty value.
409 // This may be used to include null fields in Patch requests.
410 NullFields []string `json:"-"`
411 }
412
413 func (s *BucketCors) MarshalJSON() ([]byte, error) {
414 type NoMethod BucketCors
415 raw := NoMethod(*s)
416 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
417 }
418
419 // BucketEncryption: Encryption configuration for a bucket.
420 type BucketEncryption struct {
421 // DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt
422 // objects inserted into this bucket, if no encryption method is
423 // specified.
424 DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
425
426 // ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName")
427 // to 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. "DefaultKmsKeyName") to
435 // include in API requests with the JSON null value. By default, fields
436 // with empty values are omitted from API requests. However, any field
437 // with an empty value appearing in NullFields will be sent to the
438 // server as null. It is an error if a field in this list has a
439 // non-empty value. This may be used to include null fields in Patch
440 // requests.
441 NullFields []string `json:"-"`
442 }
443
444 func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
445 type NoMethod BucketEncryption
446 raw := NoMethod(*s)
447 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
448 }
449
450 // BucketIamConfiguration: The bucket's IAM configuration.
451 type BucketIamConfiguration struct {
452 BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"`
453
454 // ForceSendFields is a list of field names (e.g. "BucketPolicyOnly") to
455 // unconditionally include in API requests. By default, fields with
456 // empty values are omitted from API requests. However, any non-pointer,
457 // non-interface field appearing in ForceSendFields will be sent to the
458 // server regardless of whether the field is empty or not. This may be
459 // used to include empty fields in Patch requests.
460 ForceSendFields []string `json:"-"`
461
462 // NullFields is a list of field names (e.g. "BucketPolicyOnly") to
463 // include in API requests with the JSON null value. By default, fields
464 // with empty values are omitted from API requests. However, any field
465 // with an empty value appearing in NullFields will be sent to the
466 // server as null. It is an error if a field in this list has a
467 // non-empty value. This may be used to include null fields in Patch
468 // requests.
469 NullFields []string `json:"-"`
470 }
471
472 func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) {
473 type NoMethod BucketIamConfiguration
474 raw := NoMethod(*s)
475 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
476 }
477
478 type BucketIamConfigurationBucketPolicyOnly struct {
479 // Enabled: If set, access checks only use bucket-level IAM policies or
480 // above.
481 Enabled bool `json:"enabled,omitempty"`
482
483 // LockedTime: The deadline time for changing
484 // iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC
485 // 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed
486 // from true to false until the locked time, after which the field is
487 // immutable.
488 LockedTime string `json:"lockedTime,omitempty"`
489
490 // ForceSendFields is a list of field names (e.g. "Enabled") to
491 // unconditionally include in API requests. By default, fields with
492 // empty values are omitted from API requests. However, any non-pointer,
493 // non-interface field appearing in ForceSendFields will be sent to the
494 // server regardless of whether the field is empty or not. This may be
495 // used to include empty fields in Patch requests.
496 ForceSendFields []string `json:"-"`
497
498 // NullFields is a list of field names (e.g. "Enabled") to include in
499 // API requests with the JSON null value. By default, fields with empty
500 // values are omitted from API requests. However, any field with an
501 // empty value appearing in NullFields will be sent to the server as
502 // null. It is an error if a field in this list has a non-empty value.
503 // This may be used to include null fields in Patch requests.
504 NullFields []string `json:"-"`
505 }
506
507 func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) {
508 type NoMethod BucketIamConfigurationBucketPolicyOnly
509 raw := NoMethod(*s)
510 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
511 }
512
513 // BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
514 // management for more information.
515 type BucketLifecycle struct {
516 // Rule: A lifecycle management rule, which is made of an action to take
517 // and the condition(s) under which the action will be taken.
518 Rule []*BucketLifecycleRule `json:"rule,omitempty"`
519
520 // ForceSendFields is a list of field names (e.g. "Rule") to
521 // unconditionally include in API requests. By default, fields with
522 // empty values are omitted from API requests. However, any non-pointer,
523 // non-interface field appearing in ForceSendFields will be sent to the
524 // server regardless of whether the field is empty or not. This may be
525 // used to include empty fields in Patch requests.
526 ForceSendFields []string `json:"-"`
527
528 // NullFields is a list of field names (e.g. "Rule") to include in API
529 // requests with the JSON null value. By default, fields with empty
530 // values are omitted from API requests. However, any field with an
531 // empty value appearing in NullFields will be sent to the server as
532 // null. It is an error if a field in this list has a non-empty value.
533 // This may be used to include null fields in Patch requests.
534 NullFields []string `json:"-"`
535 }
536
537 func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
538 type NoMethod BucketLifecycle
539 raw := NoMethod(*s)
540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
541 }
542
543 type BucketLifecycleRule struct {
544 // Action: The action to take.
545 Action *BucketLifecycleRuleAction `json:"action,omitempty"`
546
547 // Condition: The condition(s) under which the action will be taken.
548 Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
549
550 // ForceSendFields is a list of field names (e.g. "Action") to
551 // unconditionally include in API requests. By default, fields with
552 // empty values are omitted from API requests. However, any non-pointer,
553 // non-interface field appearing in ForceSendFields will be sent to the
554 // server regardless of whether the field is empty or not. This may be
555 // used to include empty fields in Patch requests.
556 ForceSendFields []string `json:"-"`
557
558 // NullFields is a list of field names (e.g. "Action") to include in API
559 // requests with the JSON null value. By default, fields with empty
560 // values are omitted from API requests. However, any field with an
561 // empty value appearing in NullFields will be sent to the server as
562 // null. It is an error if a field in this list has a non-empty value.
563 // This may be used to include null fields in Patch requests.
564 NullFields []string `json:"-"`
565 }
566
567 func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
568 type NoMethod BucketLifecycleRule
569 raw := NoMethod(*s)
570 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
571 }
572
573 // BucketLifecycleRuleAction: The action to take.
574 type BucketLifecycleRuleAction struct {
575 // StorageClass: Target storage class. Required iff the type of the
576 // action is SetStorageClass.
577 StorageClass string `json:"storageClass,omitempty"`
578
579 // Type: Type of the action. Currently, only Delete and SetStorageClass
580 // are supported.
581 Type string `json:"type,omitempty"`
582
583 // ForceSendFields is a list of field names (e.g. "StorageClass") to
584 // unconditionally include in API requests. By default, fields with
585 // empty values are omitted from API requests. However, any non-pointer,
586 // non-interface field appearing in ForceSendFields will be sent to the
587 // server regardless of whether the field is empty or not. This may be
588 // used to include empty fields in Patch requests.
589 ForceSendFields []string `json:"-"`
590
591 // NullFields is a list of field names (e.g. "StorageClass") to include
592 // in API requests with the JSON null value. By default, fields with
593 // empty values are omitted from API requests. However, any field with
594 // an empty value appearing in NullFields will be sent to the server as
595 // null. It is an error if a field in this list has a non-empty value.
596 // This may be used to include null fields in Patch requests.
597 NullFields []string `json:"-"`
598 }
599
600 func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
601 type NoMethod BucketLifecycleRuleAction
602 raw := NoMethod(*s)
603 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
604 }
605
606 // BucketLifecycleRuleCondition: The condition(s) under which the action
607 // will be taken.
608 type BucketLifecycleRuleCondition struct {
609 // Age: Age of an object (in days). This condition is satisfied when an
610 // object reaches the specified age.
611 Age int64 `json:"age,omitempty"`
612
613 // CreatedBefore: A date in RFC 3339 format with only the date part (for
614 // instance, "2013-01-15"). This condition is satisfied when an object
615 // is created before midnight of the specified date in UTC.
616 CreatedBefore string `json:"createdBefore,omitempty"`
617
618 // IsLive: Relevant only for versioned objects. If the value is true,
619 // this condition matches live objects; if the value is false, it
620 // matches archived objects.
621 IsLive *bool `json:"isLive,omitempty"`
622
623 // MatchesPattern: A regular expression that satisfies the RE2 syntax.
624 // This condition is satisfied when the name of the object matches the
625 // RE2 pattern. Note: This feature is currently in the "Early Access"
626 // launch stage and is only available to a whitelisted set of users;
627 // that means that this feature may be changed in backward-incompatible
628 // ways and that it is not guaranteed to be released.
629 MatchesPattern string `json:"matchesPattern,omitempty"`
630
631 // MatchesStorageClass: Objects having any of the storage classes
632 // specified by this condition will be matched. Values include
633 // MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and
634 // DURABLE_REDUCED_AVAILABILITY.
635 MatchesStorageClass []string `json:"matchesStorageClass,omitempty"`
636
637 // NumNewerVersions: Relevant only for versioned objects. If the value
638 // is N, this condition is satisfied when there are at least N versions
639 // (including the live version) newer than this version of the object.
640 NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
641
642 // ForceSendFields is a list of field names (e.g. "Age") to
643 // unconditionally include in API requests. By default, fields with
644 // empty values are omitted from API requests. However, any non-pointer,
645 // non-interface field appearing in ForceSendFields will be sent to the
646 // server regardless of whether the field is empty or not. This may be
647 // used to include empty fields in Patch requests.
648 ForceSendFields []string `json:"-"`
649
650 // NullFields is a list of field names (e.g. "Age") to include in API
651 // requests with the JSON null value. By default, fields with empty
652 // values are omitted from API requests. However, any field with an
653 // empty value appearing in NullFields will be sent to the server as
654 // null. It is an error if a field in this list has a non-empty value.
655 // This may be used to include null fields in Patch requests.
656 NullFields []string `json:"-"`
657 }
658
659 func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
660 type NoMethod BucketLifecycleRuleCondition
661 raw := NoMethod(*s)
662 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
663 }
664
665 // BucketLogging: The bucket's logging configuration, which defines the
666 // destination bucket and optional name prefix for the current bucket's
667 // logs.
668 type BucketLogging struct {
669 // LogBucket: The destination bucket where the current bucket's logs
670 // should be placed.
671 LogBucket string `json:"logBucket,omitempty"`
672
673 // LogObjectPrefix: A prefix for log object names.
674 LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
675
676 // ForceSendFields is a list of field names (e.g. "LogBucket") to
677 // unconditionally include in API requests. By default, fields with
678 // empty values are omitted from API requests. However, any non-pointer,
679 // non-interface field appearing in ForceSendFields will be sent to the
680 // server regardless of whether the field is empty or not. This may be
681 // used to include empty fields in Patch requests.
682 ForceSendFields []string `json:"-"`
683
684 // NullFields is a list of field names (e.g. "LogBucket") to include in
685 // API requests with the JSON null value. By default, fields with empty
686 // values are omitted from API requests. However, any field with an
687 // empty value appearing in NullFields will be sent to the server as
688 // null. It is an error if a field in this list has a non-empty value.
689 // This may be used to include null fields in Patch requests.
690 NullFields []string `json:"-"`
691 }
692
693 func (s *BucketLogging) MarshalJSON() ([]byte, error) {
694 type NoMethod BucketLogging
695 raw := NoMethod(*s)
696 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
697 }
698
699 // BucketOwner: The owner of the bucket. This is always the project
700 // team's owner group.
701 type BucketOwner struct {
702 // Entity: The entity, in the form project-owner-projectId.
703 Entity string `json:"entity,omitempty"`
704
705 // EntityId: The ID for the entity.
706 EntityId string `json:"entityId,omitempty"`
707
708 // ForceSendFields is a list of field names (e.g. "Entity") to
709 // unconditionally include in API requests. By default, fields with
710 // empty values are omitted from API requests. However, any non-pointer,
711 // non-interface field appearing in ForceSendFields will be sent to the
712 // server regardless of whether the field is empty or not. This may be
713 // used to include empty fields in Patch requests.
714 ForceSendFields []string `json:"-"`
715
716 // NullFields is a list of field names (e.g. "Entity") to include in API
717 // requests with the JSON null value. By default, fields with empty
718 // values are omitted from API requests. However, any field with an
719 // empty value appearing in NullFields will be sent to the server as
720 // null. It is an error if a field in this list has a non-empty value.
721 // This may be used to include null fields in Patch requests.
722 NullFields []string `json:"-"`
723 }
724
725 func (s *BucketOwner) MarshalJSON() ([]byte, error) {
726 type NoMethod BucketOwner
727 raw := NoMethod(*s)
728 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
729 }
730
731 // BucketRetentionPolicy: The bucket's retention policy. The retention
732 // policy enforces a minimum retention time for all objects contained in
733 // the bucket, based on their creation time. Any attempt to overwrite or
734 // delete objects younger than the retention period will result in a
735 // PERMISSION_DENIED error. An unlocked retention policy can be modified
736 // or removed from the bucket via a storage.buckets.update operation. A
737 // locked retention policy cannot be removed or shortened in duration
738 // for the lifetime of the bucket. Attempting to remove or decrease
739 // period of a locked retention policy will result in a
740 // PERMISSION_DENIED error.
741 type BucketRetentionPolicy struct {
742 // EffectiveTime: Server-determined value that indicates the time from
743 // which policy was enforced and effective. This value is in RFC 3339
744 // format.
745 EffectiveTime string `json:"effectiveTime,omitempty"`
746
747 // IsLocked: Once locked, an object retention policy cannot be modified.
748 IsLocked bool `json:"isLocked,omitempty"`
749
750 // RetentionPeriod: The duration in seconds that objects need to be
751 // retained. Retention duration must be greater than zero and less than
752 // 100 years. Note that enforcement of retention periods less than a day
753 // is not guaranteed. Such periods should only be used for testing
754 // purposes.
755 RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"`
756
757 // ForceSendFields is a list of field names (e.g. "EffectiveTime") to
758 // unconditionally include in API requests. By default, fields with
759 // empty values are omitted from API requests. However, any non-pointer,
760 // non-interface field appearing in ForceSendFields will be sent to the
761 // server regardless of whether the field is empty or not. This may be
762 // used to include empty fields in Patch requests.
763 ForceSendFields []string `json:"-"`
764
765 // NullFields is a list of field names (e.g. "EffectiveTime") to include
766 // in API requests with the JSON null value. By default, fields with
767 // empty values are omitted from API requests. However, any field with
768 // an empty value appearing in NullFields will be sent to the server as
769 // null. It is an error if a field in this list has a non-empty value.
770 // This may be used to include null fields in Patch requests.
771 NullFields []string `json:"-"`
772 }
773
774 func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) {
775 type NoMethod BucketRetentionPolicy
776 raw := NoMethod(*s)
777 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
778 }
779
780 // BucketVersioning: The bucket's versioning configuration.
781 type BucketVersioning struct {
782 // Enabled: While set to true, versioning is fully enabled for this
783 // bucket.
784 Enabled bool `json:"enabled,omitempty"`
785
786 // ForceSendFields is a list of field names (e.g. "Enabled") to
787 // unconditionally include in API requests. By default, fields with
788 // empty values are omitted from API requests. However, any non-pointer,
789 // non-interface field appearing in ForceSendFields will be sent to the
790 // server regardless of whether the field is empty or not. This may be
791 // used to include empty fields in Patch requests.
792 ForceSendFields []string `json:"-"`
793
794 // NullFields is a list of field names (e.g. "Enabled") to include in
795 // API requests with the JSON null value. By default, fields with empty
796 // values are omitted from API requests. However, any field with an
797 // empty value appearing in NullFields will be sent to the server as
798 // null. It is an error if a field in this list has a non-empty value.
799 // This may be used to include null fields in Patch requests.
800 NullFields []string `json:"-"`
801 }
802
803 func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
804 type NoMethod BucketVersioning
805 raw := NoMethod(*s)
806 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
807 }
808
809 // BucketWebsite: The bucket's website configuration, controlling how
810 // the service behaves when accessing bucket contents as a web site. See
811 // the Static Website Examples for more information.
812 type BucketWebsite struct {
813 // MainPageSuffix: If the requested object path is missing, the service
814 // will ensure the path has a trailing '/', append this suffix, and
815 // attempt to retrieve the resulting object. This allows the creation of
816 // index.html objects to represent directory pages.
817 MainPageSuffix string `json:"mainPageSuffix,omitempty"`
818
819 // NotFoundPage: If the requested object path is missing, and any
820 // mainPageSuffix object is missing, if applicable, the service will
821 // return the named object from this bucket as the content for a 404 Not
822 // Found result.
823 NotFoundPage string `json:"notFoundPage,omitempty"`
824
825 // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
826 // unconditionally include in API requests. By default, fields with
827 // empty values are omitted from API requests. However, any non-pointer,
828 // non-interface field appearing in ForceSendFields will be sent to the
829 // server regardless of whether the field is empty or not. This may be
830 // used to include empty fields in Patch requests.
831 ForceSendFields []string `json:"-"`
832
833 // NullFields is a list of field names (e.g. "MainPageSuffix") to
834 // include in API requests with the JSON null value. By default, fields
835 // with empty values are omitted from API requests. However, any field
836 // with an empty value appearing in NullFields will be sent to the
837 // server as null. It is an error if a field in this list has a
838 // non-empty value. This may be used to include null fields in Patch
839 // requests.
840 NullFields []string `json:"-"`
841 }
842
843 func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
844 type NoMethod BucketWebsite
845 raw := NoMethod(*s)
846 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
847 }
848
849 // BucketAccessControl: An access-control entry.
850 type BucketAccessControl struct {
851 // Bucket: The name of the bucket.
852 Bucket string `json:"bucket,omitempty"`
853
854 // Domain: The domain associated with the entity, if any.
855 Domain string `json:"domain,omitempty"`
856
857 // Email: The email address associated with the entity, if any.
858 Email string `json:"email,omitempty"`
859
860 // Entity: The entity holding the permission, in one of the following
861 // forms:
862 // - user-userId
863 // - user-email
864 // - group-groupId
865 // - group-email
866 // - domain-domain
867 // - project-team-projectId
868 // - allUsers
869 // - allAuthenticatedUsers Examples:
870 // - The user liz@example.com would be user-liz@example.com.
871 // - The group example@googlegroups.com would be
872 // group-example@googlegroups.com.
873 // - To refer to all members of the Google Apps for Business domain
874 // example.com, the entity would be domain-example.com.
875 Entity string `json:"entity,omitempty"`
876
877 // EntityId: The ID for the entity, if any.
878 EntityId string `json:"entityId,omitempty"`
879
880 // Etag: HTTP 1.1 Entity tag for the access-control entry.
881 Etag string `json:"etag,omitempty"`
882
883 // Id: The ID of the access-control entry.
884 Id string `json:"id,omitempty"`
885
886 // Kind: The kind of item this is. For bucket access control entries,
887 // this is always storage#bucketAccessControl.
888 Kind string `json:"kind,omitempty"`
889
890 // ProjectTeam: The project team associated with the entity, if any.
891 ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
892
893 // Role: The access permission for the entity.
894 Role string `json:"role,omitempty"`
895
896 // SelfLink: The link to this access-control entry.
897 SelfLink string `json:"selfLink,omitempty"`
898
899 // ServerResponse contains the HTTP response code and headers from the
900 // server.
901 googleapi.ServerResponse `json:"-"`
902
903 // ForceSendFields is a list of field names (e.g. "Bucket") to
904 // unconditionally include in API requests. By default, fields with
905 // empty values are omitted from API requests. However, any non-pointer,
906 // non-interface field appearing in ForceSendFields will be sent to the
907 // server regardless of whether the field is empty or not. This may be
908 // used to include empty fields in Patch requests.
909 ForceSendFields []string `json:"-"`
910
911 // NullFields is a list of field names (e.g. "Bucket") to include in API
912 // requests with the JSON null value. By default, fields with empty
913 // values are omitted from API requests. However, any field with an
914 // empty value appearing in NullFields will be sent to the server as
915 // null. It is an error if a field in this list has a non-empty value.
916 // This may be used to include null fields in Patch requests.
917 NullFields []string `json:"-"`
918 }
919
920 func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
921 type NoMethod BucketAccessControl
922 raw := NoMethod(*s)
923 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
924 }
925
926 // BucketAccessControlProjectTeam: The project team associated with the
927 // entity, if any.
928 type BucketAccessControlProjectTeam struct {
929 // ProjectNumber: The project number.
930 ProjectNumber string `json:"projectNumber,omitempty"`
931
932 // Team: The team.
933 Team string `json:"team,omitempty"`
934
935 // ForceSendFields is a list of field names (e.g. "ProjectNumber") to
936 // unconditionally include in API requests. By default, fields with
937 // empty values are omitted from API requests. However, any non-pointer,
938 // non-interface field appearing in ForceSendFields will be sent to the
939 // server regardless of whether the field is empty or not. This may be
940 // used to include empty fields in Patch requests.
941 ForceSendFields []string `json:"-"`
942
943 // NullFields is a list of field names (e.g. "ProjectNumber") to include
944 // in API requests with the JSON null value. By default, fields with
945 // empty values are omitted from API requests. However, any field with
946 // an empty value appearing in NullFields will be sent to the server as
947 // null. It is an error if a field in this list has a non-empty value.
948 // This may be used to include null fields in Patch requests.
949 NullFields []string `json:"-"`
950 }
951
952 func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
953 type NoMethod BucketAccessControlProjectTeam
954 raw := NoMethod(*s)
955 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
956 }
957
958 // BucketAccessControls: An access-control list.
959 type BucketAccessControls struct {
960 // Items: The list of items.
961 Items []*BucketAccessControl `json:"items,omitempty"`
962
963 // Kind: The kind of item this is. For lists of bucket access control
964 // entries, this is always storage#bucketAccessControls.
965 Kind string `json:"kind,omitempty"`
966
967 // ServerResponse contains the HTTP response code and headers from the
968 // server.
969 googleapi.ServerResponse `json:"-"`
970
971 // ForceSendFields is a list of field names (e.g. "Items") to
972 // unconditionally include in API requests. By default, fields with
973 // empty values are omitted from API requests. However, any non-pointer,
974 // non-interface field appearing in ForceSendFields will be sent to the
975 // server regardless of whether the field is empty or not. This may be
976 // used to include empty fields in Patch requests.
977 ForceSendFields []string `json:"-"`
978
979 // NullFields is a list of field names (e.g. "Items") to include in API
980 // requests with the JSON null value. By default, fields with empty
981 // values are omitted from API requests. However, any field with an
982 // empty value appearing in NullFields will be sent to the server as
983 // null. It is an error if a field in this list has a non-empty value.
984 // This may be used to include null fields in Patch requests.
985 NullFields []string `json:"-"`
986 }
987
988 func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
989 type NoMethod BucketAccessControls
990 raw := NoMethod(*s)
991 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
992 }
993
994 // Buckets: A list of buckets.
995 type Buckets struct {
996 // Items: The list of items.
997 Items []*Bucket `json:"items,omitempty"`
998
999 // Kind: The kind of item this is. For lists of buckets, this is always
1000 // storage#buckets.
1001 Kind string `json:"kind,omitempty"`
1002
1003 // NextPageToken: The continuation token, used to page through large
1004 // result sets. Provide this value in a subsequent request to return the
1005 // next page of results.
1006 NextPageToken string `json:"nextPageToken,omitempty"`
1007
1008 // ServerResponse contains the HTTP response code and headers from the
1009 // server.
1010 googleapi.ServerResponse `json:"-"`
1011
1012 // ForceSendFields is a list of field names (e.g. "Items") to
1013 // unconditionally include in API requests. By default, fields with
1014 // empty values are omitted from API requests. However, any non-pointer,
1015 // non-interface field appearing in ForceSendFields will be sent to the
1016 // server regardless of whether the field is empty or not. This may be
1017 // used to include empty fields in Patch requests.
1018 ForceSendFields []string `json:"-"`
1019
1020 // NullFields is a list of field names (e.g. "Items") to include in API
1021 // requests with the JSON null value. By default, fields with empty
1022 // values are omitted from API requests. However, any field with an
1023 // empty value appearing in NullFields will be sent to the server as
1024 // null. It is an error if a field in this list has a non-empty value.
1025 // This may be used to include null fields in Patch requests.
1026 NullFields []string `json:"-"`
1027 }
1028
1029 func (s *Buckets) MarshalJSON() ([]byte, error) {
1030 type NoMethod Buckets
1031 raw := NoMethod(*s)
1032 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1033 }
1034
1035 // Channel: An notification channel used to watch for resource changes.
1036 type Channel struct {
1037 // Address: The address where notifications are delivered for this
1038 // channel.
1039 Address string `json:"address,omitempty"`
1040
1041 // Expiration: Date and time of notification channel expiration,
1042 // expressed as a Unix timestamp, in milliseconds. Optional.
1043 Expiration int64 `json:"expiration,omitempty,string"`
1044
1045 // Id: A UUID or similar unique string that identifies this channel.
1046 Id string `json:"id,omitempty"`
1047
1048 // Kind: Identifies this as a notification channel used to watch for
1049 // changes to a resource. Value: the fixed string "api#channel".
1050 Kind string `json:"kind,omitempty"`
1051
1052 // Params: Additional parameters controlling delivery channel behavior.
1053 // Optional.
1054 Params map[string]string `json:"params,omitempty"`
1055
1056 // Payload: A Boolean value to indicate whether payload is wanted.
1057 // Optional.
1058 Payload bool `json:"payload,omitempty"`
1059
1060 // ResourceId: An opaque ID that identifies the resource being watched
1061 // on this channel. Stable across different API versions.
1062 ResourceId string `json:"resourceId,omitempty"`
1063
1064 // ResourceUri: A version-specific identifier for the watched resource.
1065 ResourceUri string `json:"resourceUri,omitempty"`
1066
1067 // Token: An arbitrary string delivered to the target address with each
1068 // notification delivered over this channel. Optional.
1069 Token string `json:"token,omitempty"`
1070
1071 // Type: The type of delivery mechanism used for this channel.
1072 Type string `json:"type,omitempty"`
1073
1074 // ServerResponse contains the HTTP response code and headers from the
1075 // server.
1076 googleapi.ServerResponse `json:"-"`
1077
1078 // ForceSendFields is a list of field names (e.g. "Address") to
1079 // unconditionally include in API requests. By default, fields with
1080 // empty values are omitted from API requests. However, any non-pointer,
1081 // non-interface field appearing in ForceSendFields will be sent to the
1082 // server regardless of whether the field is empty or not. This may be
1083 // used to include empty fields in Patch requests.
1084 ForceSendFields []string `json:"-"`
1085
1086 // NullFields is a list of field names (e.g. "Address") to include in
1087 // API requests with the JSON null value. By default, fields with empty
1088 // values are omitted from API requests. However, any field with an
1089 // empty value appearing in NullFields will be sent to the server as
1090 // null. It is an error if a field in this list has a non-empty value.
1091 // This may be used to include null fields in Patch requests.
1092 NullFields []string `json:"-"`
1093 }
1094
1095 func (s *Channel) MarshalJSON() ([]byte, error) {
1096 type NoMethod Channel
1097 raw := NoMethod(*s)
1098 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1099 }
1100
1101 // ComposeRequest: A Compose request.
1102 type ComposeRequest struct {
1103 // Destination: Properties of the resulting object.
1104 Destination *Object `json:"destination,omitempty"`
1105
1106 // Kind: The kind of item this is.
1107 Kind string `json:"kind,omitempty"`
1108
1109 // SourceObjects: The list of source objects that will be concatenated
1110 // into a single object.
1111 SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
1112
1113 // ForceSendFields is a list of field names (e.g. "Destination") to
1114 // unconditionally include in API requests. By default, fields with
1115 // empty values are omitted from API requests. However, any non-pointer,
1116 // non-interface field appearing in ForceSendFields will be sent to the
1117 // server regardless of whether the field is empty or not. This may be
1118 // used to include empty fields in Patch requests.
1119 ForceSendFields []string `json:"-"`
1120
1121 // NullFields is a list of field names (e.g. "Destination") to include
1122 // in API requests with the JSON null value. By default, fields with
1123 // empty values are omitted from API requests. However, any field with
1124 // an empty value appearing in NullFields will be sent to the server as
1125 // null. It is an error if a field in this list has a non-empty value.
1126 // This may be used to include null fields in Patch requests.
1127 NullFields []string `json:"-"`
1128 }
1129
1130 func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
1131 type NoMethod ComposeRequest
1132 raw := NoMethod(*s)
1133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1134 }
1135
1136 type ComposeRequestSourceObjects struct {
1137 // Generation: The generation of this object to use as the source.
1138 Generation int64 `json:"generation,omitempty,string"`
1139
1140 // Name: The source object's name. All source objects must reside in the
1141 // same bucket.
1142 Name string `json:"name,omitempty"`
1143
1144 // ObjectPreconditions: Conditions that must be met for this operation
1145 // to execute.
1146 ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
1147
1148 // ForceSendFields is a list of field names (e.g. "Generation") to
1149 // unconditionally include in API requests. By default, fields with
1150 // empty values are omitted from API requests. However, any non-pointer,
1151 // non-interface field appearing in ForceSendFields will be sent to the
1152 // server regardless of whether the field is empty or not. This may be
1153 // used to include empty fields in Patch requests.
1154 ForceSendFields []string `json:"-"`
1155
1156 // NullFields is a list of field names (e.g. "Generation") to include in
1157 // API requests with the JSON null value. By default, fields with empty
1158 // values are omitted from API requests. However, any field with an
1159 // empty value appearing in NullFields will be sent to the server as
1160 // null. It is an error if a field in this list has a non-empty value.
1161 // This may be used to include null fields in Patch requests.
1162 NullFields []string `json:"-"`
1163 }
1164
1165 func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
1166 type NoMethod ComposeRequestSourceObjects
1167 raw := NoMethod(*s)
1168 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1169 }
1170
1171 // ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
1172 // be met for this operation to execute.
1173 type ComposeRequestSourceObjectsObjectPreconditions struct {
1174 // IfGenerationMatch: Only perform the composition if the generation of
1175 // the source object that would be used matches this value. If this
1176 // value and a generation are both specified, they must be the same
1177 // value or the call will fail.
1178 IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
1179
1180 // ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
1181 // to unconditionally include in API requests. By default, fields with
1182 // empty values are omitted from API requests. However, any non-pointer,
1183 // non-interface field appearing in ForceSendFields will be sent to the
1184 // server regardless of whether the field is empty or not. This may be
1185 // used to include empty fields in Patch requests.
1186 ForceSendFields []string `json:"-"`
1187
1188 // NullFields is a list of field names (e.g. "IfGenerationMatch") to
1189 // include in API requests with the JSON null value. By default, fields
1190 // with empty values are omitted from API requests. However, any field
1191 // with an empty value appearing in NullFields will be sent to the
1192 // server as null. It is an error if a field in this list has a
1193 // non-empty value. This may be used to include null fields in Patch
1194 // requests.
1195 NullFields []string `json:"-"`
1196 }
1197
1198 func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
1199 type NoMethod ComposeRequestSourceObjectsObjectPreconditions
1200 raw := NoMethod(*s)
1201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1202 }
1203
1204 // Notification: A subscription to receive Google PubSub notifications.
1205 type Notification struct {
1206 // CustomAttributes: An optional list of additional attributes to attach
1207 // to each Cloud PubSub message published for this notification
1208 // subscription.
1209 CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
1210
1211 // Etag: HTTP 1.1 Entity tag for this subscription notification.
1212 Etag string `json:"etag,omitempty"`
1213
1214 // EventTypes: If present, only send notifications about listed event
1215 // types. If empty, sent notifications for all event types.
1216 EventTypes []string `json:"event_types,omitempty"`
1217
1218 // Id: The ID of the notification.
1219 Id string `json:"id,omitempty"`
1220
1221 // Kind: The kind of item this is. For notifications, this is always
1222 // storage#notification.
1223 Kind string `json:"kind,omitempty"`
1224
1225 // ObjectNamePrefix: If present, only apply this notification
1226 // configuration to object names that begin with this prefix.
1227 ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
1228
1229 // PayloadFormat: The desired content of the Payload.
1230 PayloadFormat string `json:"payload_format,omitempty"`
1231
1232 // SelfLink: The canonical URL of this notification.
1233 SelfLink string `json:"selfLink,omitempty"`
1234
1235 // Topic: The Cloud PubSub topic to which this subscription publishes.
1236 // Formatted as:
1237 // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
1238 // c}'
1239 Topic string `json:"topic,omitempty"`
1240
1241 // ServerResponse contains the HTTP response code and headers from the
1242 // server.
1243 googleapi.ServerResponse `json:"-"`
1244
1245 // ForceSendFields is a list of field names (e.g. "CustomAttributes") to
1246 // unconditionally include in API requests. By default, fields with
1247 // empty values are omitted from API requests. However, any non-pointer,
1248 // non-interface field appearing in ForceSendFields will be sent to the
1249 // server regardless of whether the field is empty or not. This may be
1250 // used to include empty fields in Patch requests.
1251 ForceSendFields []string `json:"-"`
1252
1253 // NullFields is a list of field names (e.g. "CustomAttributes") to
1254 // include in API requests with the JSON null value. By default, fields
1255 // with empty values are omitted from API requests. However, any field
1256 // with an empty value appearing in NullFields will be sent to the
1257 // server as null. It is an error if a field in this list has a
1258 // non-empty value. This may be used to include null fields in Patch
1259 // requests.
1260 NullFields []string `json:"-"`
1261 }
1262
1263 func (s *Notification) MarshalJSON() ([]byte, error) {
1264 type NoMethod Notification
1265 raw := NoMethod(*s)
1266 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1267 }
1268
1269 // Notifications: A list of notification subscriptions.
1270 type Notifications struct {
1271 // Items: The list of items.
1272 Items []*Notification `json:"items,omitempty"`
1273
1274 // Kind: The kind of item this is. For lists of notifications, this is
1275 // always storage#notifications.
1276 Kind string `json:"kind,omitempty"`
1277
1278 // ServerResponse contains the HTTP response code and headers from the
1279 // server.
1280 googleapi.ServerResponse `json:"-"`
1281
1282 // ForceSendFields is a list of field names (e.g. "Items") to
1283 // unconditionally include in API requests. By default, fields with
1284 // empty values are omitted from API requests. However, any non-pointer,
1285 // non-interface field appearing in ForceSendFields will be sent to the
1286 // server regardless of whether the field is empty or not. This may be
1287 // used to include empty fields in Patch requests.
1288 ForceSendFields []string `json:"-"`
1289
1290 // NullFields is a list of field names (e.g. "Items") to include in API
1291 // requests with the JSON null value. By default, fields with empty
1292 // values are omitted from API requests. However, any field with an
1293 // empty value appearing in NullFields will be sent to the server as
1294 // null. It is an error if a field in this list has a non-empty value.
1295 // This may be used to include null fields in Patch requests.
1296 NullFields []string `json:"-"`
1297 }
1298
1299 func (s *Notifications) MarshalJSON() ([]byte, error) {
1300 type NoMethod Notifications
1301 raw := NoMethod(*s)
1302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1303 }
1304
1305 // Object: An object.
1306 type Object struct {
1307 // Acl: Access controls on the object.
1308 Acl []*ObjectAccessControl `json:"acl,omitempty"`
1309
1310 // Bucket: The name of the bucket containing this object.
1311 Bucket string `json:"bucket,omitempty"`
1312
1313 // CacheControl: Cache-Control directive for the object data. If
1314 // omitted, and the object is accessible to all anonymous users, the
1315 // default will be public, max-age=3600.
1316 CacheControl string `json:"cacheControl,omitempty"`
1317
1318 // ComponentCount: Number of underlying components that make up this
1319 // object. Components are accumulated by compose operations.
1320 ComponentCount int64 `json:"componentCount,omitempty"`
1321
1322 // ContentDisposition: Content-Disposition of the object data.
1323 ContentDisposition string `json:"contentDisposition,omitempty"`
1324
1325 // ContentEncoding: Content-Encoding of the object data.
1326 ContentEncoding string `json:"contentEncoding,omitempty"`
1327
1328 // ContentLanguage: Content-Language of the object data.
1329 ContentLanguage string `json:"contentLanguage,omitempty"`
1330
1331 // ContentType: Content-Type of the object data. If an object is stored
1332 // without a Content-Type, it is served as application/octet-stream.
1333 ContentType string `json:"contentType,omitempty"`
1334
1335 // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
1336 // encoded using base64 in big-endian byte order. For more information
1337 // about using the CRC32c checksum, see Hashes and ETags: Best
1338 // Practices.
1339 Crc32c string `json:"crc32c,omitempty"`
1340
1341 // CustomerEncryption: Metadata of customer-supplied encryption key, if
1342 // the object is encrypted by such a key.
1343 CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
1344
1345 // Etag: HTTP 1.1 Entity tag for the object.
1346 Etag string `json:"etag,omitempty"`
1347
1348 // EventBasedHold: Whether an object is under event-based hold.
1349 // Event-based hold is a way to retain objects until an event occurs,
1350 // which is signified by the hold's release (i.e. this value is set to
1351 // false). After being released (set to false), such objects will be
1352 // subject to bucket-level retention (if any). One sample use case of
1353 // this flag is for banks to hold loan documents for at least 3 years
1354 // after loan is paid in full. Here, bucket-level retention is 3 years
1355 // and the event is the loan being paid in full. In this example, these
1356 // objects will be held intact for any number of years until the event
1357 // has occurred (event-based hold on the object is released) and then 3
1358 // more years after that. That means retention duration of the objects
1359 // begins from the moment event-based hold transitioned from true to
1360 // false.
1361 EventBasedHold bool `json:"eventBasedHold,omitempty"`
1362
1363 // Generation: The content generation of this object. Used for object
1364 // versioning.
1365 Generation int64 `json:"generation,omitempty,string"`
1366
1367 // Id: The ID of the object, including the bucket name, object name, and
1368 // generation number.
1369 Id string `json:"id,omitempty"`
1370
1371 // Kind: The kind of item this is. For objects, this is always
1372 // storage#object.
1373 Kind string `json:"kind,omitempty"`
1374
1375 // KmsKeyName: Cloud KMS Key used to encrypt this object, if the object
1376 // is encrypted by such a key.
1377 KmsKeyName string `json:"kmsKeyName,omitempty"`
1378
1379 // Md5Hash: MD5 hash of the data; encoded using base64. For more
1380 // information about using the MD5 hash, see Hashes and ETags: Best
1381 // Practices.
1382 Md5Hash string `json:"md5Hash,omitempty"`
1383
1384 // MediaLink: Media download link.
1385 MediaLink string `json:"mediaLink,omitempty"`
1386
1387 // Metadata: User-provided metadata, in key/value pairs.
1388 Metadata map[string]string `json:"metadata,omitempty"`
1389
1390 // Metageneration: The version of the metadata for this object at this
1391 // generation. Used for preconditions and for detecting changes in
1392 // metadata. A metageneration number is only meaningful in the context
1393 // of a particular generation of a particular object.
1394 Metageneration int64 `json:"metageneration,omitempty,string"`
1395
1396 // Name: The name of the object. Required if not specified by URL
1397 // parameter.
1398 Name string `json:"name,omitempty"`
1399
1400 // Owner: The owner of the object. This will always be the uploader of
1401 // the object.
1402 Owner *ObjectOwner `json:"owner,omitempty"`
1403
1404 // RetentionExpirationTime: A server-determined value that specifies the
1405 // earliest time that the object's retention period expires. This value
1406 // is in RFC 3339 format. Note 1: This field is not provided for objects
1407 // with an active event-based hold, since retention expiration is
1408 // unknown until the hold is removed. Note 2: This value can be provided
1409 // even when temporary hold is set (so that the user can reason about
1410 // policy without having to first unset the temporary hold).
1411 RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"`
1412
1413 // SelfLink: The link to this object.
1414 SelfLink string `json:"selfLink,omitempty"`
1415
1416 // Size: Content-Length of the data in bytes.
1417 Size uint64 `json:"size,omitempty,string"`
1418
1419 // StorageClass: Storage class of the object.
1420 StorageClass string `json:"storageClass,omitempty"`
1421
1422 // TemporaryHold: Whether an object is under temporary hold. While this
1423 // flag is set to true, the object is protected against deletion and
1424 // overwrites. A common use case of this flag is regulatory
1425 // investigations where objects need to be retained while the
1426 // investigation is ongoing. Note that unlike event-based hold,
1427 // temporary hold does not impact retention expiration time of an
1428 // object.
1429 TemporaryHold bool `json:"temporaryHold,omitempty"`
1430
1431 // TimeCreated: The creation time of the object in RFC 3339 format.
1432 TimeCreated string `json:"timeCreated,omitempty"`
1433
1434 // TimeDeleted: The deletion time of the object in RFC 3339 format. Will
1435 // be returned if and only if this version of the object has been
1436 // deleted.
1437 TimeDeleted string `json:"timeDeleted,omitempty"`
1438
1439 // TimeStorageClassUpdated: The time at which the object's storage class
1440 // was last changed. When the object is initially created, it will be
1441 // set to timeCreated.
1442 TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
1443
1444 // Updated: The modification time of the object metadata in RFC 3339
1445 // format.
1446 Updated string `json:"updated,omitempty"`
1447
1448 // ServerResponse contains the HTTP response code and headers from the
1449 // server.
1450 googleapi.ServerResponse `json:"-"`
1451
1452 // ForceSendFields is a list of field names (e.g. "Acl") to
1453 // unconditionally include in API requests. By default, fields with
1454 // empty values are omitted from API requests. However, any non-pointer,
1455 // non-interface field appearing in ForceSendFields will be sent to the
1456 // server regardless of whether the field is empty or not. This may be
1457 // used to include empty fields in Patch requests.
1458 ForceSendFields []string `json:"-"`
1459
1460 // NullFields is a list of field names (e.g. "Acl") to include in API
1461 // requests with the JSON null value. By default, fields with empty
1462 // values are omitted from API requests. However, any field with an
1463 // empty value appearing in NullFields will be sent to the server as
1464 // null. It is an error if a field in this list has a non-empty value.
1465 // This may be used to include null fields in Patch requests.
1466 NullFields []string `json:"-"`
1467 }
1468
1469 func (s *Object) MarshalJSON() ([]byte, error) {
1470 type NoMethod Object
1471 raw := NoMethod(*s)
1472 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1473 }
1474
1475 // ObjectCustomerEncryption: Metadata of customer-supplied encryption
1476 // key, if the object is encrypted by such a key.
1477 type ObjectCustomerEncryption struct {
1478 // EncryptionAlgorithm: The encryption algorithm.
1479 EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"`
1480
1481 // KeySha256: SHA256 hash value of the encryption key.
1482 KeySha256 string `json:"keySha256,omitempty"`
1483
1484 // ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm")
1485 // to unconditionally include in API requests. By default, fields with
1486 // empty values are omitted from API requests. However, any non-pointer,
1487 // non-interface field appearing in ForceSendFields will be sent to the
1488 // server regardless of whether the field is empty or not. This may be
1489 // used to include empty fields in Patch requests.
1490 ForceSendFields []string `json:"-"`
1491
1492 // NullFields is a list of field names (e.g. "EncryptionAlgorithm") to
1493 // include in API requests with the JSON null value. By default, fields
1494 // with empty values are omitted from API requests. However, any field
1495 // with an empty value appearing in NullFields will be sent to the
1496 // server as null. It is an error if a field in this list has a
1497 // non-empty value. This may be used to include null fields in Patch
1498 // requests.
1499 NullFields []string `json:"-"`
1500 }
1501
1502 func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
1503 type NoMethod ObjectCustomerEncryption
1504 raw := NoMethod(*s)
1505 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1506 }
1507
1508 // ObjectOwner: The owner of the object. This will always be the
1509 // uploader of the object.
1510 type ObjectOwner struct {
1511 // Entity: The entity, in the form user-userId.
1512 Entity string `json:"entity,omitempty"`
1513
1514 // EntityId: The ID for the entity.
1515 EntityId string `json:"entityId,omitempty"`
1516
1517 // ForceSendFields is a list of field names (e.g. "Entity") to
1518 // unconditionally include in API requests. By default, fields with
1519 // empty values are omitted from API requests. However, any non-pointer,
1520 // non-interface field appearing in ForceSendFields will be sent to the
1521 // server regardless of whether the field is empty or not. This may be
1522 // used to include empty fields in Patch requests.
1523 ForceSendFields []string `json:"-"`
1524
1525 // NullFields is a list of field names (e.g. "Entity") to include in API
1526 // requests with the JSON null value. By default, fields with empty
1527 // values are omitted from API requests. However, any field with an
1528 // empty value appearing in NullFields will be sent to the server as
1529 // null. It is an error if a field in this list has a non-empty value.
1530 // This may be used to include null fields in Patch requests.
1531 NullFields []string `json:"-"`
1532 }
1533
1534 func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
1535 type NoMethod ObjectOwner
1536 raw := NoMethod(*s)
1537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1538 }
1539
1540 // ObjectAccessControl: An access-control entry.
1541 type ObjectAccessControl struct {
1542 // Bucket: The name of the bucket.
1543 Bucket string `json:"bucket,omitempty"`
1544
1545 // Domain: The domain associated with the entity, if any.
1546 Domain string `json:"domain,omitempty"`
1547
1548 // Email: The email address associated with the entity, if any.
1549 Email string `json:"email,omitempty"`
1550
1551 // Entity: The entity holding the permission, in one of the following
1552 // forms:
1553 // - user-userId
1554 // - user-email
1555 // - group-groupId
1556 // - group-email
1557 // - domain-domain
1558 // - project-team-projectId
1559 // - allUsers
1560 // - allAuthenticatedUsers Examples:
1561 // - The user liz@example.com would be user-liz@example.com.
1562 // - The group example@googlegroups.com would be
1563 // group-example@googlegroups.com.
1564 // - To refer to all members of the Google Apps for Business domain
1565 // example.com, the entity would be domain-example.com.
1566 Entity string `json:"entity,omitempty"`
1567
1568 // EntityId: The ID for the entity, if any.
1569 EntityId string `json:"entityId,omitempty"`
1570
1571 // Etag: HTTP 1.1 Entity tag for the access-control entry.
1572 Etag string `json:"etag,omitempty"`
1573
1574 // Generation: The content generation of the object, if applied to an
1575 // object.
1576 Generation int64 `json:"generation,omitempty,string"`
1577
1578 // Id: The ID of the access-control entry.
1579 Id string `json:"id,omitempty"`
1580
1581 // Kind: The kind of item this is. For object access control entries,
1582 // this is always storage#objectAccessControl.
1583 Kind string `json:"kind,omitempty"`
1584
1585 // Object: The name of the object, if applied to an object.
1586 Object string `json:"object,omitempty"`
1587
1588 // ProjectTeam: The project team associated with the entity, if any.
1589 ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
1590
1591 // Role: The access permission for the entity.
1592 Role string `json:"role,omitempty"`
1593
1594 // SelfLink: The link to this access-control entry.
1595 SelfLink string `json:"selfLink,omitempty"`
1596
1597 // ServerResponse contains the HTTP response code and headers from the
1598 // server.
1599 googleapi.ServerResponse `json:"-"`
1600
1601 // ForceSendFields is a list of field names (e.g. "Bucket") to
1602 // unconditionally include in API requests. By default, fields with
1603 // empty values are omitted from API requests. However, any non-pointer,
1604 // non-interface field appearing in ForceSendFields will be sent to the
1605 // server regardless of whether the field is empty or not. This may be
1606 // used to include empty fields in Patch requests.
1607 ForceSendFields []string `json:"-"`
1608
1609 // NullFields is a list of field names (e.g. "Bucket") to include in API
1610 // requests with the JSON null value. By default, fields with empty
1611 // values are omitted from API requests. However, any field with an
1612 // empty value appearing in NullFields will be sent to the server as
1613 // null. It is an error if a field in this list has a non-empty value.
1614 // This may be used to include null fields in Patch requests.
1615 NullFields []string `json:"-"`
1616 }
1617
1618 func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
1619 type NoMethod ObjectAccessControl
1620 raw := NoMethod(*s)
1621 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1622 }
1623
1624 // ObjectAccessControlProjectTeam: The project team associated with the
1625 // entity, if any.
1626 type ObjectAccessControlProjectTeam struct {
1627 // ProjectNumber: The project number.
1628 ProjectNumber string `json:"projectNumber,omitempty"`
1629
1630 // Team: The team.
1631 Team string `json:"team,omitempty"`
1632
1633 // ForceSendFields is a list of field names (e.g. "ProjectNumber") to
1634 // unconditionally include in API requests. By default, fields with
1635 // empty values are omitted from API requests. However, any non-pointer,
1636 // non-interface field appearing in ForceSendFields will be sent to the
1637 // server regardless of whether the field is empty or not. This may be
1638 // used to include empty fields in Patch requests.
1639 ForceSendFields []string `json:"-"`
1640
1641 // NullFields is a list of field names (e.g. "ProjectNumber") to include
1642 // in API requests with the JSON null value. By default, fields with
1643 // empty values are omitted from API requests. However, any field with
1644 // an empty value appearing in NullFields will be sent to the server as
1645 // null. It is an error if a field in this list has a non-empty value.
1646 // This may be used to include null fields in Patch requests.
1647 NullFields []string `json:"-"`
1648 }
1649
1650 func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1651 type NoMethod ObjectAccessControlProjectTeam
1652 raw := NoMethod(*s)
1653 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1654 }
1655
1656 // ObjectAccessControls: An access-control list.
1657 type ObjectAccessControls struct {
1658 // Items: The list of items.
1659 Items []*ObjectAccessControl `json:"items,omitempty"`
1660
1661 // Kind: The kind of item this is. For lists of object access control
1662 // entries, this is always storage#objectAccessControls.
1663 Kind string `json:"kind,omitempty"`
1664
1665 // ServerResponse contains the HTTP response code and headers from the
1666 // server.
1667 googleapi.ServerResponse `json:"-"`
1668
1669 // ForceSendFields is a list of field names (e.g. "Items") to
1670 // unconditionally include in API requests. By default, fields with
1671 // empty values are omitted from API requests. However, any non-pointer,
1672 // non-interface field appearing in ForceSendFields will be sent to the
1673 // server regardless of whether the field is empty or not. This may be
1674 // used to include empty fields in Patch requests.
1675 ForceSendFields []string `json:"-"`
1676
1677 // NullFields is a list of field names (e.g. "Items") to include in API
1678 // requests with the JSON null value. By default, fields with empty
1679 // values are omitted from API requests. However, any field with an
1680 // empty value appearing in NullFields will be sent to the server as
1681 // null. It is an error if a field in this list has a non-empty value.
1682 // This may be used to include null fields in Patch requests.
1683 NullFields []string `json:"-"`
1684 }
1685
1686 func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
1687 type NoMethod ObjectAccessControls
1688 raw := NoMethod(*s)
1689 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1690 }
1691
1692 // Objects: A list of objects.
1693 type Objects struct {
1694 // Items: The list of items.
1695 Items []*Object `json:"items,omitempty"`
1696
1697 // Kind: The kind of item this is. For lists of objects, this is always
1698 // storage#objects.
1699 Kind string `json:"kind,omitempty"`
1700
1701 // NextPageToken: The continuation token, used to page through large
1702 // result sets. Provide this value in a subsequent request to return the
1703 // next page of results.
1704 NextPageToken string `json:"nextPageToken,omitempty"`
1705
1706 // Prefixes: The list of prefixes of objects matching-but-not-listed up
1707 // to and including the requested delimiter.
1708 Prefixes []string `json:"prefixes,omitempty"`
1709
1710 // ServerResponse contains the HTTP response code and headers from the
1711 // server.
1712 googleapi.ServerResponse `json:"-"`
1713
1714 // ForceSendFields is a list of field names (e.g. "Items") to
1715 // unconditionally include in API requests. By default, fields with
1716 // empty values are omitted from API requests. However, any non-pointer,
1717 // non-interface field appearing in ForceSendFields will be sent to the
1718 // server regardless of whether the field is empty or not. This may be
1719 // used to include empty fields in Patch requests.
1720 ForceSendFields []string `json:"-"`
1721
1722 // NullFields is a list of field names (e.g. "Items") to include in API
1723 // requests with the JSON null value. By default, fields with empty
1724 // values are omitted from API requests. However, any field with an
1725 // empty value appearing in NullFields will be sent to the server as
1726 // null. It is an error if a field in this list has a non-empty value.
1727 // This may be used to include null fields in Patch requests.
1728 NullFields []string `json:"-"`
1729 }
1730
1731 func (s *Objects) MarshalJSON() ([]byte, error) {
1732 type NoMethod Objects
1733 raw := NoMethod(*s)
1734 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1735 }
1736
1737 // Policy: A bucket/object IAM policy.
1738 type Policy struct {
1739 // Bindings: An association between a role, which comes with a set of
1740 // permissions, and members who may assume that role.
1741 Bindings []*PolicyBindings `json:"bindings,omitempty"`
1742
1743 // Etag: HTTP 1.1 Entity tag for the policy.
1744 Etag string `json:"etag,omitempty"`
1745
1746 // Kind: The kind of item this is. For policies, this is always
1747 // storage#policy. This field is ignored on input.
1748 Kind string `json:"kind,omitempty"`
1749
1750 // ResourceId: The ID of the resource to which this policy belongs. Will
1751 // be of the form projects/_/buckets/bucket for buckets, and
1752 // projects/_/buckets/bucket/objects/object for objects. A specific
1753 // generation may be specified by appending #generationNumber to the end
1754 // of the object name, e.g.
1755 // projects/_/buckets/my-bucket/objects/data.txt#17. The current
1756 // generation can be denoted with #0. This field is ignored on input.
1757 ResourceId string `json:"resourceId,omitempty"`
1758
1759 // ServerResponse contains the HTTP response code and headers from the
1760 // server.
1761 googleapi.ServerResponse `json:"-"`
1762
1763 // ForceSendFields is a list of field names (e.g. "Bindings") to
1764 // unconditionally include in API requests. By default, fields with
1765 // empty values are omitted from API requests. However, any non-pointer,
1766 // non-interface field appearing in ForceSendFields will be sent to the
1767 // server regardless of whether the field is empty or not. This may be
1768 // used to include empty fields in Patch requests.
1769 ForceSendFields []string `json:"-"`
1770
1771 // NullFields is a list of field names (e.g. "Bindings") to include in
1772 // API requests with the JSON null value. By default, fields with empty
1773 // values are omitted from API requests. However, any field with an
1774 // empty value appearing in NullFields will be sent to the server as
1775 // null. It is an error if a field in this list has a non-empty value.
1776 // This may be used to include null fields in Patch requests.
1777 NullFields []string `json:"-"`
1778 }
1779
1780 func (s *Policy) MarshalJSON() ([]byte, error) {
1781 type NoMethod Policy
1782 raw := NoMethod(*s)
1783 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1784 }
1785
1786 type PolicyBindings struct {
1787 Condition interface{} `json:"condition,omitempty"`
1788
1789 // Members: A collection of identifiers for members who may assume the
1790 // provided role. Recognized identifiers are as follows:
1791 // - allUsers — A special identifier that represents anyone on the
1792 // internet; with or without a Google account.
1793 // - allAuthenticatedUsers — A special identifier that represents
1794 // anyone who is authenticated with a Google account or a service
1795 // account.
1796 // - user:emailid — An email address that represents a specific
1797 // account. For example, user:alice@gmail.com or user:joe@example.com.
1798 //
1799 // - serviceAccount:emailid — An email address that represents a
1800 // service account. For example,
1801 // serviceAccount:my-other-app@appspot.gserviceaccount.com .
1802 // - group:emailid — An email address that represents a Google group.
1803 // For example, group:admins@example.com.
1804 // - domain:domain — A Google Apps domain name that represents all the
1805 // users of that domain. For example, domain:google.com or
1806 // domain:example.com.
1807 // - projectOwner:projectid — Owners of the given project. For
1808 // example, projectOwner:my-example-project
1809 // - projectEditor:projectid — Editors of the given project. For
1810 // example, projectEditor:my-example-project
1811 // - projectViewer:projectid — Viewers of the given project. For
1812 // example, projectViewer:my-example-project
1813 Members []string `json:"members,omitempty"`
1814
1815 // Role: The role to which members belong. Two types of roles are
1816 // supported: new IAM roles, which grant permissions that do not map
1817 // directly to those provided by ACLs, and legacy IAM roles, which do
1818 // map directly to ACL permissions. All roles are of the format
1819 // roles/storage.specificRole.
1820 // The new IAM roles are:
1821 // - roles/storage.admin — Full control of Google Cloud Storage
1822 // resources.
1823 // - roles/storage.objectViewer — Read-Only access to Google Cloud
1824 // Storage objects.
1825 // - roles/storage.objectCreator — Access to create objects in Google
1826 // Cloud Storage.
1827 // - roles/storage.objectAdmin — Full control of Google Cloud Storage
1828 // objects. The legacy IAM roles are:
1829 // - roles/storage.legacyObjectReader — Read-only access to objects
1830 // without listing. Equivalent to an ACL entry on an object with the
1831 // READER role.
1832 // - roles/storage.legacyObjectOwner — Read/write access to existing
1833 // objects without listing. Equivalent to an ACL entry on an object with
1834 // the OWNER role.
1835 // - roles/storage.legacyBucketReader — Read access to buckets with
1836 // object listing. Equivalent to an ACL entry on a bucket with the
1837 // READER role.
1838 // - roles/storage.legacyBucketWriter — Read access to buckets with
1839 // object listing/creation/deletion. Equivalent to an ACL entry on a
1840 // bucket with the WRITER role.
1841 // - roles/storage.legacyBucketOwner — Read and write access to
1842 // existing buckets with object listing/creation/deletion. Equivalent to
1843 // an ACL entry on a bucket with the OWNER role.
1844 Role string `json:"role,omitempty"`
1845
1846 // ForceSendFields is a list of field names (e.g. "Condition") to
1847 // unconditionally include in API requests. By default, fields with
1848 // empty values are omitted from API requests. However, any non-pointer,
1849 // non-interface field appearing in ForceSendFields will be sent to the
1850 // server regardless of whether the field is empty or not. This may be
1851 // used to include empty fields in Patch requests.
1852 ForceSendFields []string `json:"-"`
1853
1854 // NullFields is a list of field names (e.g. "Condition") to include in
1855 // API requests with the JSON null value. By default, fields with empty
1856 // values are omitted from API requests. However, any field with an
1857 // empty value appearing in NullFields will be sent to the server as
1858 // null. It is an error if a field in this list has a non-empty value.
1859 // This may be used to include null fields in Patch requests.
1860 NullFields []string `json:"-"`
1861 }
1862
1863 func (s *PolicyBindings) MarshalJSON() ([]byte, error) {
1864 type NoMethod PolicyBindings
1865 raw := NoMethod(*s)
1866 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1867 }
1868
1869 // RewriteResponse: A rewrite response.
1870 type RewriteResponse struct {
1871 // Done: true if the copy is finished; otherwise, false if the copy is
1872 // in progress. This property is always present in the response.
1873 Done bool `json:"done,omitempty"`
1874
1875 // Kind: The kind of item this is.
1876 Kind string `json:"kind,omitempty"`
1877
1878 // ObjectSize: The total size of the object being copied in bytes. This
1879 // property is always present in the response.
1880 ObjectSize int64 `json:"objectSize,omitempty,string"`
1881
1882 // Resource: A resource containing the metadata for the copied-to
1883 // object. This property is present in the response only when copying
1884 // completes.
1885 Resource *Object `json:"resource,omitempty"`
1886
1887 // RewriteToken: A token to use in subsequent requests to continue
1888 // copying data. This token is present in the response only when there
1889 // is more data to copy.
1890 RewriteToken string `json:"rewriteToken,omitempty"`
1891
1892 // TotalBytesRewritten: The total bytes written so far, which can be
1893 // used to provide a waiting user with a progress indicator. This
1894 // property is always present in the response.
1895 TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
1896
1897 // ServerResponse contains the HTTP response code and headers from the
1898 // server.
1899 googleapi.ServerResponse `json:"-"`
1900
1901 // ForceSendFields is a list of field names (e.g. "Done") to
1902 // unconditionally include in API requests. By default, fields with
1903 // empty values are omitted from API requests. However, any non-pointer,
1904 // non-interface field appearing in ForceSendFields will be sent to the
1905 // server regardless of whether the field is empty or not. This may be
1906 // used to include empty fields in Patch requests.
1907 ForceSendFields []string `json:"-"`
1908
1909 // NullFields is a list of field names (e.g. "Done") to include in API
1910 // requests with the JSON null value. By default, fields with empty
1911 // values are omitted from API requests. However, any field with an
1912 // empty value appearing in NullFields will be sent to the server as
1913 // null. It is an error if a field in this list has a non-empty value.
1914 // This may be used to include null fields in Patch requests.
1915 NullFields []string `json:"-"`
1916 }
1917
1918 func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
1919 type NoMethod RewriteResponse
1920 raw := NoMethod(*s)
1921 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1922 }
1923
1924 // ServiceAccount: A subscription to receive Google PubSub
1925 // notifications.
1926 type ServiceAccount struct {
1927 // EmailAddress: The ID of the notification.
1928 EmailAddress string `json:"email_address,omitempty"`
1929
1930 // Kind: The kind of item this is. For notifications, this is always
1931 // storage#notification.
1932 Kind string `json:"kind,omitempty"`
1933
1934 // ServerResponse contains the HTTP response code and headers from the
1935 // server.
1936 googleapi.ServerResponse `json:"-"`
1937
1938 // ForceSendFields is a list of field names (e.g. "EmailAddress") to
1939 // unconditionally include in API requests. By default, fields with
1940 // empty values are omitted from API requests. However, any non-pointer,
1941 // non-interface field appearing in ForceSendFields will be sent to the
1942 // server regardless of whether the field is empty or not. This may be
1943 // used to include empty fields in Patch requests.
1944 ForceSendFields []string `json:"-"`
1945
1946 // NullFields is a list of field names (e.g. "EmailAddress") to include
1947 // in API requests with the JSON null value. By default, fields with
1948 // empty values are omitted from API requests. However, any field with
1949 // an empty value appearing in NullFields will be sent to the server as
1950 // null. It is an error if a field in this list has a non-empty value.
1951 // This may be used to include null fields in Patch requests.
1952 NullFields []string `json:"-"`
1953 }
1954
1955 func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
1956 type NoMethod ServiceAccount
1957 raw := NoMethod(*s)
1958 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1959 }
1960
1961 // TestIamPermissionsResponse: A
1962 // storage.(buckets|objects).testIamPermissions response.
1963 type TestIamPermissionsResponse struct {
1964 // Kind: The kind of item this is.
1965 Kind string `json:"kind,omitempty"`
1966
1967 // Permissions: The permissions held by the caller. Permissions are
1968 // always of the format storage.resource.capability, where resource is
1969 // one of buckets or objects. The supported permissions are as follows:
1970 //
1971 // - storage.buckets.delete — Delete bucket.
1972 // - storage.buckets.get — Read bucket metadata.
1973 // - storage.buckets.getIamPolicy — Read bucket IAM policy.
1974 // - storage.buckets.create — Create bucket.
1975 // - storage.buckets.list — List buckets.
1976 // - storage.buckets.setIamPolicy — Update bucket IAM policy.
1977 // - storage.buckets.update — Update bucket metadata.
1978 // - storage.objects.delete — Delete object.
1979 // - storage.objects.get — Read object data and metadata.
1980 // - storage.objects.getIamPolicy — Read object IAM policy.
1981 // - storage.objects.create — Create object.
1982 // - storage.objects.list — List objects.
1983 // - storage.objects.setIamPolicy — Update object IAM policy.
1984 // - storage.objects.update — Update object metadata.
1985 Permissions []string `json:"permissions,omitempty"`
1986
1987 // ServerResponse contains the HTTP response code and headers from the
1988 // server.
1989 googleapi.ServerResponse `json:"-"`
1990
1991 // ForceSendFields is a list of field names (e.g. "Kind") to
1992 // unconditionally include in API requests. By default, fields with
1993 // empty values are omitted from API requests. However, any non-pointer,
1994 // non-interface field appearing in ForceSendFields will be sent to the
1995 // server regardless of whether the field is empty or not. This may be
1996 // used to include empty fields in Patch requests.
1997 ForceSendFields []string `json:"-"`
1998
1999 // NullFields is a list of field names (e.g. "Kind") to include in API
2000 // requests with the JSON null value. By default, fields with empty
2001 // values are omitted from API requests. However, any field with an
2002 // empty value appearing in NullFields will be sent to the server as
2003 // null. It is an error if a field in this list has a non-empty value.
2004 // This may be used to include null fields in Patch requests.
2005 NullFields []string `json:"-"`
2006 }
2007
2008 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
2009 type NoMethod TestIamPermissionsResponse
2010 raw := NoMethod(*s)
2011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2012 }
2013
2014 // method id "storage.bucketAccessControls.delete":
2015
2016 type BucketAccessControlsDeleteCall struct {
2017 s *Service
2018 bucket string
2019 entity string
2020 urlParams_ gensupport.URLParams
2021 ctx_ context.Context
2022 header_ http.Header
2023 }
2024
2025 // Delete: Permanently deletes the ACL entry for the specified entity on
2026 // the specified bucket.
2027 func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
2028 c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2029 c.bucket = bucket
2030 c.entity = entity
2031 return c
2032 }
2033
2034 // UserProject sets the optional parameter "userProject": The project to
2035 // be billed for this request. Required for Requester Pays buckets.
2036 func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
2037 c.urlParams_.Set("userProject", userProject)
2038 return c
2039 }
2040
2041 // Fields allows partial responses to be retrieved. See
2042 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2043 // for more information.
2044 func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
2045 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2046 return c
2047 }
2048
2049 // Context sets the context to be used in this call's Do method. Any
2050 // pending HTTP request will be aborted if the provided context is
2051 // canceled.
2052 func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
2053 c.ctx_ = ctx
2054 return c
2055 }
2056
2057 // Header returns an http.Header that can be modified by the caller to
2058 // add HTTP headers to the request.
2059 func (c *BucketAccessControlsDeleteCall) Header() http.Header {
2060 if c.header_ == nil {
2061 c.header_ = make(http.Header)
2062 }
2063 return c.header_
2064 }
2065
2066 func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
2067 reqHeaders := make(http.Header)
2068 for k, v := range c.header_ {
2069 reqHeaders[k] = v
2070 }
2071 reqHeaders.Set("User-Agent", c.s.userAgent())
2072 var body io.Reader = nil
2073 c.urlParams_.Set("alt", alt)
2074 c.urlParams_.Set("prettyPrint", "false")
2075 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2076 urls += "?" + c.urlParams_.Encode()
2077 req, err := http.NewRequest("DELETE", urls, body)
2078 if err != nil {
2079 return nil, err
2080 }
2081 req.Header = reqHeaders
2082 googleapi.Expand(req.URL, map[string]string{
2083 "bucket": c.bucket,
2084 "entity": c.entity,
2085 })
2086 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2087 }
2088
2089 // Do executes the "storage.bucketAccessControls.delete" call.
2090 func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
2091 gensupport.SetOptions(c.urlParams_, opts...)
2092 res, err := c.doRequest("json")
2093 if err != nil {
2094 return err
2095 }
2096 defer googleapi.CloseBody(res)
2097 if err := googleapi.CheckResponse(res); err != nil {
2098 return err
2099 }
2100 return nil
2101 // {
2102 // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
2103 // "httpMethod": "DELETE",
2104 // "id": "storage.bucketAccessControls.delete",
2105 // "parameterOrder": [
2106 // "bucket",
2107 // "entity"
2108 // ],
2109 // "parameters": {
2110 // "bucket": {
2111 // "description": "Name of a bucket.",
2112 // "location": "path",
2113 // "required": true,
2114 // "type": "string"
2115 // },
2116 // "entity": {
2117 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2118 // "location": "path",
2119 // "required": true,
2120 // "type": "string"
2121 // },
2122 // "userProject": {
2123 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2124 // "location": "query",
2125 // "type": "string"
2126 // }
2127 // },
2128 // "path": "b/{bucket}/acl/{entity}",
2129 // "scopes": [
2130 // "https://www.googleapis.com/auth/cloud-platform",
2131 // "https://www.googleapis.com/auth/devstorage.full_control"
2132 // ]
2133 // }
2134
2135 }
2136
2137 // method id "storage.bucketAccessControls.get":
2138
2139 type BucketAccessControlsGetCall struct {
2140 s *Service
2141 bucket string
2142 entity string
2143 urlParams_ gensupport.URLParams
2144 ifNoneMatch_ string
2145 ctx_ context.Context
2146 header_ http.Header
2147 }
2148
2149 // Get: Returns the ACL entry for the specified entity on the specified
2150 // bucket.
2151 func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
2152 c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2153 c.bucket = bucket
2154 c.entity = entity
2155 return c
2156 }
2157
2158 // UserProject sets the optional parameter "userProject": The project to
2159 // be billed for this request. Required for Requester Pays buckets.
2160 func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
2161 c.urlParams_.Set("userProject", userProject)
2162 return c
2163 }
2164
2165 // Fields allows partial responses to be retrieved. See
2166 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2167 // for more information.
2168 func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
2169 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2170 return c
2171 }
2172
2173 // IfNoneMatch sets the optional parameter which makes the operation
2174 // fail if the object's ETag matches the given value. This is useful for
2175 // getting updates only after the object has changed since the last
2176 // request. Use googleapi.IsNotModified to check whether the response
2177 // error from Do is the result of In-None-Match.
2178 func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
2179 c.ifNoneMatch_ = entityTag
2180 return c
2181 }
2182
2183 // Context sets the context to be used in this call's Do method. Any
2184 // pending HTTP request will be aborted if the provided context is
2185 // canceled.
2186 func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
2187 c.ctx_ = ctx
2188 return c
2189 }
2190
2191 // Header returns an http.Header that can be modified by the caller to
2192 // add HTTP headers to the request.
2193 func (c *BucketAccessControlsGetCall) Header() http.Header {
2194 if c.header_ == nil {
2195 c.header_ = make(http.Header)
2196 }
2197 return c.header_
2198 }
2199
2200 func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
2201 reqHeaders := make(http.Header)
2202 for k, v := range c.header_ {
2203 reqHeaders[k] = v
2204 }
2205 reqHeaders.Set("User-Agent", c.s.userAgent())
2206 if c.ifNoneMatch_ != "" {
2207 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2208 }
2209 var body io.Reader = nil
2210 c.urlParams_.Set("alt", alt)
2211 c.urlParams_.Set("prettyPrint", "false")
2212 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2213 urls += "?" + c.urlParams_.Encode()
2214 req, err := http.NewRequest("GET", urls, body)
2215 if err != nil {
2216 return nil, err
2217 }
2218 req.Header = reqHeaders
2219 googleapi.Expand(req.URL, map[string]string{
2220 "bucket": c.bucket,
2221 "entity": c.entity,
2222 })
2223 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2224 }
2225
2226 // Do executes the "storage.bucketAccessControls.get" call.
2227 // Exactly one of *BucketAccessControl or error will be non-nil. Any
2228 // non-2xx status code is an error. Response headers are in either
2229 // *BucketAccessControl.ServerResponse.Header or (if a response was
2230 // returned at all) in error.(*googleapi.Error).Header. Use
2231 // googleapi.IsNotModified to check whether the returned error was
2232 // because http.StatusNotModified was returned.
2233 func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2234 gensupport.SetOptions(c.urlParams_, opts...)
2235 res, err := c.doRequest("json")
2236 if res != nil && res.StatusCode == http.StatusNotModified {
2237 if res.Body != nil {
2238 res.Body.Close()
2239 }
2240 return nil, &googleapi.Error{
2241 Code: res.StatusCode,
2242 Header: res.Header,
2243 }
2244 }
2245 if err != nil {
2246 return nil, err
2247 }
2248 defer googleapi.CloseBody(res)
2249 if err := googleapi.CheckResponse(res); err != nil {
2250 return nil, err
2251 }
2252 ret := &BucketAccessControl{
2253 ServerResponse: googleapi.ServerResponse{
2254 Header: res.Header,
2255 HTTPStatusCode: res.StatusCode,
2256 },
2257 }
2258 target := &ret
2259 if err := gensupport.DecodeResponse(target, res); err != nil {
2260 return nil, err
2261 }
2262 return ret, nil
2263 // {
2264 // "description": "Returns the ACL entry for the specified entity on the specified bucket.",
2265 // "httpMethod": "GET",
2266 // "id": "storage.bucketAccessControls.get",
2267 // "parameterOrder": [
2268 // "bucket",
2269 // "entity"
2270 // ],
2271 // "parameters": {
2272 // "bucket": {
2273 // "description": "Name of a bucket.",
2274 // "location": "path",
2275 // "required": true,
2276 // "type": "string"
2277 // },
2278 // "entity": {
2279 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2280 // "location": "path",
2281 // "required": true,
2282 // "type": "string"
2283 // },
2284 // "userProject": {
2285 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2286 // "location": "query",
2287 // "type": "string"
2288 // }
2289 // },
2290 // "path": "b/{bucket}/acl/{entity}",
2291 // "response": {
2292 // "$ref": "BucketAccessControl"
2293 // },
2294 // "scopes": [
2295 // "https://www.googleapis.com/auth/cloud-platform",
2296 // "https://www.googleapis.com/auth/devstorage.full_control"
2297 // ]
2298 // }
2299
2300 }
2301
2302 // method id "storage.bucketAccessControls.insert":
2303
2304 type BucketAccessControlsInsertCall struct {
2305 s *Service
2306 bucket string
2307 bucketaccesscontrol *BucketAccessControl
2308 urlParams_ gensupport.URLParams
2309 ctx_ context.Context
2310 header_ http.Header
2311 }
2312
2313 // Insert: Creates a new ACL entry on the specified bucket.
2314 func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
2315 c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2316 c.bucket = bucket
2317 c.bucketaccesscontrol = bucketaccesscontrol
2318 return c
2319 }
2320
2321 // UserProject sets the optional parameter "userProject": The project to
2322 // be billed for this request. Required for Requester Pays buckets.
2323 func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
2324 c.urlParams_.Set("userProject", userProject)
2325 return c
2326 }
2327
2328 // Fields allows partial responses to be retrieved. See
2329 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2330 // for more information.
2331 func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
2332 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2333 return c
2334 }
2335
2336 // Context sets the context to be used in this call's Do method. Any
2337 // pending HTTP request will be aborted if the provided context is
2338 // canceled.
2339 func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
2340 c.ctx_ = ctx
2341 return c
2342 }
2343
2344 // Header returns an http.Header that can be modified by the caller to
2345 // add HTTP headers to the request.
2346 func (c *BucketAccessControlsInsertCall) Header() http.Header {
2347 if c.header_ == nil {
2348 c.header_ = make(http.Header)
2349 }
2350 return c.header_
2351 }
2352
2353 func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
2354 reqHeaders := make(http.Header)
2355 for k, v := range c.header_ {
2356 reqHeaders[k] = v
2357 }
2358 reqHeaders.Set("User-Agent", c.s.userAgent())
2359 var body io.Reader = nil
2360 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2361 if err != nil {
2362 return nil, err
2363 }
2364 reqHeaders.Set("Content-Type", "application/json")
2365 c.urlParams_.Set("alt", alt)
2366 c.urlParams_.Set("prettyPrint", "false")
2367 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2368 urls += "?" + c.urlParams_.Encode()
2369 req, err := http.NewRequest("POST", urls, body)
2370 if err != nil {
2371 return nil, err
2372 }
2373 req.Header = reqHeaders
2374 googleapi.Expand(req.URL, map[string]string{
2375 "bucket": c.bucket,
2376 })
2377 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2378 }
2379
2380 // Do executes the "storage.bucketAccessControls.insert" call.
2381 // Exactly one of *BucketAccessControl or error will be non-nil. Any
2382 // non-2xx status code is an error. Response headers are in either
2383 // *BucketAccessControl.ServerResponse.Header or (if a response was
2384 // returned at all) in error.(*googleapi.Error).Header. Use
2385 // googleapi.IsNotModified to check whether the returned error was
2386 // because http.StatusNotModified was returned.
2387 func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2388 gensupport.SetOptions(c.urlParams_, opts...)
2389 res, err := c.doRequest("json")
2390 if res != nil && res.StatusCode == http.StatusNotModified {
2391 if res.Body != nil {
2392 res.Body.Close()
2393 }
2394 return nil, &googleapi.Error{
2395 Code: res.StatusCode,
2396 Header: res.Header,
2397 }
2398 }
2399 if err != nil {
2400 return nil, err
2401 }
2402 defer googleapi.CloseBody(res)
2403 if err := googleapi.CheckResponse(res); err != nil {
2404 return nil, err
2405 }
2406 ret := &BucketAccessControl{
2407 ServerResponse: googleapi.ServerResponse{
2408 Header: res.Header,
2409 HTTPStatusCode: res.StatusCode,
2410 },
2411 }
2412 target := &ret
2413 if err := gensupport.DecodeResponse(target, res); err != nil {
2414 return nil, err
2415 }
2416 return ret, nil
2417 // {
2418 // "description": "Creates a new ACL entry on the specified bucket.",
2419 // "httpMethod": "POST",
2420 // "id": "storage.bucketAccessControls.insert",
2421 // "parameterOrder": [
2422 // "bucket"
2423 // ],
2424 // "parameters": {
2425 // "bucket": {
2426 // "description": "Name of a bucket.",
2427 // "location": "path",
2428 // "required": true,
2429 // "type": "string"
2430 // },
2431 // "userProject": {
2432 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2433 // "location": "query",
2434 // "type": "string"
2435 // }
2436 // },
2437 // "path": "b/{bucket}/acl",
2438 // "request": {
2439 // "$ref": "BucketAccessControl"
2440 // },
2441 // "response": {
2442 // "$ref": "BucketAccessControl"
2443 // },
2444 // "scopes": [
2445 // "https://www.googleapis.com/auth/cloud-platform",
2446 // "https://www.googleapis.com/auth/devstorage.full_control"
2447 // ]
2448 // }
2449
2450 }
2451
2452 // method id "storage.bucketAccessControls.list":
2453
2454 type BucketAccessControlsListCall struct {
2455 s *Service
2456 bucket string
2457 urlParams_ gensupport.URLParams
2458 ifNoneMatch_ string
2459 ctx_ context.Context
2460 header_ http.Header
2461 }
2462
2463 // List: Retrieves ACL entries on the specified bucket.
2464 func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
2465 c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2466 c.bucket = bucket
2467 return c
2468 }
2469
2470 // UserProject sets the optional parameter "userProject": The project to
2471 // be billed for this request. Required for Requester Pays buckets.
2472 func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
2473 c.urlParams_.Set("userProject", userProject)
2474 return c
2475 }
2476
2477 // Fields allows partial responses to be retrieved. See
2478 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2479 // for more information.
2480 func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
2481 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2482 return c
2483 }
2484
2485 // IfNoneMatch sets the optional parameter which makes the operation
2486 // fail if the object's ETag matches the given value. This is useful for
2487 // getting updates only after the object has changed since the last
2488 // request. Use googleapi.IsNotModified to check whether the response
2489 // error from Do is the result of In-None-Match.
2490 func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
2491 c.ifNoneMatch_ = entityTag
2492 return c
2493 }
2494
2495 // Context sets the context to be used in this call's Do method. Any
2496 // pending HTTP request will be aborted if the provided context is
2497 // canceled.
2498 func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
2499 c.ctx_ = ctx
2500 return c
2501 }
2502
2503 // Header returns an http.Header that can be modified by the caller to
2504 // add HTTP headers to the request.
2505 func (c *BucketAccessControlsListCall) Header() http.Header {
2506 if c.header_ == nil {
2507 c.header_ = make(http.Header)
2508 }
2509 return c.header_
2510 }
2511
2512 func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
2513 reqHeaders := make(http.Header)
2514 for k, v := range c.header_ {
2515 reqHeaders[k] = v
2516 }
2517 reqHeaders.Set("User-Agent", c.s.userAgent())
2518 if c.ifNoneMatch_ != "" {
2519 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2520 }
2521 var body io.Reader = nil
2522 c.urlParams_.Set("alt", alt)
2523 c.urlParams_.Set("prettyPrint", "false")
2524 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
2525 urls += "?" + c.urlParams_.Encode()
2526 req, err := http.NewRequest("GET", urls, body)
2527 if err != nil {
2528 return nil, err
2529 }
2530 req.Header = reqHeaders
2531 googleapi.Expand(req.URL, map[string]string{
2532 "bucket": c.bucket,
2533 })
2534 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2535 }
2536
2537 // Do executes the "storage.bucketAccessControls.list" call.
2538 // Exactly one of *BucketAccessControls or error will be non-nil. Any
2539 // non-2xx status code is an error. Response headers are in either
2540 // *BucketAccessControls.ServerResponse.Header or (if a response was
2541 // returned at all) in error.(*googleapi.Error).Header. Use
2542 // googleapi.IsNotModified to check whether the returned error was
2543 // because http.StatusNotModified was returned.
2544 func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
2545 gensupport.SetOptions(c.urlParams_, opts...)
2546 res, err := c.doRequest("json")
2547 if res != nil && res.StatusCode == http.StatusNotModified {
2548 if res.Body != nil {
2549 res.Body.Close()
2550 }
2551 return nil, &googleapi.Error{
2552 Code: res.StatusCode,
2553 Header: res.Header,
2554 }
2555 }
2556 if err != nil {
2557 return nil, err
2558 }
2559 defer googleapi.CloseBody(res)
2560 if err := googleapi.CheckResponse(res); err != nil {
2561 return nil, err
2562 }
2563 ret := &BucketAccessControls{
2564 ServerResponse: googleapi.ServerResponse{
2565 Header: res.Header,
2566 HTTPStatusCode: res.StatusCode,
2567 },
2568 }
2569 target := &ret
2570 if err := gensupport.DecodeResponse(target, res); err != nil {
2571 return nil, err
2572 }
2573 return ret, nil
2574 // {
2575 // "description": "Retrieves ACL entries on the specified bucket.",
2576 // "httpMethod": "GET",
2577 // "id": "storage.bucketAccessControls.list",
2578 // "parameterOrder": [
2579 // "bucket"
2580 // ],
2581 // "parameters": {
2582 // "bucket": {
2583 // "description": "Name of a bucket.",
2584 // "location": "path",
2585 // "required": true,
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",
2595 // "response": {
2596 // "$ref": "BucketAccessControls"
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.patch":
2607
2608 type BucketAccessControlsPatchCall struct {
2609 s *Service
2610 bucket string
2611 entity string
2612 bucketaccesscontrol *BucketAccessControl
2613 urlParams_ gensupport.URLParams
2614 ctx_ context.Context
2615 header_ http.Header
2616 }
2617
2618 // Patch: Patches an ACL entry on the specified bucket.
2619 func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
2620 c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2621 c.bucket = bucket
2622 c.entity = entity
2623 c.bucketaccesscontrol = bucketaccesscontrol
2624 return c
2625 }
2626
2627 // UserProject sets the optional parameter "userProject": The project to
2628 // be billed for this request. Required for Requester Pays buckets.
2629 func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
2630 c.urlParams_.Set("userProject", userProject)
2631 return c
2632 }
2633
2634 // Fields allows partial responses to be retrieved. See
2635 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2636 // for more information.
2637 func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
2638 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2639 return c
2640 }
2641
2642 // Context sets the context to be used in this call's Do method. Any
2643 // pending HTTP request will be aborted if the provided context is
2644 // canceled.
2645 func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
2646 c.ctx_ = ctx
2647 return c
2648 }
2649
2650 // Header returns an http.Header that can be modified by the caller to
2651 // add HTTP headers to the request.
2652 func (c *BucketAccessControlsPatchCall) Header() http.Header {
2653 if c.header_ == nil {
2654 c.header_ = make(http.Header)
2655 }
2656 return c.header_
2657 }
2658
2659 func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
2660 reqHeaders := make(http.Header)
2661 for k, v := range c.header_ {
2662 reqHeaders[k] = v
2663 }
2664 reqHeaders.Set("User-Agent", c.s.userAgent())
2665 var body io.Reader = nil
2666 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2667 if err != nil {
2668 return nil, err
2669 }
2670 reqHeaders.Set("Content-Type", "application/json")
2671 c.urlParams_.Set("alt", alt)
2672 c.urlParams_.Set("prettyPrint", "false")
2673 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2674 urls += "?" + c.urlParams_.Encode()
2675 req, err := http.NewRequest("PATCH", urls, body)
2676 if err != nil {
2677 return nil, err
2678 }
2679 req.Header = reqHeaders
2680 googleapi.Expand(req.URL, map[string]string{
2681 "bucket": c.bucket,
2682 "entity": c.entity,
2683 })
2684 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2685 }
2686
2687 // Do executes the "storage.bucketAccessControls.patch" call.
2688 // Exactly one of *BucketAccessControl or error will be non-nil. Any
2689 // non-2xx status code is an error. Response headers are in either
2690 // *BucketAccessControl.ServerResponse.Header or (if a response was
2691 // returned at all) in error.(*googleapi.Error).Header. Use
2692 // googleapi.IsNotModified to check whether the returned error was
2693 // because http.StatusNotModified was returned.
2694 func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2695 gensupport.SetOptions(c.urlParams_, opts...)
2696 res, err := c.doRequest("json")
2697 if res != nil && res.StatusCode == http.StatusNotModified {
2698 if res.Body != nil {
2699 res.Body.Close()
2700 }
2701 return nil, &googleapi.Error{
2702 Code: res.StatusCode,
2703 Header: res.Header,
2704 }
2705 }
2706 if err != nil {
2707 return nil, err
2708 }
2709 defer googleapi.CloseBody(res)
2710 if err := googleapi.CheckResponse(res); err != nil {
2711 return nil, err
2712 }
2713 ret := &BucketAccessControl{
2714 ServerResponse: googleapi.ServerResponse{
2715 Header: res.Header,
2716 HTTPStatusCode: res.StatusCode,
2717 },
2718 }
2719 target := &ret
2720 if err := gensupport.DecodeResponse(target, res); err != nil {
2721 return nil, err
2722 }
2723 return ret, nil
2724 // {
2725 // "description": "Patches an ACL entry on the specified bucket.",
2726 // "httpMethod": "PATCH",
2727 // "id": "storage.bucketAccessControls.patch",
2728 // "parameterOrder": [
2729 // "bucket",
2730 // "entity"
2731 // ],
2732 // "parameters": {
2733 // "bucket": {
2734 // "description": "Name of a bucket.",
2735 // "location": "path",
2736 // "required": true,
2737 // "type": "string"
2738 // },
2739 // "entity": {
2740 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2741 // "location": "path",
2742 // "required": true,
2743 // "type": "string"
2744 // },
2745 // "userProject": {
2746 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2747 // "location": "query",
2748 // "type": "string"
2749 // }
2750 // },
2751 // "path": "b/{bucket}/acl/{entity}",
2752 // "request": {
2753 // "$ref": "BucketAccessControl"
2754 // },
2755 // "response": {
2756 // "$ref": "BucketAccessControl"
2757 // },
2758 // "scopes": [
2759 // "https://www.googleapis.com/auth/cloud-platform",
2760 // "https://www.googleapis.com/auth/devstorage.full_control"
2761 // ]
2762 // }
2763
2764 }
2765
2766 // method id "storage.bucketAccessControls.update":
2767
2768 type BucketAccessControlsUpdateCall struct {
2769 s *Service
2770 bucket string
2771 entity string
2772 bucketaccesscontrol *BucketAccessControl
2773 urlParams_ gensupport.URLParams
2774 ctx_ context.Context
2775 header_ http.Header
2776 }
2777
2778 // Update: Updates an ACL entry on the specified bucket.
2779 func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
2780 c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2781 c.bucket = bucket
2782 c.entity = entity
2783 c.bucketaccesscontrol = bucketaccesscontrol
2784 return c
2785 }
2786
2787 // UserProject sets the optional parameter "userProject": The project to
2788 // be billed for this request. Required for Requester Pays buckets.
2789 func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
2790 c.urlParams_.Set("userProject", userProject)
2791 return c
2792 }
2793
2794 // Fields allows partial responses to be retrieved. See
2795 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2796 // for more information.
2797 func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
2798 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2799 return c
2800 }
2801
2802 // Context sets the context to be used in this call's Do method. Any
2803 // pending HTTP request will be aborted if the provided context is
2804 // canceled.
2805 func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
2806 c.ctx_ = ctx
2807 return c
2808 }
2809
2810 // Header returns an http.Header that can be modified by the caller to
2811 // add HTTP headers to the request.
2812 func (c *BucketAccessControlsUpdateCall) Header() http.Header {
2813 if c.header_ == nil {
2814 c.header_ = make(http.Header)
2815 }
2816 return c.header_
2817 }
2818
2819 func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
2820 reqHeaders := make(http.Header)
2821 for k, v := range c.header_ {
2822 reqHeaders[k] = v
2823 }
2824 reqHeaders.Set("User-Agent", c.s.userAgent())
2825 var body io.Reader = nil
2826 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
2827 if err != nil {
2828 return nil, err
2829 }
2830 reqHeaders.Set("Content-Type", "application/json")
2831 c.urlParams_.Set("alt", alt)
2832 c.urlParams_.Set("prettyPrint", "false")
2833 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
2834 urls += "?" + c.urlParams_.Encode()
2835 req, err := http.NewRequest("PUT", urls, body)
2836 if err != nil {
2837 return nil, err
2838 }
2839 req.Header = reqHeaders
2840 googleapi.Expand(req.URL, map[string]string{
2841 "bucket": c.bucket,
2842 "entity": c.entity,
2843 })
2844 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2845 }
2846
2847 // Do executes the "storage.bucketAccessControls.update" call.
2848 // Exactly one of *BucketAccessControl or error will be non-nil. Any
2849 // non-2xx status code is an error. Response headers are in either
2850 // *BucketAccessControl.ServerResponse.Header or (if a response was
2851 // returned at all) in error.(*googleapi.Error).Header. Use
2852 // googleapi.IsNotModified to check whether the returned error was
2853 // because http.StatusNotModified was returned.
2854 func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2855 gensupport.SetOptions(c.urlParams_, opts...)
2856 res, err := c.doRequest("json")
2857 if res != nil && res.StatusCode == http.StatusNotModified {
2858 if res.Body != nil {
2859 res.Body.Close()
2860 }
2861 return nil, &googleapi.Error{
2862 Code: res.StatusCode,
2863 Header: res.Header,
2864 }
2865 }
2866 if err != nil {
2867 return nil, err
2868 }
2869 defer googleapi.CloseBody(res)
2870 if err := googleapi.CheckResponse(res); err != nil {
2871 return nil, err
2872 }
2873 ret := &BucketAccessControl{
2874 ServerResponse: googleapi.ServerResponse{
2875 Header: res.Header,
2876 HTTPStatusCode: res.StatusCode,
2877 },
2878 }
2879 target := &ret
2880 if err := gensupport.DecodeResponse(target, res); err != nil {
2881 return nil, err
2882 }
2883 return ret, nil
2884 // {
2885 // "description": "Updates an ACL entry on the specified bucket.",
2886 // "httpMethod": "PUT",
2887 // "id": "storage.bucketAccessControls.update",
2888 // "parameterOrder": [
2889 // "bucket",
2890 // "entity"
2891 // ],
2892 // "parameters": {
2893 // "bucket": {
2894 // "description": "Name of a bucket.",
2895 // "location": "path",
2896 // "required": true,
2897 // "type": "string"
2898 // },
2899 // "entity": {
2900 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
2901 // "location": "path",
2902 // "required": true,
2903 // "type": "string"
2904 // },
2905 // "userProject": {
2906 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2907 // "location": "query",
2908 // "type": "string"
2909 // }
2910 // },
2911 // "path": "b/{bucket}/acl/{entity}",
2912 // "request": {
2913 // "$ref": "BucketAccessControl"
2914 // },
2915 // "response": {
2916 // "$ref": "BucketAccessControl"
2917 // },
2918 // "scopes": [
2919 // "https://www.googleapis.com/auth/cloud-platform",
2920 // "https://www.googleapis.com/auth/devstorage.full_control"
2921 // ]
2922 // }
2923
2924 }
2925
2926 // method id "storage.buckets.delete":
2927
2928 type BucketsDeleteCall struct {
2929 s *Service
2930 bucket string
2931 urlParams_ gensupport.URLParams
2932 ctx_ context.Context
2933 header_ http.Header
2934 }
2935
2936 // Delete: Permanently deletes an empty bucket.
2937 func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
2938 c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2939 c.bucket = bucket
2940 return c
2941 }
2942
2943 // IfMetagenerationMatch sets the optional parameter
2944 // "ifMetagenerationMatch": If set, only deletes the bucket if its
2945 // metageneration matches this value.
2946 func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall {
2947 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
2948 return c
2949 }
2950
2951 // IfMetagenerationNotMatch sets the optional parameter
2952 // "ifMetagenerationNotMatch": If set, only deletes the bucket if its
2953 // metageneration does not match this value.
2954 func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall {
2955 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
2956 return c
2957 }
2958
2959 // UserProject sets the optional parameter "userProject": The project to
2960 // be billed for this request. Required for Requester Pays buckets.
2961 func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
2962 c.urlParams_.Set("userProject", userProject)
2963 return c
2964 }
2965
2966 // Fields allows partial responses to be retrieved. See
2967 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2968 // for more information.
2969 func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
2970 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2971 return c
2972 }
2973
2974 // Context sets the context to be used in this call's Do method. Any
2975 // pending HTTP request will be aborted if the provided context is
2976 // canceled.
2977 func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
2978 c.ctx_ = ctx
2979 return c
2980 }
2981
2982 // Header returns an http.Header that can be modified by the caller to
2983 // add HTTP headers to the request.
2984 func (c *BucketsDeleteCall) Header() http.Header {
2985 if c.header_ == nil {
2986 c.header_ = make(http.Header)
2987 }
2988 return c.header_
2989 }
2990
2991 func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
2992 reqHeaders := make(http.Header)
2993 for k, v := range c.header_ {
2994 reqHeaders[k] = v
2995 }
2996 reqHeaders.Set("User-Agent", c.s.userAgent())
2997 var body io.Reader = nil
2998 c.urlParams_.Set("alt", alt)
2999 c.urlParams_.Set("prettyPrint", "false")
3000 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3001 urls += "?" + c.urlParams_.Encode()
3002 req, err := http.NewRequest("DELETE", urls, body)
3003 if err != nil {
3004 return nil, err
3005 }
3006 req.Header = reqHeaders
3007 googleapi.Expand(req.URL, map[string]string{
3008 "bucket": c.bucket,
3009 })
3010 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3011 }
3012
3013 // Do executes the "storage.buckets.delete" call.
3014 func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
3015 gensupport.SetOptions(c.urlParams_, opts...)
3016 res, err := c.doRequest("json")
3017 if err != nil {
3018 return err
3019 }
3020 defer googleapi.CloseBody(res)
3021 if err := googleapi.CheckResponse(res); err != nil {
3022 return err
3023 }
3024 return nil
3025 // {
3026 // "description": "Permanently deletes an empty bucket.",
3027 // "httpMethod": "DELETE",
3028 // "id": "storage.buckets.delete",
3029 // "parameterOrder": [
3030 // "bucket"
3031 // ],
3032 // "parameters": {
3033 // "bucket": {
3034 // "description": "Name of a bucket.",
3035 // "location": "path",
3036 // "required": true,
3037 // "type": "string"
3038 // },
3039 // "ifMetagenerationMatch": {
3040 // "description": "If set, only deletes the bucket if its metageneration matches this value.",
3041 // "format": "int64",
3042 // "location": "query",
3043 // "type": "string"
3044 // },
3045 // "ifMetagenerationNotMatch": {
3046 // "description": "If set, only deletes the bucket if its metageneration does not match this value.",
3047 // "format": "int64",
3048 // "location": "query",
3049 // "type": "string"
3050 // },
3051 // "userProject": {
3052 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3053 // "location": "query",
3054 // "type": "string"
3055 // }
3056 // },
3057 // "path": "b/{bucket}",
3058 // "scopes": [
3059 // "https://www.googleapis.com/auth/cloud-platform",
3060 // "https://www.googleapis.com/auth/devstorage.full_control",
3061 // "https://www.googleapis.com/auth/devstorage.read_write"
3062 // ]
3063 // }
3064
3065 }
3066
3067 // method id "storage.buckets.get":
3068
3069 type BucketsGetCall struct {
3070 s *Service
3071 bucket string
3072 urlParams_ gensupport.URLParams
3073 ifNoneMatch_ string
3074 ctx_ context.Context
3075 header_ http.Header
3076 }
3077
3078 // Get: Returns metadata for the specified bucket.
3079 func (r *BucketsService) Get(bucket string) *BucketsGetCall {
3080 c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3081 c.bucket = bucket
3082 return c
3083 }
3084
3085 // IfMetagenerationMatch sets the optional parameter
3086 // "ifMetagenerationMatch": Makes the return of the bucket metadata
3087 // conditional on whether the bucket's current metageneration matches
3088 // the given value.
3089 func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
3090 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3091 return c
3092 }
3093
3094 // IfMetagenerationNotMatch sets the optional parameter
3095 // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
3096 // conditional on whether the bucket's current metageneration does not
3097 // match the given value.
3098 func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall {
3099 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3100 return c
3101 }
3102
3103 // Projection sets the optional parameter "projection": Set of
3104 // properties to return. Defaults to noAcl.
3105 //
3106 // Possible values:
3107 // "full" - Include all properties.
3108 // "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3109 func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
3110 c.urlParams_.Set("projection", projection)
3111 return c
3112 }
3113
3114 // UserProject sets the optional parameter "userProject": The project to
3115 // be billed for this request. Required for Requester Pays buckets.
3116 func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
3117 c.urlParams_.Set("userProject", userProject)
3118 return c
3119 }
3120
3121 // Fields allows partial responses to be retrieved. See
3122 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3123 // for more information.
3124 func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
3125 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3126 return c
3127 }
3128
3129 // IfNoneMatch sets the optional parameter which makes the operation
3130 // fail if the object's ETag matches the given value. This is useful for
3131 // getting updates only after the object has changed since the last
3132 // request. Use googleapi.IsNotModified to check whether the response
3133 // error from Do is the result of In-None-Match.
3134 func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
3135 c.ifNoneMatch_ = entityTag
3136 return c
3137 }
3138
3139 // Context sets the context to be used in this call's Do method. Any
3140 // pending HTTP request will be aborted if the provided context is
3141 // canceled.
3142 func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
3143 c.ctx_ = ctx
3144 return c
3145 }
3146
3147 // Header returns an http.Header that can be modified by the caller to
3148 // add HTTP headers to the request.
3149 func (c *BucketsGetCall) Header() http.Header {
3150 if c.header_ == nil {
3151 c.header_ = make(http.Header)
3152 }
3153 return c.header_
3154 }
3155
3156 func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
3157 reqHeaders := make(http.Header)
3158 for k, v := range c.header_ {
3159 reqHeaders[k] = v
3160 }
3161 reqHeaders.Set("User-Agent", c.s.userAgent())
3162 if c.ifNoneMatch_ != "" {
3163 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3164 }
3165 var body io.Reader = nil
3166 c.urlParams_.Set("alt", alt)
3167 c.urlParams_.Set("prettyPrint", "false")
3168 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3169 urls += "?" + c.urlParams_.Encode()
3170 req, err := http.NewRequest("GET", urls, body)
3171 if err != nil {
3172 return nil, err
3173 }
3174 req.Header = reqHeaders
3175 googleapi.Expand(req.URL, map[string]string{
3176 "bucket": c.bucket,
3177 })
3178 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3179 }
3180
3181 // Do executes the "storage.buckets.get" call.
3182 // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3183 // code is an error. Response headers are in either
3184 // *Bucket.ServerResponse.Header or (if a response was returned at all)
3185 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3186 // check whether the returned error was because http.StatusNotModified
3187 // was returned.
3188 func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3189 gensupport.SetOptions(c.urlParams_, opts...)
3190 res, err := c.doRequest("json")
3191 if res != nil && res.StatusCode == http.StatusNotModified {
3192 if res.Body != nil {
3193 res.Body.Close()
3194 }
3195 return nil, &googleapi.Error{
3196 Code: res.StatusCode,
3197 Header: res.Header,
3198 }
3199 }
3200 if err != nil {
3201 return nil, err
3202 }
3203 defer googleapi.CloseBody(res)
3204 if err := googleapi.CheckResponse(res); err != nil {
3205 return nil, err
3206 }
3207 ret := &Bucket{
3208 ServerResponse: googleapi.ServerResponse{
3209 Header: res.Header,
3210 HTTPStatusCode: res.StatusCode,
3211 },
3212 }
3213 target := &ret
3214 if err := gensupport.DecodeResponse(target, res); err != nil {
3215 return nil, err
3216 }
3217 return ret, nil
3218 // {
3219 // "description": "Returns metadata for the specified bucket.",
3220 // "httpMethod": "GET",
3221 // "id": "storage.buckets.get",
3222 // "parameterOrder": [
3223 // "bucket"
3224 // ],
3225 // "parameters": {
3226 // "bucket": {
3227 // "description": "Name of a bucket.",
3228 // "location": "path",
3229 // "required": true,
3230 // "type": "string"
3231 // },
3232 // "ifMetagenerationMatch": {
3233 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
3234 // "format": "int64",
3235 // "location": "query",
3236 // "type": "string"
3237 // },
3238 // "ifMetagenerationNotMatch": {
3239 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
3240 // "format": "int64",
3241 // "location": "query",
3242 // "type": "string"
3243 // },
3244 // "projection": {
3245 // "description": "Set of properties to return. Defaults to noAcl.",
3246 // "enum": [
3247 // "full",
3248 // "noAcl"
3249 // ],
3250 // "enumDescriptions": [
3251 // "Include all properties.",
3252 // "Omit owner, acl and defaultObjectAcl properties."
3253 // ],
3254 // "location": "query",
3255 // "type": "string"
3256 // },
3257 // "userProject": {
3258 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3259 // "location": "query",
3260 // "type": "string"
3261 // }
3262 // },
3263 // "path": "b/{bucket}",
3264 // "response": {
3265 // "$ref": "Bucket"
3266 // },
3267 // "scopes": [
3268 // "https://www.googleapis.com/auth/cloud-platform",
3269 // "https://www.googleapis.com/auth/cloud-platform.read-only",
3270 // "https://www.googleapis.com/auth/devstorage.full_control",
3271 // "https://www.googleapis.com/auth/devstorage.read_only",
3272 // "https://www.googleapis.com/auth/devstorage.read_write"
3273 // ]
3274 // }
3275
3276 }
3277
3278 // method id "storage.buckets.getIamPolicy":
3279
3280 type BucketsGetIamPolicyCall struct {
3281 s *Service
3282 bucket string
3283 urlParams_ gensupport.URLParams
3284 ifNoneMatch_ string
3285 ctx_ context.Context
3286 header_ http.Header
3287 }
3288
3289 // GetIamPolicy: Returns an IAM policy for the specified bucket.
3290 func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
3291 c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3292 c.bucket = bucket
3293 return c
3294 }
3295
3296 // UserProject sets the optional parameter "userProject": The project to
3297 // be billed for this request. Required for Requester Pays buckets.
3298 func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
3299 c.urlParams_.Set("userProject", userProject)
3300 return c
3301 }
3302
3303 // Fields allows partial responses to be retrieved. See
3304 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3305 // for more information.
3306 func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall {
3307 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3308 return c
3309 }
3310
3311 // IfNoneMatch sets the optional parameter which makes the operation
3312 // fail if the object's ETag matches the given value. This is useful for
3313 // getting updates only after the object has changed since the last
3314 // request. Use googleapi.IsNotModified to check whether the response
3315 // error from Do is the result of In-None-Match.
3316 func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall {
3317 c.ifNoneMatch_ = entityTag
3318 return c
3319 }
3320
3321 // Context sets the context to be used in this call's Do method. Any
3322 // pending HTTP request will be aborted if the provided context is
3323 // canceled.
3324 func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
3325 c.ctx_ = ctx
3326 return c
3327 }
3328
3329 // Header returns an http.Header that can be modified by the caller to
3330 // add HTTP headers to the request.
3331 func (c *BucketsGetIamPolicyCall) Header() http.Header {
3332 if c.header_ == nil {
3333 c.header_ = make(http.Header)
3334 }
3335 return c.header_
3336 }
3337
3338 func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3339 reqHeaders := make(http.Header)
3340 for k, v := range c.header_ {
3341 reqHeaders[k] = v
3342 }
3343 reqHeaders.Set("User-Agent", c.s.userAgent())
3344 if c.ifNoneMatch_ != "" {
3345 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3346 }
3347 var body io.Reader = nil
3348 c.urlParams_.Set("alt", alt)
3349 c.urlParams_.Set("prettyPrint", "false")
3350 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
3351 urls += "?" + c.urlParams_.Encode()
3352 req, err := http.NewRequest("GET", urls, body)
3353 if err != nil {
3354 return nil, err
3355 }
3356 req.Header = reqHeaders
3357 googleapi.Expand(req.URL, map[string]string{
3358 "bucket": c.bucket,
3359 })
3360 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3361 }
3362
3363 // Do executes the "storage.buckets.getIamPolicy" call.
3364 // Exactly one of *Policy or error will be non-nil. Any non-2xx status
3365 // code is an error. Response headers are in either
3366 // *Policy.ServerResponse.Header or (if a response was returned at all)
3367 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3368 // check whether the returned error was because http.StatusNotModified
3369 // was returned.
3370 func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3371 gensupport.SetOptions(c.urlParams_, opts...)
3372 res, err := c.doRequest("json")
3373 if res != nil && res.StatusCode == http.StatusNotModified {
3374 if res.Body != nil {
3375 res.Body.Close()
3376 }
3377 return nil, &googleapi.Error{
3378 Code: res.StatusCode,
3379 Header: res.Header,
3380 }
3381 }
3382 if err != nil {
3383 return nil, err
3384 }
3385 defer googleapi.CloseBody(res)
3386 if err := googleapi.CheckResponse(res); err != nil {
3387 return nil, err
3388 }
3389 ret := &Policy{
3390 ServerResponse: googleapi.ServerResponse{
3391 Header: res.Header,
3392 HTTPStatusCode: res.StatusCode,
3393 },
3394 }
3395 target := &ret
3396 if err := gensupport.DecodeResponse(target, res); err != nil {
3397 return nil, err
3398 }
3399 return ret, nil
3400 // {
3401 // "description": "Returns an IAM policy for the specified bucket.",
3402 // "httpMethod": "GET",
3403 // "id": "storage.buckets.getIamPolicy",
3404 // "parameterOrder": [
3405 // "bucket"
3406 // ],
3407 // "parameters": {
3408 // "bucket": {
3409 // "description": "Name of a bucket.",
3410 // "location": "path",
3411 // "required": true,
3412 // "type": "string"
3413 // },
3414 // "userProject": {
3415 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3416 // "location": "query",
3417 // "type": "string"
3418 // }
3419 // },
3420 // "path": "b/{bucket}/iam",
3421 // "response": {
3422 // "$ref": "Policy"
3423 // },
3424 // "scopes": [
3425 // "https://www.googleapis.com/auth/cloud-platform",
3426 // "https://www.googleapis.com/auth/cloud-platform.read-only",
3427 // "https://www.googleapis.com/auth/devstorage.full_control",
3428 // "https://www.googleapis.com/auth/devstorage.read_only",
3429 // "https://www.googleapis.com/auth/devstorage.read_write"
3430 // ]
3431 // }
3432
3433 }
3434
3435 // method id "storage.buckets.insert":
3436
3437 type BucketsInsertCall struct {
3438 s *Service
3439 bucket *Bucket
3440 urlParams_ gensupport.URLParams
3441 ctx_ context.Context
3442 header_ http.Header
3443 }
3444
3445 // Insert: Creates a new bucket.
3446 func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
3447 c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3448 c.urlParams_.Set("project", projectid)
3449 c.bucket = bucket
3450 return c
3451 }
3452
3453 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
3454 // predefined set of access controls to this bucket.
3455 //
3456 // Possible values:
3457 // "authenticatedRead" - Project team owners get OWNER access, and
3458 // allAuthenticatedUsers get READER access.
3459 // "private" - Project team owners get OWNER access.
3460 // "projectPrivate" - Project team members get access according to
3461 // their roles.
3462 // "publicRead" - Project team owners get OWNER access, and allUsers
3463 // get READER access.
3464 // "publicReadWrite" - Project team owners get OWNER access, and
3465 // allUsers get WRITER access.
3466 func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall {
3467 c.urlParams_.Set("predefinedAcl", predefinedAcl)
3468 return c
3469 }
3470
3471 // PredefinedDefaultObjectAcl sets the optional parameter
3472 // "predefinedDefaultObjectAcl": Apply a predefined set of default
3473 // object access controls to this bucket.
3474 //
3475 // Possible values:
3476 // "authenticatedRead" - Object owner gets OWNER access, and
3477 // allAuthenticatedUsers get READER access.
3478 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
3479 // project team owners get OWNER access.
3480 // "bucketOwnerRead" - Object owner gets OWNER access, and project
3481 // team owners get READER access.
3482 // "private" - Object owner gets OWNER access.
3483 // "projectPrivate" - Object owner gets OWNER access, and project team
3484 // members get access according to their roles.
3485 // "publicRead" - Object owner gets OWNER access, and allUsers get
3486 // READER access.
3487 func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
3488 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
3489 return c
3490 }
3491
3492 // Projection sets the optional parameter "projection": Set of
3493 // properties to return. Defaults to noAcl, unless the bucket resource
3494 // specifies acl or defaultObjectAcl properties, when it defaults to
3495 // full.
3496 //
3497 // Possible values:
3498 // "full" - Include all properties.
3499 // "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3500 func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
3501 c.urlParams_.Set("projection", projection)
3502 return c
3503 }
3504
3505 // UserProject sets the optional parameter "userProject": The project to
3506 // be billed for this request.
3507 func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall {
3508 c.urlParams_.Set("userProject", userProject)
3509 return c
3510 }
3511
3512 // Fields allows partial responses to be retrieved. See
3513 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3514 // for more information.
3515 func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
3516 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3517 return c
3518 }
3519
3520 // Context sets the context to be used in this call's Do method. Any
3521 // pending HTTP request will be aborted if the provided context is
3522 // canceled.
3523 func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
3524 c.ctx_ = ctx
3525 return c
3526 }
3527
3528 // Header returns an http.Header that can be modified by the caller to
3529 // add HTTP headers to the request.
3530 func (c *BucketsInsertCall) Header() http.Header {
3531 if c.header_ == nil {
3532 c.header_ = make(http.Header)
3533 }
3534 return c.header_
3535 }
3536
3537 func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
3538 reqHeaders := make(http.Header)
3539 for k, v := range c.header_ {
3540 reqHeaders[k] = v
3541 }
3542 reqHeaders.Set("User-Agent", c.s.userAgent())
3543 var body io.Reader = nil
3544 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
3545 if err != nil {
3546 return nil, err
3547 }
3548 reqHeaders.Set("Content-Type", "application/json")
3549 c.urlParams_.Set("alt", alt)
3550 c.urlParams_.Set("prettyPrint", "false")
3551 urls := googleapi.ResolveRelative(c.s.BasePath, "b")
3552 urls += "?" + c.urlParams_.Encode()
3553 req, err := http.NewRequest("POST", urls, body)
3554 if err != nil {
3555 return nil, err
3556 }
3557 req.Header = reqHeaders
3558 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3559 }
3560
3561 // Do executes the "storage.buckets.insert" call.
3562 // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
3563 // code is an error. Response headers are in either
3564 // *Bucket.ServerResponse.Header or (if a response was returned at all)
3565 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3566 // check whether the returned error was because http.StatusNotModified
3567 // was returned.
3568 func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3569 gensupport.SetOptions(c.urlParams_, opts...)
3570 res, err := c.doRequest("json")
3571 if res != nil && res.StatusCode == http.StatusNotModified {
3572 if res.Body != nil {
3573 res.Body.Close()
3574 }
3575 return nil, &googleapi.Error{
3576 Code: res.StatusCode,
3577 Header: res.Header,
3578 }
3579 }
3580 if err != nil {
3581 return nil, err
3582 }
3583 defer googleapi.CloseBody(res)
3584 if err := googleapi.CheckResponse(res); err != nil {
3585 return nil, err
3586 }
3587 ret := &Bucket{
3588 ServerResponse: googleapi.ServerResponse{
3589 Header: res.Header,
3590 HTTPStatusCode: res.StatusCode,
3591 },
3592 }
3593 target := &ret
3594 if err := gensupport.DecodeResponse(target, res); err != nil {
3595 return nil, err
3596 }
3597 return ret, nil
3598 // {
3599 // "description": "Creates a new bucket.",
3600 // "httpMethod": "POST",
3601 // "id": "storage.buckets.insert",
3602 // "parameterOrder": [
3603 // "project"
3604 // ],
3605 // "parameters": {
3606 // "predefinedAcl": {
3607 // "description": "Apply a predefined set of access controls to this bucket.",
3608 // "enum": [
3609 // "authenticatedRead",
3610 // "private",
3611 // "projectPrivate",
3612 // "publicRead",
3613 // "publicReadWrite"
3614 // ],
3615 // "enumDescriptions": [
3616 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
3617 // "Project team owners get OWNER access.",
3618 // "Project team members get access according to their roles.",
3619 // "Project team owners get OWNER access, and allUsers get READER access.",
3620 // "Project team owners get OWNER access, and allUsers get WRITER access."
3621 // ],
3622 // "location": "query",
3623 // "type": "string"
3624 // },
3625 // "predefinedDefaultObjectAcl": {
3626 // "description": "Apply a predefined set of default object access controls to this bucket.",
3627 // "enum": [
3628 // "authenticatedRead",
3629 // "bucketOwnerFullControl",
3630 // "bucketOwnerRead",
3631 // "private",
3632 // "projectPrivate",
3633 // "publicRead"
3634 // ],
3635 // "enumDescriptions": [
3636 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
3637 // "Object owner gets OWNER access, and project team owners get OWNER access.",
3638 // "Object owner gets OWNER access, and project team owners get READER access.",
3639 // "Object owner gets OWNER access.",
3640 // "Object owner gets OWNER access, and project team members get access according to their roles.",
3641 // "Object owner gets OWNER access, and allUsers get READER access."
3642 // ],
3643 // "location": "query",
3644 // "type": "string"
3645 // },
3646 // "project": {
3647 // "description": "A valid API project identifier.",
3648 // "location": "query",
3649 // "required": true,
3650 // "type": "string"
3651 // },
3652 // "projection": {
3653 // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
3654 // "enum": [
3655 // "full",
3656 // "noAcl"
3657 // ],
3658 // "enumDescriptions": [
3659 // "Include all properties.",
3660 // "Omit owner, acl and defaultObjectAcl properties."
3661 // ],
3662 // "location": "query",
3663 // "type": "string"
3664 // },
3665 // "userProject": {
3666 // "description": "The project to be billed for this request.",
3667 // "location": "query",
3668 // "type": "string"
3669 // }
3670 // },
3671 // "path": "b",
3672 // "request": {
3673 // "$ref": "Bucket"
3674 // },
3675 // "response": {
3676 // "$ref": "Bucket"
3677 // },
3678 // "scopes": [
3679 // "https://www.googleapis.com/auth/cloud-platform",
3680 // "https://www.googleapis.com/auth/devstorage.full_control",
3681 // "https://www.googleapis.com/auth/devstorage.read_write"
3682 // ]
3683 // }
3684
3685 }
3686
3687 // method id "storage.buckets.list":
3688
3689 type BucketsListCall struct {
3690 s *Service
3691 urlParams_ gensupport.URLParams
3692 ifNoneMatch_ string
3693 ctx_ context.Context
3694 header_ http.Header
3695 }
3696
3697 // List: Retrieves a list of buckets for a given project.
3698 func (r *BucketsService) List(projectid string) *BucketsListCall {
3699 c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3700 c.urlParams_.Set("project", projectid)
3701 return c
3702 }
3703
3704 // MaxResults sets the optional parameter "maxResults": Maximum number
3705 // of buckets to return in a single response. The service will use this
3706 // parameter or 1,000 items, whichever is smaller.
3707 func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
3708 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3709 return c
3710 }
3711
3712 // PageToken sets the optional parameter "pageToken": A
3713 // previously-returned page token representing part of the larger set of
3714 // results to view.
3715 func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
3716 c.urlParams_.Set("pageToken", pageToken)
3717 return c
3718 }
3719
3720 // Prefix sets the optional parameter "prefix": Filter results to
3721 // buckets whose names begin with this prefix.
3722 func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall {
3723 c.urlParams_.Set("prefix", prefix)
3724 return c
3725 }
3726
3727 // Projection sets the optional parameter "projection": Set of
3728 // properties to return. Defaults to noAcl.
3729 //
3730 // Possible values:
3731 // "full" - Include all properties.
3732 // "noAcl" - Omit owner, acl and defaultObjectAcl properties.
3733 func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
3734 c.urlParams_.Set("projection", projection)
3735 return c
3736 }
3737
3738 // UserProject sets the optional parameter "userProject": The project to
3739 // be billed for this request.
3740 func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall {
3741 c.urlParams_.Set("userProject", userProject)
3742 return c
3743 }
3744
3745 // Fields allows partial responses to be retrieved. See
3746 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3747 // for more information.
3748 func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
3749 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3750 return c
3751 }
3752
3753 // IfNoneMatch sets the optional parameter which makes the operation
3754 // fail if the object's ETag matches the given value. This is useful for
3755 // getting updates only after the object has changed since the last
3756 // request. Use googleapi.IsNotModified to check whether the response
3757 // error from Do is the result of In-None-Match.
3758 func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
3759 c.ifNoneMatch_ = entityTag
3760 return c
3761 }
3762
3763 // Context sets the context to be used in this call's Do method. Any
3764 // pending HTTP request will be aborted if the provided context is
3765 // canceled.
3766 func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
3767 c.ctx_ = ctx
3768 return c
3769 }
3770
3771 // Header returns an http.Header that can be modified by the caller to
3772 // add HTTP headers to the request.
3773 func (c *BucketsListCall) Header() http.Header {
3774 if c.header_ == nil {
3775 c.header_ = make(http.Header)
3776 }
3777 return c.header_
3778 }
3779
3780 func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
3781 reqHeaders := make(http.Header)
3782 for k, v := range c.header_ {
3783 reqHeaders[k] = v
3784 }
3785 reqHeaders.Set("User-Agent", c.s.userAgent())
3786 if c.ifNoneMatch_ != "" {
3787 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3788 }
3789 var body io.Reader = nil
3790 c.urlParams_.Set("alt", alt)
3791 c.urlParams_.Set("prettyPrint", "false")
3792 urls := googleapi.ResolveRelative(c.s.BasePath, "b")
3793 urls += "?" + c.urlParams_.Encode()
3794 req, err := http.NewRequest("GET", urls, body)
3795 if err != nil {
3796 return nil, err
3797 }
3798 req.Header = reqHeaders
3799 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3800 }
3801
3802 // Do executes the "storage.buckets.list" call.
3803 // Exactly one of *Buckets or error will be non-nil. Any non-2xx status
3804 // code is an error. Response headers are in either
3805 // *Buckets.ServerResponse.Header or (if a response was returned at all)
3806 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3807 // check whether the returned error was because http.StatusNotModified
3808 // was returned.
3809 func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
3810 gensupport.SetOptions(c.urlParams_, opts...)
3811 res, err := c.doRequest("json")
3812 if res != nil && res.StatusCode == http.StatusNotModified {
3813 if res.Body != nil {
3814 res.Body.Close()
3815 }
3816 return nil, &googleapi.Error{
3817 Code: res.StatusCode,
3818 Header: res.Header,
3819 }
3820 }
3821 if err != nil {
3822 return nil, err
3823 }
3824 defer googleapi.CloseBody(res)
3825 if err := googleapi.CheckResponse(res); err != nil {
3826 return nil, err
3827 }
3828 ret := &Buckets{
3829 ServerResponse: googleapi.ServerResponse{
3830 Header: res.Header,
3831 HTTPStatusCode: res.StatusCode,
3832 },
3833 }
3834 target := &ret
3835 if err := gensupport.DecodeResponse(target, res); err != nil {
3836 return nil, err
3837 }
3838 return ret, nil
3839 // {
3840 // "description": "Retrieves a list of buckets for a given project.",
3841 // "httpMethod": "GET",
3842 // "id": "storage.buckets.list",
3843 // "parameterOrder": [
3844 // "project"
3845 // ],
3846 // "parameters": {
3847 // "maxResults": {
3848 // "default": "1000",
3849 // "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
3850 // "format": "uint32",
3851 // "location": "query",
3852 // "minimum": "0",
3853 // "type": "integer"
3854 // },
3855 // "pageToken": {
3856 // "description": "A previously-returned page token representing part of the larger set of results to view.",
3857 // "location": "query",
3858 // "type": "string"
3859 // },
3860 // "prefix": {
3861 // "description": "Filter results to buckets whose names begin with this prefix.",
3862 // "location": "query",
3863 // "type": "string"
3864 // },
3865 // "project": {
3866 // "description": "A valid API project identifier.",
3867 // "location": "query",
3868 // "required": true,
3869 // "type": "string"
3870 // },
3871 // "projection": {
3872 // "description": "Set of properties to return. Defaults to noAcl.",
3873 // "enum": [
3874 // "full",
3875 // "noAcl"
3876 // ],
3877 // "enumDescriptions": [
3878 // "Include all properties.",
3879 // "Omit owner, acl and defaultObjectAcl properties."
3880 // ],
3881 // "location": "query",
3882 // "type": "string"
3883 // },
3884 // "userProject": {
3885 // "description": "The project to be billed for this request.",
3886 // "location": "query",
3887 // "type": "string"
3888 // }
3889 // },
3890 // "path": "b",
3891 // "response": {
3892 // "$ref": "Buckets"
3893 // },
3894 // "scopes": [
3895 // "https://www.googleapis.com/auth/cloud-platform",
3896 // "https://www.googleapis.com/auth/cloud-platform.read-only",
3897 // "https://www.googleapis.com/auth/devstorage.full_control",
3898 // "https://www.googleapis.com/auth/devstorage.read_only",
3899 // "https://www.googleapis.com/auth/devstorage.read_write"
3900 // ]
3901 // }
3902
3903 }
3904
3905 // Pages invokes f for each page of results.
3906 // A non-nil error returned from f will halt the iteration.
3907 // The provided context supersedes any context provided to the Context method.
3908 func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
3909 c.ctx_ = ctx
3910 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3911 for {
3912 x, err := c.Do()
3913 if err != nil {
3914 return err
3915 }
3916 if err := f(x); err != nil {
3917 return err
3918 }
3919 if x.NextPageToken == "" {
3920 return nil
3921 }
3922 c.PageToken(x.NextPageToken)
3923 }
3924 }
3925
3926 // method id "storage.buckets.lockRetentionPolicy":
3927
3928 type BucketsLockRetentionPolicyCall struct {
3929 s *Service
3930 bucket string
3931 urlParams_ gensupport.URLParams
3932 ctx_ context.Context
3933 header_ http.Header
3934 }
3935
3936 // LockRetentionPolicy: Locks retention policy on a bucket.
3937 func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall {
3938 c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3939 c.bucket = bucket
3940 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3941 return c
3942 }
3943
3944 // UserProject sets the optional parameter "userProject": The project to
3945 // be billed for this request. Required for Requester Pays buckets.
3946 func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall {
3947 c.urlParams_.Set("userProject", userProject)
3948 return c
3949 }
3950
3951 // Fields allows partial responses to be retrieved. See
3952 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3953 // for more information.
3954 func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall {
3955 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3956 return c
3957 }
3958
3959 // Context sets the context to be used in this call's Do method. Any
3960 // pending HTTP request will be aborted if the provided context is
3961 // canceled.
3962 func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall {
3963 c.ctx_ = ctx
3964 return c
3965 }
3966
3967 // Header returns an http.Header that can be modified by the caller to
3968 // add HTTP headers to the request.
3969 func (c *BucketsLockRetentionPolicyCall) Header() http.Header {
3970 if c.header_ == nil {
3971 c.header_ = make(http.Header)
3972 }
3973 return c.header_
3974 }
3975
3976 func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
3977 reqHeaders := make(http.Header)
3978 for k, v := range c.header_ {
3979 reqHeaders[k] = v
3980 }
3981 reqHeaders.Set("User-Agent", c.s.userAgent())
3982 var body io.Reader = nil
3983 c.urlParams_.Set("alt", alt)
3984 c.urlParams_.Set("prettyPrint", "false")
3985 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy")
3986 urls += "?" + c.urlParams_.Encode()
3987 req, err := http.NewRequest("POST", urls, body)
3988 if err != nil {
3989 return nil, err
3990 }
3991 req.Header = reqHeaders
3992 googleapi.Expand(req.URL, map[string]string{
3993 "bucket": c.bucket,
3994 })
3995 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3996 }
3997
3998 // Do executes the "storage.buckets.lockRetentionPolicy" call.
3999 // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4000 // code is an error. Response headers are in either
4001 // *Bucket.ServerResponse.Header or (if a response was returned at all)
4002 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4003 // check whether the returned error was because http.StatusNotModified
4004 // was returned.
4005 func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4006 gensupport.SetOptions(c.urlParams_, opts...)
4007 res, err := c.doRequest("json")
4008 if res != nil && res.StatusCode == http.StatusNotModified {
4009 if res.Body != nil {
4010 res.Body.Close()
4011 }
4012 return nil, &googleapi.Error{
4013 Code: res.StatusCode,
4014 Header: res.Header,
4015 }
4016 }
4017 if err != nil {
4018 return nil, err
4019 }
4020 defer googleapi.CloseBody(res)
4021 if err := googleapi.CheckResponse(res); err != nil {
4022 return nil, err
4023 }
4024 ret := &Bucket{
4025 ServerResponse: googleapi.ServerResponse{
4026 Header: res.Header,
4027 HTTPStatusCode: res.StatusCode,
4028 },
4029 }
4030 target := &ret
4031 if err := gensupport.DecodeResponse(target, res); err != nil {
4032 return nil, err
4033 }
4034 return ret, nil
4035 // {
4036 // "description": "Locks retention policy on a bucket.",
4037 // "httpMethod": "POST",
4038 // "id": "storage.buckets.lockRetentionPolicy",
4039 // "parameterOrder": [
4040 // "bucket",
4041 // "ifMetagenerationMatch"
4042 // ],
4043 // "parameters": {
4044 // "bucket": {
4045 // "description": "Name of a bucket.",
4046 // "location": "path",
4047 // "required": true,
4048 // "type": "string"
4049 // },
4050 // "ifMetagenerationMatch": {
4051 // "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
4052 // "format": "int64",
4053 // "location": "query",
4054 // "required": true,
4055 // "type": "string"
4056 // },
4057 // "userProject": {
4058 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4059 // "location": "query",
4060 // "type": "string"
4061 // }
4062 // },
4063 // "path": "b/{bucket}/lockRetentionPolicy",
4064 // "response": {
4065 // "$ref": "Bucket"
4066 // },
4067 // "scopes": [
4068 // "https://www.googleapis.com/auth/cloud-platform",
4069 // "https://www.googleapis.com/auth/devstorage.full_control",
4070 // "https://www.googleapis.com/auth/devstorage.read_write"
4071 // ]
4072 // }
4073
4074 }
4075
4076 // method id "storage.buckets.patch":
4077
4078 type BucketsPatchCall struct {
4079 s *Service
4080 bucket string
4081 bucket2 *Bucket
4082 urlParams_ gensupport.URLParams
4083 ctx_ context.Context
4084 header_ http.Header
4085 }
4086
4087 // Patch: Patches a bucket. Changes to the bucket will be readable
4088 // immediately after writing, but configuration changes may take time to
4089 // propagate.
4090 func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
4091 c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4092 c.bucket = bucket
4093 c.bucket2 = bucket2
4094 return c
4095 }
4096
4097 // IfMetagenerationMatch sets the optional parameter
4098 // "ifMetagenerationMatch": Makes the return of the bucket metadata
4099 // conditional on whether the bucket's current metageneration matches
4100 // the given value.
4101 func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
4102 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4103 return c
4104 }
4105
4106 // IfMetagenerationNotMatch sets the optional parameter
4107 // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
4108 // conditional on whether the bucket's current metageneration does not
4109 // match the given value.
4110 func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall {
4111 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
4112 return c
4113 }
4114
4115 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4116 // predefined set of access controls to this bucket.
4117 //
4118 // Possible values:
4119 // "authenticatedRead" - Project team owners get OWNER access, and
4120 // allAuthenticatedUsers get READER access.
4121 // "private" - Project team owners get OWNER access.
4122 // "projectPrivate" - Project team members get access according to
4123 // their roles.
4124 // "publicRead" - Project team owners get OWNER access, and allUsers
4125 // get READER access.
4126 // "publicReadWrite" - Project team owners get OWNER access, and
4127 // allUsers get WRITER access.
4128 func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall {
4129 c.urlParams_.Set("predefinedAcl", predefinedAcl)
4130 return c
4131 }
4132
4133 // PredefinedDefaultObjectAcl sets the optional parameter
4134 // "predefinedDefaultObjectAcl": Apply a predefined set of default
4135 // object access controls to this bucket.
4136 //
4137 // Possible values:
4138 // "authenticatedRead" - Object owner gets OWNER access, and
4139 // allAuthenticatedUsers get READER access.
4140 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
4141 // project team owners get OWNER access.
4142 // "bucketOwnerRead" - Object owner gets OWNER access, and project
4143 // team owners get READER access.
4144 // "private" - Object owner gets OWNER access.
4145 // "projectPrivate" - Object owner gets OWNER access, and project team
4146 // members get access according to their roles.
4147 // "publicRead" - Object owner gets OWNER access, and allUsers get
4148 // READER access.
4149 func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
4150 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4151 return c
4152 }
4153
4154 // Projection sets the optional parameter "projection": Set of
4155 // properties to return. Defaults to full.
4156 //
4157 // Possible values:
4158 // "full" - Include all properties.
4159 // "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4160 func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
4161 c.urlParams_.Set("projection", projection)
4162 return c
4163 }
4164
4165 // UserProject sets the optional parameter "userProject": The project to
4166 // be billed for this request. Required for Requester Pays buckets.
4167 func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
4168 c.urlParams_.Set("userProject", userProject)
4169 return c
4170 }
4171
4172 // Fields allows partial responses to be retrieved. See
4173 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4174 // for more information.
4175 func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
4176 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4177 return c
4178 }
4179
4180 // Context sets the context to be used in this call's Do method. Any
4181 // pending HTTP request will be aborted if the provided context is
4182 // canceled.
4183 func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
4184 c.ctx_ = ctx
4185 return c
4186 }
4187
4188 // Header returns an http.Header that can be modified by the caller to
4189 // add HTTP headers to the request.
4190 func (c *BucketsPatchCall) Header() http.Header {
4191 if c.header_ == nil {
4192 c.header_ = make(http.Header)
4193 }
4194 return c.header_
4195 }
4196
4197 func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
4198 reqHeaders := make(http.Header)
4199 for k, v := range c.header_ {
4200 reqHeaders[k] = v
4201 }
4202 reqHeaders.Set("User-Agent", c.s.userAgent())
4203 var body io.Reader = nil
4204 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
4205 if err != nil {
4206 return nil, err
4207 }
4208 reqHeaders.Set("Content-Type", "application/json")
4209 c.urlParams_.Set("alt", alt)
4210 c.urlParams_.Set("prettyPrint", "false")
4211 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
4212 urls += "?" + c.urlParams_.Encode()
4213 req, err := http.NewRequest("PATCH", urls, body)
4214 if err != nil {
4215 return nil, err
4216 }
4217 req.Header = reqHeaders
4218 googleapi.Expand(req.URL, map[string]string{
4219 "bucket": c.bucket,
4220 })
4221 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4222 }
4223
4224 // Do executes the "storage.buckets.patch" call.
4225 // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4226 // code is an error. Response headers are in either
4227 // *Bucket.ServerResponse.Header or (if a response was returned at all)
4228 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4229 // check whether the returned error was because http.StatusNotModified
4230 // was returned.
4231 func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4232 gensupport.SetOptions(c.urlParams_, opts...)
4233 res, err := c.doRequest("json")
4234 if res != nil && res.StatusCode == http.StatusNotModified {
4235 if res.Body != nil {
4236 res.Body.Close()
4237 }
4238 return nil, &googleapi.Error{
4239 Code: res.StatusCode,
4240 Header: res.Header,
4241 }
4242 }
4243 if err != nil {
4244 return nil, err
4245 }
4246 defer googleapi.CloseBody(res)
4247 if err := googleapi.CheckResponse(res); err != nil {
4248 return nil, err
4249 }
4250 ret := &Bucket{
4251 ServerResponse: googleapi.ServerResponse{
4252 Header: res.Header,
4253 HTTPStatusCode: res.StatusCode,
4254 },
4255 }
4256 target := &ret
4257 if err := gensupport.DecodeResponse(target, res); err != nil {
4258 return nil, err
4259 }
4260 return ret, nil
4261 // {
4262 // "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
4263 // "httpMethod": "PATCH",
4264 // "id": "storage.buckets.patch",
4265 // "parameterOrder": [
4266 // "bucket"
4267 // ],
4268 // "parameters": {
4269 // "bucket": {
4270 // "description": "Name of a bucket.",
4271 // "location": "path",
4272 // "required": true,
4273 // "type": "string"
4274 // },
4275 // "ifMetagenerationMatch": {
4276 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
4277 // "format": "int64",
4278 // "location": "query",
4279 // "type": "string"
4280 // },
4281 // "ifMetagenerationNotMatch": {
4282 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
4283 // "format": "int64",
4284 // "location": "query",
4285 // "type": "string"
4286 // },
4287 // "predefinedAcl": {
4288 // "description": "Apply a predefined set of access controls to this bucket.",
4289 // "enum": [
4290 // "authenticatedRead",
4291 // "private",
4292 // "projectPrivate",
4293 // "publicRead",
4294 // "publicReadWrite"
4295 // ],
4296 // "enumDescriptions": [
4297 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4298 // "Project team owners get OWNER access.",
4299 // "Project team members get access according to their roles.",
4300 // "Project team owners get OWNER access, and allUsers get READER access.",
4301 // "Project team owners get OWNER access, and allUsers get WRITER access."
4302 // ],
4303 // "location": "query",
4304 // "type": "string"
4305 // },
4306 // "predefinedDefaultObjectAcl": {
4307 // "description": "Apply a predefined set of default object access controls to this bucket.",
4308 // "enum": [
4309 // "authenticatedRead",
4310 // "bucketOwnerFullControl",
4311 // "bucketOwnerRead",
4312 // "private",
4313 // "projectPrivate",
4314 // "publicRead"
4315 // ],
4316 // "enumDescriptions": [
4317 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4318 // "Object owner gets OWNER access, and project team owners get OWNER access.",
4319 // "Object owner gets OWNER access, and project team owners get READER access.",
4320 // "Object owner gets OWNER access.",
4321 // "Object owner gets OWNER access, and project team members get access according to their roles.",
4322 // "Object owner gets OWNER access, and allUsers get READER access."
4323 // ],
4324 // "location": "query",
4325 // "type": "string"
4326 // },
4327 // "projection": {
4328 // "description": "Set of properties to return. Defaults to full.",
4329 // "enum": [
4330 // "full",
4331 // "noAcl"
4332 // ],
4333 // "enumDescriptions": [
4334 // "Include all properties.",
4335 // "Omit owner, acl and defaultObjectAcl properties."
4336 // ],
4337 // "location": "query",
4338 // "type": "string"
4339 // },
4340 // "userProject": {
4341 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4342 // "location": "query",
4343 // "type": "string"
4344 // }
4345 // },
4346 // "path": "b/{bucket}",
4347 // "request": {
4348 // "$ref": "Bucket"
4349 // },
4350 // "response": {
4351 // "$ref": "Bucket"
4352 // },
4353 // "scopes": [
4354 // "https://www.googleapis.com/auth/cloud-platform",
4355 // "https://www.googleapis.com/auth/devstorage.full_control"
4356 // ]
4357 // }
4358
4359 }
4360
4361 // method id "storage.buckets.setIamPolicy":
4362
4363 type BucketsSetIamPolicyCall struct {
4364 s *Service
4365 bucket string
4366 policy *Policy
4367 urlParams_ gensupport.URLParams
4368 ctx_ context.Context
4369 header_ http.Header
4370 }
4371
4372 // SetIamPolicy: Updates an IAM policy for the specified bucket.
4373 func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall {
4374 c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4375 c.bucket = bucket
4376 c.policy = policy
4377 return c
4378 }
4379
4380 // UserProject sets the optional parameter "userProject": The project to
4381 // be billed for this request. Required for Requester Pays buckets.
4382 func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
4383 c.urlParams_.Set("userProject", userProject)
4384 return c
4385 }
4386
4387 // Fields allows partial responses to be retrieved. See
4388 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4389 // for more information.
4390 func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall {
4391 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4392 return c
4393 }
4394
4395 // Context sets the context to be used in this call's Do method. Any
4396 // pending HTTP request will be aborted if the provided context is
4397 // canceled.
4398 func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
4399 c.ctx_ = ctx
4400 return c
4401 }
4402
4403 // Header returns an http.Header that can be modified by the caller to
4404 // add HTTP headers to the request.
4405 func (c *BucketsSetIamPolicyCall) Header() http.Header {
4406 if c.header_ == nil {
4407 c.header_ = make(http.Header)
4408 }
4409 return c.header_
4410 }
4411
4412 func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4413 reqHeaders := make(http.Header)
4414 for k, v := range c.header_ {
4415 reqHeaders[k] = v
4416 }
4417 reqHeaders.Set("User-Agent", c.s.userAgent())
4418 var body io.Reader = nil
4419 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
4420 if err != nil {
4421 return nil, err
4422 }
4423 reqHeaders.Set("Content-Type", "application/json")
4424 c.urlParams_.Set("alt", alt)
4425 c.urlParams_.Set("prettyPrint", "false")
4426 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
4427 urls += "?" + c.urlParams_.Encode()
4428 req, err := http.NewRequest("PUT", urls, body)
4429 if err != nil {
4430 return nil, err
4431 }
4432 req.Header = reqHeaders
4433 googleapi.Expand(req.URL, map[string]string{
4434 "bucket": c.bucket,
4435 })
4436 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4437 }
4438
4439 // Do executes the "storage.buckets.setIamPolicy" call.
4440 // Exactly one of *Policy or error will be non-nil. Any non-2xx status
4441 // code is an error. Response headers are in either
4442 // *Policy.ServerResponse.Header or (if a response was returned at all)
4443 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4444 // check whether the returned error was because http.StatusNotModified
4445 // was returned.
4446 func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4447 gensupport.SetOptions(c.urlParams_, opts...)
4448 res, err := c.doRequest("json")
4449 if res != nil && res.StatusCode == http.StatusNotModified {
4450 if res.Body != nil {
4451 res.Body.Close()
4452 }
4453 return nil, &googleapi.Error{
4454 Code: res.StatusCode,
4455 Header: res.Header,
4456 }
4457 }
4458 if err != nil {
4459 return nil, err
4460 }
4461 defer googleapi.CloseBody(res)
4462 if err := googleapi.CheckResponse(res); err != nil {
4463 return nil, err
4464 }
4465 ret := &Policy{
4466 ServerResponse: googleapi.ServerResponse{
4467 Header: res.Header,
4468 HTTPStatusCode: res.StatusCode,
4469 },
4470 }
4471 target := &ret
4472 if err := gensupport.DecodeResponse(target, res); err != nil {
4473 return nil, err
4474 }
4475 return ret, nil
4476 // {
4477 // "description": "Updates an IAM policy for the specified bucket.",
4478 // "httpMethod": "PUT",
4479 // "id": "storage.buckets.setIamPolicy",
4480 // "parameterOrder": [
4481 // "bucket"
4482 // ],
4483 // "parameters": {
4484 // "bucket": {
4485 // "description": "Name of a bucket.",
4486 // "location": "path",
4487 // "required": true,
4488 // "type": "string"
4489 // },
4490 // "userProject": {
4491 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4492 // "location": "query",
4493 // "type": "string"
4494 // }
4495 // },
4496 // "path": "b/{bucket}/iam",
4497 // "request": {
4498 // "$ref": "Policy"
4499 // },
4500 // "response": {
4501 // "$ref": "Policy"
4502 // },
4503 // "scopes": [
4504 // "https://www.googleapis.com/auth/cloud-platform",
4505 // "https://www.googleapis.com/auth/devstorage.full_control",
4506 // "https://www.googleapis.com/auth/devstorage.read_write"
4507 // ]
4508 // }
4509
4510 }
4511
4512 // method id "storage.buckets.testIamPermissions":
4513
4514 type BucketsTestIamPermissionsCall struct {
4515 s *Service
4516 bucket string
4517 urlParams_ gensupport.URLParams
4518 ifNoneMatch_ string
4519 ctx_ context.Context
4520 header_ http.Header
4521 }
4522
4523 // TestIamPermissions: Tests a set of permissions on the given bucket to
4524 // see which, if any, are held by the caller.
4525 func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall {
4526 c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4527 c.bucket = bucket
4528 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
4529 return c
4530 }
4531
4532 // UserProject sets the optional parameter "userProject": The project to
4533 // be billed for this request. Required for Requester Pays buckets.
4534 func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
4535 c.urlParams_.Set("userProject", userProject)
4536 return c
4537 }
4538
4539 // Fields allows partial responses to be retrieved. See
4540 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4541 // for more information.
4542 func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall {
4543 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4544 return c
4545 }
4546
4547 // IfNoneMatch sets the optional parameter which makes the operation
4548 // fail if the object's ETag matches the given value. This is useful for
4549 // getting updates only after the object has changed since the last
4550 // request. Use googleapi.IsNotModified to check whether the response
4551 // error from Do is the result of In-None-Match.
4552 func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall {
4553 c.ifNoneMatch_ = entityTag
4554 return c
4555 }
4556
4557 // Context sets the context to be used in this call's Do method. Any
4558 // pending HTTP request will be aborted if the provided context is
4559 // canceled.
4560 func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
4561 c.ctx_ = ctx
4562 return c
4563 }
4564
4565 // Header returns an http.Header that can be modified by the caller to
4566 // add HTTP headers to the request.
4567 func (c *BucketsTestIamPermissionsCall) Header() http.Header {
4568 if c.header_ == nil {
4569 c.header_ = make(http.Header)
4570 }
4571 return c.header_
4572 }
4573
4574 func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4575 reqHeaders := make(http.Header)
4576 for k, v := range c.header_ {
4577 reqHeaders[k] = v
4578 }
4579 reqHeaders.Set("User-Agent", c.s.userAgent())
4580 if c.ifNoneMatch_ != "" {
4581 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4582 }
4583 var body io.Reader = nil
4584 c.urlParams_.Set("alt", alt)
4585 c.urlParams_.Set("prettyPrint", "false")
4586 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions")
4587 urls += "?" + c.urlParams_.Encode()
4588 req, err := http.NewRequest("GET", urls, body)
4589 if err != nil {
4590 return nil, err
4591 }
4592 req.Header = reqHeaders
4593 googleapi.Expand(req.URL, map[string]string{
4594 "bucket": c.bucket,
4595 })
4596 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4597 }
4598
4599 // Do executes the "storage.buckets.testIamPermissions" call.
4600 // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
4601 // Any non-2xx status code is an error. Response headers are in either
4602 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
4603 // was returned at all) in error.(*googleapi.Error).Header. Use
4604 // googleapi.IsNotModified to check whether the returned error was
4605 // because http.StatusNotModified was returned.
4606 func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4607 gensupport.SetOptions(c.urlParams_, opts...)
4608 res, err := c.doRequest("json")
4609 if res != nil && res.StatusCode == http.StatusNotModified {
4610 if res.Body != nil {
4611 res.Body.Close()
4612 }
4613 return nil, &googleapi.Error{
4614 Code: res.StatusCode,
4615 Header: res.Header,
4616 }
4617 }
4618 if err != nil {
4619 return nil, err
4620 }
4621 defer googleapi.CloseBody(res)
4622 if err := googleapi.CheckResponse(res); err != nil {
4623 return nil, err
4624 }
4625 ret := &TestIamPermissionsResponse{
4626 ServerResponse: googleapi.ServerResponse{
4627 Header: res.Header,
4628 HTTPStatusCode: res.StatusCode,
4629 },
4630 }
4631 target := &ret
4632 if err := gensupport.DecodeResponse(target, res); err != nil {
4633 return nil, err
4634 }
4635 return ret, nil
4636 // {
4637 // "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
4638 // "httpMethod": "GET",
4639 // "id": "storage.buckets.testIamPermissions",
4640 // "parameterOrder": [
4641 // "bucket",
4642 // "permissions"
4643 // ],
4644 // "parameters": {
4645 // "bucket": {
4646 // "description": "Name of a bucket.",
4647 // "location": "path",
4648 // "required": true,
4649 // "type": "string"
4650 // },
4651 // "permissions": {
4652 // "description": "Permissions to test.",
4653 // "location": "query",
4654 // "repeated": true,
4655 // "required": true,
4656 // "type": "string"
4657 // },
4658 // "userProject": {
4659 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4660 // "location": "query",
4661 // "type": "string"
4662 // }
4663 // },
4664 // "path": "b/{bucket}/iam/testPermissions",
4665 // "response": {
4666 // "$ref": "TestIamPermissionsResponse"
4667 // },
4668 // "scopes": [
4669 // "https://www.googleapis.com/auth/cloud-platform",
4670 // "https://www.googleapis.com/auth/cloud-platform.read-only",
4671 // "https://www.googleapis.com/auth/devstorage.full_control",
4672 // "https://www.googleapis.com/auth/devstorage.read_only",
4673 // "https://www.googleapis.com/auth/devstorage.read_write"
4674 // ]
4675 // }
4676
4677 }
4678
4679 // method id "storage.buckets.update":
4680
4681 type BucketsUpdateCall struct {
4682 s *Service
4683 bucket string
4684 bucket2 *Bucket
4685 urlParams_ gensupport.URLParams
4686 ctx_ context.Context
4687 header_ http.Header
4688 }
4689
4690 // Update: Updates a bucket. Changes to the bucket will be readable
4691 // immediately after writing, but configuration changes may take time to
4692 // propagate.
4693 func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
4694 c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4695 c.bucket = bucket
4696 c.bucket2 = bucket2
4697 return c
4698 }
4699
4700 // IfMetagenerationMatch sets the optional parameter
4701 // "ifMetagenerationMatch": Makes the return of the bucket metadata
4702 // conditional on whether the bucket's current metageneration matches
4703 // the given value.
4704 func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
4705 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
4706 return c
4707 }
4708
4709 // IfMetagenerationNotMatch sets the optional parameter
4710 // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
4711 // conditional on whether the bucket's current metageneration does not
4712 // match the given value.
4713 func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall {
4714 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
4715 return c
4716 }
4717
4718 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4719 // predefined set of access controls to this bucket.
4720 //
4721 // Possible values:
4722 // "authenticatedRead" - Project team owners get OWNER access, and
4723 // allAuthenticatedUsers get READER access.
4724 // "private" - Project team owners get OWNER access.
4725 // "projectPrivate" - Project team members get access according to
4726 // their roles.
4727 // "publicRead" - Project team owners get OWNER access, and allUsers
4728 // get READER access.
4729 // "publicReadWrite" - Project team owners get OWNER access, and
4730 // allUsers get WRITER access.
4731 func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall {
4732 c.urlParams_.Set("predefinedAcl", predefinedAcl)
4733 return c
4734 }
4735
4736 // PredefinedDefaultObjectAcl sets the optional parameter
4737 // "predefinedDefaultObjectAcl": Apply a predefined set of default
4738 // object access controls to this bucket.
4739 //
4740 // Possible values:
4741 // "authenticatedRead" - Object owner gets OWNER access, and
4742 // allAuthenticatedUsers get READER access.
4743 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
4744 // project team owners get OWNER access.
4745 // "bucketOwnerRead" - Object owner gets OWNER access, and project
4746 // team owners get READER access.
4747 // "private" - Object owner gets OWNER access.
4748 // "projectPrivate" - Object owner gets OWNER access, and project team
4749 // members get access according to their roles.
4750 // "publicRead" - Object owner gets OWNER access, and allUsers get
4751 // READER access.
4752 func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
4753 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4754 return c
4755 }
4756
4757 // Projection sets the optional parameter "projection": Set of
4758 // properties to return. Defaults to full.
4759 //
4760 // Possible values:
4761 // "full" - Include all properties.
4762 // "noAcl" - Omit owner, acl and defaultObjectAcl properties.
4763 func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
4764 c.urlParams_.Set("projection", projection)
4765 return c
4766 }
4767
4768 // UserProject sets the optional parameter "userProject": The project to
4769 // be billed for this request. Required for Requester Pays buckets.
4770 func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
4771 c.urlParams_.Set("userProject", userProject)
4772 return c
4773 }
4774
4775 // Fields allows partial responses to be retrieved. See
4776 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4777 // for more information.
4778 func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
4779 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4780 return c
4781 }
4782
4783 // Context sets the context to be used in this call's Do method. Any
4784 // pending HTTP request will be aborted if the provided context is
4785 // canceled.
4786 func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
4787 c.ctx_ = ctx
4788 return c
4789 }
4790
4791 // Header returns an http.Header that can be modified by the caller to
4792 // add HTTP headers to the request.
4793 func (c *BucketsUpdateCall) Header() http.Header {
4794 if c.header_ == nil {
4795 c.header_ = make(http.Header)
4796 }
4797 return c.header_
4798 }
4799
4800 func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
4801 reqHeaders := make(http.Header)
4802 for k, v := range c.header_ {
4803 reqHeaders[k] = v
4804 }
4805 reqHeaders.Set("User-Agent", c.s.userAgent())
4806 var body io.Reader = nil
4807 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
4808 if err != nil {
4809 return nil, err
4810 }
4811 reqHeaders.Set("Content-Type", "application/json")
4812 c.urlParams_.Set("alt", alt)
4813 c.urlParams_.Set("prettyPrint", "false")
4814 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
4815 urls += "?" + c.urlParams_.Encode()
4816 req, err := http.NewRequest("PUT", urls, body)
4817 if err != nil {
4818 return nil, err
4819 }
4820 req.Header = reqHeaders
4821 googleapi.Expand(req.URL, map[string]string{
4822 "bucket": c.bucket,
4823 })
4824 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4825 }
4826
4827 // Do executes the "storage.buckets.update" call.
4828 // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
4829 // code is an error. Response headers are in either
4830 // *Bucket.ServerResponse.Header or (if a response was returned at all)
4831 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4832 // check whether the returned error was because http.StatusNotModified
4833 // was returned.
4834 func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
4835 gensupport.SetOptions(c.urlParams_, opts...)
4836 res, err := c.doRequest("json")
4837 if res != nil && res.StatusCode == http.StatusNotModified {
4838 if res.Body != nil {
4839 res.Body.Close()
4840 }
4841 return nil, &googleapi.Error{
4842 Code: res.StatusCode,
4843 Header: res.Header,
4844 }
4845 }
4846 if err != nil {
4847 return nil, err
4848 }
4849 defer googleapi.CloseBody(res)
4850 if err := googleapi.CheckResponse(res); err != nil {
4851 return nil, err
4852 }
4853 ret := &Bucket{
4854 ServerResponse: googleapi.ServerResponse{
4855 Header: res.Header,
4856 HTTPStatusCode: res.StatusCode,
4857 },
4858 }
4859 target := &ret
4860 if err := gensupport.DecodeResponse(target, res); err != nil {
4861 return nil, err
4862 }
4863 return ret, nil
4864 // {
4865 // "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
4866 // "httpMethod": "PUT",
4867 // "id": "storage.buckets.update",
4868 // "parameterOrder": [
4869 // "bucket"
4870 // ],
4871 // "parameters": {
4872 // "bucket": {
4873 // "description": "Name of a bucket.",
4874 // "location": "path",
4875 // "required": true,
4876 // "type": "string"
4877 // },
4878 // "ifMetagenerationMatch": {
4879 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
4880 // "format": "int64",
4881 // "location": "query",
4882 // "type": "string"
4883 // },
4884 // "ifMetagenerationNotMatch": {
4885 // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
4886 // "format": "int64",
4887 // "location": "query",
4888 // "type": "string"
4889 // },
4890 // "predefinedAcl": {
4891 // "description": "Apply a predefined set of access controls to this bucket.",
4892 // "enum": [
4893 // "authenticatedRead",
4894 // "private",
4895 // "projectPrivate",
4896 // "publicRead",
4897 // "publicReadWrite"
4898 // ],
4899 // "enumDescriptions": [
4900 // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
4901 // "Project team owners get OWNER access.",
4902 // "Project team members get access according to their roles.",
4903 // "Project team owners get OWNER access, and allUsers get READER access.",
4904 // "Project team owners get OWNER access, and allUsers get WRITER access."
4905 // ],
4906 // "location": "query",
4907 // "type": "string"
4908 // },
4909 // "predefinedDefaultObjectAcl": {
4910 // "description": "Apply a predefined set of default object access controls to this bucket.",
4911 // "enum": [
4912 // "authenticatedRead",
4913 // "bucketOwnerFullControl",
4914 // "bucketOwnerRead",
4915 // "private",
4916 // "projectPrivate",
4917 // "publicRead"
4918 // ],
4919 // "enumDescriptions": [
4920 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
4921 // "Object owner gets OWNER access, and project team owners get OWNER access.",
4922 // "Object owner gets OWNER access, and project team owners get READER access.",
4923 // "Object owner gets OWNER access.",
4924 // "Object owner gets OWNER access, and project team members get access according to their roles.",
4925 // "Object owner gets OWNER access, and allUsers get READER access."
4926 // ],
4927 // "location": "query",
4928 // "type": "string"
4929 // },
4930 // "projection": {
4931 // "description": "Set of properties to return. Defaults to full.",
4932 // "enum": [
4933 // "full",
4934 // "noAcl"
4935 // ],
4936 // "enumDescriptions": [
4937 // "Include all properties.",
4938 // "Omit owner, acl and defaultObjectAcl properties."
4939 // ],
4940 // "location": "query",
4941 // "type": "string"
4942 // },
4943 // "userProject": {
4944 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4945 // "location": "query",
4946 // "type": "string"
4947 // }
4948 // },
4949 // "path": "b/{bucket}",
4950 // "request": {
4951 // "$ref": "Bucket"
4952 // },
4953 // "response": {
4954 // "$ref": "Bucket"
4955 // },
4956 // "scopes": [
4957 // "https://www.googleapis.com/auth/cloud-platform",
4958 // "https://www.googleapis.com/auth/devstorage.full_control"
4959 // ]
4960 // }
4961
4962 }
4963
4964 // method id "storage.channels.stop":
4965
4966 type ChannelsStopCall struct {
4967 s *Service
4968 channel *Channel
4969 urlParams_ gensupport.URLParams
4970 ctx_ context.Context
4971 header_ http.Header
4972 }
4973
4974 // Stop: Stop watching resources through this channel
4975 func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
4976 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4977 c.channel = channel
4978 return c
4979 }
4980
4981 // Fields allows partial responses to be retrieved. See
4982 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4983 // for more information.
4984 func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
4985 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4986 return c
4987 }
4988
4989 // Context sets the context to be used in this call's Do method. Any
4990 // pending HTTP request will be aborted if the provided context is
4991 // canceled.
4992 func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
4993 c.ctx_ = ctx
4994 return c
4995 }
4996
4997 // Header returns an http.Header that can be modified by the caller to
4998 // add HTTP headers to the request.
4999 func (c *ChannelsStopCall) Header() http.Header {
5000 if c.header_ == nil {
5001 c.header_ = make(http.Header)
5002 }
5003 return c.header_
5004 }
5005
5006 func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
5007 reqHeaders := make(http.Header)
5008 for k, v := range c.header_ {
5009 reqHeaders[k] = v
5010 }
5011 reqHeaders.Set("User-Agent", c.s.userAgent())
5012 var body io.Reader = nil
5013 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
5014 if err != nil {
5015 return nil, err
5016 }
5017 reqHeaders.Set("Content-Type", "application/json")
5018 c.urlParams_.Set("alt", alt)
5019 c.urlParams_.Set("prettyPrint", "false")
5020 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
5021 urls += "?" + c.urlParams_.Encode()
5022 req, err := http.NewRequest("POST", urls, body)
5023 if err != nil {
5024 return nil, err
5025 }
5026 req.Header = reqHeaders
5027 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5028 }
5029
5030 // Do executes the "storage.channels.stop" call.
5031 func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
5032 gensupport.SetOptions(c.urlParams_, opts...)
5033 res, err := c.doRequest("json")
5034 if err != nil {
5035 return err
5036 }
5037 defer googleapi.CloseBody(res)
5038 if err := googleapi.CheckResponse(res); err != nil {
5039 return err
5040 }
5041 return nil
5042 // {
5043 // "description": "Stop watching resources through this channel",
5044 // "httpMethod": "POST",
5045 // "id": "storage.channels.stop",
5046 // "path": "channels/stop",
5047 // "request": {
5048 // "$ref": "Channel",
5049 // "parameterName": "resource"
5050 // },
5051 // "scopes": [
5052 // "https://www.googleapis.com/auth/cloud-platform",
5053 // "https://www.googleapis.com/auth/cloud-platform.read-only",
5054 // "https://www.googleapis.com/auth/devstorage.full_control",
5055 // "https://www.googleapis.com/auth/devstorage.read_only",
5056 // "https://www.googleapis.com/auth/devstorage.read_write"
5057 // ]
5058 // }
5059
5060 }
5061
5062 // method id "storage.defaultObjectAccessControls.delete":
5063
5064 type DefaultObjectAccessControlsDeleteCall struct {
5065 s *Service
5066 bucket string
5067 entity string
5068 urlParams_ gensupport.URLParams
5069 ctx_ context.Context
5070 header_ http.Header
5071 }
5072
5073 // Delete: Permanently deletes the default object ACL entry for the
5074 // specified entity on the specified bucket.
5075 func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
5076 c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5077 c.bucket = bucket
5078 c.entity = entity
5079 return c
5080 }
5081
5082 // UserProject sets the optional parameter "userProject": The project to
5083 // be billed for this request. Required for Requester Pays buckets.
5084 func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
5085 c.urlParams_.Set("userProject", userProject)
5086 return c
5087 }
5088
5089 // Fields allows partial responses to be retrieved. See
5090 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5091 // for more information.
5092 func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
5093 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5094 return c
5095 }
5096
5097 // Context sets the context to be used in this call's Do method. Any
5098 // pending HTTP request will be aborted if the provided context is
5099 // canceled.
5100 func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
5101 c.ctx_ = ctx
5102 return c
5103 }
5104
5105 // Header returns an http.Header that can be modified by the caller to
5106 // add HTTP headers to the request.
5107 func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
5108 if c.header_ == nil {
5109 c.header_ = make(http.Header)
5110 }
5111 return c.header_
5112 }
5113
5114 func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
5115 reqHeaders := make(http.Header)
5116 for k, v := range c.header_ {
5117 reqHeaders[k] = v
5118 }
5119 reqHeaders.Set("User-Agent", c.s.userAgent())
5120 var body io.Reader = nil
5121 c.urlParams_.Set("alt", alt)
5122 c.urlParams_.Set("prettyPrint", "false")
5123 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5124 urls += "?" + c.urlParams_.Encode()
5125 req, err := http.NewRequest("DELETE", urls, body)
5126 if err != nil {
5127 return nil, err
5128 }
5129 req.Header = reqHeaders
5130 googleapi.Expand(req.URL, map[string]string{
5131 "bucket": c.bucket,
5132 "entity": c.entity,
5133 })
5134 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5135 }
5136
5137 // Do executes the "storage.defaultObjectAccessControls.delete" call.
5138 func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
5139 gensupport.SetOptions(c.urlParams_, opts...)
5140 res, err := c.doRequest("json")
5141 if err != nil {
5142 return err
5143 }
5144 defer googleapi.CloseBody(res)
5145 if err := googleapi.CheckResponse(res); err != nil {
5146 return err
5147 }
5148 return nil
5149 // {
5150 // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
5151 // "httpMethod": "DELETE",
5152 // "id": "storage.defaultObjectAccessControls.delete",
5153 // "parameterOrder": [
5154 // "bucket",
5155 // "entity"
5156 // ],
5157 // "parameters": {
5158 // "bucket": {
5159 // "description": "Name of a bucket.",
5160 // "location": "path",
5161 // "required": true,
5162 // "type": "string"
5163 // },
5164 // "entity": {
5165 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5166 // "location": "path",
5167 // "required": true,
5168 // "type": "string"
5169 // },
5170 // "userProject": {
5171 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5172 // "location": "query",
5173 // "type": "string"
5174 // }
5175 // },
5176 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5177 // "scopes": [
5178 // "https://www.googleapis.com/auth/cloud-platform",
5179 // "https://www.googleapis.com/auth/devstorage.full_control"
5180 // ]
5181 // }
5182
5183 }
5184
5185 // method id "storage.defaultObjectAccessControls.get":
5186
5187 type DefaultObjectAccessControlsGetCall struct {
5188 s *Service
5189 bucket string
5190 entity string
5191 urlParams_ gensupport.URLParams
5192 ifNoneMatch_ string
5193 ctx_ context.Context
5194 header_ http.Header
5195 }
5196
5197 // Get: Returns the default object ACL entry for the specified entity on
5198 // the specified bucket.
5199 func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
5200 c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5201 c.bucket = bucket
5202 c.entity = entity
5203 return c
5204 }
5205
5206 // UserProject sets the optional parameter "userProject": The project to
5207 // be billed for this request. Required for Requester Pays buckets.
5208 func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
5209 c.urlParams_.Set("userProject", userProject)
5210 return c
5211 }
5212
5213 // Fields allows partial responses to be retrieved. See
5214 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5215 // for more information.
5216 func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
5217 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5218 return c
5219 }
5220
5221 // IfNoneMatch sets the optional parameter which makes the operation
5222 // fail if the object's ETag matches the given value. This is useful for
5223 // getting updates only after the object has changed since the last
5224 // request. Use googleapi.IsNotModified to check whether the response
5225 // error from Do is the result of In-None-Match.
5226 func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
5227 c.ifNoneMatch_ = entityTag
5228 return c
5229 }
5230
5231 // Context sets the context to be used in this call's Do method. Any
5232 // pending HTTP request will be aborted if the provided context is
5233 // canceled.
5234 func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
5235 c.ctx_ = ctx
5236 return c
5237 }
5238
5239 // Header returns an http.Header that can be modified by the caller to
5240 // add HTTP headers to the request.
5241 func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
5242 if c.header_ == nil {
5243 c.header_ = make(http.Header)
5244 }
5245 return c.header_
5246 }
5247
5248 func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
5249 reqHeaders := make(http.Header)
5250 for k, v := range c.header_ {
5251 reqHeaders[k] = v
5252 }
5253 reqHeaders.Set("User-Agent", c.s.userAgent())
5254 if c.ifNoneMatch_ != "" {
5255 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5256 }
5257 var body io.Reader = nil
5258 c.urlParams_.Set("alt", alt)
5259 c.urlParams_.Set("prettyPrint", "false")
5260 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5261 urls += "?" + c.urlParams_.Encode()
5262 req, err := http.NewRequest("GET", urls, body)
5263 if err != nil {
5264 return nil, err
5265 }
5266 req.Header = reqHeaders
5267 googleapi.Expand(req.URL, map[string]string{
5268 "bucket": c.bucket,
5269 "entity": c.entity,
5270 })
5271 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5272 }
5273
5274 // Do executes the "storage.defaultObjectAccessControls.get" call.
5275 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
5276 // non-2xx status code is an error. Response headers are in either
5277 // *ObjectAccessControl.ServerResponse.Header or (if a response was
5278 // returned at all) in error.(*googleapi.Error).Header. Use
5279 // googleapi.IsNotModified to check whether the returned error was
5280 // because http.StatusNotModified was returned.
5281 func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5282 gensupport.SetOptions(c.urlParams_, opts...)
5283 res, err := c.doRequest("json")
5284 if res != nil && res.StatusCode == http.StatusNotModified {
5285 if res.Body != nil {
5286 res.Body.Close()
5287 }
5288 return nil, &googleapi.Error{
5289 Code: res.StatusCode,
5290 Header: res.Header,
5291 }
5292 }
5293 if err != nil {
5294 return nil, err
5295 }
5296 defer googleapi.CloseBody(res)
5297 if err := googleapi.CheckResponse(res); err != nil {
5298 return nil, err
5299 }
5300 ret := &ObjectAccessControl{
5301 ServerResponse: googleapi.ServerResponse{
5302 Header: res.Header,
5303 HTTPStatusCode: res.StatusCode,
5304 },
5305 }
5306 target := &ret
5307 if err := gensupport.DecodeResponse(target, res); err != nil {
5308 return nil, err
5309 }
5310 return ret, nil
5311 // {
5312 // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
5313 // "httpMethod": "GET",
5314 // "id": "storage.defaultObjectAccessControls.get",
5315 // "parameterOrder": [
5316 // "bucket",
5317 // "entity"
5318 // ],
5319 // "parameters": {
5320 // "bucket": {
5321 // "description": "Name of a bucket.",
5322 // "location": "path",
5323 // "required": true,
5324 // "type": "string"
5325 // },
5326 // "entity": {
5327 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5328 // "location": "path",
5329 // "required": true,
5330 // "type": "string"
5331 // },
5332 // "userProject": {
5333 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5334 // "location": "query",
5335 // "type": "string"
5336 // }
5337 // },
5338 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5339 // "response": {
5340 // "$ref": "ObjectAccessControl"
5341 // },
5342 // "scopes": [
5343 // "https://www.googleapis.com/auth/cloud-platform",
5344 // "https://www.googleapis.com/auth/devstorage.full_control"
5345 // ]
5346 // }
5347
5348 }
5349
5350 // method id "storage.defaultObjectAccessControls.insert":
5351
5352 type DefaultObjectAccessControlsInsertCall struct {
5353 s *Service
5354 bucket string
5355 objectaccesscontrol *ObjectAccessControl
5356 urlParams_ gensupport.URLParams
5357 ctx_ context.Context
5358 header_ http.Header
5359 }
5360
5361 // Insert: Creates a new default object ACL entry on the specified
5362 // bucket.
5363 func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
5364 c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5365 c.bucket = bucket
5366 c.objectaccesscontrol = objectaccesscontrol
5367 return c
5368 }
5369
5370 // UserProject sets the optional parameter "userProject": The project to
5371 // be billed for this request. Required for Requester Pays buckets.
5372 func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
5373 c.urlParams_.Set("userProject", userProject)
5374 return c
5375 }
5376
5377 // Fields allows partial responses to be retrieved. See
5378 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5379 // for more information.
5380 func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
5381 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5382 return c
5383 }
5384
5385 // Context sets the context to be used in this call's Do method. Any
5386 // pending HTTP request will be aborted if the provided context is
5387 // canceled.
5388 func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
5389 c.ctx_ = ctx
5390 return c
5391 }
5392
5393 // Header returns an http.Header that can be modified by the caller to
5394 // add HTTP headers to the request.
5395 func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
5396 if c.header_ == nil {
5397 c.header_ = make(http.Header)
5398 }
5399 return c.header_
5400 }
5401
5402 func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
5403 reqHeaders := make(http.Header)
5404 for k, v := range c.header_ {
5405 reqHeaders[k] = v
5406 }
5407 reqHeaders.Set("User-Agent", c.s.userAgent())
5408 var body io.Reader = nil
5409 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
5410 if err != nil {
5411 return nil, err
5412 }
5413 reqHeaders.Set("Content-Type", "application/json")
5414 c.urlParams_.Set("alt", alt)
5415 c.urlParams_.Set("prettyPrint", "false")
5416 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
5417 urls += "?" + c.urlParams_.Encode()
5418 req, err := http.NewRequest("POST", urls, body)
5419 if err != nil {
5420 return nil, err
5421 }
5422 req.Header = reqHeaders
5423 googleapi.Expand(req.URL, map[string]string{
5424 "bucket": c.bucket,
5425 })
5426 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5427 }
5428
5429 // Do executes the "storage.defaultObjectAccessControls.insert" call.
5430 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
5431 // non-2xx status code is an error. Response headers are in either
5432 // *ObjectAccessControl.ServerResponse.Header or (if a response was
5433 // returned at all) in error.(*googleapi.Error).Header. Use
5434 // googleapi.IsNotModified to check whether the returned error was
5435 // because http.StatusNotModified was returned.
5436 func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5437 gensupport.SetOptions(c.urlParams_, opts...)
5438 res, err := c.doRequest("json")
5439 if res != nil && res.StatusCode == http.StatusNotModified {
5440 if res.Body != nil {
5441 res.Body.Close()
5442 }
5443 return nil, &googleapi.Error{
5444 Code: res.StatusCode,
5445 Header: res.Header,
5446 }
5447 }
5448 if err != nil {
5449 return nil, err
5450 }
5451 defer googleapi.CloseBody(res)
5452 if err := googleapi.CheckResponse(res); err != nil {
5453 return nil, err
5454 }
5455 ret := &ObjectAccessControl{
5456 ServerResponse: googleapi.ServerResponse{
5457 Header: res.Header,
5458 HTTPStatusCode: res.StatusCode,
5459 },
5460 }
5461 target := &ret
5462 if err := gensupport.DecodeResponse(target, res); err != nil {
5463 return nil, err
5464 }
5465 return ret, nil
5466 // {
5467 // "description": "Creates a new default object ACL entry on the specified bucket.",
5468 // "httpMethod": "POST",
5469 // "id": "storage.defaultObjectAccessControls.insert",
5470 // "parameterOrder": [
5471 // "bucket"
5472 // ],
5473 // "parameters": {
5474 // "bucket": {
5475 // "description": "Name of a bucket.",
5476 // "location": "path",
5477 // "required": true,
5478 // "type": "string"
5479 // },
5480 // "userProject": {
5481 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5482 // "location": "query",
5483 // "type": "string"
5484 // }
5485 // },
5486 // "path": "b/{bucket}/defaultObjectAcl",
5487 // "request": {
5488 // "$ref": "ObjectAccessControl"
5489 // },
5490 // "response": {
5491 // "$ref": "ObjectAccessControl"
5492 // },
5493 // "scopes": [
5494 // "https://www.googleapis.com/auth/cloud-platform",
5495 // "https://www.googleapis.com/auth/devstorage.full_control"
5496 // ]
5497 // }
5498
5499 }
5500
5501 // method id "storage.defaultObjectAccessControls.list":
5502
5503 type DefaultObjectAccessControlsListCall struct {
5504 s *Service
5505 bucket string
5506 urlParams_ gensupport.URLParams
5507 ifNoneMatch_ string
5508 ctx_ context.Context
5509 header_ http.Header
5510 }
5511
5512 // List: Retrieves default object ACL entries on the specified bucket.
5513 func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
5514 c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5515 c.bucket = bucket
5516 return c
5517 }
5518
5519 // IfMetagenerationMatch sets the optional parameter
5520 // "ifMetagenerationMatch": If present, only return default ACL listing
5521 // if the bucket's current metageneration matches this value.
5522 func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
5523 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5524 return c
5525 }
5526
5527 // IfMetagenerationNotMatch sets the optional parameter
5528 // "ifMetagenerationNotMatch": If present, only return default ACL
5529 // listing if the bucket's current metageneration does not match the
5530 // given value.
5531 func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
5532 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5533 return c
5534 }
5535
5536 // UserProject sets the optional parameter "userProject": The project to
5537 // be billed for this request. Required for Requester Pays buckets.
5538 func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
5539 c.urlParams_.Set("userProject", userProject)
5540 return c
5541 }
5542
5543 // Fields allows partial responses to be retrieved. See
5544 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5545 // for more information.
5546 func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
5547 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5548 return c
5549 }
5550
5551 // IfNoneMatch sets the optional parameter which makes the operation
5552 // fail if the object's ETag matches the given value. This is useful for
5553 // getting updates only after the object has changed since the last
5554 // request. Use googleapi.IsNotModified to check whether the response
5555 // error from Do is the result of In-None-Match.
5556 func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
5557 c.ifNoneMatch_ = entityTag
5558 return c
5559 }
5560
5561 // Context sets the context to be used in this call's Do method. Any
5562 // pending HTTP request will be aborted if the provided context is
5563 // canceled.
5564 func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
5565 c.ctx_ = ctx
5566 return c
5567 }
5568
5569 // Header returns an http.Header that can be modified by the caller to
5570 // add HTTP headers to the request.
5571 func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
5572 if c.header_ == nil {
5573 c.header_ = make(http.Header)
5574 }
5575 return c.header_
5576 }
5577
5578 func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
5579 reqHeaders := make(http.Header)
5580 for k, v := range c.header_ {
5581 reqHeaders[k] = v
5582 }
5583 reqHeaders.Set("User-Agent", c.s.userAgent())
5584 if c.ifNoneMatch_ != "" {
5585 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5586 }
5587 var body io.Reader = nil
5588 c.urlParams_.Set("alt", alt)
5589 c.urlParams_.Set("prettyPrint", "false")
5590 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
5591 urls += "?" + c.urlParams_.Encode()
5592 req, err := http.NewRequest("GET", urls, body)
5593 if err != nil {
5594 return nil, err
5595 }
5596 req.Header = reqHeaders
5597 googleapi.Expand(req.URL, map[string]string{
5598 "bucket": c.bucket,
5599 })
5600 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5601 }
5602
5603 // Do executes the "storage.defaultObjectAccessControls.list" call.
5604 // Exactly one of *ObjectAccessControls or error will be non-nil. Any
5605 // non-2xx status code is an error. Response headers are in either
5606 // *ObjectAccessControls.ServerResponse.Header or (if a response was
5607 // returned at all) in error.(*googleapi.Error).Header. Use
5608 // googleapi.IsNotModified to check whether the returned error was
5609 // because http.StatusNotModified was returned.
5610 func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
5611 gensupport.SetOptions(c.urlParams_, opts...)
5612 res, err := c.doRequest("json")
5613 if res != nil && res.StatusCode == http.StatusNotModified {
5614 if res.Body != nil {
5615 res.Body.Close()
5616 }
5617 return nil, &googleapi.Error{
5618 Code: res.StatusCode,
5619 Header: res.Header,
5620 }
5621 }
5622 if err != nil {
5623 return nil, err
5624 }
5625 defer googleapi.CloseBody(res)
5626 if err := googleapi.CheckResponse(res); err != nil {
5627 return nil, err
5628 }
5629 ret := &ObjectAccessControls{
5630 ServerResponse: googleapi.ServerResponse{
5631 Header: res.Header,
5632 HTTPStatusCode: res.StatusCode,
5633 },
5634 }
5635 target := &ret
5636 if err := gensupport.DecodeResponse(target, res); err != nil {
5637 return nil, err
5638 }
5639 return ret, nil
5640 // {
5641 // "description": "Retrieves default object ACL entries on the specified bucket.",
5642 // "httpMethod": "GET",
5643 // "id": "storage.defaultObjectAccessControls.list",
5644 // "parameterOrder": [
5645 // "bucket"
5646 // ],
5647 // "parameters": {
5648 // "bucket": {
5649 // "description": "Name of a bucket.",
5650 // "location": "path",
5651 // "required": true,
5652 // "type": "string"
5653 // },
5654 // "ifMetagenerationMatch": {
5655 // "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
5656 // "format": "int64",
5657 // "location": "query",
5658 // "type": "string"
5659 // },
5660 // "ifMetagenerationNotMatch": {
5661 // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
5662 // "format": "int64",
5663 // "location": "query",
5664 // "type": "string"
5665 // },
5666 // "userProject": {
5667 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5668 // "location": "query",
5669 // "type": "string"
5670 // }
5671 // },
5672 // "path": "b/{bucket}/defaultObjectAcl",
5673 // "response": {
5674 // "$ref": "ObjectAccessControls"
5675 // },
5676 // "scopes": [
5677 // "https://www.googleapis.com/auth/cloud-platform",
5678 // "https://www.googleapis.com/auth/devstorage.full_control"
5679 // ]
5680 // }
5681
5682 }
5683
5684 // method id "storage.defaultObjectAccessControls.patch":
5685
5686 type DefaultObjectAccessControlsPatchCall struct {
5687 s *Service
5688 bucket string
5689 entity string
5690 objectaccesscontrol *ObjectAccessControl
5691 urlParams_ gensupport.URLParams
5692 ctx_ context.Context
5693 header_ http.Header
5694 }
5695
5696 // Patch: Patches a default object ACL entry on the specified bucket.
5697 func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
5698 c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5699 c.bucket = bucket
5700 c.entity = entity
5701 c.objectaccesscontrol = objectaccesscontrol
5702 return c
5703 }
5704
5705 // UserProject sets the optional parameter "userProject": The project to
5706 // be billed for this request. Required for Requester Pays buckets.
5707 func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
5708 c.urlParams_.Set("userProject", userProject)
5709 return c
5710 }
5711
5712 // Fields allows partial responses to be retrieved. See
5713 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5714 // for more information.
5715 func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
5716 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5717 return c
5718 }
5719
5720 // Context sets the context to be used in this call's Do method. Any
5721 // pending HTTP request will be aborted if the provided context is
5722 // canceled.
5723 func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
5724 c.ctx_ = ctx
5725 return c
5726 }
5727
5728 // Header returns an http.Header that can be modified by the caller to
5729 // add HTTP headers to the request.
5730 func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
5731 if c.header_ == nil {
5732 c.header_ = make(http.Header)
5733 }
5734 return c.header_
5735 }
5736
5737 func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
5738 reqHeaders := make(http.Header)
5739 for k, v := range c.header_ {
5740 reqHeaders[k] = v
5741 }
5742 reqHeaders.Set("User-Agent", c.s.userAgent())
5743 var body io.Reader = nil
5744 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
5745 if err != nil {
5746 return nil, err
5747 }
5748 reqHeaders.Set("Content-Type", "application/json")
5749 c.urlParams_.Set("alt", alt)
5750 c.urlParams_.Set("prettyPrint", "false")
5751 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5752 urls += "?" + c.urlParams_.Encode()
5753 req, err := http.NewRequest("PATCH", urls, body)
5754 if err != nil {
5755 return nil, err
5756 }
5757 req.Header = reqHeaders
5758 googleapi.Expand(req.URL, map[string]string{
5759 "bucket": c.bucket,
5760 "entity": c.entity,
5761 })
5762 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5763 }
5764
5765 // Do executes the "storage.defaultObjectAccessControls.patch" call.
5766 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
5767 // non-2xx status code is an error. Response headers are in either
5768 // *ObjectAccessControl.ServerResponse.Header or (if a response was
5769 // returned at all) in error.(*googleapi.Error).Header. Use
5770 // googleapi.IsNotModified to check whether the returned error was
5771 // because http.StatusNotModified was returned.
5772 func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5773 gensupport.SetOptions(c.urlParams_, opts...)
5774 res, err := c.doRequest("json")
5775 if res != nil && res.StatusCode == http.StatusNotModified {
5776 if res.Body != nil {
5777 res.Body.Close()
5778 }
5779 return nil, &googleapi.Error{
5780 Code: res.StatusCode,
5781 Header: res.Header,
5782 }
5783 }
5784 if err != nil {
5785 return nil, err
5786 }
5787 defer googleapi.CloseBody(res)
5788 if err := googleapi.CheckResponse(res); err != nil {
5789 return nil, err
5790 }
5791 ret := &ObjectAccessControl{
5792 ServerResponse: googleapi.ServerResponse{
5793 Header: res.Header,
5794 HTTPStatusCode: res.StatusCode,
5795 },
5796 }
5797 target := &ret
5798 if err := gensupport.DecodeResponse(target, res); err != nil {
5799 return nil, err
5800 }
5801 return ret, nil
5802 // {
5803 // "description": "Patches a default object ACL entry on the specified bucket.",
5804 // "httpMethod": "PATCH",
5805 // "id": "storage.defaultObjectAccessControls.patch",
5806 // "parameterOrder": [
5807 // "bucket",
5808 // "entity"
5809 // ],
5810 // "parameters": {
5811 // "bucket": {
5812 // "description": "Name of a bucket.",
5813 // "location": "path",
5814 // "required": true,
5815 // "type": "string"
5816 // },
5817 // "entity": {
5818 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5819 // "location": "path",
5820 // "required": true,
5821 // "type": "string"
5822 // },
5823 // "userProject": {
5824 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5825 // "location": "query",
5826 // "type": "string"
5827 // }
5828 // },
5829 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5830 // "request": {
5831 // "$ref": "ObjectAccessControl"
5832 // },
5833 // "response": {
5834 // "$ref": "ObjectAccessControl"
5835 // },
5836 // "scopes": [
5837 // "https://www.googleapis.com/auth/cloud-platform",
5838 // "https://www.googleapis.com/auth/devstorage.full_control"
5839 // ]
5840 // }
5841
5842 }
5843
5844 // method id "storage.defaultObjectAccessControls.update":
5845
5846 type DefaultObjectAccessControlsUpdateCall struct {
5847 s *Service
5848 bucket string
5849 entity string
5850 objectaccesscontrol *ObjectAccessControl
5851 urlParams_ gensupport.URLParams
5852 ctx_ context.Context
5853 header_ http.Header
5854 }
5855
5856 // Update: Updates a default object ACL entry on the specified bucket.
5857 func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
5858 c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5859 c.bucket = bucket
5860 c.entity = entity
5861 c.objectaccesscontrol = objectaccesscontrol
5862 return c
5863 }
5864
5865 // UserProject sets the optional parameter "userProject": The project to
5866 // be billed for this request. Required for Requester Pays buckets.
5867 func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
5868 c.urlParams_.Set("userProject", userProject)
5869 return c
5870 }
5871
5872 // Fields allows partial responses to be retrieved. See
5873 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5874 // for more information.
5875 func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
5876 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5877 return c
5878 }
5879
5880 // Context sets the context to be used in this call's Do method. Any
5881 // pending HTTP request will be aborted if the provided context is
5882 // canceled.
5883 func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
5884 c.ctx_ = ctx
5885 return c
5886 }
5887
5888 // Header returns an http.Header that can be modified by the caller to
5889 // add HTTP headers to the request.
5890 func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
5891 if c.header_ == nil {
5892 c.header_ = make(http.Header)
5893 }
5894 return c.header_
5895 }
5896
5897 func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
5898 reqHeaders := make(http.Header)
5899 for k, v := range c.header_ {
5900 reqHeaders[k] = v
5901 }
5902 reqHeaders.Set("User-Agent", c.s.userAgent())
5903 var body io.Reader = nil
5904 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
5905 if err != nil {
5906 return nil, err
5907 }
5908 reqHeaders.Set("Content-Type", "application/json")
5909 c.urlParams_.Set("alt", alt)
5910 c.urlParams_.Set("prettyPrint", "false")
5911 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
5912 urls += "?" + c.urlParams_.Encode()
5913 req, err := http.NewRequest("PUT", urls, body)
5914 if err != nil {
5915 return nil, err
5916 }
5917 req.Header = reqHeaders
5918 googleapi.Expand(req.URL, map[string]string{
5919 "bucket": c.bucket,
5920 "entity": c.entity,
5921 })
5922 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5923 }
5924
5925 // Do executes the "storage.defaultObjectAccessControls.update" call.
5926 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
5927 // non-2xx status code is an error. Response headers are in either
5928 // *ObjectAccessControl.ServerResponse.Header or (if a response was
5929 // returned at all) in error.(*googleapi.Error).Header. Use
5930 // googleapi.IsNotModified to check whether the returned error was
5931 // because http.StatusNotModified was returned.
5932 func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5933 gensupport.SetOptions(c.urlParams_, opts...)
5934 res, err := c.doRequest("json")
5935 if res != nil && res.StatusCode == http.StatusNotModified {
5936 if res.Body != nil {
5937 res.Body.Close()
5938 }
5939 return nil, &googleapi.Error{
5940 Code: res.StatusCode,
5941 Header: res.Header,
5942 }
5943 }
5944 if err != nil {
5945 return nil, err
5946 }
5947 defer googleapi.CloseBody(res)
5948 if err := googleapi.CheckResponse(res); err != nil {
5949 return nil, err
5950 }
5951 ret := &ObjectAccessControl{
5952 ServerResponse: googleapi.ServerResponse{
5953 Header: res.Header,
5954 HTTPStatusCode: res.StatusCode,
5955 },
5956 }
5957 target := &ret
5958 if err := gensupport.DecodeResponse(target, res); err != nil {
5959 return nil, err
5960 }
5961 return ret, nil
5962 // {
5963 // "description": "Updates a default object ACL entry on the specified bucket.",
5964 // "httpMethod": "PUT",
5965 // "id": "storage.defaultObjectAccessControls.update",
5966 // "parameterOrder": [
5967 // "bucket",
5968 // "entity"
5969 // ],
5970 // "parameters": {
5971 // "bucket": {
5972 // "description": "Name of a bucket.",
5973 // "location": "path",
5974 // "required": true,
5975 // "type": "string"
5976 // },
5977 // "entity": {
5978 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
5979 // "location": "path",
5980 // "required": true,
5981 // "type": "string"
5982 // },
5983 // "userProject": {
5984 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5985 // "location": "query",
5986 // "type": "string"
5987 // }
5988 // },
5989 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5990 // "request": {
5991 // "$ref": "ObjectAccessControl"
5992 // },
5993 // "response": {
5994 // "$ref": "ObjectAccessControl"
5995 // },
5996 // "scopes": [
5997 // "https://www.googleapis.com/auth/cloud-platform",
5998 // "https://www.googleapis.com/auth/devstorage.full_control"
5999 // ]
6000 // }
6001
6002 }
6003
6004 // method id "storage.notifications.delete":
6005
6006 type NotificationsDeleteCall struct {
6007 s *Service
6008 bucket string
6009 notification string
6010 urlParams_ gensupport.URLParams
6011 ctx_ context.Context
6012 header_ http.Header
6013 }
6014
6015 // Delete: Permanently deletes a notification subscription.
6016 func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
6017 c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6018 c.bucket = bucket
6019 c.notification = notification
6020 return c
6021 }
6022
6023 // UserProject sets the optional parameter "userProject": The project to
6024 // be billed for this request. Required for Requester Pays buckets.
6025 func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
6026 c.urlParams_.Set("userProject", userProject)
6027 return c
6028 }
6029
6030 // Fields allows partial responses to be retrieved. See
6031 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6032 // for more information.
6033 func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
6034 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6035 return c
6036 }
6037
6038 // Context sets the context to be used in this call's Do method. Any
6039 // pending HTTP request will be aborted if the provided context is
6040 // canceled.
6041 func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
6042 c.ctx_ = ctx
6043 return c
6044 }
6045
6046 // Header returns an http.Header that can be modified by the caller to
6047 // add HTTP headers to the request.
6048 func (c *NotificationsDeleteCall) Header() http.Header {
6049 if c.header_ == nil {
6050 c.header_ = make(http.Header)
6051 }
6052 return c.header_
6053 }
6054
6055 func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
6056 reqHeaders := make(http.Header)
6057 for k, v := range c.header_ {
6058 reqHeaders[k] = v
6059 }
6060 reqHeaders.Set("User-Agent", c.s.userAgent())
6061 var body io.Reader = nil
6062 c.urlParams_.Set("alt", alt)
6063 c.urlParams_.Set("prettyPrint", "false")
6064 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6065 urls += "?" + c.urlParams_.Encode()
6066 req, err := http.NewRequest("DELETE", urls, body)
6067 if err != nil {
6068 return nil, err
6069 }
6070 req.Header = reqHeaders
6071 googleapi.Expand(req.URL, map[string]string{
6072 "bucket": c.bucket,
6073 "notification": c.notification,
6074 })
6075 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6076 }
6077
6078 // Do executes the "storage.notifications.delete" call.
6079 func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
6080 gensupport.SetOptions(c.urlParams_, opts...)
6081 res, err := c.doRequest("json")
6082 if err != nil {
6083 return err
6084 }
6085 defer googleapi.CloseBody(res)
6086 if err := googleapi.CheckResponse(res); err != nil {
6087 return err
6088 }
6089 return nil
6090 // {
6091 // "description": "Permanently deletes a notification subscription.",
6092 // "httpMethod": "DELETE",
6093 // "id": "storage.notifications.delete",
6094 // "parameterOrder": [
6095 // "bucket",
6096 // "notification"
6097 // ],
6098 // "parameters": {
6099 // "bucket": {
6100 // "description": "The parent bucket of the notification.",
6101 // "location": "path",
6102 // "required": true,
6103 // "type": "string"
6104 // },
6105 // "notification": {
6106 // "description": "ID of the notification to delete.",
6107 // "location": "path",
6108 // "required": true,
6109 // "type": "string"
6110 // },
6111 // "userProject": {
6112 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6113 // "location": "query",
6114 // "type": "string"
6115 // }
6116 // },
6117 // "path": "b/{bucket}/notificationConfigs/{notification}",
6118 // "scopes": [
6119 // "https://www.googleapis.com/auth/cloud-platform",
6120 // "https://www.googleapis.com/auth/devstorage.full_control",
6121 // "https://www.googleapis.com/auth/devstorage.read_write"
6122 // ]
6123 // }
6124
6125 }
6126
6127 // method id "storage.notifications.get":
6128
6129 type NotificationsGetCall struct {
6130 s *Service
6131 bucket string
6132 notification string
6133 urlParams_ gensupport.URLParams
6134 ifNoneMatch_ string
6135 ctx_ context.Context
6136 header_ http.Header
6137 }
6138
6139 // Get: View a notification configuration.
6140 func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
6141 c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6142 c.bucket = bucket
6143 c.notification = notification
6144 return c
6145 }
6146
6147 // UserProject sets the optional parameter "userProject": The project to
6148 // be billed for this request. Required for Requester Pays buckets.
6149 func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
6150 c.urlParams_.Set("userProject", userProject)
6151 return c
6152 }
6153
6154 // Fields allows partial responses to be retrieved. See
6155 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6156 // for more information.
6157 func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
6158 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6159 return c
6160 }
6161
6162 // IfNoneMatch sets the optional parameter which makes the operation
6163 // fail if the object's ETag matches the given value. This is useful for
6164 // getting updates only after the object has changed since the last
6165 // request. Use googleapi.IsNotModified to check whether the response
6166 // error from Do is the result of In-None-Match.
6167 func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
6168 c.ifNoneMatch_ = entityTag
6169 return c
6170 }
6171
6172 // Context sets the context to be used in this call's Do method. Any
6173 // pending HTTP request will be aborted if the provided context is
6174 // canceled.
6175 func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
6176 c.ctx_ = ctx
6177 return c
6178 }
6179
6180 // Header returns an http.Header that can be modified by the caller to
6181 // add HTTP headers to the request.
6182 func (c *NotificationsGetCall) Header() http.Header {
6183 if c.header_ == nil {
6184 c.header_ = make(http.Header)
6185 }
6186 return c.header_
6187 }
6188
6189 func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
6190 reqHeaders := make(http.Header)
6191 for k, v := range c.header_ {
6192 reqHeaders[k] = v
6193 }
6194 reqHeaders.Set("User-Agent", c.s.userAgent())
6195 if c.ifNoneMatch_ != "" {
6196 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6197 }
6198 var body io.Reader = nil
6199 c.urlParams_.Set("alt", alt)
6200 c.urlParams_.Set("prettyPrint", "false")
6201 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
6202 urls += "?" + c.urlParams_.Encode()
6203 req, err := http.NewRequest("GET", urls, body)
6204 if err != nil {
6205 return nil, err
6206 }
6207 req.Header = reqHeaders
6208 googleapi.Expand(req.URL, map[string]string{
6209 "bucket": c.bucket,
6210 "notification": c.notification,
6211 })
6212 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6213 }
6214
6215 // Do executes the "storage.notifications.get" call.
6216 // Exactly one of *Notification or error will be non-nil. Any non-2xx
6217 // status code is an error. Response headers are in either
6218 // *Notification.ServerResponse.Header or (if a response was returned at
6219 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6220 // to check whether the returned error was because
6221 // http.StatusNotModified was returned.
6222 func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
6223 gensupport.SetOptions(c.urlParams_, opts...)
6224 res, err := c.doRequest("json")
6225 if res != nil && res.StatusCode == http.StatusNotModified {
6226 if res.Body != nil {
6227 res.Body.Close()
6228 }
6229 return nil, &googleapi.Error{
6230 Code: res.StatusCode,
6231 Header: res.Header,
6232 }
6233 }
6234 if err != nil {
6235 return nil, err
6236 }
6237 defer googleapi.CloseBody(res)
6238 if err := googleapi.CheckResponse(res); err != nil {
6239 return nil, err
6240 }
6241 ret := &Notification{
6242 ServerResponse: googleapi.ServerResponse{
6243 Header: res.Header,
6244 HTTPStatusCode: res.StatusCode,
6245 },
6246 }
6247 target := &ret
6248 if err := gensupport.DecodeResponse(target, res); err != nil {
6249 return nil, err
6250 }
6251 return ret, nil
6252 // {
6253 // "description": "View a notification configuration.",
6254 // "httpMethod": "GET",
6255 // "id": "storage.notifications.get",
6256 // "parameterOrder": [
6257 // "bucket",
6258 // "notification"
6259 // ],
6260 // "parameters": {
6261 // "bucket": {
6262 // "description": "The parent bucket of the notification.",
6263 // "location": "path",
6264 // "required": true,
6265 // "type": "string"
6266 // },
6267 // "notification": {
6268 // "description": "Notification ID",
6269 // "location": "path",
6270 // "required": true,
6271 // "type": "string"
6272 // },
6273 // "userProject": {
6274 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6275 // "location": "query",
6276 // "type": "string"
6277 // }
6278 // },
6279 // "path": "b/{bucket}/notificationConfigs/{notification}",
6280 // "response": {
6281 // "$ref": "Notification"
6282 // },
6283 // "scopes": [
6284 // "https://www.googleapis.com/auth/cloud-platform",
6285 // "https://www.googleapis.com/auth/cloud-platform.read-only",
6286 // "https://www.googleapis.com/auth/devstorage.full_control",
6287 // "https://www.googleapis.com/auth/devstorage.read_only",
6288 // "https://www.googleapis.com/auth/devstorage.read_write"
6289 // ]
6290 // }
6291
6292 }
6293
6294 // method id "storage.notifications.insert":
6295
6296 type NotificationsInsertCall struct {
6297 s *Service
6298 bucket string
6299 notification *Notification
6300 urlParams_ gensupport.URLParams
6301 ctx_ context.Context
6302 header_ http.Header
6303 }
6304
6305 // Insert: Creates a notification subscription for a given bucket.
6306 func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
6307 c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6308 c.bucket = bucket
6309 c.notification = notification
6310 return c
6311 }
6312
6313 // UserProject sets the optional parameter "userProject": The project to
6314 // be billed for this request. Required for Requester Pays buckets.
6315 func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
6316 c.urlParams_.Set("userProject", userProject)
6317 return c
6318 }
6319
6320 // Fields allows partial responses to be retrieved. See
6321 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6322 // for more information.
6323 func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
6324 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6325 return c
6326 }
6327
6328 // Context sets the context to be used in this call's Do method. Any
6329 // pending HTTP request will be aborted if the provided context is
6330 // canceled.
6331 func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
6332 c.ctx_ = ctx
6333 return c
6334 }
6335
6336 // Header returns an http.Header that can be modified by the caller to
6337 // add HTTP headers to the request.
6338 func (c *NotificationsInsertCall) Header() http.Header {
6339 if c.header_ == nil {
6340 c.header_ = make(http.Header)
6341 }
6342 return c.header_
6343 }
6344
6345 func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
6346 reqHeaders := make(http.Header)
6347 for k, v := range c.header_ {
6348 reqHeaders[k] = v
6349 }
6350 reqHeaders.Set("User-Agent", c.s.userAgent())
6351 var body io.Reader = nil
6352 body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
6353 if err != nil {
6354 return nil, err
6355 }
6356 reqHeaders.Set("Content-Type", "application/json")
6357 c.urlParams_.Set("alt", alt)
6358 c.urlParams_.Set("prettyPrint", "false")
6359 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
6360 urls += "?" + c.urlParams_.Encode()
6361 req, err := http.NewRequest("POST", urls, body)
6362 if err != nil {
6363 return nil, err
6364 }
6365 req.Header = reqHeaders
6366 googleapi.Expand(req.URL, map[string]string{
6367 "bucket": c.bucket,
6368 })
6369 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6370 }
6371
6372 // Do executes the "storage.notifications.insert" call.
6373 // Exactly one of *Notification or error will be non-nil. Any non-2xx
6374 // status code is an error. Response headers are in either
6375 // *Notification.ServerResponse.Header or (if a response was returned at
6376 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6377 // to check whether the returned error was because
6378 // http.StatusNotModified was returned.
6379 func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
6380 gensupport.SetOptions(c.urlParams_, opts...)
6381 res, err := c.doRequest("json")
6382 if res != nil && res.StatusCode == http.StatusNotModified {
6383 if res.Body != nil {
6384 res.Body.Close()
6385 }
6386 return nil, &googleapi.Error{
6387 Code: res.StatusCode,
6388 Header: res.Header,
6389 }
6390 }
6391 if err != nil {
6392 return nil, err
6393 }
6394 defer googleapi.CloseBody(res)
6395 if err := googleapi.CheckResponse(res); err != nil {
6396 return nil, err
6397 }
6398 ret := &Notification{
6399 ServerResponse: googleapi.ServerResponse{
6400 Header: res.Header,
6401 HTTPStatusCode: res.StatusCode,
6402 },
6403 }
6404 target := &ret
6405 if err := gensupport.DecodeResponse(target, res); err != nil {
6406 return nil, err
6407 }
6408 return ret, nil
6409 // {
6410 // "description": "Creates a notification subscription for a given bucket.",
6411 // "httpMethod": "POST",
6412 // "id": "storage.notifications.insert",
6413 // "parameterOrder": [
6414 // "bucket"
6415 // ],
6416 // "parameters": {
6417 // "bucket": {
6418 // "description": "The parent bucket of the notification.",
6419 // "location": "path",
6420 // "required": true,
6421 // "type": "string"
6422 // },
6423 // "userProject": {
6424 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6425 // "location": "query",
6426 // "type": "string"
6427 // }
6428 // },
6429 // "path": "b/{bucket}/notificationConfigs",
6430 // "request": {
6431 // "$ref": "Notification"
6432 // },
6433 // "response": {
6434 // "$ref": "Notification"
6435 // },
6436 // "scopes": [
6437 // "https://www.googleapis.com/auth/cloud-platform",
6438 // "https://www.googleapis.com/auth/devstorage.full_control",
6439 // "https://www.googleapis.com/auth/devstorage.read_write"
6440 // ]
6441 // }
6442
6443 }
6444
6445 // method id "storage.notifications.list":
6446
6447 type NotificationsListCall struct {
6448 s *Service
6449 bucket string
6450 urlParams_ gensupport.URLParams
6451 ifNoneMatch_ string
6452 ctx_ context.Context
6453 header_ http.Header
6454 }
6455
6456 // List: Retrieves a list of notification subscriptions for a given
6457 // bucket.
6458 func (r *NotificationsService) List(bucket string) *NotificationsListCall {
6459 c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6460 c.bucket = bucket
6461 return c
6462 }
6463
6464 // UserProject sets the optional parameter "userProject": The project to
6465 // be billed for this request. Required for Requester Pays buckets.
6466 func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
6467 c.urlParams_.Set("userProject", userProject)
6468 return c
6469 }
6470
6471 // Fields allows partial responses to be retrieved. See
6472 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6473 // for more information.
6474 func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
6475 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6476 return c
6477 }
6478
6479 // IfNoneMatch sets the optional parameter which makes the operation
6480 // fail if the object's ETag matches the given value. This is useful for
6481 // getting updates only after the object has changed since the last
6482 // request. Use googleapi.IsNotModified to check whether the response
6483 // error from Do is the result of In-None-Match.
6484 func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
6485 c.ifNoneMatch_ = entityTag
6486 return c
6487 }
6488
6489 // Context sets the context to be used in this call's Do method. Any
6490 // pending HTTP request will be aborted if the provided context is
6491 // canceled.
6492 func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
6493 c.ctx_ = ctx
6494 return c
6495 }
6496
6497 // Header returns an http.Header that can be modified by the caller to
6498 // add HTTP headers to the request.
6499 func (c *NotificationsListCall) Header() http.Header {
6500 if c.header_ == nil {
6501 c.header_ = make(http.Header)
6502 }
6503 return c.header_
6504 }
6505
6506 func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
6507 reqHeaders := make(http.Header)
6508 for k, v := range c.header_ {
6509 reqHeaders[k] = v
6510 }
6511 reqHeaders.Set("User-Agent", c.s.userAgent())
6512 if c.ifNoneMatch_ != "" {
6513 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6514 }
6515 var body io.Reader = nil
6516 c.urlParams_.Set("alt", alt)
6517 c.urlParams_.Set("prettyPrint", "false")
6518 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
6519 urls += "?" + c.urlParams_.Encode()
6520 req, err := http.NewRequest("GET", urls, body)
6521 if err != nil {
6522 return nil, err
6523 }
6524 req.Header = reqHeaders
6525 googleapi.Expand(req.URL, map[string]string{
6526 "bucket": c.bucket,
6527 })
6528 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6529 }
6530
6531 // Do executes the "storage.notifications.list" call.
6532 // Exactly one of *Notifications or error will be non-nil. Any non-2xx
6533 // status code is an error. Response headers are in either
6534 // *Notifications.ServerResponse.Header or (if a response was returned
6535 // at all) in error.(*googleapi.Error).Header. Use
6536 // googleapi.IsNotModified to check whether the returned error was
6537 // because http.StatusNotModified was returned.
6538 func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
6539 gensupport.SetOptions(c.urlParams_, opts...)
6540 res, err := c.doRequest("json")
6541 if res != nil && res.StatusCode == http.StatusNotModified {
6542 if res.Body != nil {
6543 res.Body.Close()
6544 }
6545 return nil, &googleapi.Error{
6546 Code: res.StatusCode,
6547 Header: res.Header,
6548 }
6549 }
6550 if err != nil {
6551 return nil, err
6552 }
6553 defer googleapi.CloseBody(res)
6554 if err := googleapi.CheckResponse(res); err != nil {
6555 return nil, err
6556 }
6557 ret := &Notifications{
6558 ServerResponse: googleapi.ServerResponse{
6559 Header: res.Header,
6560 HTTPStatusCode: res.StatusCode,
6561 },
6562 }
6563 target := &ret
6564 if err := gensupport.DecodeResponse(target, res); err != nil {
6565 return nil, err
6566 }
6567 return ret, nil
6568 // {
6569 // "description": "Retrieves a list of notification subscriptions for a given bucket.",
6570 // "httpMethod": "GET",
6571 // "id": "storage.notifications.list",
6572 // "parameterOrder": [
6573 // "bucket"
6574 // ],
6575 // "parameters": {
6576 // "bucket": {
6577 // "description": "Name of a Google Cloud Storage bucket.",
6578 // "location": "path",
6579 // "required": true,
6580 // "type": "string"
6581 // },
6582 // "userProject": {
6583 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6584 // "location": "query",
6585 // "type": "string"
6586 // }
6587 // },
6588 // "path": "b/{bucket}/notificationConfigs",
6589 // "response": {
6590 // "$ref": "Notifications"
6591 // },
6592 // "scopes": [
6593 // "https://www.googleapis.com/auth/cloud-platform",
6594 // "https://www.googleapis.com/auth/cloud-platform.read-only",
6595 // "https://www.googleapis.com/auth/devstorage.full_control",
6596 // "https://www.googleapis.com/auth/devstorage.read_only",
6597 // "https://www.googleapis.com/auth/devstorage.read_write"
6598 // ]
6599 // }
6600
6601 }
6602
6603 // method id "storage.objectAccessControls.delete":
6604
6605 type ObjectAccessControlsDeleteCall struct {
6606 s *Service
6607 bucket string
6608 object string
6609 entity string
6610 urlParams_ gensupport.URLParams
6611 ctx_ context.Context
6612 header_ http.Header
6613 }
6614
6615 // Delete: Permanently deletes the ACL entry for the specified entity on
6616 // the specified object.
6617 func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
6618 c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6619 c.bucket = bucket
6620 c.object = object
6621 c.entity = entity
6622 return c
6623 }
6624
6625 // Generation sets the optional parameter "generation": If present,
6626 // selects a specific revision of this object (as opposed to the latest
6627 // version, the default).
6628 func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall {
6629 c.urlParams_.Set("generation", fmt.Sprint(generation))
6630 return c
6631 }
6632
6633 // UserProject sets the optional parameter "userProject": The project to
6634 // be billed for this request. Required for Requester Pays buckets.
6635 func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
6636 c.urlParams_.Set("userProject", userProject)
6637 return c
6638 }
6639
6640 // Fields allows partial responses to be retrieved. See
6641 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6642 // for more information.
6643 func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
6644 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6645 return c
6646 }
6647
6648 // Context sets the context to be used in this call's Do method. Any
6649 // pending HTTP request will be aborted if the provided context is
6650 // canceled.
6651 func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
6652 c.ctx_ = ctx
6653 return c
6654 }
6655
6656 // Header returns an http.Header that can be modified by the caller to
6657 // add HTTP headers to the request.
6658 func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
6659 if c.header_ == nil {
6660 c.header_ = make(http.Header)
6661 }
6662 return c.header_
6663 }
6664
6665 func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
6666 reqHeaders := make(http.Header)
6667 for k, v := range c.header_ {
6668 reqHeaders[k] = v
6669 }
6670 reqHeaders.Set("User-Agent", c.s.userAgent())
6671 var body io.Reader = nil
6672 c.urlParams_.Set("alt", alt)
6673 c.urlParams_.Set("prettyPrint", "false")
6674 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
6675 urls += "?" + c.urlParams_.Encode()
6676 req, err := http.NewRequest("DELETE", urls, body)
6677 if err != nil {
6678 return nil, err
6679 }
6680 req.Header = reqHeaders
6681 googleapi.Expand(req.URL, map[string]string{
6682 "bucket": c.bucket,
6683 "object": c.object,
6684 "entity": c.entity,
6685 })
6686 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6687 }
6688
6689 // Do executes the "storage.objectAccessControls.delete" call.
6690 func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
6691 gensupport.SetOptions(c.urlParams_, opts...)
6692 res, err := c.doRequest("json")
6693 if err != nil {
6694 return err
6695 }
6696 defer googleapi.CloseBody(res)
6697 if err := googleapi.CheckResponse(res); err != nil {
6698 return err
6699 }
6700 return nil
6701 // {
6702 // "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
6703 // "httpMethod": "DELETE",
6704 // "id": "storage.objectAccessControls.delete",
6705 // "parameterOrder": [
6706 // "bucket",
6707 // "object",
6708 // "entity"
6709 // ],
6710 // "parameters": {
6711 // "bucket": {
6712 // "description": "Name of a bucket.",
6713 // "location": "path",
6714 // "required": true,
6715 // "type": "string"
6716 // },
6717 // "entity": {
6718 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6719 // "location": "path",
6720 // "required": true,
6721 // "type": "string"
6722 // },
6723 // "generation": {
6724 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
6725 // "format": "int64",
6726 // "location": "query",
6727 // "type": "string"
6728 // },
6729 // "object": {
6730 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
6731 // "location": "path",
6732 // "required": true,
6733 // "type": "string"
6734 // },
6735 // "userProject": {
6736 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6737 // "location": "query",
6738 // "type": "string"
6739 // }
6740 // },
6741 // "path": "b/{bucket}/o/{object}/acl/{entity}",
6742 // "scopes": [
6743 // "https://www.googleapis.com/auth/cloud-platform",
6744 // "https://www.googleapis.com/auth/devstorage.full_control"
6745 // ]
6746 // }
6747
6748 }
6749
6750 // method id "storage.objectAccessControls.get":
6751
6752 type ObjectAccessControlsGetCall struct {
6753 s *Service
6754 bucket string
6755 object string
6756 entity string
6757 urlParams_ gensupport.URLParams
6758 ifNoneMatch_ string
6759 ctx_ context.Context
6760 header_ http.Header
6761 }
6762
6763 // Get: Returns the ACL entry for the specified entity on the specified
6764 // object.
6765 func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
6766 c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6767 c.bucket = bucket
6768 c.object = object
6769 c.entity = entity
6770 return c
6771 }
6772
6773 // Generation sets the optional parameter "generation": If present,
6774 // selects a specific revision of this object (as opposed to the latest
6775 // version, the default).
6776 func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall {
6777 c.urlParams_.Set("generation", fmt.Sprint(generation))
6778 return c
6779 }
6780
6781 // UserProject sets the optional parameter "userProject": The project to
6782 // be billed for this request. Required for Requester Pays buckets.
6783 func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
6784 c.urlParams_.Set("userProject", userProject)
6785 return c
6786 }
6787
6788 // Fields allows partial responses to be retrieved. See
6789 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6790 // for more information.
6791 func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
6792 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6793 return c
6794 }
6795
6796 // IfNoneMatch sets the optional parameter which makes the operation
6797 // fail if the object's ETag matches the given value. This is useful for
6798 // getting updates only after the object has changed since the last
6799 // request. Use googleapi.IsNotModified to check whether the response
6800 // error from Do is the result of In-None-Match.
6801 func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
6802 c.ifNoneMatch_ = entityTag
6803 return c
6804 }
6805
6806 // Context sets the context to be used in this call's Do method. Any
6807 // pending HTTP request will be aborted if the provided context is
6808 // canceled.
6809 func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
6810 c.ctx_ = ctx
6811 return c
6812 }
6813
6814 // Header returns an http.Header that can be modified by the caller to
6815 // add HTTP headers to the request.
6816 func (c *ObjectAccessControlsGetCall) Header() http.Header {
6817 if c.header_ == nil {
6818 c.header_ = make(http.Header)
6819 }
6820 return c.header_
6821 }
6822
6823 func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
6824 reqHeaders := make(http.Header)
6825 for k, v := range c.header_ {
6826 reqHeaders[k] = v
6827 }
6828 reqHeaders.Set("User-Agent", c.s.userAgent())
6829 if c.ifNoneMatch_ != "" {
6830 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6831 }
6832 var body io.Reader = nil
6833 c.urlParams_.Set("alt", alt)
6834 c.urlParams_.Set("prettyPrint", "false")
6835 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
6836 urls += "?" + c.urlParams_.Encode()
6837 req, err := http.NewRequest("GET", urls, body)
6838 if err != nil {
6839 return nil, err
6840 }
6841 req.Header = reqHeaders
6842 googleapi.Expand(req.URL, map[string]string{
6843 "bucket": c.bucket,
6844 "object": c.object,
6845 "entity": c.entity,
6846 })
6847 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6848 }
6849
6850 // Do executes the "storage.objectAccessControls.get" call.
6851 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
6852 // non-2xx status code is an error. Response headers are in either
6853 // *ObjectAccessControl.ServerResponse.Header or (if a response was
6854 // returned at all) in error.(*googleapi.Error).Header. Use
6855 // googleapi.IsNotModified to check whether the returned error was
6856 // because http.StatusNotModified was returned.
6857 func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
6858 gensupport.SetOptions(c.urlParams_, opts...)
6859 res, err := c.doRequest("json")
6860 if res != nil && res.StatusCode == http.StatusNotModified {
6861 if res.Body != nil {
6862 res.Body.Close()
6863 }
6864 return nil, &googleapi.Error{
6865 Code: res.StatusCode,
6866 Header: res.Header,
6867 }
6868 }
6869 if err != nil {
6870 return nil, err
6871 }
6872 defer googleapi.CloseBody(res)
6873 if err := googleapi.CheckResponse(res); err != nil {
6874 return nil, err
6875 }
6876 ret := &ObjectAccessControl{
6877 ServerResponse: googleapi.ServerResponse{
6878 Header: res.Header,
6879 HTTPStatusCode: res.StatusCode,
6880 },
6881 }
6882 target := &ret
6883 if err := gensupport.DecodeResponse(target, res); err != nil {
6884 return nil, err
6885 }
6886 return ret, nil
6887 // {
6888 // "description": "Returns the ACL entry for the specified entity on the specified object.",
6889 // "httpMethod": "GET",
6890 // "id": "storage.objectAccessControls.get",
6891 // "parameterOrder": [
6892 // "bucket",
6893 // "object",
6894 // "entity"
6895 // ],
6896 // "parameters": {
6897 // "bucket": {
6898 // "description": "Name of a bucket.",
6899 // "location": "path",
6900 // "required": true,
6901 // "type": "string"
6902 // },
6903 // "entity": {
6904 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
6905 // "location": "path",
6906 // "required": true,
6907 // "type": "string"
6908 // },
6909 // "generation": {
6910 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
6911 // "format": "int64",
6912 // "location": "query",
6913 // "type": "string"
6914 // },
6915 // "object": {
6916 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
6917 // "location": "path",
6918 // "required": true,
6919 // "type": "string"
6920 // },
6921 // "userProject": {
6922 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6923 // "location": "query",
6924 // "type": "string"
6925 // }
6926 // },
6927 // "path": "b/{bucket}/o/{object}/acl/{entity}",
6928 // "response": {
6929 // "$ref": "ObjectAccessControl"
6930 // },
6931 // "scopes": [
6932 // "https://www.googleapis.com/auth/cloud-platform",
6933 // "https://www.googleapis.com/auth/devstorage.full_control"
6934 // ]
6935 // }
6936
6937 }
6938
6939 // method id "storage.objectAccessControls.insert":
6940
6941 type ObjectAccessControlsInsertCall struct {
6942 s *Service
6943 bucket string
6944 object string
6945 objectaccesscontrol *ObjectAccessControl
6946 urlParams_ gensupport.URLParams
6947 ctx_ context.Context
6948 header_ http.Header
6949 }
6950
6951 // Insert: Creates a new ACL entry on the specified object.
6952 func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
6953 c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6954 c.bucket = bucket
6955 c.object = object
6956 c.objectaccesscontrol = objectaccesscontrol
6957 return c
6958 }
6959
6960 // Generation sets the optional parameter "generation": If present,
6961 // selects a specific revision of this object (as opposed to the latest
6962 // version, the default).
6963 func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall {
6964 c.urlParams_.Set("generation", fmt.Sprint(generation))
6965 return c
6966 }
6967
6968 // UserProject sets the optional parameter "userProject": The project to
6969 // be billed for this request. Required for Requester Pays buckets.
6970 func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
6971 c.urlParams_.Set("userProject", userProject)
6972 return c
6973 }
6974
6975 // Fields allows partial responses to be retrieved. See
6976 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6977 // for more information.
6978 func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
6979 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6980 return c
6981 }
6982
6983 // Context sets the context to be used in this call's Do method. Any
6984 // pending HTTP request will be aborted if the provided context is
6985 // canceled.
6986 func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
6987 c.ctx_ = ctx
6988 return c
6989 }
6990
6991 // Header returns an http.Header that can be modified by the caller to
6992 // add HTTP headers to the request.
6993 func (c *ObjectAccessControlsInsertCall) Header() http.Header {
6994 if c.header_ == nil {
6995 c.header_ = make(http.Header)
6996 }
6997 return c.header_
6998 }
6999
7000 func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
7001 reqHeaders := make(http.Header)
7002 for k, v := range c.header_ {
7003 reqHeaders[k] = v
7004 }
7005 reqHeaders.Set("User-Agent", c.s.userAgent())
7006 var body io.Reader = nil
7007 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
7008 if err != nil {
7009 return nil, err
7010 }
7011 reqHeaders.Set("Content-Type", "application/json")
7012 c.urlParams_.Set("alt", alt)
7013 c.urlParams_.Set("prettyPrint", "false")
7014 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7015 urls += "?" + c.urlParams_.Encode()
7016 req, err := http.NewRequest("POST", urls, body)
7017 if err != nil {
7018 return nil, err
7019 }
7020 req.Header = reqHeaders
7021 googleapi.Expand(req.URL, map[string]string{
7022 "bucket": c.bucket,
7023 "object": c.object,
7024 })
7025 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7026 }
7027
7028 // Do executes the "storage.objectAccessControls.insert" call.
7029 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
7030 // non-2xx status code is an error. Response headers are in either
7031 // *ObjectAccessControl.ServerResponse.Header or (if a response was
7032 // returned at all) in error.(*googleapi.Error).Header. Use
7033 // googleapi.IsNotModified to check whether the returned error was
7034 // because http.StatusNotModified was returned.
7035 func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7036 gensupport.SetOptions(c.urlParams_, opts...)
7037 res, err := c.doRequest("json")
7038 if res != nil && res.StatusCode == http.StatusNotModified {
7039 if res.Body != nil {
7040 res.Body.Close()
7041 }
7042 return nil, &googleapi.Error{
7043 Code: res.StatusCode,
7044 Header: res.Header,
7045 }
7046 }
7047 if err != nil {
7048 return nil, err
7049 }
7050 defer googleapi.CloseBody(res)
7051 if err := googleapi.CheckResponse(res); err != nil {
7052 return nil, err
7053 }
7054 ret := &ObjectAccessControl{
7055 ServerResponse: googleapi.ServerResponse{
7056 Header: res.Header,
7057 HTTPStatusCode: res.StatusCode,
7058 },
7059 }
7060 target := &ret
7061 if err := gensupport.DecodeResponse(target, res); err != nil {
7062 return nil, err
7063 }
7064 return ret, nil
7065 // {
7066 // "description": "Creates a new ACL entry on the specified object.",
7067 // "httpMethod": "POST",
7068 // "id": "storage.objectAccessControls.insert",
7069 // "parameterOrder": [
7070 // "bucket",
7071 // "object"
7072 // ],
7073 // "parameters": {
7074 // "bucket": {
7075 // "description": "Name of a bucket.",
7076 // "location": "path",
7077 // "required": true,
7078 // "type": "string"
7079 // },
7080 // "generation": {
7081 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7082 // "format": "int64",
7083 // "location": "query",
7084 // "type": "string"
7085 // },
7086 // "object": {
7087 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7088 // "location": "path",
7089 // "required": true,
7090 // "type": "string"
7091 // },
7092 // "userProject": {
7093 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7094 // "location": "query",
7095 // "type": "string"
7096 // }
7097 // },
7098 // "path": "b/{bucket}/o/{object}/acl",
7099 // "request": {
7100 // "$ref": "ObjectAccessControl"
7101 // },
7102 // "response": {
7103 // "$ref": "ObjectAccessControl"
7104 // },
7105 // "scopes": [
7106 // "https://www.googleapis.com/auth/cloud-platform",
7107 // "https://www.googleapis.com/auth/devstorage.full_control"
7108 // ]
7109 // }
7110
7111 }
7112
7113 // method id "storage.objectAccessControls.list":
7114
7115 type ObjectAccessControlsListCall struct {
7116 s *Service
7117 bucket string
7118 object string
7119 urlParams_ gensupport.URLParams
7120 ifNoneMatch_ string
7121 ctx_ context.Context
7122 header_ http.Header
7123 }
7124
7125 // List: Retrieves ACL entries on the specified object.
7126 func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
7127 c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7128 c.bucket = bucket
7129 c.object = object
7130 return c
7131 }
7132
7133 // Generation sets the optional parameter "generation": If present,
7134 // selects a specific revision of this object (as opposed to the latest
7135 // version, the default).
7136 func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall {
7137 c.urlParams_.Set("generation", fmt.Sprint(generation))
7138 return c
7139 }
7140
7141 // UserProject sets the optional parameter "userProject": The project to
7142 // be billed for this request. Required for Requester Pays buckets.
7143 func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
7144 c.urlParams_.Set("userProject", userProject)
7145 return c
7146 }
7147
7148 // Fields allows partial responses to be retrieved. See
7149 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7150 // for more information.
7151 func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
7152 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7153 return c
7154 }
7155
7156 // IfNoneMatch sets the optional parameter which makes the operation
7157 // fail if the object's ETag matches the given value. This is useful for
7158 // getting updates only after the object has changed since the last
7159 // request. Use googleapi.IsNotModified to check whether the response
7160 // error from Do is the result of In-None-Match.
7161 func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
7162 c.ifNoneMatch_ = entityTag
7163 return c
7164 }
7165
7166 // Context sets the context to be used in this call's Do method. Any
7167 // pending HTTP request will be aborted if the provided context is
7168 // canceled.
7169 func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
7170 c.ctx_ = ctx
7171 return c
7172 }
7173
7174 // Header returns an http.Header that can be modified by the caller to
7175 // add HTTP headers to the request.
7176 func (c *ObjectAccessControlsListCall) Header() http.Header {
7177 if c.header_ == nil {
7178 c.header_ = make(http.Header)
7179 }
7180 return c.header_
7181 }
7182
7183 func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
7184 reqHeaders := make(http.Header)
7185 for k, v := range c.header_ {
7186 reqHeaders[k] = v
7187 }
7188 reqHeaders.Set("User-Agent", c.s.userAgent())
7189 if c.ifNoneMatch_ != "" {
7190 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7191 }
7192 var body io.Reader = nil
7193 c.urlParams_.Set("alt", alt)
7194 c.urlParams_.Set("prettyPrint", "false")
7195 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
7196 urls += "?" + c.urlParams_.Encode()
7197 req, err := http.NewRequest("GET", urls, body)
7198 if err != nil {
7199 return nil, err
7200 }
7201 req.Header = reqHeaders
7202 googleapi.Expand(req.URL, map[string]string{
7203 "bucket": c.bucket,
7204 "object": c.object,
7205 })
7206 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7207 }
7208
7209 // Do executes the "storage.objectAccessControls.list" call.
7210 // Exactly one of *ObjectAccessControls or error will be non-nil. Any
7211 // non-2xx status code is an error. Response headers are in either
7212 // *ObjectAccessControls.ServerResponse.Header or (if a response was
7213 // returned at all) in error.(*googleapi.Error).Header. Use
7214 // googleapi.IsNotModified to check whether the returned error was
7215 // because http.StatusNotModified was returned.
7216 func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
7217 gensupport.SetOptions(c.urlParams_, opts...)
7218 res, err := c.doRequest("json")
7219 if res != nil && res.StatusCode == http.StatusNotModified {
7220 if res.Body != nil {
7221 res.Body.Close()
7222 }
7223 return nil, &googleapi.Error{
7224 Code: res.StatusCode,
7225 Header: res.Header,
7226 }
7227 }
7228 if err != nil {
7229 return nil, err
7230 }
7231 defer googleapi.CloseBody(res)
7232 if err := googleapi.CheckResponse(res); err != nil {
7233 return nil, err
7234 }
7235 ret := &ObjectAccessControls{
7236 ServerResponse: googleapi.ServerResponse{
7237 Header: res.Header,
7238 HTTPStatusCode: res.StatusCode,
7239 },
7240 }
7241 target := &ret
7242 if err := gensupport.DecodeResponse(target, res); err != nil {
7243 return nil, err
7244 }
7245 return ret, nil
7246 // {
7247 // "description": "Retrieves ACL entries on the specified object.",
7248 // "httpMethod": "GET",
7249 // "id": "storage.objectAccessControls.list",
7250 // "parameterOrder": [
7251 // "bucket",
7252 // "object"
7253 // ],
7254 // "parameters": {
7255 // "bucket": {
7256 // "description": "Name of a bucket.",
7257 // "location": "path",
7258 // "required": true,
7259 // "type": "string"
7260 // },
7261 // "generation": {
7262 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7263 // "format": "int64",
7264 // "location": "query",
7265 // "type": "string"
7266 // },
7267 // "object": {
7268 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7269 // "location": "path",
7270 // "required": true,
7271 // "type": "string"
7272 // },
7273 // "userProject": {
7274 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7275 // "location": "query",
7276 // "type": "string"
7277 // }
7278 // },
7279 // "path": "b/{bucket}/o/{object}/acl",
7280 // "response": {
7281 // "$ref": "ObjectAccessControls"
7282 // },
7283 // "scopes": [
7284 // "https://www.googleapis.com/auth/cloud-platform",
7285 // "https://www.googleapis.com/auth/devstorage.full_control"
7286 // ]
7287 // }
7288
7289 }
7290
7291 // method id "storage.objectAccessControls.patch":
7292
7293 type ObjectAccessControlsPatchCall struct {
7294 s *Service
7295 bucket string
7296 object string
7297 entity string
7298 objectaccesscontrol *ObjectAccessControl
7299 urlParams_ gensupport.URLParams
7300 ctx_ context.Context
7301 header_ http.Header
7302 }
7303
7304 // Patch: Patches an ACL entry on the specified object.
7305 func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
7306 c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7307 c.bucket = bucket
7308 c.object = object
7309 c.entity = entity
7310 c.objectaccesscontrol = objectaccesscontrol
7311 return c
7312 }
7313
7314 // Generation sets the optional parameter "generation": If present,
7315 // selects a specific revision of this object (as opposed to the latest
7316 // version, the default).
7317 func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall {
7318 c.urlParams_.Set("generation", fmt.Sprint(generation))
7319 return c
7320 }
7321
7322 // UserProject sets the optional parameter "userProject": The project to
7323 // be billed for this request. Required for Requester Pays buckets.
7324 func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
7325 c.urlParams_.Set("userProject", userProject)
7326 return c
7327 }
7328
7329 // Fields allows partial responses to be retrieved. See
7330 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7331 // for more information.
7332 func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
7333 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7334 return c
7335 }
7336
7337 // Context sets the context to be used in this call's Do method. Any
7338 // pending HTTP request will be aborted if the provided context is
7339 // canceled.
7340 func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
7341 c.ctx_ = ctx
7342 return c
7343 }
7344
7345 // Header returns an http.Header that can be modified by the caller to
7346 // add HTTP headers to the request.
7347 func (c *ObjectAccessControlsPatchCall) Header() http.Header {
7348 if c.header_ == nil {
7349 c.header_ = make(http.Header)
7350 }
7351 return c.header_
7352 }
7353
7354 func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
7355 reqHeaders := make(http.Header)
7356 for k, v := range c.header_ {
7357 reqHeaders[k] = v
7358 }
7359 reqHeaders.Set("User-Agent", c.s.userAgent())
7360 var body io.Reader = nil
7361 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
7362 if err != nil {
7363 return nil, err
7364 }
7365 reqHeaders.Set("Content-Type", "application/json")
7366 c.urlParams_.Set("alt", alt)
7367 c.urlParams_.Set("prettyPrint", "false")
7368 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7369 urls += "?" + c.urlParams_.Encode()
7370 req, err := http.NewRequest("PATCH", urls, body)
7371 if err != nil {
7372 return nil, err
7373 }
7374 req.Header = reqHeaders
7375 googleapi.Expand(req.URL, map[string]string{
7376 "bucket": c.bucket,
7377 "object": c.object,
7378 "entity": c.entity,
7379 })
7380 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7381 }
7382
7383 // Do executes the "storage.objectAccessControls.patch" call.
7384 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
7385 // non-2xx status code is an error. Response headers are in either
7386 // *ObjectAccessControl.ServerResponse.Header or (if a response was
7387 // returned at all) in error.(*googleapi.Error).Header. Use
7388 // googleapi.IsNotModified to check whether the returned error was
7389 // because http.StatusNotModified was returned.
7390 func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7391 gensupport.SetOptions(c.urlParams_, opts...)
7392 res, err := c.doRequest("json")
7393 if res != nil && res.StatusCode == http.StatusNotModified {
7394 if res.Body != nil {
7395 res.Body.Close()
7396 }
7397 return nil, &googleapi.Error{
7398 Code: res.StatusCode,
7399 Header: res.Header,
7400 }
7401 }
7402 if err != nil {
7403 return nil, err
7404 }
7405 defer googleapi.CloseBody(res)
7406 if err := googleapi.CheckResponse(res); err != nil {
7407 return nil, err
7408 }
7409 ret := &ObjectAccessControl{
7410 ServerResponse: googleapi.ServerResponse{
7411 Header: res.Header,
7412 HTTPStatusCode: res.StatusCode,
7413 },
7414 }
7415 target := &ret
7416 if err := gensupport.DecodeResponse(target, res); err != nil {
7417 return nil, err
7418 }
7419 return ret, nil
7420 // {
7421 // "description": "Patches an ACL entry on the specified object.",
7422 // "httpMethod": "PATCH",
7423 // "id": "storage.objectAccessControls.patch",
7424 // "parameterOrder": [
7425 // "bucket",
7426 // "object",
7427 // "entity"
7428 // ],
7429 // "parameters": {
7430 // "bucket": {
7431 // "description": "Name of a bucket.",
7432 // "location": "path",
7433 // "required": true,
7434 // "type": "string"
7435 // },
7436 // "entity": {
7437 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7438 // "location": "path",
7439 // "required": true,
7440 // "type": "string"
7441 // },
7442 // "generation": {
7443 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7444 // "format": "int64",
7445 // "location": "query",
7446 // "type": "string"
7447 // },
7448 // "object": {
7449 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7450 // "location": "path",
7451 // "required": true,
7452 // "type": "string"
7453 // },
7454 // "userProject": {
7455 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7456 // "location": "query",
7457 // "type": "string"
7458 // }
7459 // },
7460 // "path": "b/{bucket}/o/{object}/acl/{entity}",
7461 // "request": {
7462 // "$ref": "ObjectAccessControl"
7463 // },
7464 // "response": {
7465 // "$ref": "ObjectAccessControl"
7466 // },
7467 // "scopes": [
7468 // "https://www.googleapis.com/auth/cloud-platform",
7469 // "https://www.googleapis.com/auth/devstorage.full_control"
7470 // ]
7471 // }
7472
7473 }
7474
7475 // method id "storage.objectAccessControls.update":
7476
7477 type ObjectAccessControlsUpdateCall struct {
7478 s *Service
7479 bucket string
7480 object string
7481 entity string
7482 objectaccesscontrol *ObjectAccessControl
7483 urlParams_ gensupport.URLParams
7484 ctx_ context.Context
7485 header_ http.Header
7486 }
7487
7488 // Update: Updates an ACL entry on the specified object.
7489 func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
7490 c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7491 c.bucket = bucket
7492 c.object = object
7493 c.entity = entity
7494 c.objectaccesscontrol = objectaccesscontrol
7495 return c
7496 }
7497
7498 // Generation sets the optional parameter "generation": If present,
7499 // selects a specific revision of this object (as opposed to the latest
7500 // version, the default).
7501 func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall {
7502 c.urlParams_.Set("generation", fmt.Sprint(generation))
7503 return c
7504 }
7505
7506 // UserProject sets the optional parameter "userProject": The project to
7507 // be billed for this request. Required for Requester Pays buckets.
7508 func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
7509 c.urlParams_.Set("userProject", userProject)
7510 return c
7511 }
7512
7513 // Fields allows partial responses to be retrieved. See
7514 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7515 // for more information.
7516 func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
7517 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7518 return c
7519 }
7520
7521 // Context sets the context to be used in this call's Do method. Any
7522 // pending HTTP request will be aborted if the provided context is
7523 // canceled.
7524 func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
7525 c.ctx_ = ctx
7526 return c
7527 }
7528
7529 // Header returns an http.Header that can be modified by the caller to
7530 // add HTTP headers to the request.
7531 func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
7532 if c.header_ == nil {
7533 c.header_ = make(http.Header)
7534 }
7535 return c.header_
7536 }
7537
7538 func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
7539 reqHeaders := make(http.Header)
7540 for k, v := range c.header_ {
7541 reqHeaders[k] = v
7542 }
7543 reqHeaders.Set("User-Agent", c.s.userAgent())
7544 var body io.Reader = nil
7545 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
7546 if err != nil {
7547 return nil, err
7548 }
7549 reqHeaders.Set("Content-Type", "application/json")
7550 c.urlParams_.Set("alt", alt)
7551 c.urlParams_.Set("prettyPrint", "false")
7552 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
7553 urls += "?" + c.urlParams_.Encode()
7554 req, err := http.NewRequest("PUT", urls, body)
7555 if err != nil {
7556 return nil, err
7557 }
7558 req.Header = reqHeaders
7559 googleapi.Expand(req.URL, map[string]string{
7560 "bucket": c.bucket,
7561 "object": c.object,
7562 "entity": c.entity,
7563 })
7564 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7565 }
7566
7567 // Do executes the "storage.objectAccessControls.update" call.
7568 // Exactly one of *ObjectAccessControl or error will be non-nil. Any
7569 // non-2xx status code is an error. Response headers are in either
7570 // *ObjectAccessControl.ServerResponse.Header or (if a response was
7571 // returned at all) in error.(*googleapi.Error).Header. Use
7572 // googleapi.IsNotModified to check whether the returned error was
7573 // because http.StatusNotModified was returned.
7574 func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
7575 gensupport.SetOptions(c.urlParams_, opts...)
7576 res, err := c.doRequest("json")
7577 if res != nil && res.StatusCode == http.StatusNotModified {
7578 if res.Body != nil {
7579 res.Body.Close()
7580 }
7581 return nil, &googleapi.Error{
7582 Code: res.StatusCode,
7583 Header: res.Header,
7584 }
7585 }
7586 if err != nil {
7587 return nil, err
7588 }
7589 defer googleapi.CloseBody(res)
7590 if err := googleapi.CheckResponse(res); err != nil {
7591 return nil, err
7592 }
7593 ret := &ObjectAccessControl{
7594 ServerResponse: googleapi.ServerResponse{
7595 Header: res.Header,
7596 HTTPStatusCode: res.StatusCode,
7597 },
7598 }
7599 target := &ret
7600 if err := gensupport.DecodeResponse(target, res); err != nil {
7601 return nil, err
7602 }
7603 return ret, nil
7604 // {
7605 // "description": "Updates an ACL entry on the specified object.",
7606 // "httpMethod": "PUT",
7607 // "id": "storage.objectAccessControls.update",
7608 // "parameterOrder": [
7609 // "bucket",
7610 // "object",
7611 // "entity"
7612 // ],
7613 // "parameters": {
7614 // "bucket": {
7615 // "description": "Name of a bucket.",
7616 // "location": "path",
7617 // "required": true,
7618 // "type": "string"
7619 // },
7620 // "entity": {
7621 // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
7622 // "location": "path",
7623 // "required": true,
7624 // "type": "string"
7625 // },
7626 // "generation": {
7627 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
7628 // "format": "int64",
7629 // "location": "query",
7630 // "type": "string"
7631 // },
7632 // "object": {
7633 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7634 // "location": "path",
7635 // "required": true,
7636 // "type": "string"
7637 // },
7638 // "userProject": {
7639 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7640 // "location": "query",
7641 // "type": "string"
7642 // }
7643 // },
7644 // "path": "b/{bucket}/o/{object}/acl/{entity}",
7645 // "request": {
7646 // "$ref": "ObjectAccessControl"
7647 // },
7648 // "response": {
7649 // "$ref": "ObjectAccessControl"
7650 // },
7651 // "scopes": [
7652 // "https://www.googleapis.com/auth/cloud-platform",
7653 // "https://www.googleapis.com/auth/devstorage.full_control"
7654 // ]
7655 // }
7656
7657 }
7658
7659 // method id "storage.objects.compose":
7660
7661 type ObjectsComposeCall struct {
7662 s *Service
7663 destinationBucket string
7664 destinationObject string
7665 composerequest *ComposeRequest
7666 urlParams_ gensupport.URLParams
7667 ctx_ context.Context
7668 header_ http.Header
7669 }
7670
7671 // Compose: Concatenates a list of existing objects into a new object in
7672 // the same bucket.
7673 func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
7674 c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7675 c.destinationBucket = destinationBucket
7676 c.destinationObject = destinationObject
7677 c.composerequest = composerequest
7678 return c
7679 }
7680
7681 // DestinationPredefinedAcl sets the optional parameter
7682 // "destinationPredefinedAcl": Apply a predefined set of access controls
7683 // to the destination object.
7684 //
7685 // Possible values:
7686 // "authenticatedRead" - Object owner gets OWNER access, and
7687 // allAuthenticatedUsers get READER access.
7688 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
7689 // project team owners get OWNER access.
7690 // "bucketOwnerRead" - Object owner gets OWNER access, and project
7691 // team owners get READER access.
7692 // "private" - Object owner gets OWNER access.
7693 // "projectPrivate" - Object owner gets OWNER access, and project team
7694 // members get access according to their roles.
7695 // "publicRead" - Object owner gets OWNER access, and allUsers get
7696 // READER access.
7697 func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
7698 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
7699 return c
7700 }
7701
7702 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
7703 // Makes the operation conditional on whether the object's current
7704 // generation matches the given value. Setting to 0 makes the operation
7705 // succeed only if there are no live versions of the object.
7706 func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
7707 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
7708 return c
7709 }
7710
7711 // IfMetagenerationMatch sets the optional parameter
7712 // "ifMetagenerationMatch": Makes the operation conditional on whether
7713 // the object's current metageneration matches the given value.
7714 func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall {
7715 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
7716 return c
7717 }
7718
7719 // KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
7720 // the Cloud KMS key, of the form
7721 // projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
7722 // that will be used to encrypt the object. Overrides the object
7723 // metadata's kms_key_name value, if any.
7724 func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall {
7725 c.urlParams_.Set("kmsKeyName", kmsKeyName)
7726 return c
7727 }
7728
7729 // UserProject sets the optional parameter "userProject": The project to
7730 // be billed for this request. Required for Requester Pays buckets.
7731 func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
7732 c.urlParams_.Set("userProject", userProject)
7733 return c
7734 }
7735
7736 // Fields allows partial responses to be retrieved. See
7737 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7738 // for more information.
7739 func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
7740 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7741 return c
7742 }
7743
7744 // Context sets the context to be used in this call's Do method. Any
7745 // pending HTTP request will be aborted if the provided context is
7746 // canceled.
7747 func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
7748 c.ctx_ = ctx
7749 return c
7750 }
7751
7752 // Header returns an http.Header that can be modified by the caller to
7753 // add HTTP headers to the request.
7754 func (c *ObjectsComposeCall) Header() http.Header {
7755 if c.header_ == nil {
7756 c.header_ = make(http.Header)
7757 }
7758 return c.header_
7759 }
7760
7761 func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
7762 reqHeaders := make(http.Header)
7763 for k, v := range c.header_ {
7764 reqHeaders[k] = v
7765 }
7766 reqHeaders.Set("User-Agent", c.s.userAgent())
7767 var body io.Reader = nil
7768 body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
7769 if err != nil {
7770 return nil, err
7771 }
7772 reqHeaders.Set("Content-Type", "application/json")
7773 c.urlParams_.Set("alt", alt)
7774 c.urlParams_.Set("prettyPrint", "false")
7775 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
7776 urls += "?" + c.urlParams_.Encode()
7777 req, err := http.NewRequest("POST", urls, body)
7778 if err != nil {
7779 return nil, err
7780 }
7781 req.Header = reqHeaders
7782 googleapi.Expand(req.URL, map[string]string{
7783 "destinationBucket": c.destinationBucket,
7784 "destinationObject": c.destinationObject,
7785 })
7786 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7787 }
7788
7789 // Do executes the "storage.objects.compose" call.
7790 // Exactly one of *Object or error will be non-nil. Any non-2xx status
7791 // code is an error. Response headers are in either
7792 // *Object.ServerResponse.Header or (if a response was returned at all)
7793 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7794 // check whether the returned error was because http.StatusNotModified
7795 // was returned.
7796 func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
7797 gensupport.SetOptions(c.urlParams_, opts...)
7798 res, err := c.doRequest("json")
7799 if res != nil && res.StatusCode == http.StatusNotModified {
7800 if res.Body != nil {
7801 res.Body.Close()
7802 }
7803 return nil, &googleapi.Error{
7804 Code: res.StatusCode,
7805 Header: res.Header,
7806 }
7807 }
7808 if err != nil {
7809 return nil, err
7810 }
7811 defer googleapi.CloseBody(res)
7812 if err := googleapi.CheckResponse(res); err != nil {
7813 return nil, err
7814 }
7815 ret := &Object{
7816 ServerResponse: googleapi.ServerResponse{
7817 Header: res.Header,
7818 HTTPStatusCode: res.StatusCode,
7819 },
7820 }
7821 target := &ret
7822 if err := gensupport.DecodeResponse(target, res); err != nil {
7823 return nil, err
7824 }
7825 return ret, nil
7826 // {
7827 // "description": "Concatenates a list of existing objects into a new object in the same bucket.",
7828 // "httpMethod": "POST",
7829 // "id": "storage.objects.compose",
7830 // "parameterOrder": [
7831 // "destinationBucket",
7832 // "destinationObject"
7833 // ],
7834 // "parameters": {
7835 // "destinationBucket": {
7836 // "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
7837 // "location": "path",
7838 // "required": true,
7839 // "type": "string"
7840 // },
7841 // "destinationObject": {
7842 // "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
7843 // "location": "path",
7844 // "required": true,
7845 // "type": "string"
7846 // },
7847 // "destinationPredefinedAcl": {
7848 // "description": "Apply a predefined set of access controls to the destination object.",
7849 // "enum": [
7850 // "authenticatedRead",
7851 // "bucketOwnerFullControl",
7852 // "bucketOwnerRead",
7853 // "private",
7854 // "projectPrivate",
7855 // "publicRead"
7856 // ],
7857 // "enumDescriptions": [
7858 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
7859 // "Object owner gets OWNER access, and project team owners get OWNER access.",
7860 // "Object owner gets OWNER access, and project team owners get READER access.",
7861 // "Object owner gets OWNER access.",
7862 // "Object owner gets OWNER access, and project team members get access according to their roles.",
7863 // "Object owner gets OWNER access, and allUsers get READER access."
7864 // ],
7865 // "location": "query",
7866 // "type": "string"
7867 // },
7868 // "ifGenerationMatch": {
7869 // "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.",
7870 // "format": "int64",
7871 // "location": "query",
7872 // "type": "string"
7873 // },
7874 // "ifMetagenerationMatch": {
7875 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
7876 // "format": "int64",
7877 // "location": "query",
7878 // "type": "string"
7879 // },
7880 // "kmsKeyName": {
7881 // "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.",
7882 // "location": "query",
7883 // "type": "string"
7884 // },
7885 // "userProject": {
7886 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7887 // "location": "query",
7888 // "type": "string"
7889 // }
7890 // },
7891 // "path": "b/{destinationBucket}/o/{destinationObject}/compose",
7892 // "request": {
7893 // "$ref": "ComposeRequest"
7894 // },
7895 // "response": {
7896 // "$ref": "Object"
7897 // },
7898 // "scopes": [
7899 // "https://www.googleapis.com/auth/cloud-platform",
7900 // "https://www.googleapis.com/auth/devstorage.full_control",
7901 // "https://www.googleapis.com/auth/devstorage.read_write"
7902 // ]
7903 // }
7904
7905 }
7906
7907 // method id "storage.objects.copy":
7908
7909 type ObjectsCopyCall struct {
7910 s *Service
7911 sourceBucket string
7912 sourceObject string
7913 destinationBucket string
7914 destinationObject string
7915 object *Object
7916 urlParams_ gensupport.URLParams
7917 ctx_ context.Context
7918 header_ http.Header
7919 }
7920
7921 // Copy: Copies a source object to a destination object. Optionally
7922 // overrides metadata.
7923 func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
7924 c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7925 c.sourceBucket = sourceBucket
7926 c.sourceObject = sourceObject
7927 c.destinationBucket = destinationBucket
7928 c.destinationObject = destinationObject
7929 c.object = object
7930 return c
7931 }
7932
7933 // DestinationPredefinedAcl sets the optional parameter
7934 // "destinationPredefinedAcl": Apply a predefined set of access controls
7935 // to the destination object.
7936 //
7937 // Possible values:
7938 // "authenticatedRead" - Object owner gets OWNER access, and
7939 // allAuthenticatedUsers get READER access.
7940 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
7941 // project team owners get OWNER access.
7942 // "bucketOwnerRead" - Object owner gets OWNER access, and project
7943 // team owners get READER access.
7944 // "private" - Object owner gets OWNER access.
7945 // "projectPrivate" - Object owner gets OWNER access, and project team
7946 // members get access according to their roles.
7947 // "publicRead" - Object owner gets OWNER access, and allUsers get
7948 // READER access.
7949 func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
7950 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
7951 return c
7952 }
7953
7954 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
7955 // Makes the operation conditional on whether the destination object's
7956 // current generation matches the given value. Setting to 0 makes the
7957 // operation succeed only if there are no live versions of the object.
7958 func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
7959 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
7960 return c
7961 }
7962
7963 // IfGenerationNotMatch sets the optional parameter
7964 // "ifGenerationNotMatch": Makes the operation conditional on whether
7965 // the destination object's current generation does not match the given
7966 // value. If no live object exists, the precondition fails. Setting to 0
7967 // makes the operation succeed only if there is a live version of the
7968 // object.
7969 func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
7970 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
7971 return c
7972 }
7973
7974 // IfMetagenerationMatch sets the optional parameter
7975 // "ifMetagenerationMatch": Makes the operation conditional on whether
7976 // the destination object's current metageneration matches the given
7977 // value.
7978 func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
7979 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
7980 return c
7981 }
7982
7983 // IfMetagenerationNotMatch sets the optional parameter
7984 // "ifMetagenerationNotMatch": Makes the operation conditional on
7985 // whether the destination object's current metageneration does not
7986 // match the given value.
7987 func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall {
7988 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
7989 return c
7990 }
7991
7992 // IfSourceGenerationMatch sets the optional parameter
7993 // "ifSourceGenerationMatch": Makes the operation conditional on whether
7994 // the source object's current generation matches the given value.
7995 func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
7996 c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
7997 return c
7998 }
7999
8000 // IfSourceGenerationNotMatch sets the optional parameter
8001 // "ifSourceGenerationNotMatch": Makes the operation conditional on
8002 // whether the source object's current generation does not match the
8003 // given value.
8004 func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
8005 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
8006 return c
8007 }
8008
8009 // IfSourceMetagenerationMatch sets the optional parameter
8010 // "ifSourceMetagenerationMatch": Makes the operation conditional on
8011 // whether the source object's current metageneration matches the given
8012 // value.
8013 func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
8014 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
8015 return c
8016 }
8017
8018 // IfSourceMetagenerationNotMatch sets the optional parameter
8019 // "ifSourceMetagenerationNotMatch": Makes the operation conditional on
8020 // whether the source object's current metageneration does not match the
8021 // given value.
8022 func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
8023 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
8024 return c
8025 }
8026
8027 // Projection sets the optional parameter "projection": Set of
8028 // properties to return. Defaults to noAcl, unless the object resource
8029 // specifies the acl property, when it defaults to full.
8030 //
8031 // Possible values:
8032 // "full" - Include all properties.
8033 // "noAcl" - Omit the owner, acl property.
8034 func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
8035 c.urlParams_.Set("projection", projection)
8036 return c
8037 }
8038
8039 // SourceGeneration sets the optional parameter "sourceGeneration": If
8040 // present, selects a specific revision of the source object (as opposed
8041 // to the latest version, the default).
8042 func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall {
8043 c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
8044 return c
8045 }
8046
8047 // UserProject sets the optional parameter "userProject": The project to
8048 // be billed for this request. Required for Requester Pays buckets.
8049 func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
8050 c.urlParams_.Set("userProject", userProject)
8051 return c
8052 }
8053
8054 // Fields allows partial responses to be retrieved. See
8055 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8056 // for more information.
8057 func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
8058 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8059 return c
8060 }
8061
8062 // Context sets the context to be used in this call's Do method. Any
8063 // pending HTTP request will be aborted if the provided context is
8064 // canceled.
8065 func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
8066 c.ctx_ = ctx
8067 return c
8068 }
8069
8070 // Header returns an http.Header that can be modified by the caller to
8071 // add HTTP headers to the request.
8072 func (c *ObjectsCopyCall) Header() http.Header {
8073 if c.header_ == nil {
8074 c.header_ = make(http.Header)
8075 }
8076 return c.header_
8077 }
8078
8079 func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
8080 reqHeaders := make(http.Header)
8081 for k, v := range c.header_ {
8082 reqHeaders[k] = v
8083 }
8084 reqHeaders.Set("User-Agent", c.s.userAgent())
8085 var body io.Reader = nil
8086 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
8087 if err != nil {
8088 return nil, err
8089 }
8090 reqHeaders.Set("Content-Type", "application/json")
8091 c.urlParams_.Set("alt", alt)
8092 c.urlParams_.Set("prettyPrint", "false")
8093 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
8094 urls += "?" + c.urlParams_.Encode()
8095 req, err := http.NewRequest("POST", urls, body)
8096 if err != nil {
8097 return nil, err
8098 }
8099 req.Header = reqHeaders
8100 googleapi.Expand(req.URL, map[string]string{
8101 "sourceBucket": c.sourceBucket,
8102 "sourceObject": c.sourceObject,
8103 "destinationBucket": c.destinationBucket,
8104 "destinationObject": c.destinationObject,
8105 })
8106 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8107 }
8108
8109 // Do executes the "storage.objects.copy" call.
8110 // Exactly one of *Object or error will be non-nil. Any non-2xx status
8111 // code is an error. Response headers are in either
8112 // *Object.ServerResponse.Header or (if a response was returned at all)
8113 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8114 // check whether the returned error was because http.StatusNotModified
8115 // was returned.
8116 func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8117 gensupport.SetOptions(c.urlParams_, opts...)
8118 res, err := c.doRequest("json")
8119 if res != nil && res.StatusCode == http.StatusNotModified {
8120 if res.Body != nil {
8121 res.Body.Close()
8122 }
8123 return nil, &googleapi.Error{
8124 Code: res.StatusCode,
8125 Header: res.Header,
8126 }
8127 }
8128 if err != nil {
8129 return nil, err
8130 }
8131 defer googleapi.CloseBody(res)
8132 if err := googleapi.CheckResponse(res); err != nil {
8133 return nil, err
8134 }
8135 ret := &Object{
8136 ServerResponse: googleapi.ServerResponse{
8137 Header: res.Header,
8138 HTTPStatusCode: res.StatusCode,
8139 },
8140 }
8141 target := &ret
8142 if err := gensupport.DecodeResponse(target, res); err != nil {
8143 return nil, err
8144 }
8145 return ret, nil
8146 // {
8147 // "description": "Copies a source object to a destination object. Optionally overrides metadata.",
8148 // "httpMethod": "POST",
8149 // "id": "storage.objects.copy",
8150 // "parameterOrder": [
8151 // "sourceBucket",
8152 // "sourceObject",
8153 // "destinationBucket",
8154 // "destinationObject"
8155 // ],
8156 // "parameters": {
8157 // "destinationBucket": {
8158 // "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.",
8159 // "location": "path",
8160 // "required": true,
8161 // "type": "string"
8162 // },
8163 // "destinationObject": {
8164 // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
8165 // "location": "path",
8166 // "required": true,
8167 // "type": "string"
8168 // },
8169 // "destinationPredefinedAcl": {
8170 // "description": "Apply a predefined set of access controls to the destination object.",
8171 // "enum": [
8172 // "authenticatedRead",
8173 // "bucketOwnerFullControl",
8174 // "bucketOwnerRead",
8175 // "private",
8176 // "projectPrivate",
8177 // "publicRead"
8178 // ],
8179 // "enumDescriptions": [
8180 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
8181 // "Object owner gets OWNER access, and project team owners get OWNER access.",
8182 // "Object owner gets OWNER access, and project team owners get READER access.",
8183 // "Object owner gets OWNER access.",
8184 // "Object owner gets OWNER access, and project team members get access according to their roles.",
8185 // "Object owner gets OWNER access, and allUsers get READER access."
8186 // ],
8187 // "location": "query",
8188 // "type": "string"
8189 // },
8190 // "ifGenerationMatch": {
8191 // "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.",
8192 // "format": "int64",
8193 // "location": "query",
8194 // "type": "string"
8195 // },
8196 // "ifGenerationNotMatch": {
8197 // "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.",
8198 // "format": "int64",
8199 // "location": "query",
8200 // "type": "string"
8201 // },
8202 // "ifMetagenerationMatch": {
8203 // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
8204 // "format": "int64",
8205 // "location": "query",
8206 // "type": "string"
8207 // },
8208 // "ifMetagenerationNotMatch": {
8209 // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
8210 // "format": "int64",
8211 // "location": "query",
8212 // "type": "string"
8213 // },
8214 // "ifSourceGenerationMatch": {
8215 // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
8216 // "format": "int64",
8217 // "location": "query",
8218 // "type": "string"
8219 // },
8220 // "ifSourceGenerationNotMatch": {
8221 // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
8222 // "format": "int64",
8223 // "location": "query",
8224 // "type": "string"
8225 // },
8226 // "ifSourceMetagenerationMatch": {
8227 // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
8228 // "format": "int64",
8229 // "location": "query",
8230 // "type": "string"
8231 // },
8232 // "ifSourceMetagenerationNotMatch": {
8233 // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
8234 // "format": "int64",
8235 // "location": "query",
8236 // "type": "string"
8237 // },
8238 // "projection": {
8239 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
8240 // "enum": [
8241 // "full",
8242 // "noAcl"
8243 // ],
8244 // "enumDescriptions": [
8245 // "Include all properties.",
8246 // "Omit the owner, acl property."
8247 // ],
8248 // "location": "query",
8249 // "type": "string"
8250 // },
8251 // "sourceBucket": {
8252 // "description": "Name of the bucket in which to find the source object.",
8253 // "location": "path",
8254 // "required": true,
8255 // "type": "string"
8256 // },
8257 // "sourceGeneration": {
8258 // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
8259 // "format": "int64",
8260 // "location": "query",
8261 // "type": "string"
8262 // },
8263 // "sourceObject": {
8264 // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8265 // "location": "path",
8266 // "required": true,
8267 // "type": "string"
8268 // },
8269 // "userProject": {
8270 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8271 // "location": "query",
8272 // "type": "string"
8273 // }
8274 // },
8275 // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
8276 // "request": {
8277 // "$ref": "Object"
8278 // },
8279 // "response": {
8280 // "$ref": "Object"
8281 // },
8282 // "scopes": [
8283 // "https://www.googleapis.com/auth/cloud-platform",
8284 // "https://www.googleapis.com/auth/devstorage.full_control",
8285 // "https://www.googleapis.com/auth/devstorage.read_write"
8286 // ]
8287 // }
8288
8289 }
8290
8291 // method id "storage.objects.delete":
8292
8293 type ObjectsDeleteCall struct {
8294 s *Service
8295 bucket string
8296 object string
8297 urlParams_ gensupport.URLParams
8298 ctx_ context.Context
8299 header_ http.Header
8300 }
8301
8302 // Delete: Deletes an object and its metadata. Deletions are permanent
8303 // if versioning is not enabled for the bucket, or if the generation
8304 // parameter is used.
8305 func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
8306 c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8307 c.bucket = bucket
8308 c.object = object
8309 return c
8310 }
8311
8312 // Generation sets the optional parameter "generation": If present,
8313 // permanently deletes a specific revision of this object (as opposed to
8314 // the latest version, the default).
8315 func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
8316 c.urlParams_.Set("generation", fmt.Sprint(generation))
8317 return c
8318 }
8319
8320 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8321 // Makes the operation conditional on whether the object's current
8322 // generation matches the given value. Setting to 0 makes the operation
8323 // succeed only if there are no live versions of the object.
8324 func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
8325 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8326 return c
8327 }
8328
8329 // IfGenerationNotMatch sets the optional parameter
8330 // "ifGenerationNotMatch": Makes the operation conditional on whether
8331 // the object's current generation does not match the given value. If no
8332 // live object exists, the precondition fails. Setting to 0 makes the
8333 // operation succeed only if there is a live version of the object.
8334 func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
8335 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
8336 return c
8337 }
8338
8339 // IfMetagenerationMatch sets the optional parameter
8340 // "ifMetagenerationMatch": Makes the operation conditional on whether
8341 // the object's current metageneration matches the given value.
8342 func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall {
8343 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8344 return c
8345 }
8346
8347 // IfMetagenerationNotMatch sets the optional parameter
8348 // "ifMetagenerationNotMatch": Makes the operation conditional on
8349 // whether the object's current metageneration does not match the given
8350 // value.
8351 func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
8352 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8353 return c
8354 }
8355
8356 // UserProject sets the optional parameter "userProject": The project to
8357 // be billed for this request. Required for Requester Pays buckets.
8358 func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
8359 c.urlParams_.Set("userProject", userProject)
8360 return c
8361 }
8362
8363 // Fields allows partial responses to be retrieved. See
8364 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8365 // for more information.
8366 func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
8367 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8368 return c
8369 }
8370
8371 // Context sets the context to be used in this call's Do method. Any
8372 // pending HTTP request will be aborted if the provided context is
8373 // canceled.
8374 func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
8375 c.ctx_ = ctx
8376 return c
8377 }
8378
8379 // Header returns an http.Header that can be modified by the caller to
8380 // add HTTP headers to the request.
8381 func (c *ObjectsDeleteCall) Header() http.Header {
8382 if c.header_ == nil {
8383 c.header_ = make(http.Header)
8384 }
8385 return c.header_
8386 }
8387
8388 func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
8389 reqHeaders := make(http.Header)
8390 for k, v := range c.header_ {
8391 reqHeaders[k] = v
8392 }
8393 reqHeaders.Set("User-Agent", c.s.userAgent())
8394 var body io.Reader = nil
8395 c.urlParams_.Set("alt", alt)
8396 c.urlParams_.Set("prettyPrint", "false")
8397 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
8398 urls += "?" + c.urlParams_.Encode()
8399 req, err := http.NewRequest("DELETE", urls, body)
8400 if err != nil {
8401 return nil, err
8402 }
8403 req.Header = reqHeaders
8404 googleapi.Expand(req.URL, map[string]string{
8405 "bucket": c.bucket,
8406 "object": c.object,
8407 })
8408 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8409 }
8410
8411 // Do executes the "storage.objects.delete" call.
8412 func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
8413 gensupport.SetOptions(c.urlParams_, opts...)
8414 res, err := c.doRequest("json")
8415 if err != nil {
8416 return err
8417 }
8418 defer googleapi.CloseBody(res)
8419 if err := googleapi.CheckResponse(res); err != nil {
8420 return err
8421 }
8422 return nil
8423 // {
8424 // "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.",
8425 // "httpMethod": "DELETE",
8426 // "id": "storage.objects.delete",
8427 // "parameterOrder": [
8428 // "bucket",
8429 // "object"
8430 // ],
8431 // "parameters": {
8432 // "bucket": {
8433 // "description": "Name of the bucket in which the object resides.",
8434 // "location": "path",
8435 // "required": true,
8436 // "type": "string"
8437 // },
8438 // "generation": {
8439 // "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
8440 // "format": "int64",
8441 // "location": "query",
8442 // "type": "string"
8443 // },
8444 // "ifGenerationMatch": {
8445 // "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.",
8446 // "format": "int64",
8447 // "location": "query",
8448 // "type": "string"
8449 // },
8450 // "ifGenerationNotMatch": {
8451 // "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.",
8452 // "format": "int64",
8453 // "location": "query",
8454 // "type": "string"
8455 // },
8456 // "ifMetagenerationMatch": {
8457 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
8458 // "format": "int64",
8459 // "location": "query",
8460 // "type": "string"
8461 // },
8462 // "ifMetagenerationNotMatch": {
8463 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
8464 // "format": "int64",
8465 // "location": "query",
8466 // "type": "string"
8467 // },
8468 // "object": {
8469 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8470 // "location": "path",
8471 // "required": true,
8472 // "type": "string"
8473 // },
8474 // "userProject": {
8475 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8476 // "location": "query",
8477 // "type": "string"
8478 // }
8479 // },
8480 // "path": "b/{bucket}/o/{object}",
8481 // "scopes": [
8482 // "https://www.googleapis.com/auth/cloud-platform",
8483 // "https://www.googleapis.com/auth/devstorage.full_control",
8484 // "https://www.googleapis.com/auth/devstorage.read_write"
8485 // ]
8486 // }
8487
8488 }
8489
8490 // method id "storage.objects.get":
8491
8492 type ObjectsGetCall struct {
8493 s *Service
8494 bucket string
8495 object string
8496 urlParams_ gensupport.URLParams
8497 ifNoneMatch_ string
8498 ctx_ context.Context
8499 header_ http.Header
8500 }
8501
8502 // Get: Retrieves an object or its metadata.
8503 func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
8504 c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8505 c.bucket = bucket
8506 c.object = object
8507 return c
8508 }
8509
8510 // Generation sets the optional parameter "generation": If present,
8511 // selects a specific revision of this object (as opposed to the latest
8512 // version, the default).
8513 func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
8514 c.urlParams_.Set("generation", fmt.Sprint(generation))
8515 return c
8516 }
8517
8518 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8519 // Makes the operation conditional on whether the object's current
8520 // generation matches the given value. Setting to 0 makes the operation
8521 // succeed only if there are no live versions of the object.
8522 func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
8523 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8524 return c
8525 }
8526
8527 // IfGenerationNotMatch sets the optional parameter
8528 // "ifGenerationNotMatch": Makes the operation conditional on whether
8529 // the object's current generation does not match the given value. If no
8530 // live object exists, the precondition fails. Setting to 0 makes the
8531 // operation succeed only if there is a live version of the object.
8532 func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
8533 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
8534 return c
8535 }
8536
8537 // IfMetagenerationMatch sets the optional parameter
8538 // "ifMetagenerationMatch": Makes the operation conditional on whether
8539 // the object's current metageneration matches the given value.
8540 func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall {
8541 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
8542 return c
8543 }
8544
8545 // IfMetagenerationNotMatch sets the optional parameter
8546 // "ifMetagenerationNotMatch": Makes the operation conditional on
8547 // whether the object's current metageneration does not match the given
8548 // value.
8549 func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
8550 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8551 return c
8552 }
8553
8554 // Projection sets the optional parameter "projection": Set of
8555 // properties to return. Defaults to noAcl.
8556 //
8557 // Possible values:
8558 // "full" - Include all properties.
8559 // "noAcl" - Omit the owner, acl property.
8560 func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
8561 c.urlParams_.Set("projection", projection)
8562 return c
8563 }
8564
8565 // UserProject sets the optional parameter "userProject": The project to
8566 // be billed for this request. Required for Requester Pays buckets.
8567 func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
8568 c.urlParams_.Set("userProject", userProject)
8569 return c
8570 }
8571
8572 // Fields allows partial responses to be retrieved. See
8573 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8574 // for more information.
8575 func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
8576 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8577 return c
8578 }
8579
8580 // IfNoneMatch sets the optional parameter which makes the operation
8581 // fail if the object's ETag matches the given value. This is useful for
8582 // getting updates only after the object has changed since the last
8583 // request. Use googleapi.IsNotModified to check whether the response
8584 // error from Do is the result of In-None-Match.
8585 func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
8586 c.ifNoneMatch_ = entityTag
8587 return c
8588 }
8589
8590 // Context sets the context to be used in this call's Do and Download
8591 // methods. Any pending HTTP request will be aborted if the provided
8592 // context is canceled.
8593 func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
8594 c.ctx_ = ctx
8595 return c
8596 }
8597
8598 // Header returns an http.Header that can be modified by the caller to
8599 // add HTTP headers to the request.
8600 func (c *ObjectsGetCall) Header() http.Header {
8601 if c.header_ == nil {
8602 c.header_ = make(http.Header)
8603 }
8604 return c.header_
8605 }
8606
8607 func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
8608 reqHeaders := make(http.Header)
8609 for k, v := range c.header_ {
8610 reqHeaders[k] = v
8611 }
8612 reqHeaders.Set("User-Agent", c.s.userAgent())
8613 if c.ifNoneMatch_ != "" {
8614 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8615 }
8616 var body io.Reader = nil
8617 c.urlParams_.Set("alt", alt)
8618 c.urlParams_.Set("prettyPrint", "false")
8619 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
8620 urls += "?" + c.urlParams_.Encode()
8621 req, err := http.NewRequest("GET", urls, body)
8622 if err != nil {
8623 return nil, err
8624 }
8625 req.Header = reqHeaders
8626 googleapi.Expand(req.URL, map[string]string{
8627 "bucket": c.bucket,
8628 "object": c.object,
8629 })
8630 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8631 }
8632
8633 // Download fetches the API endpoint's "media" value, instead of the normal
8634 // API response value. If the returned error is nil, the Response is guaranteed to
8635 // have a 2xx status code. Callers must close the Response.Body as usual.
8636 func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
8637 gensupport.SetOptions(c.urlParams_, opts...)
8638 res, err := c.doRequest("media")
8639 if err != nil {
8640 return nil, err
8641 }
8642 if err := googleapi.CheckMediaResponse(res); err != nil {
8643 res.Body.Close()
8644 return nil, err
8645 }
8646 return res, nil
8647 }
8648
8649 // Do executes the "storage.objects.get" call.
8650 // Exactly one of *Object or error will be non-nil. Any non-2xx status
8651 // code is an error. Response headers are in either
8652 // *Object.ServerResponse.Header or (if a response was returned at all)
8653 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8654 // check whether the returned error was because http.StatusNotModified
8655 // was returned.
8656 func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
8657 gensupport.SetOptions(c.urlParams_, opts...)
8658 res, err := c.doRequest("json")
8659 if res != nil && res.StatusCode == http.StatusNotModified {
8660 if res.Body != nil {
8661 res.Body.Close()
8662 }
8663 return nil, &googleapi.Error{
8664 Code: res.StatusCode,
8665 Header: res.Header,
8666 }
8667 }
8668 if err != nil {
8669 return nil, err
8670 }
8671 defer googleapi.CloseBody(res)
8672 if err := googleapi.CheckResponse(res); err != nil {
8673 return nil, err
8674 }
8675 ret := &Object{
8676 ServerResponse: googleapi.ServerResponse{
8677 Header: res.Header,
8678 HTTPStatusCode: res.StatusCode,
8679 },
8680 }
8681 target := &ret
8682 if err := gensupport.DecodeResponse(target, res); err != nil {
8683 return nil, err
8684 }
8685 return ret, nil
8686 // {
8687 // "description": "Retrieves an object or its metadata.",
8688 // "httpMethod": "GET",
8689 // "id": "storage.objects.get",
8690 // "parameterOrder": [
8691 // "bucket",
8692 // "object"
8693 // ],
8694 // "parameters": {
8695 // "bucket": {
8696 // "description": "Name of the bucket in which the object resides.",
8697 // "location": "path",
8698 // "required": true,
8699 // "type": "string"
8700 // },
8701 // "generation": {
8702 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8703 // "format": "int64",
8704 // "location": "query",
8705 // "type": "string"
8706 // },
8707 // "ifGenerationMatch": {
8708 // "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.",
8709 // "format": "int64",
8710 // "location": "query",
8711 // "type": "string"
8712 // },
8713 // "ifGenerationNotMatch": {
8714 // "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.",
8715 // "format": "int64",
8716 // "location": "query",
8717 // "type": "string"
8718 // },
8719 // "ifMetagenerationMatch": {
8720 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
8721 // "format": "int64",
8722 // "location": "query",
8723 // "type": "string"
8724 // },
8725 // "ifMetagenerationNotMatch": {
8726 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
8727 // "format": "int64",
8728 // "location": "query",
8729 // "type": "string"
8730 // },
8731 // "object": {
8732 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8733 // "location": "path",
8734 // "required": true,
8735 // "type": "string"
8736 // },
8737 // "projection": {
8738 // "description": "Set of properties to return. Defaults to noAcl.",
8739 // "enum": [
8740 // "full",
8741 // "noAcl"
8742 // ],
8743 // "enumDescriptions": [
8744 // "Include all properties.",
8745 // "Omit the owner, acl property."
8746 // ],
8747 // "location": "query",
8748 // "type": "string"
8749 // },
8750 // "userProject": {
8751 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8752 // "location": "query",
8753 // "type": "string"
8754 // }
8755 // },
8756 // "path": "b/{bucket}/o/{object}",
8757 // "response": {
8758 // "$ref": "Object"
8759 // },
8760 // "scopes": [
8761 // "https://www.googleapis.com/auth/cloud-platform",
8762 // "https://www.googleapis.com/auth/cloud-platform.read-only",
8763 // "https://www.googleapis.com/auth/devstorage.full_control",
8764 // "https://www.googleapis.com/auth/devstorage.read_only",
8765 // "https://www.googleapis.com/auth/devstorage.read_write"
8766 // ],
8767 // "supportsMediaDownload": true,
8768 // "useMediaDownloadService": true
8769 // }
8770
8771 }
8772
8773 // method id "storage.objects.getIamPolicy":
8774
8775 type ObjectsGetIamPolicyCall struct {
8776 s *Service
8777 bucket string
8778 object string
8779 urlParams_ gensupport.URLParams
8780 ifNoneMatch_ string
8781 ctx_ context.Context
8782 header_ http.Header
8783 }
8784
8785 // GetIamPolicy: Returns an IAM policy for the specified object.
8786 func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall {
8787 c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8788 c.bucket = bucket
8789 c.object = object
8790 return c
8791 }
8792
8793 // Generation sets the optional parameter "generation": If present,
8794 // selects a specific revision of this object (as opposed to the latest
8795 // version, the default).
8796 func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall {
8797 c.urlParams_.Set("generation", fmt.Sprint(generation))
8798 return c
8799 }
8800
8801 // UserProject sets the optional parameter "userProject": The project to
8802 // be billed for this request. Required for Requester Pays buckets.
8803 func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
8804 c.urlParams_.Set("userProject", userProject)
8805 return c
8806 }
8807
8808 // Fields allows partial responses to be retrieved. See
8809 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8810 // for more information.
8811 func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall {
8812 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8813 return c
8814 }
8815
8816 // IfNoneMatch sets the optional parameter which makes the operation
8817 // fail if the object's ETag matches the given value. This is useful for
8818 // getting updates only after the object has changed since the last
8819 // request. Use googleapi.IsNotModified to check whether the response
8820 // error from Do is the result of In-None-Match.
8821 func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall {
8822 c.ifNoneMatch_ = entityTag
8823 return c
8824 }
8825
8826 // Context sets the context to be used in this call's Do method. Any
8827 // pending HTTP request will be aborted if the provided context is
8828 // canceled.
8829 func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
8830 c.ctx_ = ctx
8831 return c
8832 }
8833
8834 // Header returns an http.Header that can be modified by the caller to
8835 // add HTTP headers to the request.
8836 func (c *ObjectsGetIamPolicyCall) Header() http.Header {
8837 if c.header_ == nil {
8838 c.header_ = make(http.Header)
8839 }
8840 return c.header_
8841 }
8842
8843 func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
8844 reqHeaders := make(http.Header)
8845 for k, v := range c.header_ {
8846 reqHeaders[k] = v
8847 }
8848 reqHeaders.Set("User-Agent", c.s.userAgent())
8849 if c.ifNoneMatch_ != "" {
8850 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8851 }
8852 var body io.Reader = nil
8853 c.urlParams_.Set("alt", alt)
8854 c.urlParams_.Set("prettyPrint", "false")
8855 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
8856 urls += "?" + c.urlParams_.Encode()
8857 req, err := http.NewRequest("GET", urls, body)
8858 if err != nil {
8859 return nil, err
8860 }
8861 req.Header = reqHeaders
8862 googleapi.Expand(req.URL, map[string]string{
8863 "bucket": c.bucket,
8864 "object": c.object,
8865 })
8866 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8867 }
8868
8869 // Do executes the "storage.objects.getIamPolicy" call.
8870 // Exactly one of *Policy or error will be non-nil. Any non-2xx status
8871 // code is an error. Response headers are in either
8872 // *Policy.ServerResponse.Header or (if a response was returned at all)
8873 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8874 // check whether the returned error was because http.StatusNotModified
8875 // was returned.
8876 func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
8877 gensupport.SetOptions(c.urlParams_, opts...)
8878 res, err := c.doRequest("json")
8879 if res != nil && res.StatusCode == http.StatusNotModified {
8880 if res.Body != nil {
8881 res.Body.Close()
8882 }
8883 return nil, &googleapi.Error{
8884 Code: res.StatusCode,
8885 Header: res.Header,
8886 }
8887 }
8888 if err != nil {
8889 return nil, err
8890 }
8891 defer googleapi.CloseBody(res)
8892 if err := googleapi.CheckResponse(res); err != nil {
8893 return nil, err
8894 }
8895 ret := &Policy{
8896 ServerResponse: googleapi.ServerResponse{
8897 Header: res.Header,
8898 HTTPStatusCode: res.StatusCode,
8899 },
8900 }
8901 target := &ret
8902 if err := gensupport.DecodeResponse(target, res); err != nil {
8903 return nil, err
8904 }
8905 return ret, nil
8906 // {
8907 // "description": "Returns an IAM policy for the specified object.",
8908 // "httpMethod": "GET",
8909 // "id": "storage.objects.getIamPolicy",
8910 // "parameterOrder": [
8911 // "bucket",
8912 // "object"
8913 // ],
8914 // "parameters": {
8915 // "bucket": {
8916 // "description": "Name of the bucket in which the object resides.",
8917 // "location": "path",
8918 // "required": true,
8919 // "type": "string"
8920 // },
8921 // "generation": {
8922 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
8923 // "format": "int64",
8924 // "location": "query",
8925 // "type": "string"
8926 // },
8927 // "object": {
8928 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
8929 // "location": "path",
8930 // "required": true,
8931 // "type": "string"
8932 // },
8933 // "userProject": {
8934 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8935 // "location": "query",
8936 // "type": "string"
8937 // }
8938 // },
8939 // "path": "b/{bucket}/o/{object}/iam",
8940 // "response": {
8941 // "$ref": "Policy"
8942 // },
8943 // "scopes": [
8944 // "https://www.googleapis.com/auth/cloud-platform",
8945 // "https://www.googleapis.com/auth/cloud-platform.read-only",
8946 // "https://www.googleapis.com/auth/devstorage.full_control",
8947 // "https://www.googleapis.com/auth/devstorage.read_only",
8948 // "https://www.googleapis.com/auth/devstorage.read_write"
8949 // ]
8950 // }
8951
8952 }
8953
8954 // method id "storage.objects.insert":
8955
8956 type ObjectsInsertCall struct {
8957 s *Service
8958 bucket string
8959 object *Object
8960 urlParams_ gensupport.URLParams
8961 mediaInfo_ *gensupport.MediaInfo
8962 ctx_ context.Context
8963 header_ http.Header
8964 }
8965
8966 // Insert: Stores a new object and metadata.
8967 func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
8968 c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8969 c.bucket = bucket
8970 c.object = object
8971 return c
8972 }
8973
8974 // ContentEncoding sets the optional parameter "contentEncoding": If
8975 // set, sets the contentEncoding property of the final object to this
8976 // value. Setting this parameter is equivalent to setting the
8977 // contentEncoding metadata property. This can be useful when uploading
8978 // an object with uploadType=media to indicate the encoding of the
8979 // content being uploaded.
8980 func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall {
8981 c.urlParams_.Set("contentEncoding", contentEncoding)
8982 return c
8983 }
8984
8985 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
8986 // Makes the operation conditional on whether the object's current
8987 // generation matches the given value. Setting to 0 makes the operation
8988 // succeed only if there are no live versions of the object.
8989 func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
8990 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
8991 return c
8992 }
8993
8994 // IfGenerationNotMatch sets the optional parameter
8995 // "ifGenerationNotMatch": Makes the operation conditional on whether
8996 // the object's current generation does not match the given value. If no
8997 // live object exists, the precondition fails. Setting to 0 makes the
8998 // operation succeed only if there is a live version of the object.
8999 func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
9000 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9001 return c
9002 }
9003
9004 // IfMetagenerationMatch sets the optional parameter
9005 // "ifMetagenerationMatch": Makes the operation conditional on whether
9006 // the object's current metageneration matches the given value.
9007 func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall {
9008 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9009 return c
9010 }
9011
9012 // IfMetagenerationNotMatch sets the optional parameter
9013 // "ifMetagenerationNotMatch": Makes the operation conditional on
9014 // whether the object's current metageneration does not match the given
9015 // value.
9016 func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
9017 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9018 return c
9019 }
9020
9021 // KmsKeyName sets the optional parameter "kmsKeyName": Resource name of
9022 // the Cloud KMS key, of the form
9023 // projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
9024 // that will be used to encrypt the object. Overrides the object
9025 // metadata's kms_key_name value, if any.
9026 func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall {
9027 c.urlParams_.Set("kmsKeyName", kmsKeyName)
9028 return c
9029 }
9030
9031 // Name sets the optional parameter "name": Name of the object. Required
9032 // when the object metadata is not otherwise provided. Overrides the
9033 // object metadata's name value, if any. For information about how to
9034 // URL encode object names to be path safe, see Encoding URI Path Parts.
9035 func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
9036 c.urlParams_.Set("name", name)
9037 return c
9038 }
9039
9040 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9041 // predefined set of access controls to this object.
9042 //
9043 // Possible values:
9044 // "authenticatedRead" - Object owner gets OWNER access, and
9045 // allAuthenticatedUsers get READER access.
9046 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
9047 // project team owners get OWNER access.
9048 // "bucketOwnerRead" - Object owner gets OWNER access, and project
9049 // team owners get READER access.
9050 // "private" - Object owner gets OWNER access.
9051 // "projectPrivate" - Object owner gets OWNER access, and project team
9052 // members get access according to their roles.
9053 // "publicRead" - Object owner gets OWNER access, and allUsers get
9054 // READER access.
9055 func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
9056 c.urlParams_.Set("predefinedAcl", predefinedAcl)
9057 return c
9058 }
9059
9060 // Projection sets the optional parameter "projection": Set of
9061 // properties to return. Defaults to noAcl, unless the object resource
9062 // specifies the acl property, when it defaults to full.
9063 //
9064 // Possible values:
9065 // "full" - Include all properties.
9066 // "noAcl" - Omit the owner, acl property.
9067 func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
9068 c.urlParams_.Set("projection", projection)
9069 return c
9070 }
9071
9072 // UserProject sets the optional parameter "userProject": The project to
9073 // be billed for this request. Required for Requester Pays buckets.
9074 func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
9075 c.urlParams_.Set("userProject", userProject)
9076 return c
9077 }
9078
9079 // Media specifies the media to upload in one or more chunks. The chunk
9080 // size may be controlled by supplying a MediaOption generated by
9081 // googleapi.ChunkSize. The chunk size defaults to
9082 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
9083 // upload request will be determined by sniffing the contents of r,
9084 // unless a MediaOption generated by googleapi.ContentType is
9085 // supplied.
9086 // At most one of Media and ResumableMedia may be set.
9087 func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
9088 if ct := c.object.ContentType; ct != "" {
9089 options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
9090 }
9091 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9092 return c
9093 }
9094
9095 // ResumableMedia specifies the media to upload in chunks and can be
9096 // canceled with ctx.
9097 //
9098 // Deprecated: use Media instead.
9099 //
9100 // At most one of Media and ResumableMedia may be set. mediaType
9101 // identifies the MIME media type of the upload, such as "image/png". If
9102 // mediaType is "", it will be auto-detected. The provided ctx will
9103 // supersede any context previously provided to the Context method.
9104 func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
9105 c.ctx_ = ctx
9106 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
9107 return c
9108 }
9109
9110 // ProgressUpdater provides a callback function that will be called
9111 // after every chunk. It should be a low-latency function in order to
9112 // not slow down the upload operation. This should only be called when
9113 // using ResumableMedia (as opposed to Media).
9114 func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
9115 c.mediaInfo_.SetProgressUpdater(pu)
9116 return c
9117 }
9118
9119 // Fields allows partial responses to be retrieved. See
9120 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9121 // for more information.
9122 func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
9123 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9124 return c
9125 }
9126
9127 // Context sets the context to be used in this call's Do method. Any
9128 // pending HTTP request will be aborted if the provided context is
9129 // canceled.
9130 // This context will supersede any context previously provided to the
9131 // ResumableMedia method.
9132 func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
9133 c.ctx_ = ctx
9134 return c
9135 }
9136
9137 // Header returns an http.Header that can be modified by the caller to
9138 // add HTTP headers to the request.
9139 func (c *ObjectsInsertCall) Header() http.Header {
9140 if c.header_ == nil {
9141 c.header_ = make(http.Header)
9142 }
9143 return c.header_
9144 }
9145
9146 func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
9147 reqHeaders := make(http.Header)
9148 for k, v := range c.header_ {
9149 reqHeaders[k] = v
9150 }
9151 reqHeaders.Set("User-Agent", c.s.userAgent())
9152 var body io.Reader = nil
9153 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
9154 if err != nil {
9155 return nil, err
9156 }
9157 reqHeaders.Set("Content-Type", "application/json")
9158 c.urlParams_.Set("alt", alt)
9159 c.urlParams_.Set("prettyPrint", "false")
9160 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
9161 if c.mediaInfo_ != nil {
9162 urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
9163 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
9164 }
9165 if body == nil {
9166 body = new(bytes.Buffer)
9167 reqHeaders.Set("Content-Type", "application/json")
9168 }
9169 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
9170 defer cleanup()
9171 urls += "?" + c.urlParams_.Encode()
9172 req, err := http.NewRequest("POST", urls, body)
9173 if err != nil {
9174 return nil, err
9175 }
9176 req.Header = reqHeaders
9177 gensupport.SetGetBody(req, getBody)
9178 googleapi.Expand(req.URL, map[string]string{
9179 "bucket": c.bucket,
9180 })
9181 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9182 }
9183
9184 // Do executes the "storage.objects.insert" call.
9185 // Exactly one of *Object or error will be non-nil. Any non-2xx status
9186 // code is an error. Response headers are in either
9187 // *Object.ServerResponse.Header or (if a response was returned at all)
9188 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9189 // check whether the returned error was because http.StatusNotModified
9190 // was returned.
9191 func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
9192 gensupport.SetOptions(c.urlParams_, opts...)
9193 res, err := c.doRequest("json")
9194 if res != nil && res.StatusCode == http.StatusNotModified {
9195 if res.Body != nil {
9196 res.Body.Close()
9197 }
9198 return nil, &googleapi.Error{
9199 Code: res.StatusCode,
9200 Header: res.Header,
9201 }
9202 }
9203 if err != nil {
9204 return nil, err
9205 }
9206 defer googleapi.CloseBody(res)
9207 if err := googleapi.CheckResponse(res); err != nil {
9208 return nil, err
9209 }
9210 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
9211 if rx != nil {
9212 rx.Client = c.s.client
9213 rx.UserAgent = c.s.userAgent()
9214 ctx := c.ctx_
9215 if ctx == nil {
9216 ctx = context.TODO()
9217 }
9218 res, err = rx.Upload(ctx)
9219 if err != nil {
9220 return nil, err
9221 }
9222 defer res.Body.Close()
9223 if err := googleapi.CheckResponse(res); err != nil {
9224 return nil, err
9225 }
9226 }
9227 ret := &Object{
9228 ServerResponse: googleapi.ServerResponse{
9229 Header: res.Header,
9230 HTTPStatusCode: res.StatusCode,
9231 },
9232 }
9233 target := &ret
9234 if err := gensupport.DecodeResponse(target, res); err != nil {
9235 return nil, err
9236 }
9237 return ret, nil
9238 // {
9239 // "description": "Stores a new object and metadata.",
9240 // "httpMethod": "POST",
9241 // "id": "storage.objects.insert",
9242 // "mediaUpload": {
9243 // "accept": [
9244 // "*/*"
9245 // ],
9246 // "protocols": {
9247 // "resumable": {
9248 // "multipart": true,
9249 // "path": "/resumable/upload/storage/v1/b/{bucket}/o"
9250 // },
9251 // "simple": {
9252 // "multipart": true,
9253 // "path": "/upload/storage/v1/b/{bucket}/o"
9254 // }
9255 // }
9256 // },
9257 // "parameterOrder": [
9258 // "bucket"
9259 // ],
9260 // "parameters": {
9261 // "bucket": {
9262 // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
9263 // "location": "path",
9264 // "required": true,
9265 // "type": "string"
9266 // },
9267 // "contentEncoding": {
9268 // "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.",
9269 // "location": "query",
9270 // "type": "string"
9271 // },
9272 // "ifGenerationMatch": {
9273 // "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.",
9274 // "format": "int64",
9275 // "location": "query",
9276 // "type": "string"
9277 // },
9278 // "ifGenerationNotMatch": {
9279 // "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.",
9280 // "format": "int64",
9281 // "location": "query",
9282 // "type": "string"
9283 // },
9284 // "ifMetagenerationMatch": {
9285 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9286 // "format": "int64",
9287 // "location": "query",
9288 // "type": "string"
9289 // },
9290 // "ifMetagenerationNotMatch": {
9291 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9292 // "format": "int64",
9293 // "location": "query",
9294 // "type": "string"
9295 // },
9296 // "kmsKeyName": {
9297 // "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.",
9298 // "location": "query",
9299 // "type": "string"
9300 // },
9301 // "name": {
9302 // "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.",
9303 // "location": "query",
9304 // "type": "string"
9305 // },
9306 // "predefinedAcl": {
9307 // "description": "Apply a predefined set of access controls to this object.",
9308 // "enum": [
9309 // "authenticatedRead",
9310 // "bucketOwnerFullControl",
9311 // "bucketOwnerRead",
9312 // "private",
9313 // "projectPrivate",
9314 // "publicRead"
9315 // ],
9316 // "enumDescriptions": [
9317 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
9318 // "Object owner gets OWNER access, and project team owners get OWNER access.",
9319 // "Object owner gets OWNER access, and project team owners get READER access.",
9320 // "Object owner gets OWNER access.",
9321 // "Object owner gets OWNER access, and project team members get access according to their roles.",
9322 // "Object owner gets OWNER access, and allUsers get READER access."
9323 // ],
9324 // "location": "query",
9325 // "type": "string"
9326 // },
9327 // "projection": {
9328 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
9329 // "enum": [
9330 // "full",
9331 // "noAcl"
9332 // ],
9333 // "enumDescriptions": [
9334 // "Include all properties.",
9335 // "Omit the owner, acl property."
9336 // ],
9337 // "location": "query",
9338 // "type": "string"
9339 // },
9340 // "userProject": {
9341 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9342 // "location": "query",
9343 // "type": "string"
9344 // }
9345 // },
9346 // "path": "b/{bucket}/o",
9347 // "request": {
9348 // "$ref": "Object"
9349 // },
9350 // "response": {
9351 // "$ref": "Object"
9352 // },
9353 // "scopes": [
9354 // "https://www.googleapis.com/auth/cloud-platform",
9355 // "https://www.googleapis.com/auth/devstorage.full_control",
9356 // "https://www.googleapis.com/auth/devstorage.read_write"
9357 // ],
9358 // "supportsMediaUpload": true
9359 // }
9360
9361 }
9362
9363 // method id "storage.objects.list":
9364
9365 type ObjectsListCall struct {
9366 s *Service
9367 bucket string
9368 urlParams_ gensupport.URLParams
9369 ifNoneMatch_ string
9370 ctx_ context.Context
9371 header_ http.Header
9372 }
9373
9374 // List: Retrieves a list of objects matching the criteria.
9375 func (r *ObjectsService) List(bucket string) *ObjectsListCall {
9376 c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9377 c.bucket = bucket
9378 return c
9379 }
9380
9381 // Delimiter sets the optional parameter "delimiter": Returns results in
9382 // a directory-like mode. items will contain only objects whose names,
9383 // aside from the prefix, do not contain delimiter. Objects whose names,
9384 // aside from the prefix, contain delimiter will have their name,
9385 // truncated after the delimiter, returned in prefixes. Duplicate
9386 // prefixes are omitted.
9387 func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
9388 c.urlParams_.Set("delimiter", delimiter)
9389 return c
9390 }
9391
9392 // IncludeTrailingDelimiter sets the optional parameter
9393 // "includeTrailingDelimiter": If true, objects that end in exactly one
9394 // instance of delimiter will have their metadata included in items in
9395 // addition to prefixes.
9396 func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall {
9397 c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
9398 return c
9399 }
9400
9401 // MaxResults sets the optional parameter "maxResults": Maximum number
9402 // of items plus prefixes to return in a single page of responses. As
9403 // duplicate prefixes are omitted, fewer total results may be returned
9404 // than requested. The service will use this parameter or 1,000 items,
9405 // whichever is smaller.
9406 func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
9407 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
9408 return c
9409 }
9410
9411 // PageToken sets the optional parameter "pageToken": A
9412 // previously-returned page token representing part of the larger set of
9413 // results to view.
9414 func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
9415 c.urlParams_.Set("pageToken", pageToken)
9416 return c
9417 }
9418
9419 // Prefix sets the optional parameter "prefix": Filter results to
9420 // objects whose names begin with this prefix.
9421 func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
9422 c.urlParams_.Set("prefix", prefix)
9423 return c
9424 }
9425
9426 // Projection sets the optional parameter "projection": Set of
9427 // properties to return. Defaults to noAcl.
9428 //
9429 // Possible values:
9430 // "full" - Include all properties.
9431 // "noAcl" - Omit the owner, acl property.
9432 func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
9433 c.urlParams_.Set("projection", projection)
9434 return c
9435 }
9436
9437 // UserProject sets the optional parameter "userProject": The project to
9438 // be billed for this request. Required for Requester Pays buckets.
9439 func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
9440 c.urlParams_.Set("userProject", userProject)
9441 return c
9442 }
9443
9444 // Versions sets the optional parameter "versions": If true, lists all
9445 // versions of an object as distinct results. The default is false. For
9446 // more information, see Object Versioning.
9447 func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
9448 c.urlParams_.Set("versions", fmt.Sprint(versions))
9449 return c
9450 }
9451
9452 // Fields allows partial responses to be retrieved. See
9453 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9454 // for more information.
9455 func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
9456 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9457 return c
9458 }
9459
9460 // IfNoneMatch sets the optional parameter which makes the operation
9461 // fail if the object's ETag matches the given value. This is useful for
9462 // getting updates only after the object has changed since the last
9463 // request. Use googleapi.IsNotModified to check whether the response
9464 // error from Do is the result of In-None-Match.
9465 func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
9466 c.ifNoneMatch_ = entityTag
9467 return c
9468 }
9469
9470 // Context sets the context to be used in this call's Do method. Any
9471 // pending HTTP request will be aborted if the provided context is
9472 // canceled.
9473 func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
9474 c.ctx_ = ctx
9475 return c
9476 }
9477
9478 // Header returns an http.Header that can be modified by the caller to
9479 // add HTTP headers to the request.
9480 func (c *ObjectsListCall) Header() http.Header {
9481 if c.header_ == nil {
9482 c.header_ = make(http.Header)
9483 }
9484 return c.header_
9485 }
9486
9487 func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
9488 reqHeaders := make(http.Header)
9489 for k, v := range c.header_ {
9490 reqHeaders[k] = v
9491 }
9492 reqHeaders.Set("User-Agent", c.s.userAgent())
9493 if c.ifNoneMatch_ != "" {
9494 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9495 }
9496 var body io.Reader = nil
9497 c.urlParams_.Set("alt", alt)
9498 c.urlParams_.Set("prettyPrint", "false")
9499 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
9500 urls += "?" + c.urlParams_.Encode()
9501 req, err := http.NewRequest("GET", urls, body)
9502 if err != nil {
9503 return nil, err
9504 }
9505 req.Header = reqHeaders
9506 googleapi.Expand(req.URL, map[string]string{
9507 "bucket": c.bucket,
9508 })
9509 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9510 }
9511
9512 // Do executes the "storage.objects.list" call.
9513 // Exactly one of *Objects or error will be non-nil. Any non-2xx status
9514 // code is an error. Response headers are in either
9515 // *Objects.ServerResponse.Header or (if a response was returned at all)
9516 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9517 // check whether the returned error was because http.StatusNotModified
9518 // was returned.
9519 func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
9520 gensupport.SetOptions(c.urlParams_, opts...)
9521 res, err := c.doRequest("json")
9522 if res != nil && res.StatusCode == http.StatusNotModified {
9523 if res.Body != nil {
9524 res.Body.Close()
9525 }
9526 return nil, &googleapi.Error{
9527 Code: res.StatusCode,
9528 Header: res.Header,
9529 }
9530 }
9531 if err != nil {
9532 return nil, err
9533 }
9534 defer googleapi.CloseBody(res)
9535 if err := googleapi.CheckResponse(res); err != nil {
9536 return nil, err
9537 }
9538 ret := &Objects{
9539 ServerResponse: googleapi.ServerResponse{
9540 Header: res.Header,
9541 HTTPStatusCode: res.StatusCode,
9542 },
9543 }
9544 target := &ret
9545 if err := gensupport.DecodeResponse(target, res); err != nil {
9546 return nil, err
9547 }
9548 return ret, nil
9549 // {
9550 // "description": "Retrieves a list of objects matching the criteria.",
9551 // "httpMethod": "GET",
9552 // "id": "storage.objects.list",
9553 // "parameterOrder": [
9554 // "bucket"
9555 // ],
9556 // "parameters": {
9557 // "bucket": {
9558 // "description": "Name of the bucket in which to look for objects.",
9559 // "location": "path",
9560 // "required": true,
9561 // "type": "string"
9562 // },
9563 // "delimiter": {
9564 // "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.",
9565 // "location": "query",
9566 // "type": "string"
9567 // },
9568 // "includeTrailingDelimiter": {
9569 // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
9570 // "location": "query",
9571 // "type": "boolean"
9572 // },
9573 // "maxResults": {
9574 // "default": "1000",
9575 // "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.",
9576 // "format": "uint32",
9577 // "location": "query",
9578 // "minimum": "0",
9579 // "type": "integer"
9580 // },
9581 // "pageToken": {
9582 // "description": "A previously-returned page token representing part of the larger set of results to view.",
9583 // "location": "query",
9584 // "type": "string"
9585 // },
9586 // "prefix": {
9587 // "description": "Filter results to objects whose names begin with this prefix.",
9588 // "location": "query",
9589 // "type": "string"
9590 // },
9591 // "projection": {
9592 // "description": "Set of properties to return. Defaults to noAcl.",
9593 // "enum": [
9594 // "full",
9595 // "noAcl"
9596 // ],
9597 // "enumDescriptions": [
9598 // "Include all properties.",
9599 // "Omit the owner, acl property."
9600 // ],
9601 // "location": "query",
9602 // "type": "string"
9603 // },
9604 // "userProject": {
9605 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9606 // "location": "query",
9607 // "type": "string"
9608 // },
9609 // "versions": {
9610 // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
9611 // "location": "query",
9612 // "type": "boolean"
9613 // }
9614 // },
9615 // "path": "b/{bucket}/o",
9616 // "response": {
9617 // "$ref": "Objects"
9618 // },
9619 // "scopes": [
9620 // "https://www.googleapis.com/auth/cloud-platform",
9621 // "https://www.googleapis.com/auth/cloud-platform.read-only",
9622 // "https://www.googleapis.com/auth/devstorage.full_control",
9623 // "https://www.googleapis.com/auth/devstorage.read_only",
9624 // "https://www.googleapis.com/auth/devstorage.read_write"
9625 // ],
9626 // "supportsSubscription": true
9627 // }
9628
9629 }
9630
9631 // Pages invokes f for each page of results.
9632 // A non-nil error returned from f will halt the iteration.
9633 // The provided context supersedes any context provided to the Context method.
9634 func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
9635 c.ctx_ = ctx
9636 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9637 for {
9638 x, err := c.Do()
9639 if err != nil {
9640 return err
9641 }
9642 if err := f(x); err != nil {
9643 return err
9644 }
9645 if x.NextPageToken == "" {
9646 return nil
9647 }
9648 c.PageToken(x.NextPageToken)
9649 }
9650 }
9651
9652 // method id "storage.objects.patch":
9653
9654 type ObjectsPatchCall struct {
9655 s *Service
9656 bucket string
9657 object string
9658 object2 *Object
9659 urlParams_ gensupport.URLParams
9660 ctx_ context.Context
9661 header_ http.Header
9662 }
9663
9664 // Patch: Patches an object's metadata.
9665 func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
9666 c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9667 c.bucket = bucket
9668 c.object = object
9669 c.object2 = object2
9670 return c
9671 }
9672
9673 // Generation sets the optional parameter "generation": If present,
9674 // selects a specific revision of this object (as opposed to the latest
9675 // version, the default).
9676 func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
9677 c.urlParams_.Set("generation", fmt.Sprint(generation))
9678 return c
9679 }
9680
9681 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
9682 // Makes the operation conditional on whether the object's current
9683 // generation matches the given value. Setting to 0 makes the operation
9684 // succeed only if there are no live versions of the object.
9685 func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
9686 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
9687 return c
9688 }
9689
9690 // IfGenerationNotMatch sets the optional parameter
9691 // "ifGenerationNotMatch": Makes the operation conditional on whether
9692 // the object's current generation does not match the given value. If no
9693 // live object exists, the precondition fails. Setting to 0 makes the
9694 // operation succeed only if there is a live version of the object.
9695 func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
9696 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
9697 return c
9698 }
9699
9700 // IfMetagenerationMatch sets the optional parameter
9701 // "ifMetagenerationMatch": Makes the operation conditional on whether
9702 // the object's current metageneration matches the given value.
9703 func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall {
9704 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
9705 return c
9706 }
9707
9708 // IfMetagenerationNotMatch sets the optional parameter
9709 // "ifMetagenerationNotMatch": Makes the operation conditional on
9710 // whether the object's current metageneration does not match the given
9711 // value.
9712 func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
9713 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9714 return c
9715 }
9716
9717 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9718 // predefined set of access controls to this object.
9719 //
9720 // Possible values:
9721 // "authenticatedRead" - Object owner gets OWNER access, and
9722 // allAuthenticatedUsers get READER access.
9723 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
9724 // project team owners get OWNER access.
9725 // "bucketOwnerRead" - Object owner gets OWNER access, and project
9726 // team owners get READER access.
9727 // "private" - Object owner gets OWNER access.
9728 // "projectPrivate" - Object owner gets OWNER access, and project team
9729 // members get access according to their roles.
9730 // "publicRead" - Object owner gets OWNER access, and allUsers get
9731 // READER access.
9732 func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
9733 c.urlParams_.Set("predefinedAcl", predefinedAcl)
9734 return c
9735 }
9736
9737 // Projection sets the optional parameter "projection": Set of
9738 // properties to return. Defaults to full.
9739 //
9740 // Possible values:
9741 // "full" - Include all properties.
9742 // "noAcl" - Omit the owner, acl property.
9743 func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
9744 c.urlParams_.Set("projection", projection)
9745 return c
9746 }
9747
9748 // UserProject sets the optional parameter "userProject": The project to
9749 // be billed for this request, for Requester Pays buckets.
9750 func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
9751 c.urlParams_.Set("userProject", userProject)
9752 return c
9753 }
9754
9755 // Fields allows partial responses to be retrieved. See
9756 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9757 // for more information.
9758 func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
9759 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9760 return c
9761 }
9762
9763 // Context sets the context to be used in this call's Do method. Any
9764 // pending HTTP request will be aborted if the provided context is
9765 // canceled.
9766 func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
9767 c.ctx_ = ctx
9768 return c
9769 }
9770
9771 // Header returns an http.Header that can be modified by the caller to
9772 // add HTTP headers to the request.
9773 func (c *ObjectsPatchCall) Header() http.Header {
9774 if c.header_ == nil {
9775 c.header_ = make(http.Header)
9776 }
9777 return c.header_
9778 }
9779
9780 func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
9781 reqHeaders := make(http.Header)
9782 for k, v := range c.header_ {
9783 reqHeaders[k] = v
9784 }
9785 reqHeaders.Set("User-Agent", c.s.userAgent())
9786 var body io.Reader = nil
9787 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
9788 if err != nil {
9789 return nil, err
9790 }
9791 reqHeaders.Set("Content-Type", "application/json")
9792 c.urlParams_.Set("alt", alt)
9793 c.urlParams_.Set("prettyPrint", "false")
9794 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
9795 urls += "?" + c.urlParams_.Encode()
9796 req, err := http.NewRequest("PATCH", urls, body)
9797 if err != nil {
9798 return nil, err
9799 }
9800 req.Header = reqHeaders
9801 googleapi.Expand(req.URL, map[string]string{
9802 "bucket": c.bucket,
9803 "object": c.object,
9804 })
9805 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9806 }
9807
9808 // Do executes the "storage.objects.patch" call.
9809 // Exactly one of *Object or error will be non-nil. Any non-2xx status
9810 // code is an error. Response headers are in either
9811 // *Object.ServerResponse.Header or (if a response was returned at all)
9812 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9813 // check whether the returned error was because http.StatusNotModified
9814 // was returned.
9815 func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
9816 gensupport.SetOptions(c.urlParams_, opts...)
9817 res, err := c.doRequest("json")
9818 if res != nil && res.StatusCode == http.StatusNotModified {
9819 if res.Body != nil {
9820 res.Body.Close()
9821 }
9822 return nil, &googleapi.Error{
9823 Code: res.StatusCode,
9824 Header: res.Header,
9825 }
9826 }
9827 if err != nil {
9828 return nil, err
9829 }
9830 defer googleapi.CloseBody(res)
9831 if err := googleapi.CheckResponse(res); err != nil {
9832 return nil, err
9833 }
9834 ret := &Object{
9835 ServerResponse: googleapi.ServerResponse{
9836 Header: res.Header,
9837 HTTPStatusCode: res.StatusCode,
9838 },
9839 }
9840 target := &ret
9841 if err := gensupport.DecodeResponse(target, res); err != nil {
9842 return nil, err
9843 }
9844 return ret, nil
9845 // {
9846 // "description": "Patches an object's metadata.",
9847 // "httpMethod": "PATCH",
9848 // "id": "storage.objects.patch",
9849 // "parameterOrder": [
9850 // "bucket",
9851 // "object"
9852 // ],
9853 // "parameters": {
9854 // "bucket": {
9855 // "description": "Name of the bucket in which the object resides.",
9856 // "location": "path",
9857 // "required": true,
9858 // "type": "string"
9859 // },
9860 // "generation": {
9861 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
9862 // "format": "int64",
9863 // "location": "query",
9864 // "type": "string"
9865 // },
9866 // "ifGenerationMatch": {
9867 // "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.",
9868 // "format": "int64",
9869 // "location": "query",
9870 // "type": "string"
9871 // },
9872 // "ifGenerationNotMatch": {
9873 // "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.",
9874 // "format": "int64",
9875 // "location": "query",
9876 // "type": "string"
9877 // },
9878 // "ifMetagenerationMatch": {
9879 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
9880 // "format": "int64",
9881 // "location": "query",
9882 // "type": "string"
9883 // },
9884 // "ifMetagenerationNotMatch": {
9885 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
9886 // "format": "int64",
9887 // "location": "query",
9888 // "type": "string"
9889 // },
9890 // "object": {
9891 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
9892 // "location": "path",
9893 // "required": true,
9894 // "type": "string"
9895 // },
9896 // "predefinedAcl": {
9897 // "description": "Apply a predefined set of access controls to this object.",
9898 // "enum": [
9899 // "authenticatedRead",
9900 // "bucketOwnerFullControl",
9901 // "bucketOwnerRead",
9902 // "private",
9903 // "projectPrivate",
9904 // "publicRead"
9905 // ],
9906 // "enumDescriptions": [
9907 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
9908 // "Object owner gets OWNER access, and project team owners get OWNER access.",
9909 // "Object owner gets OWNER access, and project team owners get READER access.",
9910 // "Object owner gets OWNER access.",
9911 // "Object owner gets OWNER access, and project team members get access according to their roles.",
9912 // "Object owner gets OWNER access, and allUsers get READER access."
9913 // ],
9914 // "location": "query",
9915 // "type": "string"
9916 // },
9917 // "projection": {
9918 // "description": "Set of properties to return. Defaults to full.",
9919 // "enum": [
9920 // "full",
9921 // "noAcl"
9922 // ],
9923 // "enumDescriptions": [
9924 // "Include all properties.",
9925 // "Omit the owner, acl property."
9926 // ],
9927 // "location": "query",
9928 // "type": "string"
9929 // },
9930 // "userProject": {
9931 // "description": "The project to be billed for this request, for Requester Pays buckets.",
9932 // "location": "query",
9933 // "type": "string"
9934 // }
9935 // },
9936 // "path": "b/{bucket}/o/{object}",
9937 // "request": {
9938 // "$ref": "Object"
9939 // },
9940 // "response": {
9941 // "$ref": "Object"
9942 // },
9943 // "scopes": [
9944 // "https://www.googleapis.com/auth/cloud-platform",
9945 // "https://www.googleapis.com/auth/devstorage.full_control"
9946 // ]
9947 // }
9948
9949 }
9950
9951 // method id "storage.objects.rewrite":
9952
9953 type ObjectsRewriteCall struct {
9954 s *Service
9955 sourceBucket string
9956 sourceObject string
9957 destinationBucket string
9958 destinationObject string
9959 object *Object
9960 urlParams_ gensupport.URLParams
9961 ctx_ context.Context
9962 header_ http.Header
9963 }
9964
9965 // Rewrite: Rewrites a source object to a destination object. Optionally
9966 // overrides metadata.
9967 func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall {
9968 c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9969 c.sourceBucket = sourceBucket
9970 c.sourceObject = sourceObject
9971 c.destinationBucket = destinationBucket
9972 c.destinationObject = destinationObject
9973 c.object = object
9974 return c
9975 }
9976
9977 // DestinationKmsKeyName sets the optional parameter
9978 // "destinationKmsKeyName": Resource name of the Cloud KMS key, of the
9979 // form
9980 // projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key,
9981 // that will be used to encrypt the object. Overrides the object
9982 // metadata's kms_key_name value, if any.
9983 func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall {
9984 c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
9985 return c
9986 }
9987
9988 // DestinationPredefinedAcl sets the optional parameter
9989 // "destinationPredefinedAcl": Apply a predefined set of access controls
9990 // to the destination object.
9991 //
9992 // Possible values:
9993 // "authenticatedRead" - Object owner gets OWNER access, and
9994 // allAuthenticatedUsers get READER access.
9995 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
9996 // project team owners get OWNER access.
9997 // "bucketOwnerRead" - Object owner gets OWNER access, and project
9998 // team owners get READER access.
9999 // "private" - Object owner gets OWNER access.
10000 // "projectPrivate" - Object owner gets OWNER access, and project team
10001 // members get access according to their roles.
10002 // "publicRead" - Object owner gets OWNER access, and allUsers get
10003 // READER access.
10004 func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
10005 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
10006 return c
10007 }
10008
10009 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10010 // Makes the operation conditional on whether the object's current
10011 // generation matches the given value. Setting to 0 makes the operation
10012 // succeed only if there are no live versions of the object.
10013 func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
10014 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10015 return c
10016 }
10017
10018 // IfGenerationNotMatch sets the optional parameter
10019 // "ifGenerationNotMatch": Makes the operation conditional on whether
10020 // the object's current generation does not match the given value. If no
10021 // live object exists, the precondition fails. Setting to 0 makes the
10022 // operation succeed only if there is a live version of the object.
10023 func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
10024 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10025 return c
10026 }
10027
10028 // IfMetagenerationMatch sets the optional parameter
10029 // "ifMetagenerationMatch": Makes the operation conditional on whether
10030 // the destination object's current metageneration matches the given
10031 // value.
10032 func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
10033 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10034 return c
10035 }
10036
10037 // IfMetagenerationNotMatch sets the optional parameter
10038 // "ifMetagenerationNotMatch": Makes the operation conditional on
10039 // whether the destination object's current metageneration does not
10040 // match the given value.
10041 func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall {
10042 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10043 return c
10044 }
10045
10046 // IfSourceGenerationMatch sets the optional parameter
10047 // "ifSourceGenerationMatch": Makes the operation conditional on whether
10048 // the source object's current generation matches the given value.
10049 func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
10050 c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
10051 return c
10052 }
10053
10054 // IfSourceGenerationNotMatch sets the optional parameter
10055 // "ifSourceGenerationNotMatch": Makes the operation conditional on
10056 // whether the source object's current generation does not match the
10057 // given value.
10058 func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
10059 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
10060 return c
10061 }
10062
10063 // IfSourceMetagenerationMatch sets the optional parameter
10064 // "ifSourceMetagenerationMatch": Makes the operation conditional on
10065 // whether the source object's current metageneration matches the given
10066 // value.
10067 func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
10068 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
10069 return c
10070 }
10071
10072 // IfSourceMetagenerationNotMatch sets the optional parameter
10073 // "ifSourceMetagenerationNotMatch": Makes the operation conditional on
10074 // whether the source object's current metageneration does not match the
10075 // given value.
10076 func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
10077 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
10078 return c
10079 }
10080
10081 // MaxBytesRewrittenPerCall sets the optional parameter
10082 // "maxBytesRewrittenPerCall": The maximum number of bytes that will be
10083 // rewritten per rewrite request. Most callers shouldn't need to specify
10084 // this parameter - it is primarily in place to support testing. If
10085 // specified the value must be an integral multiple of 1 MiB (1048576).
10086 // Also, this only applies to requests where the source and destination
10087 // span locations and/or storage classes. Finally, this value must not
10088 // change across rewrite calls else you'll get an error that the
10089 // rewriteToken is invalid.
10090 func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall {
10091 c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall))
10092 return c
10093 }
10094
10095 // Projection sets the optional parameter "projection": Set of
10096 // properties to return. Defaults to noAcl, unless the object resource
10097 // specifies the acl property, when it defaults to full.
10098 //
10099 // Possible values:
10100 // "full" - Include all properties.
10101 // "noAcl" - Omit the owner, acl property.
10102 func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall {
10103 c.urlParams_.Set("projection", projection)
10104 return c
10105 }
10106
10107 // RewriteToken sets the optional parameter "rewriteToken": Include this
10108 // field (from the previous rewrite response) on each rewrite request
10109 // after the first one, until the rewrite response 'done' flag is true.
10110 // Calls that provide a rewriteToken can omit all other request fields,
10111 // but if included those fields must match the values provided in the
10112 // first rewrite request.
10113 func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall {
10114 c.urlParams_.Set("rewriteToken", rewriteToken)
10115 return c
10116 }
10117
10118 // SourceGeneration sets the optional parameter "sourceGeneration": If
10119 // present, selects a specific revision of the source object (as opposed
10120 // to the latest version, the default).
10121 func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall {
10122 c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
10123 return c
10124 }
10125
10126 // UserProject sets the optional parameter "userProject": The project to
10127 // be billed for this request. Required for Requester Pays buckets.
10128 func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
10129 c.urlParams_.Set("userProject", userProject)
10130 return c
10131 }
10132
10133 // Fields allows partial responses to be retrieved. See
10134 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10135 // for more information.
10136 func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall {
10137 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10138 return c
10139 }
10140
10141 // Context sets the context to be used in this call's Do method. Any
10142 // pending HTTP request will be aborted if the provided context is
10143 // canceled.
10144 func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
10145 c.ctx_ = ctx
10146 return c
10147 }
10148
10149 // Header returns an http.Header that can be modified by the caller to
10150 // add HTTP headers to the request.
10151 func (c *ObjectsRewriteCall) Header() http.Header {
10152 if c.header_ == nil {
10153 c.header_ = make(http.Header)
10154 }
10155 return c.header_
10156 }
10157
10158 func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
10159 reqHeaders := make(http.Header)
10160 for k, v := range c.header_ {
10161 reqHeaders[k] = v
10162 }
10163 reqHeaders.Set("User-Agent", c.s.userAgent())
10164 var body io.Reader = nil
10165 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
10166 if err != nil {
10167 return nil, err
10168 }
10169 reqHeaders.Set("Content-Type", "application/json")
10170 c.urlParams_.Set("alt", alt)
10171 c.urlParams_.Set("prettyPrint", "false")
10172 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}")
10173 urls += "?" + c.urlParams_.Encode()
10174 req, err := http.NewRequest("POST", urls, body)
10175 if err != nil {
10176 return nil, err
10177 }
10178 req.Header = reqHeaders
10179 googleapi.Expand(req.URL, map[string]string{
10180 "sourceBucket": c.sourceBucket,
10181 "sourceObject": c.sourceObject,
10182 "destinationBucket": c.destinationBucket,
10183 "destinationObject": c.destinationObject,
10184 })
10185 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10186 }
10187
10188 // Do executes the "storage.objects.rewrite" call.
10189 // Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx
10190 // status code is an error. Response headers are in either
10191 // *RewriteResponse.ServerResponse.Header or (if a response was returned
10192 // at all) in error.(*googleapi.Error).Header. Use
10193 // googleapi.IsNotModified to check whether the returned error was
10194 // because http.StatusNotModified was returned.
10195 func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) {
10196 gensupport.SetOptions(c.urlParams_, opts...)
10197 res, err := c.doRequest("json")
10198 if res != nil && res.StatusCode == http.StatusNotModified {
10199 if res.Body != nil {
10200 res.Body.Close()
10201 }
10202 return nil, &googleapi.Error{
10203 Code: res.StatusCode,
10204 Header: res.Header,
10205 }
10206 }
10207 if err != nil {
10208 return nil, err
10209 }
10210 defer googleapi.CloseBody(res)
10211 if err := googleapi.CheckResponse(res); err != nil {
10212 return nil, err
10213 }
10214 ret := &RewriteResponse{
10215 ServerResponse: googleapi.ServerResponse{
10216 Header: res.Header,
10217 HTTPStatusCode: res.StatusCode,
10218 },
10219 }
10220 target := &ret
10221 if err := gensupport.DecodeResponse(target, res); err != nil {
10222 return nil, err
10223 }
10224 return ret, nil
10225 // {
10226 // "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
10227 // "httpMethod": "POST",
10228 // "id": "storage.objects.rewrite",
10229 // "parameterOrder": [
10230 // "sourceBucket",
10231 // "sourceObject",
10232 // "destinationBucket",
10233 // "destinationObject"
10234 // ],
10235 // "parameters": {
10236 // "destinationBucket": {
10237 // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
10238 // "location": "path",
10239 // "required": true,
10240 // "type": "string"
10241 // },
10242 // "destinationKmsKeyName": {
10243 // "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.",
10244 // "location": "query",
10245 // "type": "string"
10246 // },
10247 // "destinationObject": {
10248 // "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.",
10249 // "location": "path",
10250 // "required": true,
10251 // "type": "string"
10252 // },
10253 // "destinationPredefinedAcl": {
10254 // "description": "Apply a predefined set of access controls to the destination object.",
10255 // "enum": [
10256 // "authenticatedRead",
10257 // "bucketOwnerFullControl",
10258 // "bucketOwnerRead",
10259 // "private",
10260 // "projectPrivate",
10261 // "publicRead"
10262 // ],
10263 // "enumDescriptions": [
10264 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
10265 // "Object owner gets OWNER access, and project team owners get OWNER access.",
10266 // "Object owner gets OWNER access, and project team owners get READER access.",
10267 // "Object owner gets OWNER access.",
10268 // "Object owner gets OWNER access, and project team members get access according to their roles.",
10269 // "Object owner gets OWNER access, and allUsers get READER access."
10270 // ],
10271 // "location": "query",
10272 // "type": "string"
10273 // },
10274 // "ifGenerationMatch": {
10275 // "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.",
10276 // "format": "int64",
10277 // "location": "query",
10278 // "type": "string"
10279 // },
10280 // "ifGenerationNotMatch": {
10281 // "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.",
10282 // "format": "int64",
10283 // "location": "query",
10284 // "type": "string"
10285 // },
10286 // "ifMetagenerationMatch": {
10287 // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
10288 // "format": "int64",
10289 // "location": "query",
10290 // "type": "string"
10291 // },
10292 // "ifMetagenerationNotMatch": {
10293 // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
10294 // "format": "int64",
10295 // "location": "query",
10296 // "type": "string"
10297 // },
10298 // "ifSourceGenerationMatch": {
10299 // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
10300 // "format": "int64",
10301 // "location": "query",
10302 // "type": "string"
10303 // },
10304 // "ifSourceGenerationNotMatch": {
10305 // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
10306 // "format": "int64",
10307 // "location": "query",
10308 // "type": "string"
10309 // },
10310 // "ifSourceMetagenerationMatch": {
10311 // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
10312 // "format": "int64",
10313 // "location": "query",
10314 // "type": "string"
10315 // },
10316 // "ifSourceMetagenerationNotMatch": {
10317 // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
10318 // "format": "int64",
10319 // "location": "query",
10320 // "type": "string"
10321 // },
10322 // "maxBytesRewrittenPerCall": {
10323 // "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.",
10324 // "format": "int64",
10325 // "location": "query",
10326 // "type": "string"
10327 // },
10328 // "projection": {
10329 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
10330 // "enum": [
10331 // "full",
10332 // "noAcl"
10333 // ],
10334 // "enumDescriptions": [
10335 // "Include all properties.",
10336 // "Omit the owner, acl property."
10337 // ],
10338 // "location": "query",
10339 // "type": "string"
10340 // },
10341 // "rewriteToken": {
10342 // "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.",
10343 // "location": "query",
10344 // "type": "string"
10345 // },
10346 // "sourceBucket": {
10347 // "description": "Name of the bucket in which to find the source object.",
10348 // "location": "path",
10349 // "required": true,
10350 // "type": "string"
10351 // },
10352 // "sourceGeneration": {
10353 // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
10354 // "format": "int64",
10355 // "location": "query",
10356 // "type": "string"
10357 // },
10358 // "sourceObject": {
10359 // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10360 // "location": "path",
10361 // "required": true,
10362 // "type": "string"
10363 // },
10364 // "userProject": {
10365 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10366 // "location": "query",
10367 // "type": "string"
10368 // }
10369 // },
10370 // "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
10371 // "request": {
10372 // "$ref": "Object"
10373 // },
10374 // "response": {
10375 // "$ref": "RewriteResponse"
10376 // },
10377 // "scopes": [
10378 // "https://www.googleapis.com/auth/cloud-platform",
10379 // "https://www.googleapis.com/auth/devstorage.full_control",
10380 // "https://www.googleapis.com/auth/devstorage.read_write"
10381 // ]
10382 // }
10383
10384 }
10385
10386 // method id "storage.objects.setIamPolicy":
10387
10388 type ObjectsSetIamPolicyCall struct {
10389 s *Service
10390 bucket string
10391 object string
10392 policy *Policy
10393 urlParams_ gensupport.URLParams
10394 ctx_ context.Context
10395 header_ http.Header
10396 }
10397
10398 // SetIamPolicy: Updates an IAM policy for the specified object.
10399 func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall {
10400 c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10401 c.bucket = bucket
10402 c.object = object
10403 c.policy = policy
10404 return c
10405 }
10406
10407 // Generation sets the optional parameter "generation": If present,
10408 // selects a specific revision of this object (as opposed to the latest
10409 // version, the default).
10410 func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall {
10411 c.urlParams_.Set("generation", fmt.Sprint(generation))
10412 return c
10413 }
10414
10415 // UserProject sets the optional parameter "userProject": The project to
10416 // be billed for this request. Required for Requester Pays buckets.
10417 func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
10418 c.urlParams_.Set("userProject", userProject)
10419 return c
10420 }
10421
10422 // Fields allows partial responses to be retrieved. See
10423 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10424 // for more information.
10425 func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall {
10426 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10427 return c
10428 }
10429
10430 // Context sets the context to be used in this call's Do method. Any
10431 // pending HTTP request will be aborted if the provided context is
10432 // canceled.
10433 func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
10434 c.ctx_ = ctx
10435 return c
10436 }
10437
10438 // Header returns an http.Header that can be modified by the caller to
10439 // add HTTP headers to the request.
10440 func (c *ObjectsSetIamPolicyCall) Header() http.Header {
10441 if c.header_ == nil {
10442 c.header_ = make(http.Header)
10443 }
10444 return c.header_
10445 }
10446
10447 func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
10448 reqHeaders := make(http.Header)
10449 for k, v := range c.header_ {
10450 reqHeaders[k] = v
10451 }
10452 reqHeaders.Set("User-Agent", c.s.userAgent())
10453 var body io.Reader = nil
10454 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
10455 if err != nil {
10456 return nil, err
10457 }
10458 reqHeaders.Set("Content-Type", "application/json")
10459 c.urlParams_.Set("alt", alt)
10460 c.urlParams_.Set("prettyPrint", "false")
10461 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
10462 urls += "?" + c.urlParams_.Encode()
10463 req, err := http.NewRequest("PUT", urls, body)
10464 if err != nil {
10465 return nil, err
10466 }
10467 req.Header = reqHeaders
10468 googleapi.Expand(req.URL, map[string]string{
10469 "bucket": c.bucket,
10470 "object": c.object,
10471 })
10472 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10473 }
10474
10475 // Do executes the "storage.objects.setIamPolicy" call.
10476 // Exactly one of *Policy or error will be non-nil. Any non-2xx status
10477 // code is an error. Response headers are in either
10478 // *Policy.ServerResponse.Header or (if a response was returned at all)
10479 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10480 // check whether the returned error was because http.StatusNotModified
10481 // was returned.
10482 func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
10483 gensupport.SetOptions(c.urlParams_, opts...)
10484 res, err := c.doRequest("json")
10485 if res != nil && res.StatusCode == http.StatusNotModified {
10486 if res.Body != nil {
10487 res.Body.Close()
10488 }
10489 return nil, &googleapi.Error{
10490 Code: res.StatusCode,
10491 Header: res.Header,
10492 }
10493 }
10494 if err != nil {
10495 return nil, err
10496 }
10497 defer googleapi.CloseBody(res)
10498 if err := googleapi.CheckResponse(res); err != nil {
10499 return nil, err
10500 }
10501 ret := &Policy{
10502 ServerResponse: googleapi.ServerResponse{
10503 Header: res.Header,
10504 HTTPStatusCode: res.StatusCode,
10505 },
10506 }
10507 target := &ret
10508 if err := gensupport.DecodeResponse(target, res); err != nil {
10509 return nil, err
10510 }
10511 return ret, nil
10512 // {
10513 // "description": "Updates an IAM policy for the specified object.",
10514 // "httpMethod": "PUT",
10515 // "id": "storage.objects.setIamPolicy",
10516 // "parameterOrder": [
10517 // "bucket",
10518 // "object"
10519 // ],
10520 // "parameters": {
10521 // "bucket": {
10522 // "description": "Name of the bucket in which the object resides.",
10523 // "location": "path",
10524 // "required": true,
10525 // "type": "string"
10526 // },
10527 // "generation": {
10528 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10529 // "format": "int64",
10530 // "location": "query",
10531 // "type": "string"
10532 // },
10533 // "object": {
10534 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10535 // "location": "path",
10536 // "required": true,
10537 // "type": "string"
10538 // },
10539 // "userProject": {
10540 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10541 // "location": "query",
10542 // "type": "string"
10543 // }
10544 // },
10545 // "path": "b/{bucket}/o/{object}/iam",
10546 // "request": {
10547 // "$ref": "Policy"
10548 // },
10549 // "response": {
10550 // "$ref": "Policy"
10551 // },
10552 // "scopes": [
10553 // "https://www.googleapis.com/auth/cloud-platform",
10554 // "https://www.googleapis.com/auth/devstorage.full_control",
10555 // "https://www.googleapis.com/auth/devstorage.read_write"
10556 // ]
10557 // }
10558
10559 }
10560
10561 // method id "storage.objects.testIamPermissions":
10562
10563 type ObjectsTestIamPermissionsCall struct {
10564 s *Service
10565 bucket string
10566 object string
10567 urlParams_ gensupport.URLParams
10568 ifNoneMatch_ string
10569 ctx_ context.Context
10570 header_ http.Header
10571 }
10572
10573 // TestIamPermissions: Tests a set of permissions on the given object to
10574 // see which, if any, are held by the caller.
10575 func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall {
10576 c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10577 c.bucket = bucket
10578 c.object = object
10579 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
10580 return c
10581 }
10582
10583 // Generation sets the optional parameter "generation": If present,
10584 // selects a specific revision of this object (as opposed to the latest
10585 // version, the default).
10586 func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall {
10587 c.urlParams_.Set("generation", fmt.Sprint(generation))
10588 return c
10589 }
10590
10591 // UserProject sets the optional parameter "userProject": The project to
10592 // be billed for this request. Required for Requester Pays buckets.
10593 func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
10594 c.urlParams_.Set("userProject", userProject)
10595 return c
10596 }
10597
10598 // Fields allows partial responses to be retrieved. See
10599 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10600 // for more information.
10601 func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall {
10602 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10603 return c
10604 }
10605
10606 // IfNoneMatch sets the optional parameter which makes the operation
10607 // fail if the object's ETag matches the given value. This is useful for
10608 // getting updates only after the object has changed since the last
10609 // request. Use googleapi.IsNotModified to check whether the response
10610 // error from Do is the result of In-None-Match.
10611 func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall {
10612 c.ifNoneMatch_ = entityTag
10613 return c
10614 }
10615
10616 // Context sets the context to be used in this call's Do method. Any
10617 // pending HTTP request will be aborted if the provided context is
10618 // canceled.
10619 func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
10620 c.ctx_ = ctx
10621 return c
10622 }
10623
10624 // Header returns an http.Header that can be modified by the caller to
10625 // add HTTP headers to the request.
10626 func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
10627 if c.header_ == nil {
10628 c.header_ = make(http.Header)
10629 }
10630 return c.header_
10631 }
10632
10633 func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
10634 reqHeaders := make(http.Header)
10635 for k, v := range c.header_ {
10636 reqHeaders[k] = v
10637 }
10638 reqHeaders.Set("User-Agent", c.s.userAgent())
10639 if c.ifNoneMatch_ != "" {
10640 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10641 }
10642 var body io.Reader = nil
10643 c.urlParams_.Set("alt", alt)
10644 c.urlParams_.Set("prettyPrint", "false")
10645 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions")
10646 urls += "?" + c.urlParams_.Encode()
10647 req, err := http.NewRequest("GET", urls, body)
10648 if err != nil {
10649 return nil, err
10650 }
10651 req.Header = reqHeaders
10652 googleapi.Expand(req.URL, map[string]string{
10653 "bucket": c.bucket,
10654 "object": c.object,
10655 })
10656 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10657 }
10658
10659 // Do executes the "storage.objects.testIamPermissions" call.
10660 // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
10661 // Any non-2xx status code is an error. Response headers are in either
10662 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
10663 // was returned at all) in error.(*googleapi.Error).Header. Use
10664 // googleapi.IsNotModified to check whether the returned error was
10665 // because http.StatusNotModified was returned.
10666 func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
10667 gensupport.SetOptions(c.urlParams_, opts...)
10668 res, err := c.doRequest("json")
10669 if res != nil && res.StatusCode == http.StatusNotModified {
10670 if res.Body != nil {
10671 res.Body.Close()
10672 }
10673 return nil, &googleapi.Error{
10674 Code: res.StatusCode,
10675 Header: res.Header,
10676 }
10677 }
10678 if err != nil {
10679 return nil, err
10680 }
10681 defer googleapi.CloseBody(res)
10682 if err := googleapi.CheckResponse(res); err != nil {
10683 return nil, err
10684 }
10685 ret := &TestIamPermissionsResponse{
10686 ServerResponse: googleapi.ServerResponse{
10687 Header: res.Header,
10688 HTTPStatusCode: res.StatusCode,
10689 },
10690 }
10691 target := &ret
10692 if err := gensupport.DecodeResponse(target, res); err != nil {
10693 return nil, err
10694 }
10695 return ret, nil
10696 // {
10697 // "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
10698 // "httpMethod": "GET",
10699 // "id": "storage.objects.testIamPermissions",
10700 // "parameterOrder": [
10701 // "bucket",
10702 // "object",
10703 // "permissions"
10704 // ],
10705 // "parameters": {
10706 // "bucket": {
10707 // "description": "Name of the bucket in which the object resides.",
10708 // "location": "path",
10709 // "required": true,
10710 // "type": "string"
10711 // },
10712 // "generation": {
10713 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10714 // "format": "int64",
10715 // "location": "query",
10716 // "type": "string"
10717 // },
10718 // "object": {
10719 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10720 // "location": "path",
10721 // "required": true,
10722 // "type": "string"
10723 // },
10724 // "permissions": {
10725 // "description": "Permissions to test.",
10726 // "location": "query",
10727 // "repeated": true,
10728 // "required": true,
10729 // "type": "string"
10730 // },
10731 // "userProject": {
10732 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10733 // "location": "query",
10734 // "type": "string"
10735 // }
10736 // },
10737 // "path": "b/{bucket}/o/{object}/iam/testPermissions",
10738 // "response": {
10739 // "$ref": "TestIamPermissionsResponse"
10740 // },
10741 // "scopes": [
10742 // "https://www.googleapis.com/auth/cloud-platform",
10743 // "https://www.googleapis.com/auth/cloud-platform.read-only",
10744 // "https://www.googleapis.com/auth/devstorage.full_control",
10745 // "https://www.googleapis.com/auth/devstorage.read_only",
10746 // "https://www.googleapis.com/auth/devstorage.read_write"
10747 // ]
10748 // }
10749
10750 }
10751
10752 // method id "storage.objects.update":
10753
10754 type ObjectsUpdateCall struct {
10755 s *Service
10756 bucket string
10757 object string
10758 object2 *Object
10759 urlParams_ gensupport.URLParams
10760 ctx_ context.Context
10761 header_ http.Header
10762 }
10763
10764 // Update: Updates an object's metadata.
10765 func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
10766 c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10767 c.bucket = bucket
10768 c.object = object
10769 c.object2 = object2
10770 return c
10771 }
10772
10773 // Generation sets the optional parameter "generation": If present,
10774 // selects a specific revision of this object (as opposed to the latest
10775 // version, the default).
10776 func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
10777 c.urlParams_.Set("generation", fmt.Sprint(generation))
10778 return c
10779 }
10780
10781 // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
10782 // Makes the operation conditional on whether the object's current
10783 // generation matches the given value. Setting to 0 makes the operation
10784 // succeed only if there are no live versions of the object.
10785 func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
10786 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
10787 return c
10788 }
10789
10790 // IfGenerationNotMatch sets the optional parameter
10791 // "ifGenerationNotMatch": Makes the operation conditional on whether
10792 // the object's current generation does not match the given value. If no
10793 // live object exists, the precondition fails. Setting to 0 makes the
10794 // operation succeed only if there is a live version of the object.
10795 func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
10796 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
10797 return c
10798 }
10799
10800 // IfMetagenerationMatch sets the optional parameter
10801 // "ifMetagenerationMatch": Makes the operation conditional on whether
10802 // the object's current metageneration matches the given value.
10803 func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall {
10804 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
10805 return c
10806 }
10807
10808 // IfMetagenerationNotMatch sets the optional parameter
10809 // "ifMetagenerationNotMatch": Makes the operation conditional on
10810 // whether the object's current metageneration does not match the given
10811 // value.
10812 func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
10813 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10814 return c
10815 }
10816
10817 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
10818 // predefined set of access controls to this object.
10819 //
10820 // Possible values:
10821 // "authenticatedRead" - Object owner gets OWNER access, and
10822 // allAuthenticatedUsers get READER access.
10823 // "bucketOwnerFullControl" - Object owner gets OWNER access, and
10824 // project team owners get OWNER access.
10825 // "bucketOwnerRead" - Object owner gets OWNER access, and project
10826 // team owners get READER access.
10827 // "private" - Object owner gets OWNER access.
10828 // "projectPrivate" - Object owner gets OWNER access, and project team
10829 // members get access according to their roles.
10830 // "publicRead" - Object owner gets OWNER access, and allUsers get
10831 // READER access.
10832 func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
10833 c.urlParams_.Set("predefinedAcl", predefinedAcl)
10834 return c
10835 }
10836
10837 // Projection sets the optional parameter "projection": Set of
10838 // properties to return. Defaults to full.
10839 //
10840 // Possible values:
10841 // "full" - Include all properties.
10842 // "noAcl" - Omit the owner, acl property.
10843 func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
10844 c.urlParams_.Set("projection", projection)
10845 return c
10846 }
10847
10848 // UserProject sets the optional parameter "userProject": The project to
10849 // be billed for this request. Required for Requester Pays buckets.
10850 func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
10851 c.urlParams_.Set("userProject", userProject)
10852 return c
10853 }
10854
10855 // Fields allows partial responses to be retrieved. See
10856 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10857 // for more information.
10858 func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
10859 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10860 return c
10861 }
10862
10863 // Context sets the context to be used in this call's Do method. Any
10864 // pending HTTP request will be aborted if the provided context is
10865 // canceled.
10866 func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
10867 c.ctx_ = ctx
10868 return c
10869 }
10870
10871 // Header returns an http.Header that can be modified by the caller to
10872 // add HTTP headers to the request.
10873 func (c *ObjectsUpdateCall) Header() http.Header {
10874 if c.header_ == nil {
10875 c.header_ = make(http.Header)
10876 }
10877 return c.header_
10878 }
10879
10880 func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
10881 reqHeaders := make(http.Header)
10882 for k, v := range c.header_ {
10883 reqHeaders[k] = v
10884 }
10885 reqHeaders.Set("User-Agent", c.s.userAgent())
10886 var body io.Reader = nil
10887 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
10888 if err != nil {
10889 return nil, err
10890 }
10891 reqHeaders.Set("Content-Type", "application/json")
10892 c.urlParams_.Set("alt", alt)
10893 c.urlParams_.Set("prettyPrint", "false")
10894 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
10895 urls += "?" + c.urlParams_.Encode()
10896 req, err := http.NewRequest("PUT", urls, body)
10897 if err != nil {
10898 return nil, err
10899 }
10900 req.Header = reqHeaders
10901 googleapi.Expand(req.URL, map[string]string{
10902 "bucket": c.bucket,
10903 "object": c.object,
10904 })
10905 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10906 }
10907
10908 // Do executes the "storage.objects.update" call.
10909 // Exactly one of *Object or error will be non-nil. Any non-2xx status
10910 // code is an error. Response headers are in either
10911 // *Object.ServerResponse.Header or (if a response was returned at all)
10912 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10913 // check whether the returned error was because http.StatusNotModified
10914 // was returned.
10915 func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
10916 gensupport.SetOptions(c.urlParams_, opts...)
10917 res, err := c.doRequest("json")
10918 if res != nil && res.StatusCode == http.StatusNotModified {
10919 if res.Body != nil {
10920 res.Body.Close()
10921 }
10922 return nil, &googleapi.Error{
10923 Code: res.StatusCode,
10924 Header: res.Header,
10925 }
10926 }
10927 if err != nil {
10928 return nil, err
10929 }
10930 defer googleapi.CloseBody(res)
10931 if err := googleapi.CheckResponse(res); err != nil {
10932 return nil, err
10933 }
10934 ret := &Object{
10935 ServerResponse: googleapi.ServerResponse{
10936 Header: res.Header,
10937 HTTPStatusCode: res.StatusCode,
10938 },
10939 }
10940 target := &ret
10941 if err := gensupport.DecodeResponse(target, res); err != nil {
10942 return nil, err
10943 }
10944 return ret, nil
10945 // {
10946 // "description": "Updates an object's metadata.",
10947 // "httpMethod": "PUT",
10948 // "id": "storage.objects.update",
10949 // "parameterOrder": [
10950 // "bucket",
10951 // "object"
10952 // ],
10953 // "parameters": {
10954 // "bucket": {
10955 // "description": "Name of the bucket in which the object resides.",
10956 // "location": "path",
10957 // "required": true,
10958 // "type": "string"
10959 // },
10960 // "generation": {
10961 // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
10962 // "format": "int64",
10963 // "location": "query",
10964 // "type": "string"
10965 // },
10966 // "ifGenerationMatch": {
10967 // "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.",
10968 // "format": "int64",
10969 // "location": "query",
10970 // "type": "string"
10971 // },
10972 // "ifGenerationNotMatch": {
10973 // "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.",
10974 // "format": "int64",
10975 // "location": "query",
10976 // "type": "string"
10977 // },
10978 // "ifMetagenerationMatch": {
10979 // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
10980 // "format": "int64",
10981 // "location": "query",
10982 // "type": "string"
10983 // },
10984 // "ifMetagenerationNotMatch": {
10985 // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
10986 // "format": "int64",
10987 // "location": "query",
10988 // "type": "string"
10989 // },
10990 // "object": {
10991 // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
10992 // "location": "path",
10993 // "required": true,
10994 // "type": "string"
10995 // },
10996 // "predefinedAcl": {
10997 // "description": "Apply a predefined set of access controls to this object.",
10998 // "enum": [
10999 // "authenticatedRead",
11000 // "bucketOwnerFullControl",
11001 // "bucketOwnerRead",
11002 // "private",
11003 // "projectPrivate",
11004 // "publicRead"
11005 // ],
11006 // "enumDescriptions": [
11007 // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
11008 // "Object owner gets OWNER access, and project team owners get OWNER access.",
11009 // "Object owner gets OWNER access, and project team owners get READER access.",
11010 // "Object owner gets OWNER access.",
11011 // "Object owner gets OWNER access, and project team members get access according to their roles.",
11012 // "Object owner gets OWNER access, and allUsers get READER access."
11013 // ],
11014 // "location": "query",
11015 // "type": "string"
11016 // },
11017 // "projection": {
11018 // "description": "Set of properties to return. Defaults to full.",
11019 // "enum": [
11020 // "full",
11021 // "noAcl"
11022 // ],
11023 // "enumDescriptions": [
11024 // "Include all properties.",
11025 // "Omit the owner, acl property."
11026 // ],
11027 // "location": "query",
11028 // "type": "string"
11029 // },
11030 // "userProject": {
11031 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11032 // "location": "query",
11033 // "type": "string"
11034 // }
11035 // },
11036 // "path": "b/{bucket}/o/{object}",
11037 // "request": {
11038 // "$ref": "Object"
11039 // },
11040 // "response": {
11041 // "$ref": "Object"
11042 // },
11043 // "scopes": [
11044 // "https://www.googleapis.com/auth/cloud-platform",
11045 // "https://www.googleapis.com/auth/devstorage.full_control"
11046 // ]
11047 // }
11048
11049 }
11050
11051 // method id "storage.objects.watchAll":
11052
11053 type ObjectsWatchAllCall struct {
11054 s *Service
11055 bucket string
11056 channel *Channel
11057 urlParams_ gensupport.URLParams
11058 ctx_ context.Context
11059 header_ http.Header
11060 }
11061
11062 // WatchAll: Watch for changes on all objects in a bucket.
11063 func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
11064 c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11065 c.bucket = bucket
11066 c.channel = channel
11067 return c
11068 }
11069
11070 // Delimiter sets the optional parameter "delimiter": Returns results in
11071 // a directory-like mode. items will contain only objects whose names,
11072 // aside from the prefix, do not contain delimiter. Objects whose names,
11073 // aside from the prefix, contain delimiter will have their name,
11074 // truncated after the delimiter, returned in prefixes. Duplicate
11075 // prefixes are omitted.
11076 func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
11077 c.urlParams_.Set("delimiter", delimiter)
11078 return c
11079 }
11080
11081 // IncludeTrailingDelimiter sets the optional parameter
11082 // "includeTrailingDelimiter": If true, objects that end in exactly one
11083 // instance of delimiter will have their metadata included in items in
11084 // addition to prefixes.
11085 func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall {
11086 c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
11087 return c
11088 }
11089
11090 // MaxResults sets the optional parameter "maxResults": Maximum number
11091 // of items plus prefixes to return in a single page of responses. As
11092 // duplicate prefixes are omitted, fewer total results may be returned
11093 // than requested. The service will use this parameter or 1,000 items,
11094 // whichever is smaller.
11095 func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
11096 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
11097 return c
11098 }
11099
11100 // PageToken sets the optional parameter "pageToken": A
11101 // previously-returned page token representing part of the larger set of
11102 // results to view.
11103 func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
11104 c.urlParams_.Set("pageToken", pageToken)
11105 return c
11106 }
11107
11108 // Prefix sets the optional parameter "prefix": Filter results to
11109 // objects whose names begin with this prefix.
11110 func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
11111 c.urlParams_.Set("prefix", prefix)
11112 return c
11113 }
11114
11115 // Projection sets the optional parameter "projection": Set of
11116 // properties to return. Defaults to noAcl.
11117 //
11118 // Possible values:
11119 // "full" - Include all properties.
11120 // "noAcl" - Omit the owner, acl property.
11121 func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
11122 c.urlParams_.Set("projection", projection)
11123 return c
11124 }
11125
11126 // UserProject sets the optional parameter "userProject": The project to
11127 // be billed for this request. Required for Requester Pays buckets.
11128 func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
11129 c.urlParams_.Set("userProject", userProject)
11130 return c
11131 }
11132
11133 // Versions sets the optional parameter "versions": If true, lists all
11134 // versions of an object as distinct results. The default is false. For
11135 // more information, see Object Versioning.
11136 func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
11137 c.urlParams_.Set("versions", fmt.Sprint(versions))
11138 return c
11139 }
11140
11141 // Fields allows partial responses to be retrieved. See
11142 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11143 // for more information.
11144 func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
11145 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11146 return c
11147 }
11148
11149 // Context sets the context to be used in this call's Do method. Any
11150 // pending HTTP request will be aborted if the provided context is
11151 // canceled.
11152 func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
11153 c.ctx_ = ctx
11154 return c
11155 }
11156
11157 // Header returns an http.Header that can be modified by the caller to
11158 // add HTTP headers to the request.
11159 func (c *ObjectsWatchAllCall) Header() http.Header {
11160 if c.header_ == nil {
11161 c.header_ = make(http.Header)
11162 }
11163 return c.header_
11164 }
11165
11166 func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
11167 reqHeaders := make(http.Header)
11168 for k, v := range c.header_ {
11169 reqHeaders[k] = v
11170 }
11171 reqHeaders.Set("User-Agent", c.s.userAgent())
11172 var body io.Reader = nil
11173 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
11174 if err != nil {
11175 return nil, err
11176 }
11177 reqHeaders.Set("Content-Type", "application/json")
11178 c.urlParams_.Set("alt", alt)
11179 c.urlParams_.Set("prettyPrint", "false")
11180 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
11181 urls += "?" + c.urlParams_.Encode()
11182 req, err := http.NewRequest("POST", urls, body)
11183 if err != nil {
11184 return nil, err
11185 }
11186 req.Header = reqHeaders
11187 googleapi.Expand(req.URL, map[string]string{
11188 "bucket": c.bucket,
11189 })
11190 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11191 }
11192
11193 // Do executes the "storage.objects.watchAll" call.
11194 // Exactly one of *Channel or error will be non-nil. Any non-2xx status
11195 // code is an error. Response headers are in either
11196 // *Channel.ServerResponse.Header or (if a response was returned at all)
11197 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11198 // check whether the returned error was because http.StatusNotModified
11199 // was returned.
11200 func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
11201 gensupport.SetOptions(c.urlParams_, opts...)
11202 res, err := c.doRequest("json")
11203 if res != nil && res.StatusCode == http.StatusNotModified {
11204 if res.Body != nil {
11205 res.Body.Close()
11206 }
11207 return nil, &googleapi.Error{
11208 Code: res.StatusCode,
11209 Header: res.Header,
11210 }
11211 }
11212 if err != nil {
11213 return nil, err
11214 }
11215 defer googleapi.CloseBody(res)
11216 if err := googleapi.CheckResponse(res); err != nil {
11217 return nil, err
11218 }
11219 ret := &Channel{
11220 ServerResponse: googleapi.ServerResponse{
11221 Header: res.Header,
11222 HTTPStatusCode: res.StatusCode,
11223 },
11224 }
11225 target := &ret
11226 if err := gensupport.DecodeResponse(target, res); err != nil {
11227 return nil, err
11228 }
11229 return ret, nil
11230 // {
11231 // "description": "Watch for changes on all objects in a bucket.",
11232 // "httpMethod": "POST",
11233 // "id": "storage.objects.watchAll",
11234 // "parameterOrder": [
11235 // "bucket"
11236 // ],
11237 // "parameters": {
11238 // "bucket": {
11239 // "description": "Name of the bucket in which to look for objects.",
11240 // "location": "path",
11241 // "required": true,
11242 // "type": "string"
11243 // },
11244 // "delimiter": {
11245 // "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.",
11246 // "location": "query",
11247 // "type": "string"
11248 // },
11249 // "includeTrailingDelimiter": {
11250 // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
11251 // "location": "query",
11252 // "type": "boolean"
11253 // },
11254 // "maxResults": {
11255 // "default": "1000",
11256 // "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.",
11257 // "format": "uint32",
11258 // "location": "query",
11259 // "minimum": "0",
11260 // "type": "integer"
11261 // },
11262 // "pageToken": {
11263 // "description": "A previously-returned page token representing part of the larger set of results to view.",
11264 // "location": "query",
11265 // "type": "string"
11266 // },
11267 // "prefix": {
11268 // "description": "Filter results to objects whose names begin with this prefix.",
11269 // "location": "query",
11270 // "type": "string"
11271 // },
11272 // "projection": {
11273 // "description": "Set of properties to return. Defaults to noAcl.",
11274 // "enum": [
11275 // "full",
11276 // "noAcl"
11277 // ],
11278 // "enumDescriptions": [
11279 // "Include all properties.",
11280 // "Omit the owner, acl property."
11281 // ],
11282 // "location": "query",
11283 // "type": "string"
11284 // },
11285 // "userProject": {
11286 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11287 // "location": "query",
11288 // "type": "string"
11289 // },
11290 // "versions": {
11291 // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
11292 // "location": "query",
11293 // "type": "boolean"
11294 // }
11295 // },
11296 // "path": "b/{bucket}/o/watch",
11297 // "request": {
11298 // "$ref": "Channel",
11299 // "parameterName": "resource"
11300 // },
11301 // "response": {
11302 // "$ref": "Channel"
11303 // },
11304 // "scopes": [
11305 // "https://www.googleapis.com/auth/cloud-platform",
11306 // "https://www.googleapis.com/auth/cloud-platform.read-only",
11307 // "https://www.googleapis.com/auth/devstorage.full_control",
11308 // "https://www.googleapis.com/auth/devstorage.read_only",
11309 // "https://www.googleapis.com/auth/devstorage.read_write"
11310 // ],
11311 // "supportsSubscription": true
11312 // }
11313
11314 }
11315
11316 // method id "storage.projects.serviceAccount.get":
11317
11318 type ProjectsServiceAccountGetCall struct {
11319 s *Service
11320 projectId string
11321 urlParams_ gensupport.URLParams
11322 ifNoneMatch_ string
11323 ctx_ context.Context
11324 header_ http.Header
11325 }
11326
11327 // Get: Get the email address of this project's Google Cloud Storage
11328 // service account.
11329 func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
11330 c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11331 c.projectId = projectId
11332 return c
11333 }
11334
11335 // UserProject sets the optional parameter "userProject": The project to
11336 // be billed for this request.
11337 func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall {
11338 c.urlParams_.Set("userProject", userProject)
11339 return c
11340 }
11341
11342 // Fields allows partial responses to be retrieved. See
11343 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11344 // for more information.
11345 func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
11346 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11347 return c
11348 }
11349
11350 // IfNoneMatch sets the optional parameter which makes the operation
11351 // fail if the object's ETag matches the given value. This is useful for
11352 // getting updates only after the object has changed since the last
11353 // request. Use googleapi.IsNotModified to check whether the response
11354 // error from Do is the result of In-None-Match.
11355 func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
11356 c.ifNoneMatch_ = entityTag
11357 return c
11358 }
11359
11360 // Context sets the context to be used in this call's Do method. Any
11361 // pending HTTP request will be aborted if the provided context is
11362 // canceled.
11363 func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
11364 c.ctx_ = ctx
11365 return c
11366 }
11367
11368 // Header returns an http.Header that can be modified by the caller to
11369 // add HTTP headers to the request.
11370 func (c *ProjectsServiceAccountGetCall) Header() http.Header {
11371 if c.header_ == nil {
11372 c.header_ = make(http.Header)
11373 }
11374 return c.header_
11375 }
11376
11377 func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
11378 reqHeaders := make(http.Header)
11379 for k, v := range c.header_ {
11380 reqHeaders[k] = v
11381 }
11382 reqHeaders.Set("User-Agent", c.s.userAgent())
11383 if c.ifNoneMatch_ != "" {
11384 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11385 }
11386 var body io.Reader = nil
11387 c.urlParams_.Set("alt", alt)
11388 c.urlParams_.Set("prettyPrint", "false")
11389 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
11390 urls += "?" + c.urlParams_.Encode()
11391 req, err := http.NewRequest("GET", urls, body)
11392 if err != nil {
11393 return nil, err
11394 }
11395 req.Header = reqHeaders
11396 googleapi.Expand(req.URL, map[string]string{
11397 "projectId": c.projectId,
11398 })
11399 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11400 }
11401
11402 // Do executes the "storage.projects.serviceAccount.get" call.
11403 // Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
11404 // status code is an error. Response headers are in either
11405 // *ServiceAccount.ServerResponse.Header or (if a response was returned
11406 // at all) in error.(*googleapi.Error).Header. Use
11407 // googleapi.IsNotModified to check whether the returned error was
11408 // because http.StatusNotModified was returned.
11409 func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
11410 gensupport.SetOptions(c.urlParams_, opts...)
11411 res, err := c.doRequest("json")
11412 if res != nil && res.StatusCode == http.StatusNotModified {
11413 if res.Body != nil {
11414 res.Body.Close()
11415 }
11416 return nil, &googleapi.Error{
11417 Code: res.StatusCode,
11418 Header: res.Header,
11419 }
11420 }
11421 if err != nil {
11422 return nil, err
11423 }
11424 defer googleapi.CloseBody(res)
11425 if err := googleapi.CheckResponse(res); err != nil {
11426 return nil, err
11427 }
11428 ret := &ServiceAccount{
11429 ServerResponse: googleapi.ServerResponse{
11430 Header: res.Header,
11431 HTTPStatusCode: res.StatusCode,
11432 },
11433 }
11434 target := &ret
11435 if err := gensupport.DecodeResponse(target, res); err != nil {
11436 return nil, err
11437 }
11438 return ret, nil
11439 // {
11440 // "description": "Get the email address of this project's Google Cloud Storage service account.",
11441 // "httpMethod": "GET",
11442 // "id": "storage.projects.serviceAccount.get",
11443 // "parameterOrder": [
11444 // "projectId"
11445 // ],
11446 // "parameters": {
11447 // "projectId": {
11448 // "description": "Project ID",
11449 // "location": "path",
11450 // "required": true,
11451 // "type": "string"
11452 // },
11453 // "userProject": {
11454 // "description": "The project to be billed for this request.",
11455 // "location": "query",
11456 // "type": "string"
11457 // }
11458 // },
11459 // "path": "projects/{projectId}/serviceAccount",
11460 // "response": {
11461 // "$ref": "ServiceAccount"
11462 // },
11463 // "scopes": [
11464 // "https://www.googleapis.com/auth/cloud-platform",
11465 // "https://www.googleapis.com/auth/cloud-platform.read-only",
11466 // "https://www.googleapis.com/auth/devstorage.full_control",
11467 // "https://www.googleapis.com/auth/devstorage.read_only",
11468 // "https://www.googleapis.com/auth/devstorage.read_write"
11469 // ]
11470 // }
11471
11472 }