aboutsummaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/api/storage/v1/storage-gen.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/api/storage/v1/storage-gen.go')
-rw-r--r--vendor/google.golang.org/api/storage/v1/storage-gen.go1711
1 files changed, 1604 insertions, 107 deletions
diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go
index b36bff2..e311c29 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-gen.go
+++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go
@@ -72,8 +72,10 @@ func New(client *http.Client) (*Service, error) {
s.Buckets = NewBucketsService(s)
s.Channels = NewChannelsService(s)
s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
+ s.Notifications = NewNotificationsService(s)
s.ObjectAccessControls = NewObjectAccessControlsService(s)
s.Objects = NewObjectsService(s)
+ s.Projects = NewProjectsService(s)
return s, nil
}
@@ -90,9 +92,13 @@ type Service struct {
DefaultObjectAccessControls *DefaultObjectAccessControlsService
+ Notifications *NotificationsService
+
ObjectAccessControls *ObjectAccessControlsService
Objects *ObjectsService
+
+ Projects *ProjectsService
}
func (s *Service) userAgent() string {
@@ -138,6 +144,15 @@ type DefaultObjectAccessControlsService struct {
s *Service
}
+func NewNotificationsService(s *Service) *NotificationsService {
+ rs := &NotificationsService{s: s}
+ return rs
+}
+
+type NotificationsService struct {
+ s *Service
+}
+
func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
rs := &ObjectAccessControlsService{s: s}
return rs
@@ -156,11 +171,35 @@ type ObjectsService struct {
s *Service
}
+func NewProjectsService(s *Service) *ProjectsService {
+ rs := &ProjectsService{s: s}
+ rs.ServiceAccount = NewProjectsServiceAccountService(s)
+ return rs
+}
+
+type ProjectsService struct {
+ s *Service
+
+ ServiceAccount *ProjectsServiceAccountService
+}
+
+func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
+ rs := &ProjectsServiceAccountService{s: s}
+ return rs
+}
+
+type ProjectsServiceAccountService struct {
+ s *Service
+}
+
// Bucket: A bucket.
type Bucket struct {
// Acl: Access controls on the bucket.
Acl []*BucketAccessControl `json:"acl,omitempty"`
+ // Billing: The bucket's billing configuration.
+ Billing *BucketBilling `json:"billing,omitempty"`
+
// Cors: The bucket's Cross-Origin Resource Sharing (CORS)
// configuration.
Cors []*BucketCors `json:"cors,omitempty"`
@@ -169,6 +208,10 @@ type Bucket struct {
// when no ACL is provided.
DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
+ // Encryption: Encryption configuration used by default for newly
+ // inserted objects, when no encryption config is specified.
+ Encryption *BucketEncryption `json:"encryption,omitempty"`
+
// Etag: HTTP 1.1 Entity tag for the bucket.
Etag string `json:"etag,omitempty"`
@@ -180,6 +223,9 @@ type Bucket struct {
// storage#bucket.
Kind string `json:"kind,omitempty"`
+ // Labels: User-provided labels, in key/value pairs.
+ Labels map[string]string `json:"labels,omitempty"`
+
// Lifecycle: The bucket's lifecycle configuration. See lifecycle
// management for more information.
Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
@@ -261,6 +307,34 @@ func (s *Bucket) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
+// BucketBilling: The bucket's billing configuration.
+type BucketBilling struct {
+ // RequesterPays: When set to true, bucket is requester pays.
+ RequesterPays bool `json:"requesterPays,omitempty"`
+
+ // ForceSendFields is a list of field names (e.g. "RequesterPays") to
+ // unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "RequesterPays") to include
+ // in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. However, any field with
+ // an empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *BucketBilling) MarshalJSON() ([]byte, error) {
+ type noMethod BucketBilling
+ raw := noMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
type BucketCors struct {
// MaxAgeSeconds: The value, in seconds, to return in the
// Access-Control-Max-Age header used in preflight responses.
@@ -304,6 +378,35 @@ func (s *BucketCors) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
+// BucketEncryption: Encryption configuration used by default for newly
+// inserted objects, when no encryption config is specified.
+type BucketEncryption struct {
+ DefaultKmsKeyName string `json:"defaultKmsKeyName,omitempty"`
+
+ // ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName")
+ // to unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "DefaultKmsKeyName") to
+ // include in API requests with the JSON null value. By default, fields
+ // with empty values are omitted from API requests. However, any field
+ // with an empty value appearing in NullFields will be sent to the
+ // server as null. It is an error if a field in this list has a
+ // non-empty value. This may be used to include null fields in Patch
+ // requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *BucketEncryption) MarshalJSON() ([]byte, error) {
+ type noMethod BucketEncryption
+ raw := noMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
// management for more information.
type BucketLifecycle struct {
@@ -412,7 +515,7 @@ type BucketLifecycleRuleCondition struct {
// IsLive: Relevant only for versioned objects. If the value is true,
// this condition matches live objects; if the value is false, it
// matches archived objects.
- IsLive bool `json:"isLive,omitempty"`
+ IsLive *bool `json:"isLive,omitempty"`
// MatchesStorageClass: Objects having any of the storage classes
// specified by this condition will be matched. Values include
@@ -938,6 +1041,107 @@ func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte,
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
+// Notification: A subscription to receive Google PubSub notifications.
+type Notification struct {
+ // CustomAttributes: An optional list of additional attributes to attach
+ // to each Cloud PubSub message published for this notification
+ // subscription.
+ CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
+
+ // Etag: HTTP 1.1 Entity tag for this subscription notification.
+ Etag string `json:"etag,omitempty"`
+
+ // EventTypes: If present, only send notifications about listed event
+ // types. If empty, sent notifications for all event types.
+ EventTypes []string `json:"event_types,omitempty"`
+
+ // Id: The ID of the notification.
+ Id string `json:"id,omitempty"`
+
+ // Kind: The kind of item this is. For notifications, this is always
+ // storage#notification.
+ Kind string `json:"kind,omitempty"`
+
+ // ObjectNamePrefix: If present, only apply this notification
+ // configuration to object names that begin with this prefix.
+ ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
+
+ // PayloadFormat: The desired content of the Payload.
+ PayloadFormat string `json:"payload_format,omitempty"`
+
+ // SelfLink: The canonical URL of this notification.
+ SelfLink string `json:"selfLink,omitempty"`
+
+ // Topic: The Cloud PubSub topic to which this subscription publishes.
+ // Formatted as:
+ // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
+ // c}'
+ Topic string `json:"topic,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the
+ // server.
+ googleapi.ServerResponse `json:"-"`
+
+ // ForceSendFields is a list of field names (e.g. "CustomAttributes") to
+ // unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "CustomAttributes") to
+ // include in API requests with the JSON null value. By default, fields
+ // with empty values are omitted from API requests. However, any field
+ // with an empty value appearing in NullFields will be sent to the
+ // server as null. It is an error if a field in this list has a
+ // non-empty value. This may be used to include null fields in Patch
+ // requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *Notification) MarshalJSON() ([]byte, error) {
+ type noMethod Notification
+ raw := noMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
+// Notifications: A list of notification subscriptions.
+type Notifications struct {
+ // Items: The list of items.
+ Items []*Notification `json:"items,omitempty"`
+
+ // Kind: The kind of item this is. For lists of notifications, this is
+ // always storage#notifications.
+ Kind string `json:"kind,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the
+ // server.
+ googleapi.ServerResponse `json:"-"`
+
+ // ForceSendFields is a list of field names (e.g. "Items") to
+ // unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Items") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *Notifications) MarshalJSON() ([]byte, error) {
+ type noMethod Notifications
+ raw := noMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
// Object: An object.
type Object struct {
// Acl: Access controls on the object.
@@ -964,9 +1168,8 @@ type Object struct {
// ContentLanguage: Content-Language of the object data.
ContentLanguage string `json:"contentLanguage,omitempty"`
- // ContentType: Content-Type of the object data. If contentType is not
- // specified, object downloads will be served as
- // application/octet-stream.
+ // ContentType: Content-Type of the object data. If an object is stored
+ // without a Content-Type, it is served as application/octet-stream.
ContentType string `json:"contentType,omitempty"`
// Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
@@ -994,6 +1197,10 @@ type Object struct {
// storage#object.
Kind string `json:"kind,omitempty"`
+ // KmsKeyName: Cloud KMS Key used to encrypt this object, if the object
+ // is encrypted by such a key.
+ KmsKeyName string `json:"kmsKeyName,omitempty"`
+
// Md5Hash: MD5 hash of the data; encoded using base64. For more
// information about using the MD5 hash, see Hashes and ETags: Best
// Practices.
@@ -1348,10 +1555,11 @@ type Policy struct {
Kind string `json:"kind,omitempty"`
// ResourceId: The ID of the resource to which this policy belongs. Will
- // be of the form buckets/bucket for buckets, and
- // buckets/bucket/objects/object for objects. A specific generation may
- // be specified by appending #generationNumber to the end of the object
- // name, e.g. buckets/my-bucket/objects/data.txt#17. The current
+ // be of the form projects/_/buckets/bucket for buckets, and
+ // projects/_/buckets/bucket/objects/object for objects. A specific
+ // generation may be specified by appending #generationNumber to the end
+ // of the object name, e.g.
+ // projects/_/buckets/my-bucket/objects/data.txt#17. The current
// generation can be denoted with #0. This field is ignored on input.
ResourceId string `json:"resourceId,omitempty"`
@@ -1383,6 +1591,8 @@ func (s *Policy) MarshalJSON() ([]byte, error) {
}
type PolicyBindings struct {
+ Condition interface{} `json:"condition,omitempty"`
+
// Members: A collection of identifiers for members who may assume the
// provided role. Recognized identifiers are as follows:
// - allUsers — A special identifier that represents anyone on the
@@ -1440,7 +1650,7 @@ type PolicyBindings struct {
// an ACL entry on a bucket with the OWNER role.
Role string `json:"role,omitempty"`
- // ForceSendFields is a list of field names (e.g. "Members") to
+ // ForceSendFields is a list of field names (e.g. "Condition") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@@ -1448,7 +1658,7 @@ type PolicyBindings struct {
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
- // NullFields is a list of field names (e.g. "Members") to include in
+ // NullFields is a list of field names (e.g. "Condition") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
@@ -1474,7 +1684,7 @@ type RewriteResponse struct {
// ObjectSize: The total size of the object being copied in bytes. This
// property is always present in the response.
- ObjectSize uint64 `json:"objectSize,omitempty,string"`
+ ObjectSize int64 `json:"objectSize,omitempty,string"`
// Resource: A resource containing the metadata for the copied-to
// object. This property is present in the response only when copying
@@ -1489,7 +1699,7 @@ type RewriteResponse struct {
// TotalBytesRewritten: The total bytes written so far, which can be
// used to provide a waiting user with a progress indicator. This
// property is always present in the response.
- TotalBytesRewritten uint64 `json:"totalBytesRewritten,omitempty,string"`
+ TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
// ServerResponse contains the HTTP response code and headers from the
// server.
@@ -1518,6 +1728,43 @@ func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
+// ServiceAccount: A subscription to receive Google PubSub
+// notifications.
+type ServiceAccount struct {
+ // EmailAddress: The ID of the notification.
+ EmailAddress string `json:"email_address,omitempty"`
+
+ // Kind: The kind of item this is. For notifications, this is always
+ // storage#notification.
+ Kind string `json:"kind,omitempty"`
+
+ // ServerResponse contains the HTTP response code and headers from the
+ // server.
+ googleapi.ServerResponse `json:"-"`
+
+ // ForceSendFields is a list of field names (e.g. "EmailAddress") to
+ // unconditionally include in API requests. By default, fields with
+ // empty values are omitted from API requests. However, any non-pointer,
+ // non-interface field appearing in ForceSendFields will be sent to the
+ // server regardless of whether the field is empty or not. This may be
+ // used to include empty fields in Patch requests.
+ ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "EmailAddress") to include
+ // in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. However, any field with
+ // an empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
+}
+
+func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
+ type noMethod ServiceAccount
+ raw := noMethod(*s)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
+}
+
// TestIamPermissionsResponse: A
// storage.(buckets|objects).testIamPermissions response.
type TestIamPermissionsResponse struct {
@@ -1591,6 +1838,13 @@ func (r *BucketAccessControlsService) Delete(bucket string, entity string) *Buck
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -1667,6 +1921,11 @@ func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/acl/{entity}",
@@ -1699,6 +1958,13 @@ func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketA
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -1813,6 +2079,11 @@ func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketA
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/acl/{entity}",
@@ -1846,6 +2117,13 @@ func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -1944,6 +2222,11 @@ func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*Buck
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/acl",
@@ -1979,6 +2262,13 @@ func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsL
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -2085,6 +2375,11 @@ func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*Bucket
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/acl",
@@ -2121,6 +2416,13 @@ func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucket
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -2227,6 +2529,11 @@ func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*Bucke
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/acl/{entity}",
@@ -2265,6 +2572,13 @@ func (r *BucketAccessControlsService) Update(bucket string, entity string, bucke
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -2371,6 +2685,11 @@ func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*Buck
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/acl/{entity}",
@@ -2421,6 +2740,13 @@ func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch in
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -2501,6 +2827,11 @@ func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
// "format": "int64",
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}",
@@ -2560,6 +2891,13 @@ func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -2691,6 +3029,11 @@ func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}",
@@ -2726,6 +3069,13 @@ func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -2832,6 +3182,11 @@ func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, err
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/iam",
@@ -2919,6 +3274,13 @@ func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request
+func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -3067,6 +3429,11 @@ func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b",
@@ -3136,6 +3503,13 @@ func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request.
+func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -3270,6 +3644,11 @@ func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b",
@@ -3397,6 +3776,13 @@ func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -3560,6 +3946,11 @@ func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}",
@@ -3596,6 +3987,13 @@ func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSet
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -3694,6 +4092,11 @@ func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, err
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/iam",
@@ -3732,6 +4135,13 @@ func (r *BucketsService) TestIamPermissions(bucket string, permissions []string)
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -3846,6 +4256,11 @@ func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestI
// "repeated": true,
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/iam/testPermissions",
@@ -3952,6 +4367,13 @@ func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -4115,6 +4537,11 @@ func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}",
@@ -4246,6 +4673,13 @@ func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -4322,6 +4756,11 @@ func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption)
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/defaultObjectAcl/{entity}",
@@ -4354,6 +4793,13 @@ func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -4468,6 +4914,11 @@ func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/defaultObjectAcl/{entity}",
@@ -4502,6 +4953,13 @@ func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccessc
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -4600,6 +5058,11 @@ func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption)
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/defaultObjectAcl",
@@ -4652,6 +5115,13 @@ func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagen
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -4770,6 +5240,11 @@ func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (
// "format": "int64",
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/defaultObjectAcl",
@@ -4806,6 +5281,13 @@ func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string,
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -4912,6 +5394,11 @@ func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption)
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/defaultObjectAcl/{entity}",
@@ -4950,6 +5437,13 @@ func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -5056,6 +5550,11 @@ func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption)
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/defaultObjectAcl/{entity}",
@@ -5073,6 +5572,589 @@ func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption)
}
+// method id "storage.notifications.delete":
+
+type NotificationsDeleteCall struct {
+ s *Service
+ bucket string
+ notification string
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Delete: Permanently deletes a notification subscription.
+func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
+ c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.bucket = bucket
+ c.notification = notification
+ return c
+}
+
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *NotificationsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
+ urls += "?" + c.urlParams_.Encode()
+ req, _ := http.NewRequest("DELETE", urls, body)
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "bucket": c.bucket,
+ "notification": c.notification,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.notifications.delete" call.
+func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if err != nil {
+ return err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return err
+ }
+ return nil
+ // {
+ // "description": "Permanently deletes a notification subscription.",
+ // "httpMethod": "DELETE",
+ // "id": "storage.notifications.delete",
+ // "parameterOrder": [
+ // "bucket",
+ // "notification"
+ // ],
+ // "parameters": {
+ // "bucket": {
+ // "description": "The parent bucket of the notification.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "notification": {
+ // "description": "ID of the notification to delete.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
+ // }
+ // },
+ // "path": "b/{bucket}/notificationConfigs/{notification}",
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/devstorage.full_control",
+ // "https://www.googleapis.com/auth/devstorage.read_write"
+ // ]
+ // }
+
+}
+
+// method id "storage.notifications.get":
+
+type NotificationsGetCall struct {
+ s *Service
+ bucket string
+ notification string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: View a notification configuration.
+func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
+ c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.bucket = bucket
+ c.notification = notification
+ return c
+}
+
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets the optional parameter which makes the operation
+// fail if the object's ETag matches the given value. This is useful for
+// getting updates only after the object has changed since the last
+// request. Use googleapi.IsNotModified to check whether the response
+// error from Do is the result of In-None-Match.
+func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *NotificationsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
+ urls += "?" + c.urlParams_.Encode()
+ req, _ := http.NewRequest("GET", urls, body)
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "bucket": c.bucket,
+ "notification": c.notification,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.notifications.get" call.
+// Exactly one of *Notification or error will be non-nil. Any non-2xx
+// status code is an error. Response headers are in either
+// *Notification.ServerResponse.Header or (if a response was returned at
+// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
+// to check whether the returned error was because
+// http.StatusNotModified was returned.
+func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &Notification{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := json.NewDecoder(res.Body).Decode(target); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "View a notification configuration.",
+ // "httpMethod": "GET",
+ // "id": "storage.notifications.get",
+ // "parameterOrder": [
+ // "bucket",
+ // "notification"
+ // ],
+ // "parameters": {
+ // "bucket": {
+ // "description": "The parent bucket of the notification.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "notification": {
+ // "description": "Notification ID",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
+ // }
+ // },
+ // "path": "b/{bucket}/notificationConfigs/{notification}",
+ // "response": {
+ // "$ref": "Notification"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/cloud-platform.read-only",
+ // "https://www.googleapis.com/auth/devstorage.full_control",
+ // "https://www.googleapis.com/auth/devstorage.read_only",
+ // "https://www.googleapis.com/auth/devstorage.read_write"
+ // ]
+ // }
+
+}
+
+// method id "storage.notifications.insert":
+
+type NotificationsInsertCall struct {
+ s *Service
+ bucket string
+ notification *Notification
+ urlParams_ gensupport.URLParams
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Insert: Creates a notification subscription for a given bucket.
+func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
+ c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.bucket = bucket
+ c.notification = notification
+ return c
+}
+
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *NotificationsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ var body io.Reader = nil
+ body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
+ if err != nil {
+ return nil, err
+ }
+ reqHeaders.Set("Content-Type", "application/json")
+ c.urlParams_.Set("alt", alt)
+ urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
+ urls += "?" + c.urlParams_.Encode()
+ req, _ := http.NewRequest("POST", urls, body)
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "bucket": c.bucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.notifications.insert" call.
+// Exactly one of *Notification or error will be non-nil. Any non-2xx
+// status code is an error. Response headers are in either
+// *Notification.ServerResponse.Header or (if a response was returned at
+// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
+// to check whether the returned error was because
+// http.StatusNotModified was returned.
+func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &Notification{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := json.NewDecoder(res.Body).Decode(target); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "Creates a notification subscription for a given bucket.",
+ // "httpMethod": "POST",
+ // "id": "storage.notifications.insert",
+ // "parameterOrder": [
+ // "bucket"
+ // ],
+ // "parameters": {
+ // "bucket": {
+ // "description": "The parent bucket of the notification.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
+ // }
+ // },
+ // "path": "b/{bucket}/notificationConfigs",
+ // "request": {
+ // "$ref": "Notification"
+ // },
+ // "response": {
+ // "$ref": "Notification"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/devstorage.full_control",
+ // "https://www.googleapis.com/auth/devstorage.read_write"
+ // ]
+ // }
+
+}
+
+// method id "storage.notifications.list":
+
+type NotificationsListCall struct {
+ s *Service
+ bucket string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// List: Retrieves a list of notification subscriptions for a given
+// bucket.
+func (r *NotificationsService) List(bucket string) *NotificationsListCall {
+ c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.bucket = bucket
+ return c
+}
+
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets the optional parameter which makes the operation
+// fail if the object's ETag matches the given value. This is useful for
+// getting updates only after the object has changed since the last
+// request. Use googleapi.IsNotModified to check whether the response
+// error from Do is the result of In-None-Match.
+func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *NotificationsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
+ urls += "?" + c.urlParams_.Encode()
+ req, _ := http.NewRequest("GET", urls, body)
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "bucket": c.bucket,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.notifications.list" call.
+// Exactly one of *Notifications or error will be non-nil. Any non-2xx
+// status code is an error. Response headers are in either
+// *Notifications.ServerResponse.Header or (if a response was returned
+// at all) in error.(*googleapi.Error).Header. Use
+// googleapi.IsNotModified to check whether the returned error was
+// because http.StatusNotModified was returned.
+func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &Notifications{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := json.NewDecoder(res.Body).Decode(target); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "Retrieves a list of notification subscriptions for a given bucket.",
+ // "httpMethod": "GET",
+ // "id": "storage.notifications.list",
+ // "parameterOrder": [
+ // "bucket"
+ // ],
+ // "parameters": {
+ // "bucket": {
+ // "description": "Name of a Google Cloud Storage bucket.",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
+ // }
+ // },
+ // "path": "b/{bucket}/notificationConfigs",
+ // "response": {
+ // "$ref": "Notifications"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/cloud-platform.read-only",
+ // "https://www.googleapis.com/auth/devstorage.full_control",
+ // "https://www.googleapis.com/auth/devstorage.read_only",
+ // "https://www.googleapis.com/auth/devstorage.read_write"
+ // ]
+ // }
+
+}
+
// method id "storage.objectAccessControls.delete":
type ObjectAccessControlsDeleteCall struct {
@@ -5103,6 +6185,13 @@ func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAcc
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -5193,6 +6282,11 @@ func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/acl/{entity}",
@@ -5235,6 +6329,13 @@ func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccess
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -5363,6 +6464,11 @@ func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectA
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/acl/{entity}",
@@ -5406,6 +6512,13 @@ func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAcc
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -5518,6 +6631,11 @@ func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*Obje
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/acl",
@@ -5563,6 +6681,13 @@ func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAcces
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -5683,6 +6808,11 @@ func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*Object
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/acl",
@@ -5729,6 +6859,13 @@ func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAcce
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -5849,6 +6986,11 @@ func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*Objec
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/acl/{entity}",
@@ -5897,6 +7039,13 @@ func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAcc
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -6017,6 +7166,11 @@ func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*Obje
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/acl/{entity}",
@@ -6079,7 +7233,8 @@ func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl s
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
// Makes the operation conditional on whether the object's current
-// generation matches the given value.
+// generation matches the given value. Setting to 0 makes the operation
+// succeed only if there are no live versions of the object.
func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -6093,6 +7248,23 @@ func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64)
return c
}
+// KmsKeyName sets the optional parameter "kmsKeyName": 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.
+func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall {
+ c.urlParams_.Set("kmsKeyName", kmsKeyName)
+ return c
+}
+
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -6238,7 +7410,7 @@ func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -6248,6 +7420,16 @@ func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "format": "int64",
// "location": "query",
// "type": "string"
+ // },
+ // "kmsKeyName": {
+ // "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.",
+ // "location": "query",
+ // "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{destinationBucket}/o/{destinationObject}/compose",
@@ -6317,7 +7499,8 @@ func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl stri
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
// Makes the operation conditional on whether the destination object's
-// current generation matches the given value.
+// current generation matches the given value. Setting to 0 makes the
+// operation succeed only if there are no live versions of the object.
func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -6326,7 +7509,9 @@ func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCop
// IfGenerationNotMatch sets the optional parameter
// "ifGenerationNotMatch": Makes the operation conditional on whether
// the destination object's current generation does not match the given
-// value.
+// 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.
func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
return c
@@ -6352,7 +7537,7 @@ func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int6
// IfSourceGenerationMatch sets the optional parameter
// "ifSourceGenerationMatch": Makes the operation conditional on whether
-// the source object's generation matches the given value.
+// the source object's current generation matches the given value.
func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
return c
@@ -6360,8 +7545,8 @@ func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64)
// IfSourceGenerationNotMatch sets the optional parameter
// "ifSourceGenerationNotMatch": Makes the operation conditional on
-// whether the source object's generation does not match the given
-// value.
+// whether the source object's current generation does not match the
+// given value.
func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
return c
@@ -6405,6 +7590,13 @@ func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyC
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -6554,13 +7746,13 @@ func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -6578,13 +7770,13 @@ func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "type": "string"
// },
// "ifSourceGenerationMatch": {
- // "description": "Makes the operation conditional on whether the source object's generation matches the given value.",
+ // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifSourceGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the source object's generation does not match the given value.",
+ // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -6631,6 +7823,11 @@ func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
@@ -6682,7 +7879,8 @@ func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
// Makes the operation conditional on whether the object's current
-// generation matches the given value.
+// generation matches the given value. Setting to 0 makes the operation
+// succeed only if there are no live versions of the object.
func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -6690,7 +7888,9 @@ func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsD
// IfGenerationNotMatch sets the optional parameter
// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value.
+// 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.
func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
return c
@@ -6713,6 +7913,13 @@ func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch in
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -6791,13 +7998,13 @@ func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -6819,6 +8026,11 @@ func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}",
@@ -6860,8 +8072,9 @@ func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
}
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's generation
-// matches the given value.
+// 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.
func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -6869,7 +8082,9 @@ func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetC
// IfGenerationNotMatch sets the optional parameter
// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's generation does not match the given value.
+// 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.
func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
return c
@@ -6903,6 +8118,13 @@ func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -7035,13 +8257,13 @@ func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's generation does not match the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -7076,6 +8298,11 @@ func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}",
@@ -7123,6 +8350,13 @@ func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPol
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -7243,6 +8477,11 @@ func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, err
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/iam",
@@ -7263,17 +8502,13 @@ func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, err
// method id "storage.objects.insert":
type ObjectsInsertCall struct {
- s *Service
- bucket string
- object *Object
- urlParams_ gensupport.URLParams
- media_ io.Reader
- mediaBuffer_ *gensupport.MediaBuffer
- mediaType_ string
- mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
- progressUpdater_ googleapi.ProgressUpdater
- ctx_ context.Context
- header_ http.Header
+ s *Service
+ bucket string
+ object *Object
+ urlParams_ gensupport.URLParams
+ mediaInfo_ *gensupport.MediaInfo
+ ctx_ context.Context
+ header_ http.Header
}
// Insert: Stores a new object and metadata.
@@ -7297,7 +8532,8 @@ func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInse
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
// Makes the operation conditional on whether the object's current
-// generation matches the given value.
+// generation matches the given value. Setting to 0 makes the operation
+// succeed only if there are no live versions of the object.
func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -7305,7 +8541,9 @@ func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsI
// IfGenerationNotMatch sets the optional parameter
// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value.
+// 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.
func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
return c
@@ -7328,6 +8566,16 @@ func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch in
return c
}
+// KmsKeyName sets the optional parameter "kmsKeyName": 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.
+func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall {
+ c.urlParams_.Set("kmsKeyName", kmsKeyName)
+ return c
+}
+
// Name sets the optional parameter "name": 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
@@ -7369,6 +8617,13 @@ func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Media specifies the media to upload in one or more chunks. The chunk
// size may be controlled by supplying a MediaOption generated by
// googleapi.ChunkSize. The chunk size defaults to
@@ -7381,12 +8636,7 @@ func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption)
if ct := c.object.ContentType; ct != "" {
options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
}
- opts := googleapi.ProcessMediaOptions(options)
- chunkSize := opts.ChunkSize
- if !opts.ForceEmptyContentType {
- r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
- }
- c.media_, c.mediaBuffer_ = gensupport.PrepareUpload(r, chunkSize)
+ c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
return c
}
@@ -7401,11 +8651,7 @@ func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption)
// supersede any context previously provided to the Context method.
func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
c.ctx_ = ctx
- rdr := gensupport.ReaderAtToReader(r, size)
- rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
- c.mediaBuffer_ = gensupport.NewMediaBuffer(rdr, googleapi.DefaultUploadChunkSize)
- c.media_ = nil
- c.mediaSize_ = size
+ c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
return c
}
@@ -7414,7 +8660,7 @@ func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, s
// not slow down the upload operation. This should only be called when
// using ResumableMedia (as opposed to Media).
func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
- c.progressUpdater_ = pu
+ c.mediaInfo_.SetProgressUpdater(pu)
return c
}
@@ -7459,27 +8705,16 @@ func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
- if c.media_ != nil || c.mediaBuffer_ != nil {
+ if c.mediaInfo_ != nil {
urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
- protocol := "multipart"
- if c.mediaBuffer_ != nil {
- protocol = "resumable"
- }
- c.urlParams_.Set("uploadType", protocol)
+ c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
}
if body == nil {
body = new(bytes.Buffer)
reqHeaders.Set("Content-Type", "application/json")
}
- if c.media_ != nil {
- combined, ctype := gensupport.CombineBodyMedia(body, "application/json", c.media_, c.mediaType_)
- defer combined.Close()
- reqHeaders.Set("Content-Type", ctype)
- body = combined
- }
- if c.mediaBuffer_ != nil && c.mediaType_ != "" {
- reqHeaders.Set("X-Upload-Content-Type", c.mediaType_)
- }
+ body, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
+ defer cleanup()
urls += "?" + c.urlParams_.Encode()
req, _ := http.NewRequest("POST", urls, body)
req.Header = reqHeaders
@@ -7515,20 +8750,10 @@ func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
- if c.mediaBuffer_ != nil {
- loc := res.Header.Get("Location")
- rx := &gensupport.ResumableUpload{
- Client: c.s.client,
- UserAgent: c.s.userAgent(),
- URI: loc,
- Media: c.mediaBuffer_,
- MediaType: c.mediaType_,
- Callback: func(curr int64) {
- if c.progressUpdater_ != nil {
- c.progressUpdater_(curr, c.mediaSize_)
- }
- },
- }
+ rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
+ if rx != nil {
+ rx.Client = c.s.client
+ rx.UserAgent = c.s.userAgent()
ctx := c.ctx_
if ctx == nil {
ctx = context.TODO()
@@ -7588,13 +8813,13 @@ func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -7611,6 +8836,11 @@ func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "location": "query",
// "type": "string"
// },
+ // "kmsKeyName": {
+ // "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.",
+ // "location": "query",
+ // "type": "string"
+ // },
// "name": {
// "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.",
// "location": "query",
@@ -7649,6 +8879,11 @@ func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o",
@@ -7735,6 +8970,13 @@ func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Versions sets the optional parameter "versions": If true, lists all
// versions of an object as distinct results. The default is false. For
// more information, see Object Versioning.
@@ -7886,6 +9128,11 @@ func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
// "location": "query",
// "type": "string"
// },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
+ // },
// "versions": {
// "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
// "location": "query",
@@ -7961,7 +9208,8 @@ func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
// Makes the operation conditional on whether the object's current
-// generation matches the given value.
+// generation matches the given value. Setting to 0 makes the operation
+// succeed only if there are no live versions of the object.
func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -7969,7 +9217,9 @@ func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPa
// IfGenerationNotMatch sets the optional parameter
// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value.
+// 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.
func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
return c
@@ -8023,6 +9273,13 @@ func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -8131,13 +9388,13 @@ func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -8193,6 +9450,11 @@ func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}",
@@ -8236,6 +9498,17 @@ func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, desti
return c
}
+// DestinationKmsKeyName sets the optional parameter
+// "destinationKmsKeyName": 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.
+func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall {
+ c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName)
+ return c
+}
+
// DestinationPredefinedAcl sets the optional parameter
// "destinationPredefinedAcl": Apply a predefined set of access controls
// to the destination object.
@@ -8258,8 +9531,9 @@ func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl s
}
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the destination object's
-// current generation matches the given value.
+// 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.
func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -8267,8 +9541,9 @@ func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *Objects
// IfGenerationNotMatch sets the optional parameter
// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the destination object's current generation does not match the given
-// value.
+// 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.
func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
return c
@@ -8294,7 +9569,7 @@ func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch i
// IfSourceGenerationMatch sets the optional parameter
// "ifSourceGenerationMatch": Makes the operation conditional on whether
-// the source object's generation matches the given value.
+// the source object's current generation matches the given value.
func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
return c
@@ -8302,8 +9577,8 @@ func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int
// IfSourceGenerationNotMatch sets the optional parameter
// "ifSourceGenerationNotMatch": Makes the operation conditional on
-// whether the source object's generation does not match the given
-// value.
+// whether the source object's current generation does not match the
+// given value.
func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
return c
@@ -8372,6 +9647,13 @@ func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRe
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -8477,6 +9759,11 @@ func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse,
// "required": true,
// "type": "string"
// },
+ // "destinationKmsKeyName": {
+ // "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.",
+ // "location": "query",
+ // "type": "string"
+ // },
// "destinationObject": {
// "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.",
// "location": "path",
@@ -8505,13 +9792,13 @@ func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse,
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -8529,13 +9816,13 @@ func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse,
// "type": "string"
// },
// "ifSourceGenerationMatch": {
- // "description": "Makes the operation conditional on whether the source object's generation matches the given value.",
+ // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifSourceGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the source object's generation does not match the given value.",
+ // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -8593,6 +9880,11 @@ func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse,
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
@@ -8640,6 +9932,13 @@ func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPol
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -8752,6 +10051,11 @@ func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, err
// "location": "path",
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/iam",
@@ -8800,6 +10104,13 @@ func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTes
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -8928,6 +10239,11 @@ func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestI
// "repeated": true,
// "required": true,
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}/iam/testPermissions",
@@ -8976,7 +10292,8 @@ func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
// Makes the operation conditional on whether the object's current
-// generation matches the given value.
+// generation matches the given value. Setting to 0 makes the operation
+// succeed only if there are no live versions of the object.
func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
return c
@@ -8984,7 +10301,9 @@ func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsU
// IfGenerationNotMatch sets the optional parameter
// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value.
+// 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.
func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
return c
@@ -9038,6 +10357,13 @@ func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
@@ -9162,13 +10488,13 @@ func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// "type": "string"
// },
// "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
// },
// "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
+ // "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.",
// "format": "int64",
// "location": "query",
// "type": "string"
@@ -9224,6 +10550,11 @@ func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
// ],
// "location": "query",
// "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
// }
// },
// "path": "b/{bucket}/o/{object}",
@@ -9309,6 +10640,13 @@ func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall
return c
}
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request. Required for Requester Pays buckets.
+func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
// Versions sets the optional parameter "versions": If true, lists all
// versions of an object as distinct results. The default is false. For
// more information, see Object Versioning.
@@ -9452,6 +10790,11 @@ func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error)
// "location": "query",
// "type": "string"
// },
+ // "userProject": {
+ // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
+ // "location": "query",
+ // "type": "string"
+ // },
// "versions": {
// "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
// "location": "query",
@@ -9477,3 +10820,157 @@ func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error)
// }
}
+
+// method id "storage.projects.serviceAccount.get":
+
+type ProjectsServiceAccountGetCall struct {
+ s *Service
+ projectId string
+ urlParams_ gensupport.URLParams
+ ifNoneMatch_ string
+ ctx_ context.Context
+ header_ http.Header
+}
+
+// Get: Get the email address of this project's Google Cloud Storage
+// service account.
+func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
+ c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
+ c.projectId = projectId
+ return c
+}
+
+// UserProject sets the optional parameter "userProject": The project to
+// be billed for this request.
+func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall {
+ c.urlParams_.Set("userProject", userProject)
+ return c
+}
+
+// Fields allows partial responses to be retrieved. See
+// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
+// for more information.
+func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
+ c.urlParams_.Set("fields", googleapi.CombineFields(s))
+ return c
+}
+
+// IfNoneMatch sets the optional parameter which makes the operation
+// fail if the object's ETag matches the given value. This is useful for
+// getting updates only after the object has changed since the last
+// request. Use googleapi.IsNotModified to check whether the response
+// error from Do is the result of In-None-Match.
+func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
+ c.ifNoneMatch_ = entityTag
+ return c
+}
+
+// Context sets the context to be used in this call's Do method. Any
+// pending HTTP request will be aborted if the provided context is
+// canceled.
+func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
+ c.ctx_ = ctx
+ return c
+}
+
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ProjectsServiceAccountGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
+func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
+ reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
+ reqHeaders.Set("User-Agent", c.s.userAgent())
+ if c.ifNoneMatch_ != "" {
+ reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
+ }
+ var body io.Reader = nil
+ c.urlParams_.Set("alt", alt)
+ urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
+ urls += "?" + c.urlParams_.Encode()
+ req, _ := http.NewRequest("GET", urls, body)
+ req.Header = reqHeaders
+ googleapi.Expand(req.URL, map[string]string{
+ "projectId": c.projectId,
+ })
+ return gensupport.SendRequest(c.ctx_, c.s.client, req)
+}
+
+// Do executes the "storage.projects.serviceAccount.get" call.
+// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
+// status code is an error. Response headers are in either
+// *ServiceAccount.ServerResponse.Header or (if a response was returned
+// at all) in error.(*googleapi.Error).Header. Use
+// googleapi.IsNotModified to check whether the returned error was
+// because http.StatusNotModified was returned.
+func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
+ gensupport.SetOptions(c.urlParams_, opts...)
+ res, err := c.doRequest("json")
+ if res != nil && res.StatusCode == http.StatusNotModified {
+ if res.Body != nil {
+ res.Body.Close()
+ }
+ return nil, &googleapi.Error{
+ Code: res.StatusCode,
+ Header: res.Header,
+ }
+ }
+ if err != nil {
+ return nil, err
+ }
+ defer googleapi.CloseBody(res)
+ if err := googleapi.CheckResponse(res); err != nil {
+ return nil, err
+ }
+ ret := &ServiceAccount{
+ ServerResponse: googleapi.ServerResponse{
+ Header: res.Header,
+ HTTPStatusCode: res.StatusCode,
+ },
+ }
+ target := &ret
+ if err := json.NewDecoder(res.Body).Decode(target); err != nil {
+ return nil, err
+ }
+ return ret, nil
+ // {
+ // "description": "Get the email address of this project's Google Cloud Storage service account.",
+ // "httpMethod": "GET",
+ // "id": "storage.projects.serviceAccount.get",
+ // "parameterOrder": [
+ // "projectId"
+ // ],
+ // "parameters": {
+ // "projectId": {
+ // "description": "Project ID",
+ // "location": "path",
+ // "required": true,
+ // "type": "string"
+ // },
+ // "userProject": {
+ // "description": "The project to be billed for this request.",
+ // "location": "query",
+ // "type": "string"
+ // }
+ // },
+ // "path": "projects/{projectId}/serviceAccount",
+ // "response": {
+ // "$ref": "ServiceAccount"
+ // },
+ // "scopes": [
+ // "https://www.googleapis.com/auth/cloud-platform",
+ // "https://www.googleapis.com/auth/cloud-platform.read-only",
+ // "https://www.googleapis.com/auth/devstorage.full_control",
+ // "https://www.googleapis.com/auth/devstorage.read_only",
+ // "https://www.googleapis.com/auth/devstorage.read_write"
+ // ]
+ // }
+
+}