ImageAPI class

Constructors

ImageAPI({required RestAPI restAPI, required String accountId})

Properties

accountId String
finalinherited
dataType CloudflareImage?
getter/setter pairinherited
errorType CloudflareErrorResponse?
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
isBasic bool
no setterinherited
restAPI ↔ RestAPI
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
service ↔ ImageService
getter/setter pairinherited

Methods

createDirectUpload({bool? requireSignedURLs, Map<String, dynamic>? metadata, DateTime? expiry}) Future<CloudflareHTTPResponse<DataUploadDraft?>>
Direct uploads allow users to upload images without API keys. A common place to use direct uploads is on web apps, client side applications, or on mobile devices where users upload content directly to Cloudflare Images. Method creates a draft record for a future image and returns upload URL and image identifier that can be used later to verify if image itself has been uploaded or not with the draft: true property in the image response.
delete({String? id, CloudflareImage? image}) Future<CloudflareHTTPResponse>
Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from Cache.
deleteMultiple({List<String>? ids, List<CloudflareImage>? images}) Future<List<CloudflareHTTPResponse>>
Deletes a list of images on Cloudflare Images. On success, all copies of the images are deleted and purged from Cache.
directUpload({required DataUploadDraft dataUploadDraft, DataTransmit<File>? contentFromFile, DataTransmit<String>? contentFromPath, DataTransmit<Uint8List>? contentFromBytes}) Future<CloudflareHTTPResponse<CloudflareImage?>>
For image direct upload without API key or token. This function is to be used specifically after an image createDirectUpload has been requested.
genericParseResponse<DataTypeGeneric>(Future futureResponse, {DataTypeGeneric? dataType, bool parseCloudflareResponse = true}) Future<CloudflareHTTPResponse<DataTypeGeneric>>
inherited
genericParseResponseAsList<DataTypeGeneric extends Jsonable<Object>?>(Future futureResponse, {DataTypeGeneric? dataType, bool parseCloudflareResponse = true}) Future<CloudflareHTTPResponse<List<DataTypeGeneric>>>
inherited
get({String? id, CloudflareImage? image}) Future<CloudflareHTTPResponse<CloudflareImage?>>
Fetch details of a single image.
getAll({int? page, int? size}) Future<CloudflareHTTPResponse<List<CloudflareImage>?>>
Up to 100 images can be listed with one request, use optional parameters to get a specific range of images.
getBase({String? id, CloudflareImage? image}) Future<CloudflareHTTPResponse<Uint8List?>>
Fetch base image. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original. Note: the response is
getSaveResponse<ContainerDataTypeGeneric>(Future futureResponse, {bool parseCloudflareResponse = true}) Future<CloudflareHTTPResponse>
inherited
getStats() Future<CloudflareHTTPResponse<ImageStats?>>
Fetch details of Cloudflare Images usage statistics
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseResponse(Future futureResponse, {bool parseCloudflareResponse = true}) Future<CloudflareHTTPResponse<CloudflareImage>>
inherited
parseResponseAsList(Future futureResponse, {bool parseCloudflareResponse = true}) Future<CloudflareHTTPResponse<List<CloudflareImage>>>
inherited
toString() String
A string representation of this object.
inherited
update({required CloudflareImage image}) Future<CloudflareHTTPResponse<CloudflareImage?>>
Update image access control. On access control change, all copies of the image are purged from Cache.
upload({DataTransmit<File>? contentFromFile, DataTransmit<String>? contentFromPath, DataTransmit<Uint8List>? contentFromBytes, DataTransmit<String>? contentFromUrl, bool? requireSignedURLs, Map<String, dynamic>? metadata}) Future<CloudflareHTTPResponse<CloudflareImage?>>
An image up to 10 Megabytes can be upload.
uploadMultiple({List<DataTransmit<File>>? contentFromFiles, List<DataTransmit<String>>? contentFromPaths, List<DataTransmit<Uint8List>>? contentFromBytes, List<DataTransmit<String>>? contentFromUrls, bool? requireSignedURLs, Map<String, dynamic>? metadata}) Future<List<CloudflareHTTPResponse<CloudflareImage?>>>
Uploads multiple images by repeatedly calling upload

Operators

operator ==(Object other) bool
The equality operator.
inherited