Asset

public class Asset : LocalizableResource, AssetDecodable
extension Asset: EndpointAccessible
extension Asset: ResourceQueryable

An asset represents a media file in Contentful.

  • The key paths for member fields of an Asset

    See more

    Declaration

    Swift

    public enum Fields : String, CodingKey
  • url

    The URL for the underlying media file. Returns nil if the url was omitted from the response (i.e. select operation in query) or if the underlying media file is still processing with Contentful.

    Declaration

    Swift

    public var url: URL? { get }
  • String representation for the URL of the media file associated with this asset. Optional for compatibility with select operator queries. Also, If the media file is still being processed, as the final stage of uploading to your space, this property will be nil.

    Declaration

    Swift

    public var urlString: String? { get }
  • The title of the asset. Optional for compatibility with select operator queries.

    Declaration

    Swift

    public var title: String? { get }
  • Description of the asset. Optional for compatibility with select operator queries.

    Declaration

    Swift

    public var description: String? { get }
  • Metadata describing the file associated with the asset. Optional for compatibility with select operator queries.

    Declaration

    Swift

    public var file: FileMetadata? { get }
  • Metadata describing underlying media file.

    See more

    Declaration

    Swift

    public struct FileMetadata : Decodable
  • Declaration

    Swift

    public static let endpoint: Endpoint
  • The QueryType for an Asset is AssetQuery

    Declaration

    Swift

    public typealias QueryType = AssetQuery