Class GdataMedia

  • All Implemented Interfaces:
    java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.Object>

    public final class GdataMedia
    extends com.google.api.client.json.GenericJson
    A reference to data stored on the filesystem, on GFS or in blobstore.

    This is the Java data model class that specifies how to parse/serialize into the JSON that is transmitted over HTTP when working with the RCS Business Messaging API. For a detailed explanation see: https://developers.google.com/api-client-library/java/google-http-java-client/json

    Author:
    Google, Inc.
    • Constructor Detail

      • GdataMedia

        public GdataMedia()
    • Method Detail

      • getAlgorithm

        public java.lang.String getAlgorithm()
        Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, "MD5" is the only possible value for this field. New values may be added at any time.
        Returns:
        value or null for none
      • setAlgorithm

        public GdataMedia setAlgorithm​(java.lang.String algorithm)
        Deprecated, use one of explicit hash type fields instead. Algorithm used for calculating the hash. As of 2011/01/21, "MD5" is the only possible value for this field. New values may be added at any time.
        Parameters:
        algorithm - algorithm or null for none
      • getBigstoreObjectRef

        public java.lang.String getBigstoreObjectRef()
        Use object_id instead.
        Returns:
        value or null for none
        See Also:
        decodeBigstoreObjectRef()
      • decodeBigstoreObjectRef

        public byte[] decodeBigstoreObjectRef()
        Use object_id instead.
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getBigstoreObjectRef()
      • setBigstoreObjectRef

        public GdataMedia setBigstoreObjectRef​(java.lang.String bigstoreObjectRef)
        Use object_id instead.
        Parameters:
        bigstoreObjectRef - bigstoreObjectRef or null for none
        See Also:
        #encodeBigstoreObjectRef()
      • encodeBigstoreObjectRef

        public GdataMedia encodeBigstoreObjectRef​(byte[] bigstoreObjectRef)
        Use object_id instead.
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getBlobRef

        public java.lang.String getBlobRef()
        Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.
        Returns:
        value or null for none
        See Also:
        decodeBlobRef()
      • decodeBlobRef

        public byte[] decodeBlobRef()
        Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getBlobRef()
      • setBlobRef

        public GdataMedia setBlobRef​(java.lang.String blobRef)
        Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.
        Parameters:
        blobRef - blobRef or null for none
        See Also:
        #encodeBlobRef()
      • encodeBlobRef

        public GdataMedia encodeBlobRef​(byte[] blobRef)
        Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getBlobstore2Info

        public GdataBlobstore2Info getBlobstore2Info()
        Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.
        Returns:
        value or null for none
      • setBlobstore2Info

        public GdataMedia setBlobstore2Info​(GdataBlobstore2Info blobstore2Info)
        Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.
        Parameters:
        blobstore2Info - blobstore2Info or null for none
      • getCompositeMedia

        public java.util.List<GdataCompositeMedia> getCompositeMedia()
        A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified.
        Returns:
        value or null for none
      • setCompositeMedia

        public GdataMedia setCompositeMedia​(java.util.List<GdataCompositeMedia> compositeMedia)
        A composite media composed of one or more media objects, set if reference_type is COMPOSITE_MEDIA. The media length field must be set to the sum of the lengths of all composite media objects. Note: All composite media must have length specified.
        Parameters:
        compositeMedia - compositeMedia or null for none
      • getContentType

        public java.lang.String getContentType()
        MIME type of the data
        Returns:
        value or null for none
      • setContentType

        public GdataMedia setContentType​(java.lang.String contentType)
        MIME type of the data
        Parameters:
        contentType - contentType or null for none
      • getContentTypeInfo

        public GdataContentTypeInfo getContentTypeInfo()
        Extended content type information provided for Scotty uploads.
        Returns:
        value or null for none
      • setContentTypeInfo

        public GdataMedia setContentTypeInfo​(GdataContentTypeInfo contentTypeInfo)
        Extended content type information provided for Scotty uploads.
        Parameters:
        contentTypeInfo - contentTypeInfo or null for none
      • getCosmoBinaryReference

        public java.lang.String getCosmoBinaryReference()
        A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.
        Returns:
        value or null for none
        See Also:
        decodeCosmoBinaryReference()
      • decodeCosmoBinaryReference

        public byte[] decodeCosmoBinaryReference()
        A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getCosmoBinaryReference()
      • setCosmoBinaryReference

        public GdataMedia setCosmoBinaryReference​(java.lang.String cosmoBinaryReference)
        A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.
        Parameters:
        cosmoBinaryReference - cosmoBinaryReference or null for none
        See Also:
        #encodeCosmoBinaryReference()
      • encodeCosmoBinaryReference

        public GdataMedia encodeCosmoBinaryReference​(byte[] cosmoBinaryReference)
        A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getCrc32cHash

        public java.lang.Long getCrc32cHash()
        For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported.
        Returns:
        value or null for none
      • setCrc32cHash

        public GdataMedia setCrc32cHash​(java.lang.Long crc32cHash)
        For Scotty Uploads: Scotty-provided hashes for uploads For Scotty Downloads: (WARNING: DO NOT USE WITHOUT PERMISSION FROM THE SCOTTY TEAM.) A Hash provided by the agent to be used to verify the data being downloaded. Currently only supported for inline payloads. Further, only crc32c_hash is currently supported.
        Parameters:
        crc32cHash - crc32cHash or null for none
      • getDiffChecksumsResponse

        public GdataDiffChecksumsResponse getDiffChecksumsResponse()
        Set if reference_type is DIFF_CHECKSUMS_RESPONSE.
        Returns:
        value or null for none
      • setDiffChecksumsResponse

        public GdataMedia setDiffChecksumsResponse​(GdataDiffChecksumsResponse diffChecksumsResponse)
        Set if reference_type is DIFF_CHECKSUMS_RESPONSE.
        Parameters:
        diffChecksumsResponse - diffChecksumsResponse or null for none
      • getDiffDownloadResponse

        public GdataDiffDownloadResponse getDiffDownloadResponse()
        Set if reference_type is DIFF_DOWNLOAD_RESPONSE.
        Returns:
        value or null for none
      • setDiffDownloadResponse

        public GdataMedia setDiffDownloadResponse​(GdataDiffDownloadResponse diffDownloadResponse)
        Set if reference_type is DIFF_DOWNLOAD_RESPONSE.
        Parameters:
        diffDownloadResponse - diffDownloadResponse or null for none
      • getDiffUploadRequest

        public GdataDiffUploadRequest getDiffUploadRequest()
        Set if reference_type is DIFF_UPLOAD_REQUEST.
        Returns:
        value or null for none
      • setDiffUploadRequest

        public GdataMedia setDiffUploadRequest​(GdataDiffUploadRequest diffUploadRequest)
        Set if reference_type is DIFF_UPLOAD_REQUEST.
        Parameters:
        diffUploadRequest - diffUploadRequest or null for none
      • getDiffUploadResponse

        public GdataDiffUploadResponse getDiffUploadResponse()
        Set if reference_type is DIFF_UPLOAD_RESPONSE.
        Returns:
        value or null for none
      • setDiffUploadResponse

        public GdataMedia setDiffUploadResponse​(GdataDiffUploadResponse diffUploadResponse)
        Set if reference_type is DIFF_UPLOAD_RESPONSE.
        Parameters:
        diffUploadResponse - diffUploadResponse or null for none
      • getDiffVersionResponse

        public GdataDiffVersionResponse getDiffVersionResponse()
        Set if reference_type is DIFF_VERSION_RESPONSE.
        Returns:
        value or null for none
      • setDiffVersionResponse

        public GdataMedia setDiffVersionResponse​(GdataDiffVersionResponse diffVersionResponse)
        Set if reference_type is DIFF_VERSION_RESPONSE.
        Parameters:
        diffVersionResponse - diffVersionResponse or null for none
      • getDownloadParameters

        public GdataDownloadParameters getDownloadParameters()
        Parameters for a media download.
        Returns:
        value or null for none
      • setDownloadParameters

        public GdataMedia setDownloadParameters​(GdataDownloadParameters downloadParameters)
        Parameters for a media download.
        Parameters:
        downloadParameters - downloadParameters or null for none
      • getFilename

        public java.lang.String getFilename()
        Original file name
        Returns:
        value or null for none
      • setFilename

        public GdataMedia setFilename​(java.lang.String filename)
        Original file name
        Parameters:
        filename - filename or null for none
      • getHash

        public java.lang.String getHash()
        Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: http://cs/#google3/uploader/service/proto/upload_listener.proto&q=class:Hash Hex encoded hash value of the uploaded media.
        Returns:
        value or null for none
      • setHash

        public GdataMedia setHash​(java.lang.String hash)
        Deprecated, use one of explicit hash type fields instead. These two hash related fields will only be populated on Scotty based media uploads and will contain the content of the hash group in the NotificationRequest: http://cs/#google3/uploader/service/proto/upload_listener.proto&q=class:Hash Hex encoded hash value of the uploaded media.
        Parameters:
        hash - hash or null for none
      • getHashVerified

        public java.lang.Boolean getHashVerified()
        For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification.
        Returns:
        value or null for none
      • setHashVerified

        public GdataMedia setHashVerified​(java.lang.Boolean hashVerified)
        For Scotty uploads only. If a user sends a hash code and the backend has requested that Scotty verify the upload against the client hash, Scotty will perform the check on behalf of the backend and will reject it if the hashes don't match. This is set to true if Scotty performed this verification.
        Parameters:
        hashVerified - hashVerified or null for none
      • getInline

        public java.lang.String getInline()
        Media data, set if reference_type is INLINE
        Returns:
        value or null for none
        See Also:
        decodeInline()
      • decodeInline

        public byte[] decodeInline()
        Media data, set if reference_type is INLINE
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getInline()
      • setInline

        public GdataMedia setInline​(java.lang.String inline)
        Media data, set if reference_type is INLINE
        Parameters:
        inline - inline or null for none
        See Also:
        #encodeInline()
      • encodeInline

        public GdataMedia encodeInline​(byte[] inline)
        Media data, set if reference_type is INLINE
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getIsPotentialRetry

        public java.lang.Boolean getIsPotentialRetry()
        |is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence.
        Returns:
        value or null for none
      • setIsPotentialRetry

        public GdataMedia setIsPotentialRetry​(java.lang.Boolean isPotentialRetry)
        |is_potential_retry| is set false only when Scotty is certain that it has not sent the request before. When a client resumes an upload, this field must be set true in agent calls, because Scotty cannot be certain that it has never sent the request before due to potential failure in the session state persistence.
        Parameters:
        isPotentialRetry - isPotentialRetry or null for none
      • getLength

        public java.lang.Long getLength()
        Size of the data, in bytes
        Returns:
        value or null for none
      • setLength

        public GdataMedia setLength​(java.lang.Long length)
        Size of the data, in bytes
        Parameters:
        length - length or null for none
      • getMd5Hash

        public java.lang.String getMd5Hash()
        Scotty-provided MD5 hash for an upload.
        Returns:
        value or null for none
        See Also:
        decodeMd5Hash()
      • decodeMd5Hash

        public byte[] decodeMd5Hash()
        Scotty-provided MD5 hash for an upload.
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getMd5Hash()
      • setMd5Hash

        public GdataMedia setMd5Hash​(java.lang.String md5Hash)
        Scotty-provided MD5 hash for an upload.
        Parameters:
        md5Hash - md5Hash or null for none
        See Also:
        #encodeMd5Hash()
      • encodeMd5Hash

        public GdataMedia encodeMd5Hash​(byte[] md5Hash)
        Scotty-provided MD5 hash for an upload.
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getMediaId

        public java.lang.String getMediaId()
        Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA.
        Returns:
        value or null for none
        See Also:
        decodeMediaId()
      • decodeMediaId

        public byte[] decodeMediaId()
        Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA.
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getMediaId()
      • setMediaId

        public GdataMedia setMediaId​(java.lang.String mediaId)
        Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA.
        Parameters:
        mediaId - mediaId or null for none
        See Also:
        #encodeMediaId()
      • encodeMediaId

        public GdataMedia encodeMediaId​(byte[] mediaId)
        Media id to forward to the operation GetMedia. Can be set if reference_type is GET_MEDIA.
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getObjectId

        public GdataObjectId getObjectId()
        Reference to a TI Blob, set if reference_type is BIGSTORE_REF.
        Returns:
        value or null for none
      • setObjectId

        public GdataMedia setObjectId​(GdataObjectId objectId)
        Reference to a TI Blob, set if reference_type is BIGSTORE_REF.
        Parameters:
        objectId - objectId or null for none
      • getPath

        public java.lang.String getPath()
        Path to the data, set if reference_type is PATH
        Returns:
        value or null for none
      • setPath

        public GdataMedia setPath​(java.lang.String path)
        Path to the data, set if reference_type is PATH
        Parameters:
        path - path or null for none
      • getReferenceType

        public java.lang.String getReferenceType()
        Describes what the field reference contains.
        Returns:
        value or null for none
      • setReferenceType

        public GdataMedia setReferenceType​(java.lang.String referenceType)
        Describes what the field reference contains.
        Parameters:
        referenceType - referenceType or null for none
      • getSha1Hash

        public java.lang.String getSha1Hash()
        Scotty-provided SHA1 hash for an upload.
        Returns:
        value or null for none
        See Also:
        decodeSha1Hash()
      • decodeSha1Hash

        public byte[] decodeSha1Hash()
        Scotty-provided SHA1 hash for an upload.
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getSha1Hash()
      • setSha1Hash

        public GdataMedia setSha1Hash​(java.lang.String sha1Hash)
        Scotty-provided SHA1 hash for an upload.
        Parameters:
        sha1Hash - sha1Hash or null for none
        See Also:
        #encodeSha1Hash()
      • encodeSha1Hash

        public GdataMedia encodeSha1Hash​(byte[] sha1Hash)
        Scotty-provided SHA1 hash for an upload.
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getSha256Hash

        public java.lang.String getSha256Hash()
        Scotty-provided SHA256 hash for an upload.
        Returns:
        value or null for none
        See Also:
        decodeSha256Hash()
      • decodeSha256Hash

        public byte[] decodeSha256Hash()
        Scotty-provided SHA256 hash for an upload.
        Returns:
        Base64 decoded value or null for none
        Since:
        1.14
        See Also:
        getSha256Hash()
      • setSha256Hash

        public GdataMedia setSha256Hash​(java.lang.String sha256Hash)
        Scotty-provided SHA256 hash for an upload.
        Parameters:
        sha256Hash - sha256Hash or null for none
        See Also:
        #encodeSha256Hash()
      • encodeSha256Hash

        public GdataMedia encodeSha256Hash​(byte[] sha256Hash)
        Scotty-provided SHA256 hash for an upload.
        Since:
        1.14
        See Also:
        The value is encoded Base64 or for none.
      • getTimestamp

        public java.math.BigInteger getTimestamp()
        Time at which the media data was last updated, in milliseconds since UNIX epoch
        Returns:
        value or null for none
      • setTimestamp

        public GdataMedia setTimestamp​(java.math.BigInteger timestamp)
        Time at which the media data was last updated, in milliseconds since UNIX epoch
        Parameters:
        timestamp - timestamp or null for none
      • getToken

        public java.lang.String getToken()
        A unique fingerprint/version id for the media data
        Returns:
        value or null for none
      • setToken

        public GdataMedia setToken​(java.lang.String token)
        A unique fingerprint/version id for the media data
        Parameters:
        token - token or null for none
      • set

        public GdataMedia set​(java.lang.String fieldName,
                              java.lang.Object value)
        Overrides:
        set in class com.google.api.client.json.GenericJson
      • clone

        public GdataMedia clone()
        Overrides:
        clone in class com.google.api.client.json.GenericJson