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.
5 // Code generated file. DO NOT EDIT.
7 // Package storage provides access to the Cloud Storage JSON API.
9 // This package is DEPRECATED. Use package cloud.google.com/go/storage instead.
11 // See https://developers.google.com/storage/docs/json_api/
15 // import "google.golang.org/api/storage/v1"
17 // storageService, err := storage.New(oauthHttpClient)
18 package storage // import "google.golang.org/api/storage/v1"
32 gensupport "google.golang.org/api/gensupport"
33 googleapi "google.golang.org/api/googleapi"
36 // Always reference these packages, just in case the auto-generated code
38 var _ = bytes.NewBuffer
41 var _ = json.NewDecoder
44 var _ = gensupport.MarshalJSON
45 var _ = googleapi.Version
47 var _ = strings.Replace
48 var _ = context.Canceled
50 const apiId = "storage:v1"
51 const apiName = "storage"
52 const apiVersion = "v1"
53 const basePath = "https://www.googleapis.com/storage/v1/"
55 // OAuth2 scopes used by this API.
57 // View and manage your data across Google Cloud Platform services
58 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
60 // View your data across Google Cloud Platform services
61 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
63 // Manage your data and permissions in Google Cloud Storage
64 DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
66 // View your data in Google Cloud Storage
67 DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
69 // Manage your data in Google Cloud Storage
70 DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
73 func New(client *http.Client) (*Service, error) {
75 return nil, errors.New("client is nil")
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)
91 BasePath string // API endpoint base URL
92 UserAgent string // optional additional User-Agent fragment
94 BucketAccessControls *BucketAccessControlsService
96 Buckets *BucketsService
98 Channels *ChannelsService
100 DefaultObjectAccessControls *DefaultObjectAccessControlsService
102 Notifications *NotificationsService
104 ObjectAccessControls *ObjectAccessControlsService
106 Objects *ObjectsService
108 Projects *ProjectsService
111 func (s *Service) userAgent() string {
112 if s.UserAgent == "" {
113 return googleapi.UserAgent
115 return googleapi.UserAgent + " " + s.UserAgent
118 func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
119 rs := &BucketAccessControlsService{s: s}
123 type BucketAccessControlsService struct {
127 func NewBucketsService(s *Service) *BucketsService {
128 rs := &BucketsService{s: s}
132 type BucketsService struct {
136 func NewChannelsService(s *Service) *ChannelsService {
137 rs := &ChannelsService{s: s}
141 type ChannelsService struct {
145 func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
146 rs := &DefaultObjectAccessControlsService{s: s}
150 type DefaultObjectAccessControlsService struct {
154 func NewNotificationsService(s *Service) *NotificationsService {
155 rs := &NotificationsService{s: s}
159 type NotificationsService struct {
163 func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
164 rs := &ObjectAccessControlsService{s: s}
168 type ObjectAccessControlsService struct {
172 func NewObjectsService(s *Service) *ObjectsService {
173 rs := &ObjectsService{s: s}
177 type ObjectsService struct {
181 func NewProjectsService(s *Service) *ProjectsService {
182 rs := &ProjectsService{s: s}
183 rs.ServiceAccount = NewProjectsServiceAccountService(s)
187 type ProjectsService struct {
190 ServiceAccount *ProjectsServiceAccountService
193 func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
194 rs := &ProjectsServiceAccountService{s: s}
198 type ProjectsServiceAccountService struct {
204 // Acl: Access controls on the bucket.
205 Acl []*BucketAccessControl `json:"acl,omitempty"`
207 // Billing: The bucket's billing configuration.
208 Billing *BucketBilling `json:"billing,omitempty"`
210 // Cors: The bucket's Cross-Origin Resource Sharing (CORS)
212 Cors []*BucketCors `json:"cors,omitempty"`
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"`
230 // DefaultObjectAcl: Default access controls to apply to new objects
231 // when no ACL is provided.
232 DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
234 // Encryption: Encryption configuration for a bucket.
235 Encryption *BucketEncryption `json:"encryption,omitempty"`
237 // Etag: HTTP 1.1 Entity tag for the bucket.
238 Etag string `json:"etag,omitempty"`
240 // IamConfiguration: The bucket's IAM configuration.
241 IamConfiguration *BucketIamConfiguration `json:"iamConfiguration,omitempty"`
243 // Id: The ID of the bucket. For buckets, the id and name properties are
245 Id string `json:"id,omitempty"`
247 // Kind: The kind of item this is. For buckets, this is always
249 Kind string `json:"kind,omitempty"`
251 // Labels: User-provided labels, in key/value pairs.
252 Labels map[string]string `json:"labels,omitempty"`
254 // Lifecycle: The bucket's lifecycle configuration. See lifecycle
255 // management for more information.
256 Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
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"`
263 // Logging: The bucket's logging configuration, which defines the
264 // destination bucket and optional name prefix for the current bucket's
266 Logging *BucketLogging `json:"logging,omitempty"`
268 // Metageneration: The metadata generation of this bucket.
269 Metageneration int64 `json:"metageneration,omitempty,string"`
271 // Name: The name of the bucket.
272 Name string `json:"name,omitempty"`
274 // Owner: The owner of the bucket. This is always the project team's
276 Owner *BucketOwner `json:"owner,omitempty"`
278 // ProjectNumber: The project number of the project the bucket belongs
280 ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
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"`
294 // SelfLink: The URI of this bucket.
295 SelfLink string `json:"selfLink,omitempty"`
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"`
306 // TimeCreated: The creation time of the bucket in RFC 3339 format.
307 TimeCreated string `json:"timeCreated,omitempty"`
309 // Updated: The modification time of the bucket in RFC 3339 format.
310 Updated string `json:"updated,omitempty"`
312 // Versioning: The bucket's versioning configuration.
313 Versioning *BucketVersioning `json:"versioning,omitempty"`
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"`
320 // ServerResponse contains the HTTP response code and headers from the
322 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
341 func (s *Bucket) MarshalJSON() ([]byte, error) {
344 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
347 // BucketBilling: The bucket's billing configuration.
348 type BucketBilling struct {
349 // RequesterPays: When set to true, Requester Pays is enabled for this
351 RequesterPays bool `json:"requesterPays,omitempty"`
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:"-"`
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:"-"`
370 func (s *BucketBilling) MarshalJSON() ([]byte, error) {
371 type NoMethod BucketBilling
373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
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"`
386 // Origin: The list of Origins eligible to receive CORS response
387 // headers. Note: "*" is permitted in the list of origins, and means
389 Origin []string `json:"origin,omitempty"`
391 // ResponseHeader: The list of HTTP headers other than the simple
392 // response headers to give permission for the user-agent to share
394 ResponseHeader []string `json:"responseHeader,omitempty"`
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:"-"`
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:"-"`
413 func (s *BucketCors) MarshalJSON() ([]byte, error) {
414 type NoMethod BucketCors
416 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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
424 DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
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:"-"`
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
441 NullFields []string `json:"-"`
444 func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
445 type NoMethod BucketEncryption
447 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
450 // BucketIamConfiguration: The bucket's IAM configuration.
451 type BucketIamConfiguration struct {
452 BucketPolicyOnly *BucketIamConfigurationBucketPolicyOnly `json:"bucketPolicyOnly,omitempty"`
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:"-"`
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
469 NullFields []string `json:"-"`
472 func (s *BucketIamConfiguration) MarshalJSON() ([]byte, error) {
473 type NoMethod BucketIamConfiguration
475 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
478 type BucketIamConfigurationBucketPolicyOnly struct {
479 // Enabled: If set, access checks only use bucket-level IAM policies or
481 Enabled bool `json:"enabled,omitempty"`
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
488 LockedTime string `json:"lockedTime,omitempty"`
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:"-"`
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:"-"`
507 func (s *BucketIamConfigurationBucketPolicyOnly) MarshalJSON() ([]byte, error) {
508 type NoMethod BucketIamConfigurationBucketPolicyOnly
510 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
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:"-"`
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:"-"`
537 func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
538 type NoMethod BucketLifecycle
540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
543 type BucketLifecycleRule struct {
544 // Action: The action to take.
545 Action *BucketLifecycleRuleAction `json:"action,omitempty"`
547 // Condition: The condition(s) under which the action will be taken.
548 Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
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:"-"`
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:"-"`
567 func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
568 type NoMethod BucketLifecycleRule
570 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
579 // Type: Type of the action. Currently, only Delete and SetStorageClass
581 Type string `json:"type,omitempty"`
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:"-"`
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:"-"`
600 func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
601 type NoMethod BucketLifecycleRuleAction
603 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
606 // BucketLifecycleRuleCondition: The condition(s) under which the action
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"`
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"`
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"`
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"`
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"`
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"`
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:"-"`
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:"-"`
659 func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
660 type NoMethod BucketLifecycleRuleCondition
662 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
665 // BucketLogging: The bucket's logging configuration, which defines the
666 // destination bucket and optional name prefix for the current bucket's
668 type BucketLogging struct {
669 // LogBucket: The destination bucket where the current bucket's logs
671 LogBucket string `json:"logBucket,omitempty"`
673 // LogObjectPrefix: A prefix for log object names.
674 LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
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:"-"`
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:"-"`
693 func (s *BucketLogging) MarshalJSON() ([]byte, error) {
694 type NoMethod BucketLogging
696 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
705 // EntityId: The ID for the entity.
706 EntityId string `json:"entityId,omitempty"`
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:"-"`
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:"-"`
725 func (s *BucketOwner) MarshalJSON() ([]byte, error) {
726 type NoMethod BucketOwner
728 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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
745 EffectiveTime string `json:"effectiveTime,omitempty"`
747 // IsLocked: Once locked, an object retention policy cannot be modified.
748 IsLocked bool `json:"isLocked,omitempty"`
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
755 RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"`
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:"-"`
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:"-"`
774 func (s *BucketRetentionPolicy) MarshalJSON() ([]byte, error) {
775 type NoMethod BucketRetentionPolicy
777 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
780 // BucketVersioning: The bucket's versioning configuration.
781 type BucketVersioning struct {
782 // Enabled: While set to true, versioning is fully enabled for this
784 Enabled bool `json:"enabled,omitempty"`
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:"-"`
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:"-"`
803 func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
804 type NoMethod BucketVersioning
806 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
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
823 NotFoundPage string `json:"notFoundPage,omitempty"`
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:"-"`
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
840 NullFields []string `json:"-"`
843 func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
844 type NoMethod BucketWebsite
846 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
849 // BucketAccessControl: An access-control entry.
850 type BucketAccessControl struct {
851 // Bucket: The name of the bucket.
852 Bucket string `json:"bucket,omitempty"`
854 // Domain: The domain associated with the entity, if any.
855 Domain string `json:"domain,omitempty"`
857 // Email: The email address associated with the entity, if any.
858 Email string `json:"email,omitempty"`
860 // Entity: The entity holding the permission, in one of the following
867 // - project-team-projectId
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"`
877 // EntityId: The ID for the entity, if any.
878 EntityId string `json:"entityId,omitempty"`
880 // Etag: HTTP 1.1 Entity tag for the access-control entry.
881 Etag string `json:"etag,omitempty"`
883 // Id: The ID of the access-control entry.
884 Id string `json:"id,omitempty"`
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"`
890 // ProjectTeam: The project team associated with the entity, if any.
891 ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
893 // Role: The access permission for the entity.
894 Role string `json:"role,omitempty"`
896 // SelfLink: The link to this access-control entry.
897 SelfLink string `json:"selfLink,omitempty"`
899 // ServerResponse contains the HTTP response code and headers from the
901 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
920 func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
921 type NoMethod BucketAccessControl
923 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
926 // BucketAccessControlProjectTeam: The project team associated with the
928 type BucketAccessControlProjectTeam struct {
929 // ProjectNumber: The project number.
930 ProjectNumber string `json:"projectNumber,omitempty"`
933 Team string `json:"team,omitempty"`
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:"-"`
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:"-"`
952 func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
953 type NoMethod BucketAccessControlProjectTeam
955 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
958 // BucketAccessControls: An access-control list.
959 type BucketAccessControls struct {
960 // Items: The list of items.
961 Items []*BucketAccessControl `json:"items,omitempty"`
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"`
967 // ServerResponse contains the HTTP response code and headers from the
969 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
988 func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
989 type NoMethod BucketAccessControls
991 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
994 // Buckets: A list of buckets.
995 type Buckets struct {
996 // Items: The list of items.
997 Items []*Bucket `json:"items,omitempty"`
999 // Kind: The kind of item this is. For lists of buckets, this is always
1001 Kind string `json:"kind,omitempty"`
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"`
1008 // ServerResponse contains the HTTP response code and headers from the
1010 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1029 func (s *Buckets) MarshalJSON() ([]byte, error) {
1030 type NoMethod Buckets
1032 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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
1039 Address string `json:"address,omitempty"`
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"`
1045 // Id: A UUID or similar unique string that identifies this channel.
1046 Id string `json:"id,omitempty"`
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"`
1052 // Params: Additional parameters controlling delivery channel behavior.
1054 Params map[string]string `json:"params,omitempty"`
1056 // Payload: A Boolean value to indicate whether payload is wanted.
1058 Payload bool `json:"payload,omitempty"`
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"`
1064 // ResourceUri: A version-specific identifier for the watched resource.
1065 ResourceUri string `json:"resourceUri,omitempty"`
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"`
1071 // Type: The type of delivery mechanism used for this channel.
1072 Type string `json:"type,omitempty"`
1074 // ServerResponse contains the HTTP response code and headers from the
1076 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1095 func (s *Channel) MarshalJSON() ([]byte, error) {
1096 type NoMethod Channel
1098 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1101 // ComposeRequest: A Compose request.
1102 type ComposeRequest struct {
1103 // Destination: Properties of the resulting object.
1104 Destination *Object `json:"destination,omitempty"`
1106 // Kind: The kind of item this is.
1107 Kind string `json:"kind,omitempty"`
1109 // SourceObjects: The list of source objects that will be concatenated
1110 // into a single object.
1111 SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
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:"-"`
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:"-"`
1130 func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
1131 type NoMethod ComposeRequest
1133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1136 type ComposeRequestSourceObjects struct {
1137 // Generation: The generation of this object to use as the source.
1138 Generation int64 `json:"generation,omitempty,string"`
1140 // Name: The source object's name. All source objects must reside in the
1142 Name string `json:"name,omitempty"`
1144 // ObjectPreconditions: Conditions that must be met for this operation
1146 ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
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:"-"`
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:"-"`
1165 func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
1166 type NoMethod ComposeRequestSourceObjects
1168 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
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:"-"`
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
1195 NullFields []string `json:"-"`
1198 func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
1199 type NoMethod ComposeRequestSourceObjectsObjectPreconditions
1201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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
1209 CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
1211 // Etag: HTTP 1.1 Entity tag for this subscription notification.
1212 Etag string `json:"etag,omitempty"`
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"`
1218 // Id: The ID of the notification.
1219 Id string `json:"id,omitempty"`
1221 // Kind: The kind of item this is. For notifications, this is always
1222 // storage#notification.
1223 Kind string `json:"kind,omitempty"`
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"`
1229 // PayloadFormat: The desired content of the Payload.
1230 PayloadFormat string `json:"payload_format,omitempty"`
1232 // SelfLink: The canonical URL of this notification.
1233 SelfLink string `json:"selfLink,omitempty"`
1235 // Topic: The Cloud PubSub topic to which this subscription publishes.
1237 // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
1239 Topic string `json:"topic,omitempty"`
1241 // ServerResponse contains the HTTP response code and headers from the
1243 googleapi.ServerResponse `json:"-"`
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:"-"`
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
1260 NullFields []string `json:"-"`
1263 func (s *Notification) MarshalJSON() ([]byte, error) {
1264 type NoMethod Notification
1266 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1269 // Notifications: A list of notification subscriptions.
1270 type Notifications struct {
1271 // Items: The list of items.
1272 Items []*Notification `json:"items,omitempty"`
1274 // Kind: The kind of item this is. For lists of notifications, this is
1275 // always storage#notifications.
1276 Kind string `json:"kind,omitempty"`
1278 // ServerResponse contains the HTTP response code and headers from the
1280 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1299 func (s *Notifications) MarshalJSON() ([]byte, error) {
1300 type NoMethod Notifications
1302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1305 // Object: An object.
1306 type Object struct {
1307 // Acl: Access controls on the object.
1308 Acl []*ObjectAccessControl `json:"acl,omitempty"`
1310 // Bucket: The name of the bucket containing this object.
1311 Bucket string `json:"bucket,omitempty"`
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"`
1318 // ComponentCount: Number of underlying components that make up this
1319 // object. Components are accumulated by compose operations.
1320 ComponentCount int64 `json:"componentCount,omitempty"`
1322 // ContentDisposition: Content-Disposition of the object data.
1323 ContentDisposition string `json:"contentDisposition,omitempty"`
1325 // ContentEncoding: Content-Encoding of the object data.
1326 ContentEncoding string `json:"contentEncoding,omitempty"`
1328 // ContentLanguage: Content-Language of the object data.
1329 ContentLanguage string `json:"contentLanguage,omitempty"`
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"`
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
1339 Crc32c string `json:"crc32c,omitempty"`
1341 // CustomerEncryption: Metadata of customer-supplied encryption key, if
1342 // the object is encrypted by such a key.
1343 CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
1345 // Etag: HTTP 1.1 Entity tag for the object.
1346 Etag string `json:"etag,omitempty"`
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
1361 EventBasedHold bool `json:"eventBasedHold,omitempty"`
1363 // Generation: The content generation of this object. Used for object
1365 Generation int64 `json:"generation,omitempty,string"`
1367 // Id: The ID of the object, including the bucket name, object name, and
1368 // generation number.
1369 Id string `json:"id,omitempty"`
1371 // Kind: The kind of item this is. For objects, this is always
1373 Kind string `json:"kind,omitempty"`
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"`
1379 // Md5Hash: MD5 hash of the data; encoded using base64. For more
1380 // information about using the MD5 hash, see Hashes and ETags: Best
1382 Md5Hash string `json:"md5Hash,omitempty"`
1384 // MediaLink: Media download link.
1385 MediaLink string `json:"mediaLink,omitempty"`
1387 // Metadata: User-provided metadata, in key/value pairs.
1388 Metadata map[string]string `json:"metadata,omitempty"`
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"`
1396 // Name: The name of the object. Required if not specified by URL
1398 Name string `json:"name,omitempty"`
1400 // Owner: The owner of the object. This will always be the uploader of
1402 Owner *ObjectOwner `json:"owner,omitempty"`
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"`
1413 // SelfLink: The link to this object.
1414 SelfLink string `json:"selfLink,omitempty"`
1416 // Size: Content-Length of the data in bytes.
1417 Size uint64 `json:"size,omitempty,string"`
1419 // StorageClass: Storage class of the object.
1420 StorageClass string `json:"storageClass,omitempty"`
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
1429 TemporaryHold bool `json:"temporaryHold,omitempty"`
1431 // TimeCreated: The creation time of the object in RFC 3339 format.
1432 TimeCreated string `json:"timeCreated,omitempty"`
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
1437 TimeDeleted string `json:"timeDeleted,omitempty"`
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"`
1444 // Updated: The modification time of the object metadata in RFC 3339
1446 Updated string `json:"updated,omitempty"`
1448 // ServerResponse contains the HTTP response code and headers from the
1450 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1469 func (s *Object) MarshalJSON() ([]byte, error) {
1470 type NoMethod Object
1472 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
1481 // KeySha256: SHA256 hash value of the encryption key.
1482 KeySha256 string `json:"keySha256,omitempty"`
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:"-"`
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
1499 NullFields []string `json:"-"`
1502 func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
1503 type NoMethod ObjectCustomerEncryption
1505 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
1514 // EntityId: The ID for the entity.
1515 EntityId string `json:"entityId,omitempty"`
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:"-"`
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:"-"`
1534 func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
1535 type NoMethod ObjectOwner
1537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1540 // ObjectAccessControl: An access-control entry.
1541 type ObjectAccessControl struct {
1542 // Bucket: The name of the bucket.
1543 Bucket string `json:"bucket,omitempty"`
1545 // Domain: The domain associated with the entity, if any.
1546 Domain string `json:"domain,omitempty"`
1548 // Email: The email address associated with the entity, if any.
1549 Email string `json:"email,omitempty"`
1551 // Entity: The entity holding the permission, in one of the following
1558 // - project-team-projectId
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"`
1568 // EntityId: The ID for the entity, if any.
1569 EntityId string `json:"entityId,omitempty"`
1571 // Etag: HTTP 1.1 Entity tag for the access-control entry.
1572 Etag string `json:"etag,omitempty"`
1574 // Generation: The content generation of the object, if applied to an
1576 Generation int64 `json:"generation,omitempty,string"`
1578 // Id: The ID of the access-control entry.
1579 Id string `json:"id,omitempty"`
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"`
1585 // Object: The name of the object, if applied to an object.
1586 Object string `json:"object,omitempty"`
1588 // ProjectTeam: The project team associated with the entity, if any.
1589 ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
1591 // Role: The access permission for the entity.
1592 Role string `json:"role,omitempty"`
1594 // SelfLink: The link to this access-control entry.
1595 SelfLink string `json:"selfLink,omitempty"`
1597 // ServerResponse contains the HTTP response code and headers from the
1599 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1618 func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
1619 type NoMethod ObjectAccessControl
1621 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1624 // ObjectAccessControlProjectTeam: The project team associated with the
1626 type ObjectAccessControlProjectTeam struct {
1627 // ProjectNumber: The project number.
1628 ProjectNumber string `json:"projectNumber,omitempty"`
1631 Team string `json:"team,omitempty"`
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:"-"`
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:"-"`
1650 func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
1651 type NoMethod ObjectAccessControlProjectTeam
1653 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1656 // ObjectAccessControls: An access-control list.
1657 type ObjectAccessControls struct {
1658 // Items: The list of items.
1659 Items []*ObjectAccessControl `json:"items,omitempty"`
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"`
1665 // ServerResponse contains the HTTP response code and headers from the
1667 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1686 func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
1687 type NoMethod ObjectAccessControls
1689 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1692 // Objects: A list of objects.
1693 type Objects struct {
1694 // Items: The list of items.
1695 Items []*Object `json:"items,omitempty"`
1697 // Kind: The kind of item this is. For lists of objects, this is always
1699 Kind string `json:"kind,omitempty"`
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"`
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"`
1710 // ServerResponse contains the HTTP response code and headers from the
1712 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1731 func (s *Objects) MarshalJSON() ([]byte, error) {
1732 type NoMethod Objects
1734 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
1743 // Etag: HTTP 1.1 Entity tag for the policy.
1744 Etag string `json:"etag,omitempty"`
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"`
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"`
1759 // ServerResponse contains the HTTP response code and headers from the
1761 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1780 func (s *Policy) MarshalJSON() ([]byte, error) {
1781 type NoMethod Policy
1783 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1786 type PolicyBindings struct {
1787 Condition interface{} `json:"condition,omitempty"`
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
1796 // - user:emailid — An email address that represents a specific
1797 // account. For example, user:alice@gmail.com or user:joe@example.com.
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"`
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
1823 // - roles/storage.objectViewer — Read-Only access to Google Cloud
1825 // - roles/storage.objectCreator — Access to create objects in Google
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
1832 // - roles/storage.legacyObjectOwner — Read/write access to existing
1833 // objects without listing. Equivalent to an ACL entry on an object with
1835 // - roles/storage.legacyBucketReader — Read access to buckets with
1836 // object listing. Equivalent to an ACL entry on a bucket with the
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"`
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:"-"`
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:"-"`
1863 func (s *PolicyBindings) MarshalJSON() ([]byte, error) {
1864 type NoMethod PolicyBindings
1866 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
1875 // Kind: The kind of item this is.
1876 Kind string `json:"kind,omitempty"`
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"`
1882 // Resource: A resource containing the metadata for the copied-to
1883 // object. This property is present in the response only when copying
1885 Resource *Object `json:"resource,omitempty"`
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"`
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"`
1897 // ServerResponse contains the HTTP response code and headers from the
1899 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1918 func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
1919 type NoMethod RewriteResponse
1921 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1924 // ServiceAccount: A subscription to receive Google PubSub
1926 type ServiceAccount struct {
1927 // EmailAddress: The ID of the notification.
1928 EmailAddress string `json:"email_address,omitempty"`
1930 // Kind: The kind of item this is. For notifications, this is always
1931 // storage#notification.
1932 Kind string `json:"kind,omitempty"`
1934 // ServerResponse contains the HTTP response code and headers from the
1936 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
1955 func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
1956 type NoMethod ServiceAccount
1958 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
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"`
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:
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"`
1987 // ServerResponse contains the HTTP response code and headers from the
1989 googleapi.ServerResponse `json:"-"`
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:"-"`
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:"-"`
2008 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
2009 type NoMethod TestIamPermissionsResponse
2011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2014 // method id "storage.bucketAccessControls.delete":
2016 type BucketAccessControlsDeleteCall struct {
2020 urlParams_ gensupport.URLParams
2021 ctx_ context.Context
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)}
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)
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))
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
2052 func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
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)
2066 func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
2067 reqHeaders := make(http.Header)
2068 for k, v := range c.header_ {
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)
2081 req.Header = reqHeaders
2082 googleapi.Expand(req.URL, map[string]string{
2086 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
2096 defer googleapi.CloseBody(res)
2097 if err := googleapi.CheckResponse(res); err != nil {
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": [
2111 // "description": "Name of a bucket.",
2112 // "location": "path",
2113 // "required": true,
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,
2123 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2124 // "location": "query",
2128 // "path": "b/{bucket}/acl/{entity}",
2130 // "https://www.googleapis.com/auth/cloud-platform",
2131 // "https://www.googleapis.com/auth/devstorage.full_control"
2137 // method id "storage.bucketAccessControls.get":
2139 type BucketAccessControlsGetCall struct {
2143 urlParams_ gensupport.URLParams
2145 ctx_ context.Context
2149 // Get: Returns the ACL entry for the specified entity on the specified
2151 func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
2152 c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
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)
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))
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
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
2186 func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
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)
2200 func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
2201 reqHeaders := make(http.Header)
2202 for k, v := range c.header_ {
2205 reqHeaders.Set("User-Agent", c.s.userAgent())
2206 if c.ifNoneMatch_ != "" {
2207 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
2218 req.Header = reqHeaders
2219 googleapi.Expand(req.URL, map[string]string{
2223 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
2240 return nil, &googleapi.Error{
2241 Code: res.StatusCode,
2248 defer googleapi.CloseBody(res)
2249 if err := googleapi.CheckResponse(res); err != nil {
2252 ret := &BucketAccessControl{
2253 ServerResponse: googleapi.ServerResponse{
2255 HTTPStatusCode: res.StatusCode,
2259 if err := gensupport.DecodeResponse(target, res); err != nil {
2264 // "description": "Returns the ACL entry for the specified entity on the specified bucket.",
2265 // "httpMethod": "GET",
2266 // "id": "storage.bucketAccessControls.get",
2267 // "parameterOrder": [
2273 // "description": "Name of a bucket.",
2274 // "location": "path",
2275 // "required": true,
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,
2285 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2286 // "location": "query",
2290 // "path": "b/{bucket}/acl/{entity}",
2292 // "$ref": "BucketAccessControl"
2295 // "https://www.googleapis.com/auth/cloud-platform",
2296 // "https://www.googleapis.com/auth/devstorage.full_control"
2302 // method id "storage.bucketAccessControls.insert":
2304 type BucketAccessControlsInsertCall struct {
2307 bucketaccesscontrol *BucketAccessControl
2308 urlParams_ gensupport.URLParams
2309 ctx_ context.Context
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)}
2317 c.bucketaccesscontrol = bucketaccesscontrol
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)
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))
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
2339 func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
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)
2353 func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
2354 reqHeaders := make(http.Header)
2355 for k, v := range c.header_ {
2358 reqHeaders.Set("User-Agent", c.s.userAgent())
2359 var body io.Reader = nil
2360 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
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)
2373 req.Header = reqHeaders
2374 googleapi.Expand(req.URL, map[string]string{
2377 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
2394 return nil, &googleapi.Error{
2395 Code: res.StatusCode,
2402 defer googleapi.CloseBody(res)
2403 if err := googleapi.CheckResponse(res); err != nil {
2406 ret := &BucketAccessControl{
2407 ServerResponse: googleapi.ServerResponse{
2409 HTTPStatusCode: res.StatusCode,
2413 if err := gensupport.DecodeResponse(target, res); err != nil {
2418 // "description": "Creates a new ACL entry on the specified bucket.",
2419 // "httpMethod": "POST",
2420 // "id": "storage.bucketAccessControls.insert",
2421 // "parameterOrder": [
2426 // "description": "Name of a bucket.",
2427 // "location": "path",
2428 // "required": true,
2432 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2433 // "location": "query",
2437 // "path": "b/{bucket}/acl",
2439 // "$ref": "BucketAccessControl"
2442 // "$ref": "BucketAccessControl"
2445 // "https://www.googleapis.com/auth/cloud-platform",
2446 // "https://www.googleapis.com/auth/devstorage.full_control"
2452 // method id "storage.bucketAccessControls.list":
2454 type BucketAccessControlsListCall struct {
2457 urlParams_ gensupport.URLParams
2459 ctx_ context.Context
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)}
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)
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))
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
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
2498 func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
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)
2512 func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
2513 reqHeaders := make(http.Header)
2514 for k, v := range c.header_ {
2517 reqHeaders.Set("User-Agent", c.s.userAgent())
2518 if c.ifNoneMatch_ != "" {
2519 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
2530 req.Header = reqHeaders
2531 googleapi.Expand(req.URL, map[string]string{
2534 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
2551 return nil, &googleapi.Error{
2552 Code: res.StatusCode,
2559 defer googleapi.CloseBody(res)
2560 if err := googleapi.CheckResponse(res); err != nil {
2563 ret := &BucketAccessControls{
2564 ServerResponse: googleapi.ServerResponse{
2566 HTTPStatusCode: res.StatusCode,
2570 if err := gensupport.DecodeResponse(target, res); err != nil {
2575 // "description": "Retrieves ACL entries on the specified bucket.",
2576 // "httpMethod": "GET",
2577 // "id": "storage.bucketAccessControls.list",
2578 // "parameterOrder": [
2583 // "description": "Name of a bucket.",
2584 // "location": "path",
2585 // "required": true,
2589 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2590 // "location": "query",
2594 // "path": "b/{bucket}/acl",
2596 // "$ref": "BucketAccessControls"
2599 // "https://www.googleapis.com/auth/cloud-platform",
2600 // "https://www.googleapis.com/auth/devstorage.full_control"
2606 // method id "storage.bucketAccessControls.patch":
2608 type BucketAccessControlsPatchCall struct {
2612 bucketaccesscontrol *BucketAccessControl
2613 urlParams_ gensupport.URLParams
2614 ctx_ context.Context
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)}
2623 c.bucketaccesscontrol = bucketaccesscontrol
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)
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))
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
2645 func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
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)
2659 func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
2660 reqHeaders := make(http.Header)
2661 for k, v := range c.header_ {
2664 reqHeaders.Set("User-Agent", c.s.userAgent())
2665 var body io.Reader = nil
2666 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
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)
2679 req.Header = reqHeaders
2680 googleapi.Expand(req.URL, map[string]string{
2684 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
2701 return nil, &googleapi.Error{
2702 Code: res.StatusCode,
2709 defer googleapi.CloseBody(res)
2710 if err := googleapi.CheckResponse(res); err != nil {
2713 ret := &BucketAccessControl{
2714 ServerResponse: googleapi.ServerResponse{
2716 HTTPStatusCode: res.StatusCode,
2720 if err := gensupport.DecodeResponse(target, res); err != nil {
2725 // "description": "Patches an ACL entry on the specified bucket.",
2726 // "httpMethod": "PATCH",
2727 // "id": "storage.bucketAccessControls.patch",
2728 // "parameterOrder": [
2734 // "description": "Name of a bucket.",
2735 // "location": "path",
2736 // "required": true,
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,
2746 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2747 // "location": "query",
2751 // "path": "b/{bucket}/acl/{entity}",
2753 // "$ref": "BucketAccessControl"
2756 // "$ref": "BucketAccessControl"
2759 // "https://www.googleapis.com/auth/cloud-platform",
2760 // "https://www.googleapis.com/auth/devstorage.full_control"
2766 // method id "storage.bucketAccessControls.update":
2768 type BucketAccessControlsUpdateCall struct {
2772 bucketaccesscontrol *BucketAccessControl
2773 urlParams_ gensupport.URLParams
2774 ctx_ context.Context
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)}
2783 c.bucketaccesscontrol = bucketaccesscontrol
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)
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))
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
2805 func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
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)
2819 func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
2820 reqHeaders := make(http.Header)
2821 for k, v := range c.header_ {
2824 reqHeaders.Set("User-Agent", c.s.userAgent())
2825 var body io.Reader = nil
2826 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
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)
2839 req.Header = reqHeaders
2840 googleapi.Expand(req.URL, map[string]string{
2844 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
2861 return nil, &googleapi.Error{
2862 Code: res.StatusCode,
2869 defer googleapi.CloseBody(res)
2870 if err := googleapi.CheckResponse(res); err != nil {
2873 ret := &BucketAccessControl{
2874 ServerResponse: googleapi.ServerResponse{
2876 HTTPStatusCode: res.StatusCode,
2880 if err := gensupport.DecodeResponse(target, res); err != nil {
2885 // "description": "Updates an ACL entry on the specified bucket.",
2886 // "httpMethod": "PUT",
2887 // "id": "storage.bucketAccessControls.update",
2888 // "parameterOrder": [
2894 // "description": "Name of a bucket.",
2895 // "location": "path",
2896 // "required": true,
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,
2906 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
2907 // "location": "query",
2911 // "path": "b/{bucket}/acl/{entity}",
2913 // "$ref": "BucketAccessControl"
2916 // "$ref": "BucketAccessControl"
2919 // "https://www.googleapis.com/auth/cloud-platform",
2920 // "https://www.googleapis.com/auth/devstorage.full_control"
2926 // method id "storage.buckets.delete":
2928 type BucketsDeleteCall struct {
2931 urlParams_ gensupport.URLParams
2932 ctx_ context.Context
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)}
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))
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))
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)
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))
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
2977 func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
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)
2991 func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
2992 reqHeaders := make(http.Header)
2993 for k, v := range c.header_ {
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)
3006 req.Header = reqHeaders
3007 googleapi.Expand(req.URL, map[string]string{
3010 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
3020 defer googleapi.CloseBody(res)
3021 if err := googleapi.CheckResponse(res); err != nil {
3026 // "description": "Permanently deletes an empty bucket.",
3027 // "httpMethod": "DELETE",
3028 // "id": "storage.buckets.delete",
3029 // "parameterOrder": [
3034 // "description": "Name of a bucket.",
3035 // "location": "path",
3036 // "required": true,
3039 // "ifMetagenerationMatch": {
3040 // "description": "If set, only deletes the bucket if its metageneration matches this value.",
3041 // "format": "int64",
3042 // "location": "query",
3045 // "ifMetagenerationNotMatch": {
3046 // "description": "If set, only deletes the bucket if its metageneration does not match this value.",
3047 // "format": "int64",
3048 // "location": "query",
3052 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3053 // "location": "query",
3057 // "path": "b/{bucket}",
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"
3067 // method id "storage.buckets.get":
3069 type BucketsGetCall struct {
3072 urlParams_ gensupport.URLParams
3074 ctx_ context.Context
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)}
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
3089 func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
3090 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
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))
3103 // Projection sets the optional parameter "projection": Set of
3104 // properties to return. Defaults to noAcl.
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)
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)
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))
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
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
3142 func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
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)
3156 func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
3157 reqHeaders := make(http.Header)
3158 for k, v := range c.header_ {
3161 reqHeaders.Set("User-Agent", c.s.userAgent())
3162 if c.ifNoneMatch_ != "" {
3163 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
3174 req.Header = reqHeaders
3175 googleapi.Expand(req.URL, map[string]string{
3178 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
3195 return nil, &googleapi.Error{
3196 Code: res.StatusCode,
3203 defer googleapi.CloseBody(res)
3204 if err := googleapi.CheckResponse(res); err != nil {
3208 ServerResponse: googleapi.ServerResponse{
3210 HTTPStatusCode: res.StatusCode,
3214 if err := gensupport.DecodeResponse(target, res); err != nil {
3219 // "description": "Returns metadata for the specified bucket.",
3220 // "httpMethod": "GET",
3221 // "id": "storage.buckets.get",
3222 // "parameterOrder": [
3227 // "description": "Name of a bucket.",
3228 // "location": "path",
3229 // "required": true,
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",
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",
3245 // "description": "Set of properties to return. Defaults to noAcl.",
3250 // "enumDescriptions": [
3251 // "Include all properties.",
3252 // "Omit owner, acl and defaultObjectAcl properties."
3254 // "location": "query",
3258 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3259 // "location": "query",
3263 // "path": "b/{bucket}",
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"
3278 // method id "storage.buckets.getIamPolicy":
3280 type BucketsGetIamPolicyCall struct {
3283 urlParams_ gensupport.URLParams
3285 ctx_ context.Context
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)}
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)
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))
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
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
3324 func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
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)
3338 func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3339 reqHeaders := make(http.Header)
3340 for k, v := range c.header_ {
3343 reqHeaders.Set("User-Agent", c.s.userAgent())
3344 if c.ifNoneMatch_ != "" {
3345 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
3356 req.Header = reqHeaders
3357 googleapi.Expand(req.URL, map[string]string{
3360 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
3377 return nil, &googleapi.Error{
3378 Code: res.StatusCode,
3385 defer googleapi.CloseBody(res)
3386 if err := googleapi.CheckResponse(res); err != nil {
3390 ServerResponse: googleapi.ServerResponse{
3392 HTTPStatusCode: res.StatusCode,
3396 if err := gensupport.DecodeResponse(target, res); err != nil {
3401 // "description": "Returns an IAM policy for the specified bucket.",
3402 // "httpMethod": "GET",
3403 // "id": "storage.buckets.getIamPolicy",
3404 // "parameterOrder": [
3409 // "description": "Name of a bucket.",
3410 // "location": "path",
3411 // "required": true,
3415 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
3416 // "location": "query",
3420 // "path": "b/{bucket}/iam",
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"
3435 // method id "storage.buckets.insert":
3437 type BucketsInsertCall struct {
3440 urlParams_ gensupport.URLParams
3441 ctx_ context.Context
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)
3453 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
3454 // predefined set of access controls to this bucket.
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
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)
3471 // PredefinedDefaultObjectAcl sets the optional parameter
3472 // "predefinedDefaultObjectAcl": Apply a predefined set of default
3473 // object access controls to this bucket.
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
3487 func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
3488 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
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
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)
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)
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))
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
3523 func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
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)
3537 func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
3538 reqHeaders := make(http.Header)
3539 for k, v := range c.header_ {
3542 reqHeaders.Set("User-Agent", c.s.userAgent())
3543 var body io.Reader = nil
3544 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
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)
3557 req.Header = reqHeaders
3558 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
3575 return nil, &googleapi.Error{
3576 Code: res.StatusCode,
3583 defer googleapi.CloseBody(res)
3584 if err := googleapi.CheckResponse(res); err != nil {
3588 ServerResponse: googleapi.ServerResponse{
3590 HTTPStatusCode: res.StatusCode,
3594 if err := gensupport.DecodeResponse(target, res); err != nil {
3599 // "description": "Creates a new bucket.",
3600 // "httpMethod": "POST",
3601 // "id": "storage.buckets.insert",
3602 // "parameterOrder": [
3606 // "predefinedAcl": {
3607 // "description": "Apply a predefined set of access controls to this bucket.",
3609 // "authenticatedRead",
3611 // "projectPrivate",
3613 // "publicReadWrite"
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."
3622 // "location": "query",
3625 // "predefinedDefaultObjectAcl": {
3626 // "description": "Apply a predefined set of default object access controls to this bucket.",
3628 // "authenticatedRead",
3629 // "bucketOwnerFullControl",
3630 // "bucketOwnerRead",
3632 // "projectPrivate",
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."
3643 // "location": "query",
3647 // "description": "A valid API project identifier.",
3648 // "location": "query",
3649 // "required": true,
3653 // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
3658 // "enumDescriptions": [
3659 // "Include all properties.",
3660 // "Omit owner, acl and defaultObjectAcl properties."
3662 // "location": "query",
3666 // "description": "The project to be billed for this request.",
3667 // "location": "query",
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"
3687 // method id "storage.buckets.list":
3689 type BucketsListCall struct {
3691 urlParams_ gensupport.URLParams
3693 ctx_ context.Context
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)
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))
3712 // PageToken sets the optional parameter "pageToken": A
3713 // previously-returned page token representing part of the larger set of
3715 func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
3716 c.urlParams_.Set("pageToken", pageToken)
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)
3727 // Projection sets the optional parameter "projection": Set of
3728 // properties to return. Defaults to noAcl.
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)
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)
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))
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
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
3766 func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
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)
3780 func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
3781 reqHeaders := make(http.Header)
3782 for k, v := range c.header_ {
3785 reqHeaders.Set("User-Agent", c.s.userAgent())
3786 if c.ifNoneMatch_ != "" {
3787 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
3798 req.Header = reqHeaders
3799 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
3816 return nil, &googleapi.Error{
3817 Code: res.StatusCode,
3824 defer googleapi.CloseBody(res)
3825 if err := googleapi.CheckResponse(res); err != nil {
3829 ServerResponse: googleapi.ServerResponse{
3831 HTTPStatusCode: res.StatusCode,
3835 if err := gensupport.DecodeResponse(target, res); err != nil {
3840 // "description": "Retrieves a list of buckets for a given project.",
3841 // "httpMethod": "GET",
3842 // "id": "storage.buckets.list",
3843 // "parameterOrder": [
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",
3853 // "type": "integer"
3856 // "description": "A previously-returned page token representing part of the larger set of results to view.",
3857 // "location": "query",
3861 // "description": "Filter results to buckets whose names begin with this prefix.",
3862 // "location": "query",
3866 // "description": "A valid API project identifier.",
3867 // "location": "query",
3868 // "required": true,
3872 // "description": "Set of properties to return. Defaults to noAcl.",
3877 // "enumDescriptions": [
3878 // "Include all properties.",
3879 // "Omit owner, acl and defaultObjectAcl properties."
3881 // "location": "query",
3885 // "description": "The project to be billed for this request.",
3886 // "location": "query",
3892 // "$ref": "Buckets"
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"
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 {
3910 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3916 if err := f(x); err != nil {
3919 if x.NextPageToken == "" {
3922 c.PageToken(x.NextPageToken)
3926 // method id "storage.buckets.lockRetentionPolicy":
3928 type BucketsLockRetentionPolicyCall struct {
3931 urlParams_ gensupport.URLParams
3932 ctx_ context.Context
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)}
3940 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
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)
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))
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
3962 func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall {
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)
3976 func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
3977 reqHeaders := make(http.Header)
3978 for k, v := range c.header_ {
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)
3991 req.Header = reqHeaders
3992 googleapi.Expand(req.URL, map[string]string{
3995 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
4012 return nil, &googleapi.Error{
4013 Code: res.StatusCode,
4020 defer googleapi.CloseBody(res)
4021 if err := googleapi.CheckResponse(res); err != nil {
4025 ServerResponse: googleapi.ServerResponse{
4027 HTTPStatusCode: res.StatusCode,
4031 if err := gensupport.DecodeResponse(target, res); err != nil {
4036 // "description": "Locks retention policy on a bucket.",
4037 // "httpMethod": "POST",
4038 // "id": "storage.buckets.lockRetentionPolicy",
4039 // "parameterOrder": [
4041 // "ifMetagenerationMatch"
4045 // "description": "Name of a bucket.",
4046 // "location": "path",
4047 // "required": true,
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,
4058 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4059 // "location": "query",
4063 // "path": "b/{bucket}/lockRetentionPolicy",
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"
4076 // method id "storage.buckets.patch":
4078 type BucketsPatchCall struct {
4082 urlParams_ gensupport.URLParams
4083 ctx_ context.Context
4087 // Patch: Patches a bucket. Changes to the bucket will be readable
4088 // immediately after writing, but configuration changes may take time to
4090 func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
4091 c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
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
4101 func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
4102 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
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))
4115 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4116 // predefined set of access controls to this bucket.
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
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)
4133 // PredefinedDefaultObjectAcl sets the optional parameter
4134 // "predefinedDefaultObjectAcl": Apply a predefined set of default
4135 // object access controls to this bucket.
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
4149 func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
4150 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4154 // Projection sets the optional parameter "projection": Set of
4155 // properties to return. Defaults to full.
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)
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)
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))
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
4183 func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
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)
4197 func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
4198 reqHeaders := make(http.Header)
4199 for k, v := range c.header_ {
4202 reqHeaders.Set("User-Agent", c.s.userAgent())
4203 var body io.Reader = nil
4204 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
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)
4217 req.Header = reqHeaders
4218 googleapi.Expand(req.URL, map[string]string{
4221 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
4238 return nil, &googleapi.Error{
4239 Code: res.StatusCode,
4246 defer googleapi.CloseBody(res)
4247 if err := googleapi.CheckResponse(res); err != nil {
4251 ServerResponse: googleapi.ServerResponse{
4253 HTTPStatusCode: res.StatusCode,
4257 if err := gensupport.DecodeResponse(target, res); err != nil {
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": [
4270 // "description": "Name of a bucket.",
4271 // "location": "path",
4272 // "required": true,
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",
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",
4287 // "predefinedAcl": {
4288 // "description": "Apply a predefined set of access controls to this bucket.",
4290 // "authenticatedRead",
4292 // "projectPrivate",
4294 // "publicReadWrite"
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."
4303 // "location": "query",
4306 // "predefinedDefaultObjectAcl": {
4307 // "description": "Apply a predefined set of default object access controls to this bucket.",
4309 // "authenticatedRead",
4310 // "bucketOwnerFullControl",
4311 // "bucketOwnerRead",
4313 // "projectPrivate",
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."
4324 // "location": "query",
4328 // "description": "Set of properties to return. Defaults to full.",
4333 // "enumDescriptions": [
4334 // "Include all properties.",
4335 // "Omit owner, acl and defaultObjectAcl properties."
4337 // "location": "query",
4341 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4342 // "location": "query",
4346 // "path": "b/{bucket}",
4354 // "https://www.googleapis.com/auth/cloud-platform",
4355 // "https://www.googleapis.com/auth/devstorage.full_control"
4361 // method id "storage.buckets.setIamPolicy":
4363 type BucketsSetIamPolicyCall struct {
4367 urlParams_ gensupport.URLParams
4368 ctx_ context.Context
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)}
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)
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))
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
4398 func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
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)
4412 func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4413 reqHeaders := make(http.Header)
4414 for k, v := range c.header_ {
4417 reqHeaders.Set("User-Agent", c.s.userAgent())
4418 var body io.Reader = nil
4419 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
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)
4432 req.Header = reqHeaders
4433 googleapi.Expand(req.URL, map[string]string{
4436 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
4453 return nil, &googleapi.Error{
4454 Code: res.StatusCode,
4461 defer googleapi.CloseBody(res)
4462 if err := googleapi.CheckResponse(res); err != nil {
4466 ServerResponse: googleapi.ServerResponse{
4468 HTTPStatusCode: res.StatusCode,
4472 if err := gensupport.DecodeResponse(target, res); err != nil {
4477 // "description": "Updates an IAM policy for the specified bucket.",
4478 // "httpMethod": "PUT",
4479 // "id": "storage.buckets.setIamPolicy",
4480 // "parameterOrder": [
4485 // "description": "Name of a bucket.",
4486 // "location": "path",
4487 // "required": true,
4491 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4492 // "location": "query",
4496 // "path": "b/{bucket}/iam",
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"
4512 // method id "storage.buckets.testIamPermissions":
4514 type BucketsTestIamPermissionsCall struct {
4517 urlParams_ gensupport.URLParams
4519 ctx_ context.Context
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)}
4528 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
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)
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))
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
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
4560 func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
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)
4574 func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4575 reqHeaders := make(http.Header)
4576 for k, v := range c.header_ {
4579 reqHeaders.Set("User-Agent", c.s.userAgent())
4580 if c.ifNoneMatch_ != "" {
4581 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
4592 req.Header = reqHeaders
4593 googleapi.Expand(req.URL, map[string]string{
4596 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
4613 return nil, &googleapi.Error{
4614 Code: res.StatusCode,
4621 defer googleapi.CloseBody(res)
4622 if err := googleapi.CheckResponse(res); err != nil {
4625 ret := &TestIamPermissionsResponse{
4626 ServerResponse: googleapi.ServerResponse{
4628 HTTPStatusCode: res.StatusCode,
4632 if err := gensupport.DecodeResponse(target, res); err != nil {
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": [
4646 // "description": "Name of a bucket.",
4647 // "location": "path",
4648 // "required": true,
4652 // "description": "Permissions to test.",
4653 // "location": "query",
4654 // "repeated": true,
4655 // "required": true,
4659 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4660 // "location": "query",
4664 // "path": "b/{bucket}/iam/testPermissions",
4666 // "$ref": "TestIamPermissionsResponse"
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"
4679 // method id "storage.buckets.update":
4681 type BucketsUpdateCall struct {
4685 urlParams_ gensupport.URLParams
4686 ctx_ context.Context
4690 // Update: Updates a bucket. Changes to the bucket will be readable
4691 // immediately after writing, but configuration changes may take time to
4693 func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
4694 c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
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
4704 func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
4705 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
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))
4718 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
4719 // predefined set of access controls to this bucket.
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
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)
4736 // PredefinedDefaultObjectAcl sets the optional parameter
4737 // "predefinedDefaultObjectAcl": Apply a predefined set of default
4738 // object access controls to this bucket.
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
4752 func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
4753 c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
4757 // Projection sets the optional parameter "projection": Set of
4758 // properties to return. Defaults to full.
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)
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)
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))
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
4786 func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
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)
4800 func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
4801 reqHeaders := make(http.Header)
4802 for k, v := range c.header_ {
4805 reqHeaders.Set("User-Agent", c.s.userAgent())
4806 var body io.Reader = nil
4807 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
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)
4820 req.Header = reqHeaders
4821 googleapi.Expand(req.URL, map[string]string{
4824 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
4841 return nil, &googleapi.Error{
4842 Code: res.StatusCode,
4849 defer googleapi.CloseBody(res)
4850 if err := googleapi.CheckResponse(res); err != nil {
4854 ServerResponse: googleapi.ServerResponse{
4856 HTTPStatusCode: res.StatusCode,
4860 if err := gensupport.DecodeResponse(target, res); err != nil {
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": [
4873 // "description": "Name of a bucket.",
4874 // "location": "path",
4875 // "required": true,
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",
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",
4890 // "predefinedAcl": {
4891 // "description": "Apply a predefined set of access controls to this bucket.",
4893 // "authenticatedRead",
4895 // "projectPrivate",
4897 // "publicReadWrite"
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."
4906 // "location": "query",
4909 // "predefinedDefaultObjectAcl": {
4910 // "description": "Apply a predefined set of default object access controls to this bucket.",
4912 // "authenticatedRead",
4913 // "bucketOwnerFullControl",
4914 // "bucketOwnerRead",
4916 // "projectPrivate",
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."
4927 // "location": "query",
4931 // "description": "Set of properties to return. Defaults to full.",
4936 // "enumDescriptions": [
4937 // "Include all properties.",
4938 // "Omit owner, acl and defaultObjectAcl properties."
4940 // "location": "query",
4944 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
4945 // "location": "query",
4949 // "path": "b/{bucket}",
4957 // "https://www.googleapis.com/auth/cloud-platform",
4958 // "https://www.googleapis.com/auth/devstorage.full_control"
4964 // method id "storage.channels.stop":
4966 type ChannelsStopCall struct {
4969 urlParams_ gensupport.URLParams
4970 ctx_ context.Context
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)}
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))
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
4992 func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
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)
5006 func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
5007 reqHeaders := make(http.Header)
5008 for k, v := range c.header_ {
5011 reqHeaders.Set("User-Agent", c.s.userAgent())
5012 var body io.Reader = nil
5013 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
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)
5026 req.Header = reqHeaders
5027 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
5037 defer googleapi.CloseBody(res)
5038 if err := googleapi.CheckResponse(res); err != nil {
5043 // "description": "Stop watching resources through this channel",
5044 // "httpMethod": "POST",
5045 // "id": "storage.channels.stop",
5046 // "path": "channels/stop",
5048 // "$ref": "Channel",
5049 // "parameterName": "resource"
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"
5062 // method id "storage.defaultObjectAccessControls.delete":
5064 type DefaultObjectAccessControlsDeleteCall struct {
5068 urlParams_ gensupport.URLParams
5069 ctx_ context.Context
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)}
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)
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))
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
5100 func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
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)
5114 func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
5115 reqHeaders := make(http.Header)
5116 for k, v := range c.header_ {
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)
5129 req.Header = reqHeaders
5130 googleapi.Expand(req.URL, map[string]string{
5134 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
5144 defer googleapi.CloseBody(res)
5145 if err := googleapi.CheckResponse(res); err != nil {
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": [
5159 // "description": "Name of a bucket.",
5160 // "location": "path",
5161 // "required": true,
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,
5171 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5172 // "location": "query",
5176 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5178 // "https://www.googleapis.com/auth/cloud-platform",
5179 // "https://www.googleapis.com/auth/devstorage.full_control"
5185 // method id "storage.defaultObjectAccessControls.get":
5187 type DefaultObjectAccessControlsGetCall struct {
5191 urlParams_ gensupport.URLParams
5193 ctx_ context.Context
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)}
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)
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))
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
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
5234 func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
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)
5248 func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
5249 reqHeaders := make(http.Header)
5250 for k, v := range c.header_ {
5253 reqHeaders.Set("User-Agent", c.s.userAgent())
5254 if c.ifNoneMatch_ != "" {
5255 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
5266 req.Header = reqHeaders
5267 googleapi.Expand(req.URL, map[string]string{
5271 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
5288 return nil, &googleapi.Error{
5289 Code: res.StatusCode,
5296 defer googleapi.CloseBody(res)
5297 if err := googleapi.CheckResponse(res); err != nil {
5300 ret := &ObjectAccessControl{
5301 ServerResponse: googleapi.ServerResponse{
5303 HTTPStatusCode: res.StatusCode,
5307 if err := gensupport.DecodeResponse(target, res); err != nil {
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": [
5321 // "description": "Name of a bucket.",
5322 // "location": "path",
5323 // "required": true,
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,
5333 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5334 // "location": "query",
5338 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5340 // "$ref": "ObjectAccessControl"
5343 // "https://www.googleapis.com/auth/cloud-platform",
5344 // "https://www.googleapis.com/auth/devstorage.full_control"
5350 // method id "storage.defaultObjectAccessControls.insert":
5352 type DefaultObjectAccessControlsInsertCall struct {
5355 objectaccesscontrol *ObjectAccessControl
5356 urlParams_ gensupport.URLParams
5357 ctx_ context.Context
5361 // Insert: Creates a new default object ACL entry on the specified
5363 func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
5364 c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5366 c.objectaccesscontrol = objectaccesscontrol
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)
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))
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
5388 func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
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)
5402 func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
5403 reqHeaders := make(http.Header)
5404 for k, v := range c.header_ {
5407 reqHeaders.Set("User-Agent", c.s.userAgent())
5408 var body io.Reader = nil
5409 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
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)
5422 req.Header = reqHeaders
5423 googleapi.Expand(req.URL, map[string]string{
5426 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
5443 return nil, &googleapi.Error{
5444 Code: res.StatusCode,
5451 defer googleapi.CloseBody(res)
5452 if err := googleapi.CheckResponse(res); err != nil {
5455 ret := &ObjectAccessControl{
5456 ServerResponse: googleapi.ServerResponse{
5458 HTTPStatusCode: res.StatusCode,
5462 if err := gensupport.DecodeResponse(target, res); err != nil {
5467 // "description": "Creates a new default object ACL entry on the specified bucket.",
5468 // "httpMethod": "POST",
5469 // "id": "storage.defaultObjectAccessControls.insert",
5470 // "parameterOrder": [
5475 // "description": "Name of a bucket.",
5476 // "location": "path",
5477 // "required": true,
5481 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5482 // "location": "query",
5486 // "path": "b/{bucket}/defaultObjectAcl",
5488 // "$ref": "ObjectAccessControl"
5491 // "$ref": "ObjectAccessControl"
5494 // "https://www.googleapis.com/auth/cloud-platform",
5495 // "https://www.googleapis.com/auth/devstorage.full_control"
5501 // method id "storage.defaultObjectAccessControls.list":
5503 type DefaultObjectAccessControlsListCall struct {
5506 urlParams_ gensupport.URLParams
5508 ctx_ context.Context
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)}
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))
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
5531 func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
5532 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
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)
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))
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
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
5564 func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
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)
5578 func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
5579 reqHeaders := make(http.Header)
5580 for k, v := range c.header_ {
5583 reqHeaders.Set("User-Agent", c.s.userAgent())
5584 if c.ifNoneMatch_ != "" {
5585 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
5596 req.Header = reqHeaders
5597 googleapi.Expand(req.URL, map[string]string{
5600 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
5617 return nil, &googleapi.Error{
5618 Code: res.StatusCode,
5625 defer googleapi.CloseBody(res)
5626 if err := googleapi.CheckResponse(res); err != nil {
5629 ret := &ObjectAccessControls{
5630 ServerResponse: googleapi.ServerResponse{
5632 HTTPStatusCode: res.StatusCode,
5636 if err := gensupport.DecodeResponse(target, res); err != nil {
5641 // "description": "Retrieves default object ACL entries on the specified bucket.",
5642 // "httpMethod": "GET",
5643 // "id": "storage.defaultObjectAccessControls.list",
5644 // "parameterOrder": [
5649 // "description": "Name of a bucket.",
5650 // "location": "path",
5651 // "required": true,
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",
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",
5667 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5668 // "location": "query",
5672 // "path": "b/{bucket}/defaultObjectAcl",
5674 // "$ref": "ObjectAccessControls"
5677 // "https://www.googleapis.com/auth/cloud-platform",
5678 // "https://www.googleapis.com/auth/devstorage.full_control"
5684 // method id "storage.defaultObjectAccessControls.patch":
5686 type DefaultObjectAccessControlsPatchCall struct {
5690 objectaccesscontrol *ObjectAccessControl
5691 urlParams_ gensupport.URLParams
5692 ctx_ context.Context
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)}
5701 c.objectaccesscontrol = objectaccesscontrol
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)
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))
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
5723 func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
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)
5737 func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
5738 reqHeaders := make(http.Header)
5739 for k, v := range c.header_ {
5742 reqHeaders.Set("User-Agent", c.s.userAgent())
5743 var body io.Reader = nil
5744 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
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)
5757 req.Header = reqHeaders
5758 googleapi.Expand(req.URL, map[string]string{
5762 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
5779 return nil, &googleapi.Error{
5780 Code: res.StatusCode,
5787 defer googleapi.CloseBody(res)
5788 if err := googleapi.CheckResponse(res); err != nil {
5791 ret := &ObjectAccessControl{
5792 ServerResponse: googleapi.ServerResponse{
5794 HTTPStatusCode: res.StatusCode,
5798 if err := gensupport.DecodeResponse(target, res); err != nil {
5803 // "description": "Patches a default object ACL entry on the specified bucket.",
5804 // "httpMethod": "PATCH",
5805 // "id": "storage.defaultObjectAccessControls.patch",
5806 // "parameterOrder": [
5812 // "description": "Name of a bucket.",
5813 // "location": "path",
5814 // "required": true,
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,
5824 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5825 // "location": "query",
5829 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5831 // "$ref": "ObjectAccessControl"
5834 // "$ref": "ObjectAccessControl"
5837 // "https://www.googleapis.com/auth/cloud-platform",
5838 // "https://www.googleapis.com/auth/devstorage.full_control"
5844 // method id "storage.defaultObjectAccessControls.update":
5846 type DefaultObjectAccessControlsUpdateCall struct {
5850 objectaccesscontrol *ObjectAccessControl
5851 urlParams_ gensupport.URLParams
5852 ctx_ context.Context
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)}
5861 c.objectaccesscontrol = objectaccesscontrol
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)
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))
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
5883 func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
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)
5897 func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
5898 reqHeaders := make(http.Header)
5899 for k, v := range c.header_ {
5902 reqHeaders.Set("User-Agent", c.s.userAgent())
5903 var body io.Reader = nil
5904 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
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)
5917 req.Header = reqHeaders
5918 googleapi.Expand(req.URL, map[string]string{
5922 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
5939 return nil, &googleapi.Error{
5940 Code: res.StatusCode,
5947 defer googleapi.CloseBody(res)
5948 if err := googleapi.CheckResponse(res); err != nil {
5951 ret := &ObjectAccessControl{
5952 ServerResponse: googleapi.ServerResponse{
5954 HTTPStatusCode: res.StatusCode,
5958 if err := gensupport.DecodeResponse(target, res); err != nil {
5963 // "description": "Updates a default object ACL entry on the specified bucket.",
5964 // "httpMethod": "PUT",
5965 // "id": "storage.defaultObjectAccessControls.update",
5966 // "parameterOrder": [
5972 // "description": "Name of a bucket.",
5973 // "location": "path",
5974 // "required": true,
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,
5984 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
5985 // "location": "query",
5989 // "path": "b/{bucket}/defaultObjectAcl/{entity}",
5991 // "$ref": "ObjectAccessControl"
5994 // "$ref": "ObjectAccessControl"
5997 // "https://www.googleapis.com/auth/cloud-platform",
5998 // "https://www.googleapis.com/auth/devstorage.full_control"
6004 // method id "storage.notifications.delete":
6006 type NotificationsDeleteCall struct {
6010 urlParams_ gensupport.URLParams
6011 ctx_ context.Context
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)}
6019 c.notification = notification
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)
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))
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
6041 func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
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)
6055 func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
6056 reqHeaders := make(http.Header)
6057 for k, v := range c.header_ {
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)
6070 req.Header = reqHeaders
6071 googleapi.Expand(req.URL, map[string]string{
6073 "notification": c.notification,
6075 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
6085 defer googleapi.CloseBody(res)
6086 if err := googleapi.CheckResponse(res); err != nil {
6091 // "description": "Permanently deletes a notification subscription.",
6092 // "httpMethod": "DELETE",
6093 // "id": "storage.notifications.delete",
6094 // "parameterOrder": [
6100 // "description": "The parent bucket of the notification.",
6101 // "location": "path",
6102 // "required": true,
6105 // "notification": {
6106 // "description": "ID of the notification to delete.",
6107 // "location": "path",
6108 // "required": true,
6112 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6113 // "location": "query",
6117 // "path": "b/{bucket}/notificationConfigs/{notification}",
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"
6127 // method id "storage.notifications.get":
6129 type NotificationsGetCall struct {
6133 urlParams_ gensupport.URLParams
6135 ctx_ context.Context
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)}
6143 c.notification = notification
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)
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))
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
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
6175 func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
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)
6189 func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
6190 reqHeaders := make(http.Header)
6191 for k, v := range c.header_ {
6194 reqHeaders.Set("User-Agent", c.s.userAgent())
6195 if c.ifNoneMatch_ != "" {
6196 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
6207 req.Header = reqHeaders
6208 googleapi.Expand(req.URL, map[string]string{
6210 "notification": c.notification,
6212 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
6229 return nil, &googleapi.Error{
6230 Code: res.StatusCode,
6237 defer googleapi.CloseBody(res)
6238 if err := googleapi.CheckResponse(res); err != nil {
6241 ret := &Notification{
6242 ServerResponse: googleapi.ServerResponse{
6244 HTTPStatusCode: res.StatusCode,
6248 if err := gensupport.DecodeResponse(target, res); err != nil {
6253 // "description": "View a notification configuration.",
6254 // "httpMethod": "GET",
6255 // "id": "storage.notifications.get",
6256 // "parameterOrder": [
6262 // "description": "The parent bucket of the notification.",
6263 // "location": "path",
6264 // "required": true,
6267 // "notification": {
6268 // "description": "Notification ID",
6269 // "location": "path",
6270 // "required": true,
6274 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6275 // "location": "query",
6279 // "path": "b/{bucket}/notificationConfigs/{notification}",
6281 // "$ref": "Notification"
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"
6294 // method id "storage.notifications.insert":
6296 type NotificationsInsertCall struct {
6299 notification *Notification
6300 urlParams_ gensupport.URLParams
6301 ctx_ context.Context
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)}
6309 c.notification = notification
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)
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))
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
6331 func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
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)
6345 func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
6346 reqHeaders := make(http.Header)
6347 for k, v := range c.header_ {
6350 reqHeaders.Set("User-Agent", c.s.userAgent())
6351 var body io.Reader = nil
6352 body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
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)
6365 req.Header = reqHeaders
6366 googleapi.Expand(req.URL, map[string]string{
6369 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
6386 return nil, &googleapi.Error{
6387 Code: res.StatusCode,
6394 defer googleapi.CloseBody(res)
6395 if err := googleapi.CheckResponse(res); err != nil {
6398 ret := &Notification{
6399 ServerResponse: googleapi.ServerResponse{
6401 HTTPStatusCode: res.StatusCode,
6405 if err := gensupport.DecodeResponse(target, res); err != nil {
6410 // "description": "Creates a notification subscription for a given bucket.",
6411 // "httpMethod": "POST",
6412 // "id": "storage.notifications.insert",
6413 // "parameterOrder": [
6418 // "description": "The parent bucket of the notification.",
6419 // "location": "path",
6420 // "required": true,
6424 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6425 // "location": "query",
6429 // "path": "b/{bucket}/notificationConfigs",
6431 // "$ref": "Notification"
6434 // "$ref": "Notification"
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"
6445 // method id "storage.notifications.list":
6447 type NotificationsListCall struct {
6450 urlParams_ gensupport.URLParams
6452 ctx_ context.Context
6456 // List: Retrieves a list of notification subscriptions for a given
6458 func (r *NotificationsService) List(bucket string) *NotificationsListCall {
6459 c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
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)
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))
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
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
6492 func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
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)
6506 func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
6507 reqHeaders := make(http.Header)
6508 for k, v := range c.header_ {
6511 reqHeaders.Set("User-Agent", c.s.userAgent())
6512 if c.ifNoneMatch_ != "" {
6513 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
6524 req.Header = reqHeaders
6525 googleapi.Expand(req.URL, map[string]string{
6528 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
6545 return nil, &googleapi.Error{
6546 Code: res.StatusCode,
6553 defer googleapi.CloseBody(res)
6554 if err := googleapi.CheckResponse(res); err != nil {
6557 ret := &Notifications{
6558 ServerResponse: googleapi.ServerResponse{
6560 HTTPStatusCode: res.StatusCode,
6564 if err := gensupport.DecodeResponse(target, res); err != nil {
6569 // "description": "Retrieves a list of notification subscriptions for a given bucket.",
6570 // "httpMethod": "GET",
6571 // "id": "storage.notifications.list",
6572 // "parameterOrder": [
6577 // "description": "Name of a Google Cloud Storage bucket.",
6578 // "location": "path",
6579 // "required": true,
6583 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6584 // "location": "query",
6588 // "path": "b/{bucket}/notificationConfigs",
6590 // "$ref": "Notifications"
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"
6603 // method id "storage.objectAccessControls.delete":
6605 type ObjectAccessControlsDeleteCall struct {
6610 urlParams_ gensupport.URLParams
6611 ctx_ context.Context
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)}
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))
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)
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))
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
6651 func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
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)
6665 func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
6666 reqHeaders := make(http.Header)
6667 for k, v := range c.header_ {
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)
6680 req.Header = reqHeaders
6681 googleapi.Expand(req.URL, map[string]string{
6686 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
6696 defer googleapi.CloseBody(res)
6697 if err := googleapi.CheckResponse(res); err != nil {
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": [
6712 // "description": "Name of a bucket.",
6713 // "location": "path",
6714 // "required": true,
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,
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",
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,
6736 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6737 // "location": "query",
6741 // "path": "b/{bucket}/o/{object}/acl/{entity}",
6743 // "https://www.googleapis.com/auth/cloud-platform",
6744 // "https://www.googleapis.com/auth/devstorage.full_control"
6750 // method id "storage.objectAccessControls.get":
6752 type ObjectAccessControlsGetCall struct {
6757 urlParams_ gensupport.URLParams
6759 ctx_ context.Context
6763 // Get: Returns the ACL entry for the specified entity on the specified
6765 func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
6766 c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
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))
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)
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))
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
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
6809 func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
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)
6823 func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
6824 reqHeaders := make(http.Header)
6825 for k, v := range c.header_ {
6828 reqHeaders.Set("User-Agent", c.s.userAgent())
6829 if c.ifNoneMatch_ != "" {
6830 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
6841 req.Header = reqHeaders
6842 googleapi.Expand(req.URL, map[string]string{
6847 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
6864 return nil, &googleapi.Error{
6865 Code: res.StatusCode,
6872 defer googleapi.CloseBody(res)
6873 if err := googleapi.CheckResponse(res); err != nil {
6876 ret := &ObjectAccessControl{
6877 ServerResponse: googleapi.ServerResponse{
6879 HTTPStatusCode: res.StatusCode,
6883 if err := gensupport.DecodeResponse(target, res); err != nil {
6888 // "description": "Returns the ACL entry for the specified entity on the specified object.",
6889 // "httpMethod": "GET",
6890 // "id": "storage.objectAccessControls.get",
6891 // "parameterOrder": [
6898 // "description": "Name of a bucket.",
6899 // "location": "path",
6900 // "required": true,
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,
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",
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,
6922 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
6923 // "location": "query",
6927 // "path": "b/{bucket}/o/{object}/acl/{entity}",
6929 // "$ref": "ObjectAccessControl"
6932 // "https://www.googleapis.com/auth/cloud-platform",
6933 // "https://www.googleapis.com/auth/devstorage.full_control"
6939 // method id "storage.objectAccessControls.insert":
6941 type ObjectAccessControlsInsertCall struct {
6945 objectaccesscontrol *ObjectAccessControl
6946 urlParams_ gensupport.URLParams
6947 ctx_ context.Context
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)}
6956 c.objectaccesscontrol = objectaccesscontrol
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))
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)
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))
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
6986 func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
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)
7000 func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
7001 reqHeaders := make(http.Header)
7002 for k, v := range c.header_ {
7005 reqHeaders.Set("User-Agent", c.s.userAgent())
7006 var body io.Reader = nil
7007 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
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)
7020 req.Header = reqHeaders
7021 googleapi.Expand(req.URL, map[string]string{
7025 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
7042 return nil, &googleapi.Error{
7043 Code: res.StatusCode,
7050 defer googleapi.CloseBody(res)
7051 if err := googleapi.CheckResponse(res); err != nil {
7054 ret := &ObjectAccessControl{
7055 ServerResponse: googleapi.ServerResponse{
7057 HTTPStatusCode: res.StatusCode,
7061 if err := gensupport.DecodeResponse(target, res); err != nil {
7066 // "description": "Creates a new ACL entry on the specified object.",
7067 // "httpMethod": "POST",
7068 // "id": "storage.objectAccessControls.insert",
7069 // "parameterOrder": [
7075 // "description": "Name of a bucket.",
7076 // "location": "path",
7077 // "required": true,
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",
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,
7093 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7094 // "location": "query",
7098 // "path": "b/{bucket}/o/{object}/acl",
7100 // "$ref": "ObjectAccessControl"
7103 // "$ref": "ObjectAccessControl"
7106 // "https://www.googleapis.com/auth/cloud-platform",
7107 // "https://www.googleapis.com/auth/devstorage.full_control"
7113 // method id "storage.objectAccessControls.list":
7115 type ObjectAccessControlsListCall struct {
7119 urlParams_ gensupport.URLParams
7121 ctx_ context.Context
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)}
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))
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)
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))
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
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
7169 func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
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)
7183 func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
7184 reqHeaders := make(http.Header)
7185 for k, v := range c.header_ {
7188 reqHeaders.Set("User-Agent", c.s.userAgent())
7189 if c.ifNoneMatch_ != "" {
7190 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
7201 req.Header = reqHeaders
7202 googleapi.Expand(req.URL, map[string]string{
7206 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
7223 return nil, &googleapi.Error{
7224 Code: res.StatusCode,
7231 defer googleapi.CloseBody(res)
7232 if err := googleapi.CheckResponse(res); err != nil {
7235 ret := &ObjectAccessControls{
7236 ServerResponse: googleapi.ServerResponse{
7238 HTTPStatusCode: res.StatusCode,
7242 if err := gensupport.DecodeResponse(target, res); err != nil {
7247 // "description": "Retrieves ACL entries on the specified object.",
7248 // "httpMethod": "GET",
7249 // "id": "storage.objectAccessControls.list",
7250 // "parameterOrder": [
7256 // "description": "Name of a bucket.",
7257 // "location": "path",
7258 // "required": true,
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",
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,
7274 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7275 // "location": "query",
7279 // "path": "b/{bucket}/o/{object}/acl",
7281 // "$ref": "ObjectAccessControls"
7284 // "https://www.googleapis.com/auth/cloud-platform",
7285 // "https://www.googleapis.com/auth/devstorage.full_control"
7291 // method id "storage.objectAccessControls.patch":
7293 type ObjectAccessControlsPatchCall struct {
7298 objectaccesscontrol *ObjectAccessControl
7299 urlParams_ gensupport.URLParams
7300 ctx_ context.Context
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)}
7310 c.objectaccesscontrol = objectaccesscontrol
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))
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)
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))
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
7340 func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
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)
7354 func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
7355 reqHeaders := make(http.Header)
7356 for k, v := range c.header_ {
7359 reqHeaders.Set("User-Agent", c.s.userAgent())
7360 var body io.Reader = nil
7361 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
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)
7374 req.Header = reqHeaders
7375 googleapi.Expand(req.URL, map[string]string{
7380 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
7397 return nil, &googleapi.Error{
7398 Code: res.StatusCode,
7405 defer googleapi.CloseBody(res)
7406 if err := googleapi.CheckResponse(res); err != nil {
7409 ret := &ObjectAccessControl{
7410 ServerResponse: googleapi.ServerResponse{
7412 HTTPStatusCode: res.StatusCode,
7416 if err := gensupport.DecodeResponse(target, res); err != nil {
7421 // "description": "Patches an ACL entry on the specified object.",
7422 // "httpMethod": "PATCH",
7423 // "id": "storage.objectAccessControls.patch",
7424 // "parameterOrder": [
7431 // "description": "Name of a bucket.",
7432 // "location": "path",
7433 // "required": true,
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,
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",
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,
7455 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7456 // "location": "query",
7460 // "path": "b/{bucket}/o/{object}/acl/{entity}",
7462 // "$ref": "ObjectAccessControl"
7465 // "$ref": "ObjectAccessControl"
7468 // "https://www.googleapis.com/auth/cloud-platform",
7469 // "https://www.googleapis.com/auth/devstorage.full_control"
7475 // method id "storage.objectAccessControls.update":
7477 type ObjectAccessControlsUpdateCall struct {
7482 objectaccesscontrol *ObjectAccessControl
7483 urlParams_ gensupport.URLParams
7484 ctx_ context.Context
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)}
7494 c.objectaccesscontrol = objectaccesscontrol
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))
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)
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))
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
7524 func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
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)
7538 func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
7539 reqHeaders := make(http.Header)
7540 for k, v := range c.header_ {
7543 reqHeaders.Set("User-Agent", c.s.userAgent())
7544 var body io.Reader = nil
7545 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
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)
7558 req.Header = reqHeaders
7559 googleapi.Expand(req.URL, map[string]string{
7564 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
7581 return nil, &googleapi.Error{
7582 Code: res.StatusCode,
7589 defer googleapi.CloseBody(res)
7590 if err := googleapi.CheckResponse(res); err != nil {
7593 ret := &ObjectAccessControl{
7594 ServerResponse: googleapi.ServerResponse{
7596 HTTPStatusCode: res.StatusCode,
7600 if err := gensupport.DecodeResponse(target, res); err != nil {
7605 // "description": "Updates an ACL entry on the specified object.",
7606 // "httpMethod": "PUT",
7607 // "id": "storage.objectAccessControls.update",
7608 // "parameterOrder": [
7615 // "description": "Name of a bucket.",
7616 // "location": "path",
7617 // "required": true,
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,
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",
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,
7639 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7640 // "location": "query",
7644 // "path": "b/{bucket}/o/{object}/acl/{entity}",
7646 // "$ref": "ObjectAccessControl"
7649 // "$ref": "ObjectAccessControl"
7652 // "https://www.googleapis.com/auth/cloud-platform",
7653 // "https://www.googleapis.com/auth/devstorage.full_control"
7659 // method id "storage.objects.compose":
7661 type ObjectsComposeCall struct {
7663 destinationBucket string
7664 destinationObject string
7665 composerequest *ComposeRequest
7666 urlParams_ gensupport.URLParams
7667 ctx_ context.Context
7671 // Compose: Concatenates a list of existing objects into a new object in
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
7681 // DestinationPredefinedAcl sets the optional parameter
7682 // "destinationPredefinedAcl": Apply a predefined set of access controls
7683 // to the destination object.
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
7697 func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
7698 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
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))
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))
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)
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)
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))
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
7747 func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
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)
7761 func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
7762 reqHeaders := make(http.Header)
7763 for k, v := range c.header_ {
7766 reqHeaders.Set("User-Agent", c.s.userAgent())
7767 var body io.Reader = nil
7768 body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
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)
7781 req.Header = reqHeaders
7782 googleapi.Expand(req.URL, map[string]string{
7783 "destinationBucket": c.destinationBucket,
7784 "destinationObject": c.destinationObject,
7786 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
7803 return nil, &googleapi.Error{
7804 Code: res.StatusCode,
7811 defer googleapi.CloseBody(res)
7812 if err := googleapi.CheckResponse(res); err != nil {
7816 ServerResponse: googleapi.ServerResponse{
7818 HTTPStatusCode: res.StatusCode,
7822 if err := gensupport.DecodeResponse(target, res); err != nil {
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"
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,
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,
7847 // "destinationPredefinedAcl": {
7848 // "description": "Apply a predefined set of access controls to the destination object.",
7850 // "authenticatedRead",
7851 // "bucketOwnerFullControl",
7852 // "bucketOwnerRead",
7854 // "projectPrivate",
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."
7865 // "location": "query",
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",
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",
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",
7886 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
7887 // "location": "query",
7891 // "path": "b/{destinationBucket}/o/{destinationObject}/compose",
7893 // "$ref": "ComposeRequest"
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"
7907 // method id "storage.objects.copy":
7909 type ObjectsCopyCall struct {
7913 destinationBucket string
7914 destinationObject string
7916 urlParams_ gensupport.URLParams
7917 ctx_ context.Context
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
7933 // DestinationPredefinedAcl sets the optional parameter
7934 // "destinationPredefinedAcl": Apply a predefined set of access controls
7935 // to the destination object.
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
7949 func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
7950 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
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))
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
7969 func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
7970 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
7974 // IfMetagenerationMatch sets the optional parameter
7975 // "ifMetagenerationMatch": Makes the operation conditional on whether
7976 // the destination object's current metageneration matches the given
7978 func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
7979 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
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))
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))
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
8004 func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
8005 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
8009 // IfSourceMetagenerationMatch sets the optional parameter
8010 // "ifSourceMetagenerationMatch": Makes the operation conditional on
8011 // whether the source object's current metageneration matches the given
8013 func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
8014 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
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
8022 func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
8023 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
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.
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)
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))
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)
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))
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
8065 func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
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)
8079 func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
8080 reqHeaders := make(http.Header)
8081 for k, v := range c.header_ {
8084 reqHeaders.Set("User-Agent", c.s.userAgent())
8085 var body io.Reader = nil
8086 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
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)
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,
8106 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
8123 return nil, &googleapi.Error{
8124 Code: res.StatusCode,
8131 defer googleapi.CloseBody(res)
8132 if err := googleapi.CheckResponse(res); err != nil {
8136 ServerResponse: googleapi.ServerResponse{
8138 HTTPStatusCode: res.StatusCode,
8142 if err := gensupport.DecodeResponse(target, res); err != nil {
8147 // "description": "Copies a source object to a destination object. Optionally overrides metadata.",
8148 // "httpMethod": "POST",
8149 // "id": "storage.objects.copy",
8150 // "parameterOrder": [
8153 // "destinationBucket",
8154 // "destinationObject"
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,
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,
8169 // "destinationPredefinedAcl": {
8170 // "description": "Apply a predefined set of access controls to the destination object.",
8172 // "authenticatedRead",
8173 // "bucketOwnerFullControl",
8174 // "bucketOwnerRead",
8176 // "projectPrivate",
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."
8187 // "location": "query",
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",
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",
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",
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",
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",
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",
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",
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",
8239 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
8244 // "enumDescriptions": [
8245 // "Include all properties.",
8246 // "Omit the owner, acl property."
8248 // "location": "query",
8251 // "sourceBucket": {
8252 // "description": "Name of the bucket in which to find the source object.",
8253 // "location": "path",
8254 // "required": true,
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",
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,
8270 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8271 // "location": "query",
8275 // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
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"
8291 // method id "storage.objects.delete":
8293 type ObjectsDeleteCall struct {
8297 urlParams_ gensupport.URLParams
8298 ctx_ context.Context
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)}
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))
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))
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))
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))
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
8351 func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
8352 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
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)
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))
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
8374 func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
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)
8388 func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
8389 reqHeaders := make(http.Header)
8390 for k, v := range c.header_ {
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)
8403 req.Header = reqHeaders
8404 googleapi.Expand(req.URL, map[string]string{
8408 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
8418 defer googleapi.CloseBody(res)
8419 if err := googleapi.CheckResponse(res); err != nil {
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": [
8433 // "description": "Name of the bucket in which the object resides.",
8434 // "location": "path",
8435 // "required": true,
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",
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",
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",
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",
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",
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,
8475 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8476 // "location": "query",
8480 // "path": "b/{bucket}/o/{object}",
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"
8490 // method id "storage.objects.get":
8492 type ObjectsGetCall struct {
8496 urlParams_ gensupport.URLParams
8498 ctx_ context.Context
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)}
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))
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))
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))
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))
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
8549 func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
8550 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
8554 // Projection sets the optional parameter "projection": Set of
8555 // properties to return. Defaults to noAcl.
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)
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)
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))
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
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 {
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)
8607 func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
8608 reqHeaders := make(http.Header)
8609 for k, v := range c.header_ {
8612 reqHeaders.Set("User-Agent", c.s.userAgent())
8613 if c.ifNoneMatch_ != "" {
8614 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
8625 req.Header = reqHeaders
8626 googleapi.Expand(req.URL, map[string]string{
8630 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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")
8642 if err := googleapi.CheckMediaResponse(res); err != nil {
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
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 {
8663 return nil, &googleapi.Error{
8664 Code: res.StatusCode,
8671 defer googleapi.CloseBody(res)
8672 if err := googleapi.CheckResponse(res); err != nil {
8676 ServerResponse: googleapi.ServerResponse{
8678 HTTPStatusCode: res.StatusCode,
8682 if err := gensupport.DecodeResponse(target, res); err != nil {
8687 // "description": "Retrieves an object or its metadata.",
8688 // "httpMethod": "GET",
8689 // "id": "storage.objects.get",
8690 // "parameterOrder": [
8696 // "description": "Name of the bucket in which the object resides.",
8697 // "location": "path",
8698 // "required": true,
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",
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",
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",
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",
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",
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,
8738 // "description": "Set of properties to return. Defaults to noAcl.",
8743 // "enumDescriptions": [
8744 // "Include all properties.",
8745 // "Omit the owner, acl property."
8747 // "location": "query",
8751 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8752 // "location": "query",
8756 // "path": "b/{bucket}/o/{object}",
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"
8767 // "supportsMediaDownload": true,
8768 // "useMediaDownloadService": true
8773 // method id "storage.objects.getIamPolicy":
8775 type ObjectsGetIamPolicyCall struct {
8779 urlParams_ gensupport.URLParams
8781 ctx_ context.Context
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)}
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))
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)
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))
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
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
8829 func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
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)
8843 func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
8844 reqHeaders := make(http.Header)
8845 for k, v := range c.header_ {
8848 reqHeaders.Set("User-Agent", c.s.userAgent())
8849 if c.ifNoneMatch_ != "" {
8850 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
8861 req.Header = reqHeaders
8862 googleapi.Expand(req.URL, map[string]string{
8866 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
8883 return nil, &googleapi.Error{
8884 Code: res.StatusCode,
8891 defer googleapi.CloseBody(res)
8892 if err := googleapi.CheckResponse(res); err != nil {
8896 ServerResponse: googleapi.ServerResponse{
8898 HTTPStatusCode: res.StatusCode,
8902 if err := gensupport.DecodeResponse(target, res); err != nil {
8907 // "description": "Returns an IAM policy for the specified object.",
8908 // "httpMethod": "GET",
8909 // "id": "storage.objects.getIamPolicy",
8910 // "parameterOrder": [
8916 // "description": "Name of the bucket in which the object resides.",
8917 // "location": "path",
8918 // "required": true,
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",
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,
8934 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
8935 // "location": "query",
8939 // "path": "b/{bucket}/o/{object}/iam",
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"
8954 // method id "storage.objects.insert":
8956 type ObjectsInsertCall struct {
8960 urlParams_ gensupport.URLParams
8961 mediaInfo_ *gensupport.MediaInfo
8962 ctx_ context.Context
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)}
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)
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))
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))
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))
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
9016 func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
9017 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
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)
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)
9040 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9041 // predefined set of access controls to this object.
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
9055 func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
9056 c.urlParams_.Set("predefinedAcl", predefinedAcl)
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.
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)
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)
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
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...)
9091 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9095 // ResumableMedia specifies the media to upload in chunks and can be
9096 // canceled with ctx.
9098 // Deprecated: use Media instead.
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 {
9106 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
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)
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))
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
9130 // This context will supersede any context previously provided to the
9131 // ResumableMedia method.
9132 func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
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)
9146 func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
9147 reqHeaders := make(http.Header)
9148 for k, v := range c.header_ {
9151 reqHeaders.Set("User-Agent", c.s.userAgent())
9152 var body io.Reader = nil
9153 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
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())
9166 body = new(bytes.Buffer)
9167 reqHeaders.Set("Content-Type", "application/json")
9169 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
9171 urls += "?" + c.urlParams_.Encode()
9172 req, err := http.NewRequest("POST", urls, body)
9176 req.Header = reqHeaders
9177 gensupport.SetGetBody(req, getBody)
9178 googleapi.Expand(req.URL, map[string]string{
9181 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
9198 return nil, &googleapi.Error{
9199 Code: res.StatusCode,
9206 defer googleapi.CloseBody(res)
9207 if err := googleapi.CheckResponse(res); err != nil {
9210 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
9212 rx.Client = c.s.client
9213 rx.UserAgent = c.s.userAgent()
9216 ctx = context.TODO()
9218 res, err = rx.Upload(ctx)
9222 defer res.Body.Close()
9223 if err := googleapi.CheckResponse(res); err != nil {
9228 ServerResponse: googleapi.ServerResponse{
9230 HTTPStatusCode: res.StatusCode,
9234 if err := gensupport.DecodeResponse(target, res); err != nil {
9239 // "description": "Stores a new object and metadata.",
9240 // "httpMethod": "POST",
9241 // "id": "storage.objects.insert",
9248 // "multipart": true,
9249 // "path": "/resumable/upload/storage/v1/b/{bucket}/o"
9252 // "multipart": true,
9253 // "path": "/upload/storage/v1/b/{bucket}/o"
9257 // "parameterOrder": [
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,
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",
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",
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",
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",
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",
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",
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",
9306 // "predefinedAcl": {
9307 // "description": "Apply a predefined set of access controls to this object.",
9309 // "authenticatedRead",
9310 // "bucketOwnerFullControl",
9311 // "bucketOwnerRead",
9313 // "projectPrivate",
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."
9324 // "location": "query",
9328 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
9333 // "enumDescriptions": [
9334 // "Include all properties.",
9335 // "Omit the owner, acl property."
9337 // "location": "query",
9341 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9342 // "location": "query",
9346 // "path": "b/{bucket}/o",
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"
9358 // "supportsMediaUpload": true
9363 // method id "storage.objects.list":
9365 type ObjectsListCall struct {
9368 urlParams_ gensupport.URLParams
9370 ctx_ context.Context
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)}
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)
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))
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))
9411 // PageToken sets the optional parameter "pageToken": A
9412 // previously-returned page token representing part of the larger set of
9414 func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
9415 c.urlParams_.Set("pageToken", pageToken)
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)
9426 // Projection sets the optional parameter "projection": Set of
9427 // properties to return. Defaults to noAcl.
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)
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)
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))
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))
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
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
9473 func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
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)
9487 func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
9488 reqHeaders := make(http.Header)
9489 for k, v := range c.header_ {
9492 reqHeaders.Set("User-Agent", c.s.userAgent())
9493 if c.ifNoneMatch_ != "" {
9494 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
9505 req.Header = reqHeaders
9506 googleapi.Expand(req.URL, map[string]string{
9509 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
9526 return nil, &googleapi.Error{
9527 Code: res.StatusCode,
9534 defer googleapi.CloseBody(res)
9535 if err := googleapi.CheckResponse(res); err != nil {
9539 ServerResponse: googleapi.ServerResponse{
9541 HTTPStatusCode: res.StatusCode,
9545 if err := gensupport.DecodeResponse(target, res); err != nil {
9550 // "description": "Retrieves a list of objects matching the criteria.",
9551 // "httpMethod": "GET",
9552 // "id": "storage.objects.list",
9553 // "parameterOrder": [
9558 // "description": "Name of the bucket in which to look for objects.",
9559 // "location": "path",
9560 // "required": true,
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",
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"
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",
9579 // "type": "integer"
9582 // "description": "A previously-returned page token representing part of the larger set of results to view.",
9583 // "location": "query",
9587 // "description": "Filter results to objects whose names begin with this prefix.",
9588 // "location": "query",
9592 // "description": "Set of properties to return. Defaults to noAcl.",
9597 // "enumDescriptions": [
9598 // "Include all properties.",
9599 // "Omit the owner, acl property."
9601 // "location": "query",
9605 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
9606 // "location": "query",
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"
9615 // "path": "b/{bucket}/o",
9617 // "$ref": "Objects"
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"
9626 // "supportsSubscription": true
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 {
9636 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9642 if err := f(x); err != nil {
9645 if x.NextPageToken == "" {
9648 c.PageToken(x.NextPageToken)
9652 // method id "storage.objects.patch":
9654 type ObjectsPatchCall struct {
9659 urlParams_ gensupport.URLParams
9660 ctx_ context.Context
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)}
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))
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))
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))
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))
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
9712 func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
9713 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
9717 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
9718 // predefined set of access controls to this object.
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
9732 func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
9733 c.urlParams_.Set("predefinedAcl", predefinedAcl)
9737 // Projection sets the optional parameter "projection": Set of
9738 // properties to return. Defaults to full.
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)
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)
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))
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
9766 func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
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)
9780 func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
9781 reqHeaders := make(http.Header)
9782 for k, v := range c.header_ {
9785 reqHeaders.Set("User-Agent", c.s.userAgent())
9786 var body io.Reader = nil
9787 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
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)
9800 req.Header = reqHeaders
9801 googleapi.Expand(req.URL, map[string]string{
9805 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
9822 return nil, &googleapi.Error{
9823 Code: res.StatusCode,
9830 defer googleapi.CloseBody(res)
9831 if err := googleapi.CheckResponse(res); err != nil {
9835 ServerResponse: googleapi.ServerResponse{
9837 HTTPStatusCode: res.StatusCode,
9841 if err := gensupport.DecodeResponse(target, res); err != nil {
9846 // "description": "Patches an object's metadata.",
9847 // "httpMethod": "PATCH",
9848 // "id": "storage.objects.patch",
9849 // "parameterOrder": [
9855 // "description": "Name of the bucket in which the object resides.",
9856 // "location": "path",
9857 // "required": true,
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",
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",
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",
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",
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",
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,
9896 // "predefinedAcl": {
9897 // "description": "Apply a predefined set of access controls to this object.",
9899 // "authenticatedRead",
9900 // "bucketOwnerFullControl",
9901 // "bucketOwnerRead",
9903 // "projectPrivate",
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."
9914 // "location": "query",
9918 // "description": "Set of properties to return. Defaults to full.",
9923 // "enumDescriptions": [
9924 // "Include all properties.",
9925 // "Omit the owner, acl property."
9927 // "location": "query",
9931 // "description": "The project to be billed for this request, for Requester Pays buckets.",
9932 // "location": "query",
9936 // "path": "b/{bucket}/o/{object}",
9944 // "https://www.googleapis.com/auth/cloud-platform",
9945 // "https://www.googleapis.com/auth/devstorage.full_control"
9951 // method id "storage.objects.rewrite":
9953 type ObjectsRewriteCall struct {
9957 destinationBucket string
9958 destinationObject string
9960 urlParams_ gensupport.URLParams
9961 ctx_ context.Context
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
9977 // DestinationKmsKeyName sets the optional parameter
9978 // "destinationKmsKeyName": Resource name of the Cloud KMS key, of the
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)
9988 // DestinationPredefinedAcl sets the optional parameter
9989 // "destinationPredefinedAcl": Apply a predefined set of access controls
9990 // to the destination object.
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
10004 func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
10005 c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
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))
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))
10028 // IfMetagenerationMatch sets the optional parameter
10029 // "ifMetagenerationMatch": Makes the operation conditional on whether
10030 // the destination object's current metageneration matches the given
10032 func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
10033 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
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))
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))
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
10058 func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
10059 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
10063 // IfSourceMetagenerationMatch sets the optional parameter
10064 // "ifSourceMetagenerationMatch": Makes the operation conditional on
10065 // whether the source object's current metageneration matches the given
10067 func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
10068 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
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
10076 func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
10077 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
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))
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.
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)
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)
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))
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)
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))
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
10144 func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
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)
10158 func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
10159 reqHeaders := make(http.Header)
10160 for k, v := range c.header_ {
10163 reqHeaders.Set("User-Agent", c.s.userAgent())
10164 var body io.Reader = nil
10165 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
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)
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,
10185 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
10202 return nil, &googleapi.Error{
10203 Code: res.StatusCode,
10204 Header: res.Header,
10210 defer googleapi.CloseBody(res)
10211 if err := googleapi.CheckResponse(res); err != nil {
10214 ret := &RewriteResponse{
10215 ServerResponse: googleapi.ServerResponse{
10216 Header: res.Header,
10217 HTTPStatusCode: res.StatusCode,
10221 if err := gensupport.DecodeResponse(target, res); err != nil {
10226 // "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
10227 // "httpMethod": "POST",
10228 // "id": "storage.objects.rewrite",
10229 // "parameterOrder": [
10232 // "destinationBucket",
10233 // "destinationObject"
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"
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"
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"
10253 // "destinationPredefinedAcl": {
10254 // "description": "Apply a predefined set of access controls to the destination object.",
10256 // "authenticatedRead",
10257 // "bucketOwnerFullControl",
10258 // "bucketOwnerRead",
10260 // "projectPrivate",
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."
10271 // "location": "query",
10272 // "type": "string"
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"
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"
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"
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"
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"
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"
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"
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"
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"
10329 // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
10334 // "enumDescriptions": [
10335 // "Include all properties.",
10336 // "Omit the owner, acl property."
10338 // "location": "query",
10339 // "type": "string"
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"
10346 // "sourceBucket": {
10347 // "description": "Name of the bucket in which to find the source object.",
10348 // "location": "path",
10349 // "required": true,
10350 // "type": "string"
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"
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"
10364 // "userProject": {
10365 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10366 // "location": "query",
10367 // "type": "string"
10370 // "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
10372 // "$ref": "Object"
10375 // "$ref": "RewriteResponse"
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"
10386 // method id "storage.objects.setIamPolicy":
10388 type ObjectsSetIamPolicyCall struct {
10393 urlParams_ gensupport.URLParams
10394 ctx_ context.Context
10395 header_ http.Header
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)}
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))
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)
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))
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
10433 func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
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)
10447 func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
10448 reqHeaders := make(http.Header)
10449 for k, v := range c.header_ {
10452 reqHeaders.Set("User-Agent", c.s.userAgent())
10453 var body io.Reader = nil
10454 body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
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)
10467 req.Header = reqHeaders
10468 googleapi.Expand(req.URL, map[string]string{
10469 "bucket": c.bucket,
10470 "object": c.object,
10472 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
10489 return nil, &googleapi.Error{
10490 Code: res.StatusCode,
10491 Header: res.Header,
10497 defer googleapi.CloseBody(res)
10498 if err := googleapi.CheckResponse(res); err != nil {
10502 ServerResponse: googleapi.ServerResponse{
10503 Header: res.Header,
10504 HTTPStatusCode: res.StatusCode,
10508 if err := gensupport.DecodeResponse(target, res); err != nil {
10513 // "description": "Updates an IAM policy for the specified object.",
10514 // "httpMethod": "PUT",
10515 // "id": "storage.objects.setIamPolicy",
10516 // "parameterOrder": [
10522 // "description": "Name of the bucket in which the object resides.",
10523 // "location": "path",
10524 // "required": true,
10525 // "type": "string"
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"
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"
10539 // "userProject": {
10540 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10541 // "location": "query",
10542 // "type": "string"
10545 // "path": "b/{bucket}/o/{object}/iam",
10547 // "$ref": "Policy"
10550 // "$ref": "Policy"
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"
10561 // method id "storage.objects.testIamPermissions":
10563 type ObjectsTestIamPermissionsCall struct {
10567 urlParams_ gensupport.URLParams
10568 ifNoneMatch_ string
10569 ctx_ context.Context
10570 header_ http.Header
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)}
10579 c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
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))
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)
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))
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
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
10619 func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
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)
10633 func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
10634 reqHeaders := make(http.Header)
10635 for k, v := range c.header_ {
10638 reqHeaders.Set("User-Agent", c.s.userAgent())
10639 if c.ifNoneMatch_ != "" {
10640 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
10651 req.Header = reqHeaders
10652 googleapi.Expand(req.URL, map[string]string{
10653 "bucket": c.bucket,
10654 "object": c.object,
10656 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
10673 return nil, &googleapi.Error{
10674 Code: res.StatusCode,
10675 Header: res.Header,
10681 defer googleapi.CloseBody(res)
10682 if err := googleapi.CheckResponse(res); err != nil {
10685 ret := &TestIamPermissionsResponse{
10686 ServerResponse: googleapi.ServerResponse{
10687 Header: res.Header,
10688 HTTPStatusCode: res.StatusCode,
10692 if err := gensupport.DecodeResponse(target, res); err != nil {
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": [
10707 // "description": "Name of the bucket in which the object resides.",
10708 // "location": "path",
10709 // "required": true,
10710 // "type": "string"
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"
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"
10724 // "permissions": {
10725 // "description": "Permissions to test.",
10726 // "location": "query",
10727 // "repeated": true,
10728 // "required": true,
10729 // "type": "string"
10731 // "userProject": {
10732 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
10733 // "location": "query",
10734 // "type": "string"
10737 // "path": "b/{bucket}/o/{object}/iam/testPermissions",
10739 // "$ref": "TestIamPermissionsResponse"
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"
10752 // method id "storage.objects.update":
10754 type ObjectsUpdateCall struct {
10759 urlParams_ gensupport.URLParams
10760 ctx_ context.Context
10761 header_ http.Header
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)}
10769 c.object2 = object2
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))
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))
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))
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))
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
10812 func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
10813 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
10817 // PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
10818 // predefined set of access controls to this object.
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
10832 func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
10833 c.urlParams_.Set("predefinedAcl", predefinedAcl)
10837 // Projection sets the optional parameter "projection": Set of
10838 // properties to return. Defaults to full.
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)
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)
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))
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
10866 func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
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)
10880 func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
10881 reqHeaders := make(http.Header)
10882 for k, v := range c.header_ {
10885 reqHeaders.Set("User-Agent", c.s.userAgent())
10886 var body io.Reader = nil
10887 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
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)
10900 req.Header = reqHeaders
10901 googleapi.Expand(req.URL, map[string]string{
10902 "bucket": c.bucket,
10903 "object": c.object,
10905 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
10922 return nil, &googleapi.Error{
10923 Code: res.StatusCode,
10924 Header: res.Header,
10930 defer googleapi.CloseBody(res)
10931 if err := googleapi.CheckResponse(res); err != nil {
10935 ServerResponse: googleapi.ServerResponse{
10936 Header: res.Header,
10937 HTTPStatusCode: res.StatusCode,
10941 if err := gensupport.DecodeResponse(target, res); err != nil {
10946 // "description": "Updates an object's metadata.",
10947 // "httpMethod": "PUT",
10948 // "id": "storage.objects.update",
10949 // "parameterOrder": [
10955 // "description": "Name of the bucket in which the object resides.",
10956 // "location": "path",
10957 // "required": true,
10958 // "type": "string"
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"
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"
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"
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"
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"
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"
10996 // "predefinedAcl": {
10997 // "description": "Apply a predefined set of access controls to this object.",
10999 // "authenticatedRead",
11000 // "bucketOwnerFullControl",
11001 // "bucketOwnerRead",
11003 // "projectPrivate",
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."
11014 // "location": "query",
11015 // "type": "string"
11018 // "description": "Set of properties to return. Defaults to full.",
11023 // "enumDescriptions": [
11024 // "Include all properties.",
11025 // "Omit the owner, acl property."
11027 // "location": "query",
11028 // "type": "string"
11030 // "userProject": {
11031 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11032 // "location": "query",
11033 // "type": "string"
11036 // "path": "b/{bucket}/o/{object}",
11038 // "$ref": "Object"
11041 // "$ref": "Object"
11044 // "https://www.googleapis.com/auth/cloud-platform",
11045 // "https://www.googleapis.com/auth/devstorage.full_control"
11051 // method id "storage.objects.watchAll":
11053 type ObjectsWatchAllCall struct {
11057 urlParams_ gensupport.URLParams
11058 ctx_ context.Context
11059 header_ http.Header
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)}
11066 c.channel = channel
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)
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))
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))
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)
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)
11115 // Projection sets the optional parameter "projection": Set of
11116 // properties to return. Defaults to noAcl.
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)
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)
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))
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))
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
11152 func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
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)
11166 func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
11167 reqHeaders := make(http.Header)
11168 for k, v := range c.header_ {
11171 reqHeaders.Set("User-Agent", c.s.userAgent())
11172 var body io.Reader = nil
11173 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
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)
11186 req.Header = reqHeaders
11187 googleapi.Expand(req.URL, map[string]string{
11188 "bucket": c.bucket,
11190 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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
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 {
11207 return nil, &googleapi.Error{
11208 Code: res.StatusCode,
11209 Header: res.Header,
11215 defer googleapi.CloseBody(res)
11216 if err := googleapi.CheckResponse(res); err != nil {
11220 ServerResponse: googleapi.ServerResponse{
11221 Header: res.Header,
11222 HTTPStatusCode: res.StatusCode,
11226 if err := gensupport.DecodeResponse(target, res); err != nil {
11231 // "description": "Watch for changes on all objects in a bucket.",
11232 // "httpMethod": "POST",
11233 // "id": "storage.objects.watchAll",
11234 // "parameterOrder": [
11239 // "description": "Name of the bucket in which to look for objects.",
11240 // "location": "path",
11241 // "required": true,
11242 // "type": "string"
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"
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"
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",
11260 // "type": "integer"
11263 // "description": "A previously-returned page token representing part of the larger set of results to view.",
11264 // "location": "query",
11265 // "type": "string"
11268 // "description": "Filter results to objects whose names begin with this prefix.",
11269 // "location": "query",
11270 // "type": "string"
11273 // "description": "Set of properties to return. Defaults to noAcl.",
11278 // "enumDescriptions": [
11279 // "Include all properties.",
11280 // "Omit the owner, acl property."
11282 // "location": "query",
11283 // "type": "string"
11285 // "userProject": {
11286 // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
11287 // "location": "query",
11288 // "type": "string"
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"
11296 // "path": "b/{bucket}/o/watch",
11298 // "$ref": "Channel",
11299 // "parameterName": "resource"
11302 // "$ref": "Channel"
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"
11311 // "supportsSubscription": true
11316 // method id "storage.projects.serviceAccount.get":
11318 type ProjectsServiceAccountGetCall struct {
11321 urlParams_ gensupport.URLParams
11322 ifNoneMatch_ string
11323 ctx_ context.Context
11324 header_ http.Header
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
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)
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))
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
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
11363 func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
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)
11377 func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
11378 reqHeaders := make(http.Header)
11379 for k, v := range c.header_ {
11382 reqHeaders.Set("User-Agent", c.s.userAgent())
11383 if c.ifNoneMatch_ != "" {
11384 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
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)
11395 req.Header = reqHeaders
11396 googleapi.Expand(req.URL, map[string]string{
11397 "projectId": c.projectId,
11399 return gensupport.SendRequest(c.ctx_, c.s.client, req)
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 {
11416 return nil, &googleapi.Error{
11417 Code: res.StatusCode,
11418 Header: res.Header,
11424 defer googleapi.CloseBody(res)
11425 if err := googleapi.CheckResponse(res); err != nil {
11428 ret := &ServiceAccount{
11429 ServerResponse: googleapi.ServerResponse{
11430 Header: res.Header,
11431 HTTPStatusCode: res.StatusCode,
11435 if err := gensupport.DecodeResponse(target, res); err != nil {
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": [
11448 // "description": "Project ID",
11449 // "location": "path",
11450 // "required": true,
11451 // "type": "string"
11453 // "userProject": {
11454 // "description": "The project to be billed for this request.",
11455 // "location": "query",
11456 // "type": "string"
11459 // "path": "projects/{projectId}/serviceAccount",
11461 // "$ref": "ServiceAccount"
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"