public class Storage.Objects.Insert extends StorageRequest<StorageObject>
GenericData.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
USER_AGENT_SUFFIX
Modifier | Constructor and Description |
---|---|
protected |
Insert(String bucket,
StorageObject content)
Stores a new object and metadata.
|
protected |
Insert(String bucket,
StorageObject content,
AbstractInputStreamContent mediaContent)
Stores a new object and metadata.
|
Modifier and Type | Method and Description |
---|---|
String |
getBucket()
Name of the bucket in which to store the new object.
|
String |
getContentEncoding()
If set, sets the contentEncoding property of the final object to this value.
|
Long |
getIfGenerationMatch()
Makes the operation conditional on whether the object's current generation matches the given value.
|
Long |
getIfGenerationNotMatch()
Makes the operation conditional on whether the object's current generation does not match the given
value.
|
Long |
getIfMetagenerationMatch()
Makes the operation conditional on whether the object's current metageneration matches the given
value.
|
Long |
getIfMetagenerationNotMatch()
Makes the operation conditional on whether the object's current metageneration does not match the
given value.
|
String |
getKmsKeyName()
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.
|
String |
getName()
Name of the object.
|
String |
getPredefinedAcl()
Apply a predefined set of access controls to this object.
|
String |
getProjection()
Set of properties to return.
|
String |
getProvisionalUserProject()
The project to be billed for this request if the target bucket is requester-pays bucket.
|
String |
getUserProject()
The project to be billed for this request.
|
Storage.Objects.Insert |
set(String parameterName,
Object value) |
Storage.Objects.Insert |
setAlt(String alt)
Data format for the response.
|
Storage.Objects.Insert |
setBucket(String bucket)
Name of the bucket in which to store the new object.
|
Storage.Objects.Insert |
setContentEncoding(String contentEncoding)
If set, sets the contentEncoding property of the final object to this value.
|
Storage.Objects.Insert |
setFields(String fields)
Selector specifying which fields to include in a partial response.
|
Storage.Objects.Insert |
setIfGenerationMatch(Long ifGenerationMatch)
Makes the operation conditional on whether the object's current generation matches the
given value.
|
Storage.Objects.Insert |
setIfGenerationNotMatch(Long ifGenerationNotMatch)
Makes the operation conditional on whether the object's current generation does not match
the given value.
|
Storage.Objects.Insert |
setIfMetagenerationMatch(Long ifMetagenerationMatch)
Makes the operation conditional on whether the object's current metageneration matches the
given value.
|
Storage.Objects.Insert |
setIfMetagenerationNotMatch(Long ifMetagenerationNotMatch)
Makes the operation conditional on whether the object's current metageneration does not
match the given value.
|
Storage.Objects.Insert |
setKey(String key)
API key.
|
Storage.Objects.Insert |
setKmsKeyName(String 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.
|
Storage.Objects.Insert |
setName(String name)
Name of the object.
|
Storage.Objects.Insert |
setOauthToken(String oauthToken)
OAuth 2.0 token for the current user.
|
Storage.Objects.Insert |
setPredefinedAcl(String predefinedAcl)
Apply a predefined set of access controls to this object.
|
Storage.Objects.Insert |
setPrettyPrint(Boolean prettyPrint)
Returns response with indentations and line breaks.
|
Storage.Objects.Insert |
setProjection(String projection)
Set of properties to return.
|
Storage.Objects.Insert |
setProvisionalUserProject(String provisionalUserProject)
The project to be billed for this request if the target bucket is requester-pays bucket.
|
Storage.Objects.Insert |
setQuotaUser(String quotaUser)
An opaque string that represents a user for quota purposes.
|
Storage.Objects.Insert |
setUserIp(String userIp)
Deprecated.
|
Storage.Objects.Insert |
setUserProject(String userProject)
The project to be billed for this request.
|
getAbstractGoogleClient, getAlt, getFields, getKey, getOauthToken, getPrettyPrint, getQuotaUser, getUserIp, setDisableGZipContent, setRequestHeaders
getJsonContent, newExceptionOnError, queue
buildHttpRequest, buildHttpRequestUrl, buildHttpRequestUsingHead, checkRequiredParameter, execute, executeAndDownloadTo, executeAsInputStream, executeMedia, executeMediaAndDownloadTo, executeMediaAsInputStream, executeUnparsed, executeUsingHead, getDisableGZipContent, getHttpContent, getLastResponseHeaders, getLastStatusCode, getLastStatusMessage, getMediaHttpDownloader, getMediaHttpUploader, getRequestHeaders, getRequestMethod, getResponseClass, getUriTemplate, initializeMediaDownload, initializeMediaUpload, queue
clone, entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected Insert(String bucket, StorageObject content)
AbstractGoogleClientRequest.execute()
method to invoke the remote operation. Storage.initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)
must
be called to initialize this instance immediately after invoking the constructor.
bucket
- Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket
value, if any.content
- the StorageObject
protected Insert(String bucket, StorageObject content, AbstractInputStreamContent mediaContent)
AbstractGoogleClientRequest.execute()
method to invoke the remote operation. Storage.initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)
must
be called to initialize this instance immediately after invoking the constructor.
This constructor should be used for uploading media content.
bucket
- Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket
value, if any.content
- the StorageObject
media metadata or null
if nonemediaContent
- The media HTTP content or null
if none.public Storage.Objects.Insert setAlt(String alt)
StorageRequest
setAlt
in class StorageRequest<StorageObject>
public Storage.Objects.Insert setFields(String fields)
StorageRequest
setFields
in class StorageRequest<StorageObject>
public Storage.Objects.Insert setKey(String key)
StorageRequest
setKey
in class StorageRequest<StorageObject>
public Storage.Objects.Insert setOauthToken(String oauthToken)
StorageRequest
setOauthToken
in class StorageRequest<StorageObject>
public Storage.Objects.Insert setPrettyPrint(Boolean prettyPrint)
StorageRequest
setPrettyPrint
in class StorageRequest<StorageObject>
public Storage.Objects.Insert setQuotaUser(String quotaUser)
StorageRequest
setQuotaUser
in class StorageRequest<StorageObject>
public Storage.Objects.Insert setUserIp(String userIp)
StorageRequest
setUserIp
in class StorageRequest<StorageObject>
public String getBucket()
public Storage.Objects.Insert setBucket(String bucket)
public String getContentEncoding()
public Storage.Objects.Insert setContentEncoding(String contentEncoding)
public Long getIfGenerationMatch()
public Storage.Objects.Insert setIfGenerationMatch(Long ifGenerationMatch)
public Long getIfGenerationNotMatch()
public Storage.Objects.Insert setIfGenerationNotMatch(Long ifGenerationNotMatch)
public Long getIfMetagenerationMatch()
public Storage.Objects.Insert setIfMetagenerationMatch(Long ifMetagenerationMatch)
public Long getIfMetagenerationNotMatch()
public Storage.Objects.Insert setIfMetagenerationNotMatch(Long ifMetagenerationNotMatch)
public String getKmsKeyName()
public Storage.Objects.Insert setKmsKeyName(String kmsKeyName)
public String getName()
public Storage.Objects.Insert setName(String name)
public String getPredefinedAcl()
public Storage.Objects.Insert setPredefinedAcl(String predefinedAcl)
public String getProjection()
public Storage.Objects.Insert setProjection(String projection)
public String getProvisionalUserProject()
public Storage.Objects.Insert setProvisionalUserProject(String provisionalUserProject)
public String getUserProject()
public Storage.Objects.Insert setUserProject(String userProject)
public Storage.Objects.Insert set(String parameterName, Object value)
set
in class StorageRequest<StorageObject>
Copyright © 2011–2019 Google. All rights reserved.