Class FileMetadata

  • All Implemented Interfaces:

    
    public final class FileMetadata
    
                        
    • Constructor Detail

    • Method Detail

      • id

         final String id()

        Unique object identifier.

        The format and length of IDs may change over time.

      • filename

         final String filename()

        Original filename of the uploaded file.

      • expiresAt

         final Optional<OffsetDateTime> expiresAt()

        RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with expires_in_seconds, this is the upload time plus that value.

      • _type

         final JsonValue _type()

        Object type.

        For files, this is always "file".

        Expected to always return the following:

        JsonValue.from("file")

        However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).

      • _id

         final JsonField<String> _id()

        Returns the raw JSON value of id.

        Unlike id, this method doesn't throw if the JSON field has an unexpected type.

      • _createdAt

         final JsonField<OffsetDateTime> _createdAt()

        Returns the raw JSON value of createdAt.

        Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.

      • _filename

         final JsonField<String> _filename()

        Returns the raw JSON value of filename.

        Unlike filename, this method doesn't throw if the JSON field has an unexpected type.

      • _mimeType

         final JsonField<String> _mimeType()

        Returns the raw JSON value of mimeType.

        Unlike mimeType, this method doesn't throw if the JSON field has an unexpected type.

      • _sizeBytes

         final JsonField<Long> _sizeBytes()

        Returns the raw JSON value of sizeBytes.

        Unlike sizeBytes, this method doesn't throw if the JSON field has an unexpected type.

      • _downloadable

         final JsonField<Boolean> _downloadable()

        Returns the raw JSON value of downloadable.

        Unlike downloadable, this method doesn't throw if the JSON field has an unexpected type.

      • _expiresAt

         final JsonField<OffsetDateTime> _expiresAt()

        Returns the raw JSON value of expiresAt.

        Unlike expiresAt, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final FileMetadata validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.

      • builder

         final static FileMetadata.Builder builder()

        Returns a mutable builder for constructing an instance of FileMetadata.

        The following fields are required:

        .id()
        .createdAt()
        .filename()
        .mimeType()
        .sizeBytes()